Первый коммит
10
.gitattributes
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
||||
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
*.kra filter=lfs diff=lfs merge=lfs -text
|
||||
*.webm filter=lfs diff=lfs merge=lfs -text
|
||||
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.docx filter=lfs diff=lfs merge=lfs -text
|
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.vscode
|
||||
resources/_gen
|
0
.hugo_build.lock
Normal file
13
archetypes/default.md
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
draft: true
|
||||
categories: ["misc"]
|
||||
<!-- featured_image: miniature.jpg -->
|
||||
---
|
||||
|
||||
Описание
|
||||
|
||||
<!--more-->
|
||||
|
||||
Текст
|
15
config.toml
Normal file
@ -0,0 +1,15 @@
|
||||
baseURL = 'https://mmote.ru/'
|
||||
title = 'Здесь был MultiMote'
|
||||
theme = 'mmotium'
|
||||
languageCode = 'ru'
|
||||
|
||||
[params]
|
||||
author = 'MultiMote'
|
||||
|
||||
[permalinks]
|
||||
posts = "/:slugorfilename"
|
||||
other = "/:slugorfilename"
|
||||
|
||||
[markup]
|
||||
[markup.highlight]
|
||||
style = 'monokailight'
|
4
content/categories/archive/_index.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Архив"
|
||||
description: "Это было давно и неправда"
|
||||
---
|
3
content/categories/cpp/_index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: "Программирование на C/C++"
|
||||
---
|
3
content/categories/dendrite-fecal/_index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: "Дендрофекальное проектирование"
|
||||
---
|
3
content/categories/mcu/_index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: "Микроконтроллеры"
|
||||
---
|
3
content/categories/misc/_index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: "Разное"
|
||||
---
|
3
content/categories/news/_index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
title: "Новости"
|
||||
---
|
4
content/categories/pinned/_index.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
title: "Закреплено"
|
||||
description: "Информация особой важности"
|
||||
---
|
18
content/other/astyle-style/index.md
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "Astyle"
|
||||
categories: ["cpp", "archive"]
|
||||
date: 2018-08-31T00:00:00+03:00
|
||||
draft: false
|
||||
---
|
||||
|
||||
|
||||
<!--more-->
|
||||
|
||||
```
|
||||
--style=java
|
||||
--pad-oper
|
||||
--pad-header
|
||||
--convert-tabs
|
||||
--align-pointer=name
|
||||
--align-reference=name
|
||||
```
|
BIN
content/other/avr-runline/anim.gif
(Stored with Git LFS)
Normal file
68
content/other/avr-runline/index.md
Normal file
@ -0,0 +1,68 @@
|
||||
---
|
||||
title: "Бегущая строка"
|
||||
categories: ["mcu", "archive"]
|
||||
date: 2016-02-19T00:00:00+03:00
|
||||
draft: false
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
|
||||
<!--more-->
|
||||
|
||||
```c
|
||||
#include <avr/io.h>
|
||||
#include <string.h>
|
||||
#include <util/delay.h>
|
||||
#include "lcd_lib.h"
|
||||
|
||||
#define LINE 16
|
||||
|
||||
char *str = "Postapokaliptichesky1232323123";
|
||||
char *pstr;
|
||||
char buf[LINE + 1];
|
||||
|
||||
void lcd_clear() {
|
||||
LCDsendCommand(0x01);
|
||||
}
|
||||
|
||||
void lcd_zero_coord() {
|
||||
char y = 0;
|
||||
char x = 0;
|
||||
LCDsendCommand(0x80 | ((0x40 * y) + x));
|
||||
}
|
||||
|
||||
void lcd_data(char byte) {
|
||||
LCDsendChar(byte);
|
||||
}
|
||||
|
||||
void lcd_str(char *s) {
|
||||
while (*s != '\0') lcd_data(*(s++));
|
||||
}
|
||||
|
||||
|
||||
int main(void) {
|
||||
LCDinit();
|
||||
lcd_clear();
|
||||
while (1) {
|
||||
int len = strlen(str) + LINE;
|
||||
for (int i = 0; i < len; ++i) {
|
||||
lcd_clear();
|
||||
lcd_zero_coord();
|
||||
|
||||
strcpy(buf, str);
|
||||
int spaces = LINE - i;
|
||||
|
||||
buf[i] = '\0';
|
||||
pstr = buf;
|
||||
|
||||
if (spaces > 0) for (int s = 0; s < spaces; ++s) lcd_data(' ');
|
||||
else pstr += i - LINE;
|
||||
|
||||
lcd_str(pstr);
|
||||
_delay_ms(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
![|](anim.gif)
|
BIN
content/other/avr-runline/miniature.jpg
(Stored with Git LFS)
Normal file
107
content/other/cheatsheet/index.md
Normal file
@ -0,0 +1,107 @@
|
||||
---
|
||||
title: "Полезности"
|
||||
categories: ["cpp", "archive"]
|
||||
date: 2015-12-01T00:00:00+03:00
|
||||
draft: false
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
|
||||
На этой страничке я собираю все полезные кусочки кодов, которые мне пригождаются.
|
||||
|
||||
<!--more-->
|
||||
|
||||
# С/С++:
|
||||
|
||||
|
||||
## Вывод списка файлов в папке, dirent:
|
||||
|
||||
```c
|
||||
DIR *dir;
|
||||
struct dirent *ent;
|
||||
if (dir = opendir ("mydir")) {
|
||||
while (ent = readdir (dir)) {
|
||||
printf ("%s\n", ent->d_name);
|
||||
}
|
||||
closedir (dir);
|
||||
}
|
||||
```
|
||||
|
||||
## Удаление элементов вектора во время итерации:
|
||||
|
||||
```cpp
|
||||
vector< string >::iterator it = curFiles.begin();
|
||||
|
||||
while(it != curFiles.end()) {
|
||||
if(something) {
|
||||
it = curFiles.erase(it);
|
||||
} else ++it;
|
||||
}
|
||||
```
|
||||
|
||||
## Освобождение памяти вектора:
|
||||
|
||||
```cpp
|
||||
struct delete_ptr {
|
||||
template <typename P>
|
||||
void operator () (P p) {
|
||||
delete p;
|
||||
}
|
||||
};
|
||||
|
||||
std::for_each(myvector.begin(), myvector.end(), delete_ptr());
|
||||
myvector.clear();
|
||||
```
|
||||
|
||||
## Построковое чтение файла:
|
||||
|
||||
```c
|
||||
const char filename[] = "file.txt";
|
||||
FILE *file = fopen(filename, "r");
|
||||
if (file != NULL) {
|
||||
char line[128];
|
||||
while (fgets(line, sizeof line, file) != NULL)
|
||||
{
|
||||
fputs(line, stdout);
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
```
|
||||
|
||||
## OpenGL, рисование цветных прямоугольников:
|
||||
|
||||
```cpp
|
||||
void drawRect(int x1, int y1, int x2, int y2, int color) {
|
||||
float alpha = (float) (color >> 24 & 255) / 255.0F;
|
||||
float red = (float) (color >> 16 & 255) / 255.0F;
|
||||
float green = (float) (color >> 8 & 255) / 255.0F;
|
||||
float blue = (float) (color & 255) / 255.0F;
|
||||
glColor4f(red, green, blue, alpha);
|
||||
glBegin(GL_QUADS);
|
||||
glVertex3f(x1, y2, 0.0F);
|
||||
glVertex3f(x2, y2, 0.0F);
|
||||
glVertex3f(x2, y1, 0.0F);
|
||||
glVertex3f(x1, y1, 0.0F);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
void drawRectAt(int x, int y, int width, int height, int color) {
|
||||
drawRect(x, y, x + width, x + height, color);
|
||||
}
|
||||
|
||||
void drawPixel(int x, int y, int color) {
|
||||
drawRect(x, y, x + 1, y + 1, color);
|
||||
}
|
||||
```
|
||||
|
||||
## Количество дней в месяце (с учётом високостного года):
|
||||
|
||||
```c
|
||||
int get_month_days(int year, int month){
|
||||
if (month == 4 || month == 6 || month == 9 || month == 11){
|
||||
return 30;
|
||||
} else if (month == 2) {
|
||||
return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 29 : 28;
|
||||
} else return 31;
|
||||
}
|
||||
```
|
BIN
content/other/cheatsheet/miniature.jpg
(Stored with Git LFS)
Normal file
12
content/other/cleanup-open-with/index.md
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "Удаление программ из меню "
|
||||
categories: ["misc", "archive"]
|
||||
date: 2018-07-03T00:00:00+03:00
|
||||
draft: false
|
||||
---
|
||||
|
||||
|
||||
<!--more-->
|
||||
|
||||
1. regedit.exe -> __HKEY\_CLASSES\_ROOT/Applications__
|
||||
2. Удалить лишнее
|
BIN
content/other/device-manuals/Cameron_URC-4020.jpg
(Stored with Git LFS)
Normal file
BIN
content/other/device-manuals/Cameron_URC-4020.pdf
(Stored with Git LFS)
Normal file
17
content/other/device-manuals/index.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "Инструкции от устройств"
|
||||
categories: ["misc", "archive"]
|
||||
date: 2020-08-19T00:00:00+03:00
|
||||
draft: false
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
Отсканированные инструкции от различных устройств.
|
||||
|
||||
<!--more-->
|
||||
|
||||
### Универсальный пульт Maxmedia Сameron URC-4020
|
||||
|
||||
![Cameron_URC-4020](Cameron_URC-4020.jpg)
|
||||
|
||||
[Cameron_URC-4020.pdf](Cameron_URC-4020.pdf)
|
BIN
content/other/device-manuals/miniature.jpg
(Stored with Git LFS)
Normal file
BIN
content/other/ic-dumps/16AT004_B.jpg
(Stored with Git LFS)
Normal file
BIN
content/other/ic-dumps/16AT004_F.jpg
(Stored with Git LFS)
Normal file
BIN
content/other/ic-dumps/MX25L6405@Sunny_pnl_LC490DUY.zip
(Stored with Git LFS)
Normal file
BIN
content/other/ic-dumps/bn41-01795a-25q40.zip
(Stored with Git LFS)
Normal file
37
content/other/ic-dumps/index.md
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "Дампы"
|
||||
categories: ["misc", "archive"]
|
||||
date: 2019-12-03T00:00:00+03:00
|
||||
draft: false
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
|
||||
Различные дампы микросхем энергонезависимой памяти, снятые с рабочей техники
|
||||
|
||||
<!--more-->
|
||||
|
||||
## Телевизоры
|
||||
|
||||
### Samsung bn41-01795a
|
||||
|
||||
Чип 25Q40
|
||||
|
||||
[bn41-01795a-25q40.zip](bn41-01795a-25q40.zip)
|
||||
|
||||
### SUNNY SN049DLD
|
||||
|
||||
Чип памяти 25Q64
|
||||
|
||||
Плата:
|
||||
|
||||
![|300](16AT004_F.jpg) ![|300](16AT004_B.jpg)
|
||||
|
||||
[MX25L6405@Sunny_pnl_LC490DUY.zip](MX25L6405@Sunny_pnl_LC490DUY.zip)
|
||||
|
||||
Дамп взят [отсюда](https://www.amwajsat.net/showthread.php?t=5098). Успешно протестирован, язык французский.
|
||||
|
||||
## BIOS
|
||||
|
||||
...
|
||||
|
BIN
content/other/ic-dumps/miniature.jpg
(Stored with Git LFS)
Normal file
BIN
content/other/logic-ic/4001.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
content/other/logic-ic/4001_s.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
content/other/logic-ic/4001_single.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
content/other/logic-ic/4049.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
content/other/logic-ic/4049_s.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
content/other/logic-ic/4049_single.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
content/other/logic-ic/4069.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
content/other/logic-ic/4069_s.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
content/other/logic-ic/4069_single.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
content/other/logic-ic/4502.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
content/other/logic-ic/4502_s.png
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
content/other/logic-ic/4502_single.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
content/other/logic-ic/and.png
Normal file
After Width: | Height: | Size: 247 B |
190
content/other/logic-ic/index.md
Normal file
@ -0,0 +1,190 @@
|
||||
---
|
||||
title: "Современные логические элементы"
|
||||
categories: ["misc", "archive"]
|
||||
date: 2016-06-30T00:00:00+03:00
|
||||
draft: true
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
|
||||
Сборки логических элементов, которые можно найти практически в любом радиомагазине.<!--more-->
|
||||
|
||||
> :warning: Статья не закончена. Когда-нибудь она будет доработана.
|
||||
|
||||
|
||||
**Vss** - катод <span style="color: #3366ff;">**(-)**</span>
|
||||
|
||||
**Vdd** - анод <span style="color: #ff0000;">**(+)**</span>
|
||||
|
||||
|
||||
|
||||
<h3 style="text-align: center;">НЕ (NOT)</h3>
|
||||
|
||||
<h3 style="text-align: center;">![nodeco:НЕ|](not.png)</h3>
|
||||
|
||||
<table border="1" cellpadding="5" style="border-color: #000000; border-width: 1px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: center;">Название</td>
|
||||
<td style="text-align: center;">Описание</td>
|
||||
<td style="text-align: center;">Структура</td>
|
||||
<td style="text-align: center;">Распиновка</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p style="text-align: center;"><strong>4069</strong></p>
|
||||
</td>
|
||||
<td style="text-align: center;">6 логических элементов НЕ</td>
|
||||
<td>
|
||||
<p>![|100](4069_s.png)</p>
|
||||
<p>![|100](4069_single.png)</p>
|
||||
</td>
|
||||
<td>![|200](4069.png)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;"><strong>4049</strong></td>
|
||||
<td style="text-align: center;">6 логических элементов НЕ</td>
|
||||
<td style="text-align: center;">
|
||||
<p>![|100](4049_s.png)</p>
|
||||
<p>![|100](4049_single.png)</p>
|
||||
</td>
|
||||
<td style="text-align: center;">![|200](4049.png)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center;">
|
||||
<p><strong>4502</strong></p>
|
||||
</td>
|
||||
<td style="text-align: center;"><span>6 логических элементов НЕ с блокировкой и запретом</span></td>
|
||||
<td style="text-align: center;">
|
||||
<p>![|100](4502_s.png)</p>
|
||||
<p>![|100](4502_single.png)</p>
|
||||
</td>
|
||||
<td style="text-align: center;">![|200](4502.png)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
<h3 style="text-align: center;">ИЛИ (OR)</h3>
|
||||
|
||||
<p style="text-align: center;">![nodeco:ИЛИ|](or.png)</p>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
<table border="1" cellpadding="5" style="border-color: #000000; border-width: 1px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: center;"><span style="color: #ff0000;">Название</span></td>
|
||||
<td style="text-align: center;">Описание</td>
|
||||
<td style="text-align: center;">Структура</td>
|
||||
<td style="text-align: center;">Распиновка</td>
|
||||
<td style="text-align: center;">Схема ячейки</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p style="text-align: center;"><strong>4069</strong></p>
|
||||
</td>
|
||||
<td style="text-align: center;">6 логических элементов НЕ</td>
|
||||
<td>
|
||||
<p>![|100](4069_s.png)</p>
|
||||
<p>![|100](4049_single.png)</p>
|
||||
</td>
|
||||
<td>![|200](4069.png)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="text-align: center;"></td>
|
||||
<td style="text-align: center;"></td>
|
||||
<td style="text-align: center;"></td>
|
||||
<td style="text-align: center;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
<h3 style="text-align: center;">ИЛИ-НЕ (NOR)</h3>
|
||||
|
||||
<p style="text-align: center;">![nodeco:ИЛИ-НЕ|](nor.png)</p>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
<table border="1" cellpadding="5" style="border-color: #000000; border-width: 1px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Название</td>
|
||||
<td style="text-align: center;">Описание</td>
|
||||
<td style="text-align: center;">Структура</td>
|
||||
<td style="text-align: center;">Распиновка</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p style="text-align: center;"><strong>4001</strong></p>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
<p align="center">4 логических элемента ИЛИ-НЕ</p>
|
||||
</td>
|
||||
<td>![|100](4001_s.png)
|
||||
<p>![|100](4001_single.png)</p>
|
||||
</td>
|
||||
<td>![|200](4001.png)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="text-align: center;"></td>
|
||||
<td style="text-align: center;"></td>
|
||||
<td style="text-align: center;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
<h3 style="text-align: center;">И (AND)</h3>
|
||||
|
||||
<p style="text-align: center;">![nodeco:И|](and.png)</p>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
<table border="1" cellpadding="5" style="border-color: #000000; border-width: 1px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: center;"><span style="color: #ff0000;">Название</span></td>
|
||||
<td style="text-align: center;">Описание</td>
|
||||
<td style="text-align: center;">Структура</td>
|
||||
<td style="text-align: center;">Распиновка</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p style="text-align: center;"><strong>4069</strong></p>
|
||||
</td>
|
||||
<td style="text-align: center;">6 логических элементов НЕ</td>
|
||||
<td>![|100](4069_s.png)
|
||||
<p>![|100](4049_single.png)</p>
|
||||
</td>
|
||||
<td>![|200](4069.png)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="text-align: center;"></td>
|
||||
<td style="text-align: center;"></td>
|
||||
<td style="text-align: center;"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
<h3 style="text-align: center;">И-НЕ (NAND)</h3>
|
||||
|
||||
<p style="text-align: center;">![nodeco:И-НЕ|](nand.png)</p>
|
||||
|
||||
<p style="text-align: center;"></p>
|
||||
|
||||
| Название | Описание | Структура | Распиновка |
|
||||
|----------|---------------------------|----------------------------------------------|-------------------|
|
||||
| 4069 | 6 логических элементов НЕ | ![100](4069_s.png) ![100](4049_single.png) | ![|200](4069.png) |
|
BIN
content/other/logic-ic/miniature.jpg
(Stored with Git LFS)
Normal file
BIN
content/other/logic-ic/nand.png
Normal file
After Width: | Height: | Size: 265 B |
BIN
content/other/logic-ic/nor.png
Normal file
After Width: | Height: | Size: 311 B |
BIN
content/other/logic-ic/not.png
Normal file
After Width: | Height: | Size: 262 B |
BIN
content/other/logic-ic/or.png
Normal file
After Width: | Height: | Size: 302 B |
256
content/other/markdown-test/index.md
Normal file
@ -0,0 +1,256 @@
|
||||
---
|
||||
title: "Markdown test"
|
||||
date: 2022-12-24T14:16:25+03:00
|
||||
draft: false
|
||||
categories: ["misc"]
|
||||
---
|
||||
|
||||
Тут проверка
|
||||
|
||||
<!--more-->
|
||||
|
||||
---
|
||||
__Advertisement :)__
|
||||
|
||||
- __[pica](https://nodeca.github.io/pica/demo/)__ - high quality and fast image
|
||||
resize in browser.
|
||||
- __[babelfish](https://github.com/nodeca/babelfish/)__ - developer friendly
|
||||
i18n with plurals support and easy syntax.
|
||||
|
||||
You will like those projects!
|
||||
|
||||
---
|
||||
|
||||
# h1 Heading 8-)
|
||||
## h2 Heading
|
||||
### h3 Heading
|
||||
#### h4 Heading
|
||||
##### h5 Heading
|
||||
###### h6 Heading
|
||||
|
||||
|
||||
## Horizontal Rules
|
||||
|
||||
___
|
||||
|
||||
---
|
||||
|
||||
***
|
||||
|
||||
|
||||
## Typographic replacements
|
||||
|
||||
Enable typographer option to see result.
|
||||
|
||||
(c) (C) (r) (R) (tm) (TM) (p) (P) +-
|
||||
|
||||
test.. test... test..... test?..... test!....
|
||||
|
||||
!!!!!! ???? ,, -- ---
|
||||
|
||||
"Smartypants, double quotes" and 'single quotes'
|
||||
|
||||
|
||||
## Emphasis
|
||||
|
||||
**This is bold text**
|
||||
|
||||
__This is bold text__
|
||||
|
||||
*This is italic text*
|
||||
|
||||
_This is italic text_
|
||||
|
||||
~~Strikethrough~~
|
||||
|
||||
|
||||
## Blockquotes
|
||||
|
||||
|
||||
> Blockquotes can also be nested...
|
||||
>> ...by using additional greater-than signs right next to each other...
|
||||
> > > ...or with spaces between arrows.
|
||||
|
||||
|
||||
## Lists
|
||||
|
||||
Unordered
|
||||
|
||||
+ Create a list by starting a line with `+`, `-`, or `*`
|
||||
+ Sub-lists are made by indenting 2 spaces:
|
||||
- Marker character change forces new list start:
|
||||
* Ac tristique libero volutpat at
|
||||
+ Facilisis in pretium nisl aliquet
|
||||
- Nulla volutpat aliquam velit
|
||||
+ Very easy!
|
||||
|
||||
Ordered
|
||||
|
||||
1. Lorem ipsum dolor sit amet
|
||||
2. Consectetur adipiscing elit
|
||||
3. Integer molestie lorem at massa
|
||||
|
||||
|
||||
1. You can use sequential numbers...
|
||||
1. ...or keep all the numbers as `1.`
|
||||
|
||||
Start numbering with offset:
|
||||
|
||||
57. foo
|
||||
1. bar
|
||||
|
||||
|
||||
## Code
|
||||
|
||||
Inline `code`
|
||||
|
||||
Indented code
|
||||
|
||||
// Some comments
|
||||
line 1 of code
|
||||
line 2 of code
|
||||
line 3 of code
|
||||
|
||||
|
||||
Block code "fences"
|
||||
|
||||
```
|
||||
Sample text here...
|
||||
```
|
||||
|
||||
Syntax highlighting
|
||||
|
||||
``` js
|
||||
var foo = function (bar) {
|
||||
return bar++;
|
||||
};
|
||||
|
||||
console.log(foo(5));
|
||||
```
|
||||
|
||||
## Tables
|
||||
|
||||
| Option | Description |
|
||||
| ------ | ----------- |
|
||||
| data | path to data files to supply the data that will be passed into templates. |
|
||||
| engine | engine to be used for processing templates. Handlebars is the default. |
|
||||
| ext | extension to be used for dest files. |
|
||||
|
||||
Right aligned columns
|
||||
|
||||
| Option | Description |
|
||||
| ------:| -----------:|
|
||||
| data | path to data files to supply the data that will be passed into templates. |
|
||||
| engine | engine to be used for processing templates. Handlebars is the default. |
|
||||
| ext | extension to be used for dest files. |
|
||||
|
||||
|
||||
## Links
|
||||
|
||||
[link text](http://dev.nodeca.com)
|
||||
|
||||
[link with title](http://nodeca.github.io/pica/demo/ "title text!")
|
||||
|
||||
Autoconverted link https://github.com/nodeca/pica (enable linkify to see)
|
||||
|
||||
|
||||
## Images
|
||||
|
||||
![Minion](https://octodex.github.com/images/minion.png)
|
||||
![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")
|
||||
|
||||
Like links, Images also have a footnote style syntax
|
||||
|
||||
![Alt text][id]
|
||||
|
||||
With a reference later in the document defining the URL location:
|
||||
|
||||
[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat"
|
||||
|
||||
|
||||
## Plugins
|
||||
|
||||
The killer feature of `markdown-it` is very effective support of
|
||||
[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin).
|
||||
|
||||
|
||||
### [Emojies](https://github.com/markdown-it/markdown-it-emoji)
|
||||
|
||||
> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum:
|
||||
>
|
||||
> Shortcuts (emoticons): :-) :-( 8-) ;)
|
||||
|
||||
see [how to change output](https://github.com/markdown-it/markdown-it-emoji#change-output) with twemoji.
|
||||
|
||||
|
||||
### [Subscript](https://github.com/markdown-it/markdown-it-sub) / [Superscript](https://github.com/markdown-it/markdown-it-sup)
|
||||
|
||||
- 19^th^
|
||||
- H~2~O
|
||||
|
||||
|
||||
### [\<ins>](https://github.com/markdown-it/markdown-it-ins)
|
||||
|
||||
++Inserted text++
|
||||
|
||||
|
||||
### [\<mark>](https://github.com/markdown-it/markdown-it-mark)
|
||||
|
||||
==Marked text==
|
||||
|
||||
|
||||
### [Footnotes](https://github.com/markdown-it/markdown-it-footnote)
|
||||
|
||||
Footnote 1 link[^first].
|
||||
|
||||
Footnote 2 link[^second].
|
||||
|
||||
Inline footnote^[Text of inline footnote] definition.
|
||||
|
||||
Duplicated footnote reference[^second].
|
||||
|
||||
[^first]: Footnote **can have markup**
|
||||
|
||||
and multiple paragraphs.
|
||||
|
||||
[^second]: Footnote text.
|
||||
|
||||
|
||||
### [Definition lists](https://github.com/markdown-it/markdown-it-deflist)
|
||||
|
||||
Term 1
|
||||
|
||||
: Definition 1
|
||||
with lazy continuation.
|
||||
|
||||
Term 2 with *inline markup*
|
||||
|
||||
: Definition 2
|
||||
|
||||
{ some code, part of Definition 2 }
|
||||
|
||||
Third paragraph of definition 2.
|
||||
|
||||
_Compact style:_
|
||||
|
||||
Term 1
|
||||
~ Definition 1
|
||||
|
||||
Term 2
|
||||
~ Definition 2a
|
||||
~ Definition 2b
|
||||
|
||||
|
||||
### [Abbreviations](https://github.com/markdown-it/markdown-it-abbr)
|
||||
|
||||
This is HTML abbreviation example.
|
||||
|
||||
It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.
|
||||
|
||||
*[HTML]: Hyper Text Markup Language
|
||||
|
||||
### [Custom containers](https://github.com/markdown-it/markdown-it-container)
|
||||
|
||||
::: warning
|
||||
*here be dragons*
|
||||
:::
|
BIN
content/other/mingw-libs/curl.7z
(Stored with Git LFS)
Normal file
BIN
content/other/mingw-libs/fltk.zip
(Stored with Git LFS)
Normal file
37
content/other/mingw-libs/index.md
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "Бибилотеки MinGW"
|
||||
categories: ["cpp", "archive"]
|
||||
date: 2016-02-19T00:00:00+03:00
|
||||
draft: false
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
|
||||
Тут находятся некоторые, уже откомпилированные мной, библиотеки для MinGW.
|
||||
|
||||
<!--more-->
|
||||
|
||||
|
||||
### PNG
|
||||
|
||||
[png1621.7z](png1621.7z)
|
||||
|
||||
### SSL
|
||||
|
||||
[ssl.7z](ssl.7z)
|
||||
|
||||
### FLTK
|
||||
|
||||
[fltk.zip](fltk.zip)
|
||||
|
||||
### Zlib
|
||||
|
||||
[zlib128.7z](zlib128.7z)
|
||||
|
||||
### Curl
|
||||
|
||||
[curl.7z](curl.7z)
|
||||
|
||||
### SQLite
|
||||
|
||||
[sqlite.7z](sqlite.7z)
|
BIN
content/other/mingw-libs/miniature.jpg
(Stored with Git LFS)
Normal file
BIN
content/other/mingw-libs/png1621.7z
(Stored with Git LFS)
Normal file
BIN
content/other/mingw-libs/sqlite.7z
(Stored with Git LFS)
Normal file
BIN
content/other/mingw-libs/ssl.7z
(Stored with Git LFS)
Normal file
BIN
content/other/mingw-libs/zlib128.7z
(Stored with Git LFS)
Normal file
BIN
content/other/pinouts/i2c_lcd_pinout.jpg
(Stored with Git LFS)
Normal file
21
content/other/pinouts/index.md
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "Распиновки"
|
||||
categories: ["misc", "archive"]
|
||||
date: 2018-09-07T00:00:00+03:00
|
||||
draft: false
|
||||
---
|
||||
|
||||
|
||||
Разнообразные найденные или выясненные распиновки
|
||||
|
||||
<!--more-->
|
||||
|
||||
|
||||
Распиновка модуля i2c - LCD
|
||||
|
||||
i2c LCD adapter pinout
|
||||
|
||||
(PCF8574T)
|
||||
|
||||
![|547](i2c_lcd_pinout.jpg)
|
||||
|
BIN
content/other/soft/ft232_2814.zip
(Stored with Git LFS)
Normal file
BIN
content/other/soft/ftdi.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
33
content/other/soft/index.md
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "Софт"
|
||||
categories: ["misc", "archive"]
|
||||
date: 2015-08-13T00:00:00+03:00
|
||||
draft: false
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
|
||||
Различный софт.
|
||||
|
||||
<!--more-->
|
||||
|
||||
---
|
||||
|
||||
### LCDPict
|
||||
|
||||
![lcd](lcd.png)
|
||||
|
||||
Редактор изображений и символов для LCD экранов
|
||||
|
||||
[lcdpict.zip](lcdpict.zip)
|
||||
|
||||
---
|
||||
|
||||
### Драйвер FTDI FT232 2.8.14
|
||||
|
||||
![ftdi](ftdi.png)
|
||||
|
||||
Подходит для китайских копий FT232
|
||||
|
||||
[ft232_2814.zip](ft232_2814.zip)
|
||||
|
BIN
content/other/soft/lcd.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
content/other/soft/lcd_cloud.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
content/other/soft/lcdpict.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
content/other/soft/lcdpict.zip
(Stored with Git LFS)
Normal file
BIN
content/other/soft/miniature.jpg
(Stored with Git LFS)
Normal file
217
content/other/stm32f1x-makefile/index.md
Normal file
@ -0,0 +1,217 @@
|
||||
---
|
||||
title: "Makefile для STM32F103"
|
||||
categories: ["mcu", "archive"]
|
||||
date: 2017-02-26T00:00:00+03:00
|
||||
draft: false
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
|
||||
Почти что в первый раз писал. Прошу простить за убогость и SPL. Всё это убирается. Под linux не проверялось.
|
||||
|
||||
<!--more-->
|
||||
|
||||
Рабочий проект: [stm32f103make.zip](stm32f103make.zip)
|
||||
|
||||
|
||||
```makefile
|
||||
CXX = arm-none-eabi-g++
|
||||
CC = arm-none-eabi-gcc
|
||||
LD = arm-none-eabi-gcc
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
SIZE = arm-none-eabi-size
|
||||
STFLASH = st-flash
|
||||
OPENOCD = openocd
|
||||
STUTIL = st-flash
|
||||
|
||||
|
||||
OUTPUT_DIR = bin
|
||||
OBJ_DIR = obj
|
||||
|
||||
TARGET_NAME = led
|
||||
TARGET_BINARY = $(TARGET_NAME).elf
|
||||
TARGET_HEX = $(TARGET_NAME).hex
|
||||
|
||||
vpath %.c ./src
|
||||
|
||||
SOURCES = \
|
||||
main.c
|
||||
|
||||
LDFLAGS_DEBUG =
|
||||
CDFLAGS_DEBUG = -g3 -O0
|
||||
|
||||
LDFLAGS_RELEASE =
|
||||
CDFLAGS_RELEASE = -O2
|
||||
|
||||
CFLAGS = -Wall \
|
||||
-mcpu=cortex-m3 \
|
||||
-mthumb \
|
||||
-D__HEAP_SIZE=0x0000 \
|
||||
-D__STACK_SIZE=0x0100 \
|
||||
-mfloat-abi=soft \
|
||||
-fno-strict-aliasing \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-DSTM32F103C8 \
|
||||
-DSTM32F10X_MD \
|
||||
-DUSE_STDPERIPH_DRIVER
|
||||
|
||||
TARGET = $(OUTPUT_DIR)/$(TARGET_BINARY)
|
||||
|
||||
LIBS = -lm
|
||||
|
||||
LDFLAGS = \
|
||||
--specs=nosys.specs \
|
||||
--specs=nano.specs \
|
||||
-mcpu=cortex-m3 \
|
||||
-mthumb \
|
||||
-Wl,--defsym=__HEAP_SIZE=0x0000 \
|
||||
-Wl,--defsym=__STACK_SIZE=0x0100 \
|
||||
-mfloat-abi=soft \
|
||||
-fno-strict-aliasing \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-Wl,--gc-sections \
|
||||
-Wl,-script="./hardware/stm32f103c8_flash.ld" \
|
||||
-Wl,-Map=$(TARGET).map
|
||||
#-u _printf_float
|
||||
|
||||
INCLUDES = \
|
||||
-I. \
|
||||
-I./include \
|
||||
-I./hardware/include \
|
||||
-I./hardware/include/cmsis \
|
||||
-I./hardware/SPL/include
|
||||
|
||||
STARUPFILE = hardware/src/startup_stm32f10x_md.S
|
||||
|
||||
SOURCES_SPL = \
|
||||
stm32f10x_rcc.c \
|
||||
stm32f10x_gpio.c \
|
||||
stm32f10x_dma.c
|
||||
|
||||
#stm32f10x_crc.c \
|
||||
#stm32f10x_flash.c \
|
||||
#stm32f10x_pwr.c \
|
||||
#stm32f10x_tim.c \
|
||||
#stm32f10x_adc.c \
|
||||
#stm32f10x_dac.c \
|
||||
#stm32f10x_fsmc.c \
|
||||
#stm32f10x_usart.c \
|
||||
#stm32f10x_bkp.c \
|
||||
#stm32f10x_dbgmcu.c \
|
||||
#stm32f10x_rtc.c \
|
||||
#stm32f10x_wwdg.c \
|
||||
#stm32f10x_can.c \
|
||||
#stm32f10x_i2c.c \
|
||||
#stm32f10x_sdio.c \
|
||||
#stm32f10x_cec.c \
|
||||
#stm32f10x_exti.c \
|
||||
#stm32f10x_iwdg.c \
|
||||
#stm32f10x_spi.c \
|
||||
#misc.c
|
||||
|
||||
################################################################
|
||||
|
||||
|
||||
SOURCES += $(addprefix hardware/SPL/src/, $(SOURCES_SPL))
|
||||
SOURCES += hardware/src/system_stm32f10x.c
|
||||
|
||||
HEX = $(OUTPUT_DIR)/$(TARGET_HEX)
|
||||
|
||||
STARTUPOBJ = $(notdir $(STARUPFILE))
|
||||
STARTUPOBJ := $(patsubst %.S, $(OBJ_DIR)/%.S.o, $(STARTUPOBJ))
|
||||
|
||||
OBJECTS = $(patsubst %, $(OBJ_DIR)/%.o, $(SOURCES))
|
||||
OBJECTS += $(STARTUPOBJ)
|
||||
|
||||
DEPS = $(OBJECTS:.o=.d)
|
||||
|
||||
|
||||
|
||||
all: release
|
||||
|
||||
release: LDFLAGS+=$(LDFLAGS_RELEASE)
|
||||
release: CFLAGS+=$(CDFLAGS_RELEASE)
|
||||
release: _firmware
|
||||
|
||||
debug: LDFLAGS+=$(LDFLAGS_DEBUG)
|
||||
debug: CFLAGS+=$(CDFLAGS_DEBUG)
|
||||
debug: _firmware
|
||||
|
||||
|
||||
_firmware: $(TARGET) $(HEX)
|
||||
|
||||
|
||||
$(TARGET): $(OBJECTS) | $(OUTPUT_DIR) $(OBJ_DIR)
|
||||
$(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
|
||||
$(SIZE) --format=berkeley $(TARGET)
|
||||
|
||||
obj/%.cpp.o: %.cpp
|
||||
ifeq ($(OS), Windows_NT)
|
||||
$(eval dirname=$(subst /,\\,$(dir $@)))
|
||||
@ if NOT EXIST $(dirname) mkdir $(dirname)
|
||||
else
|
||||
@mkdir -p $(dir $@) $(TO_NULL)
|
||||
endif
|
||||
$(CXX) -c -MMD -MP $(CFLAGS) $(INCLUDES) $< -o $@
|
||||
|
||||
obj/%.c.o: %.c
|
||||
ifeq ($(OS), Windows_NT)
|
||||
$(eval dirname=$(subst /,\\,$(dir $@)))
|
||||
@ if NOT EXIST $(dirname) mkdir $(dirname)
|
||||
else
|
||||
@mkdir -p $(dir $@) $(TO_NULL)
|
||||
endif
|
||||
$(CC) -c -MMD -MP $(CFLAGS) $(INCLUDES) $< -o $@
|
||||
|
||||
$(STARTUPOBJ):
|
||||
$(CC) -c -MMD -MP $(CFLAGS) $(INCLUDES) $(STARUPFILE) -o $(STARTUPOBJ)
|
||||
|
||||
$(HEX): $(TARGET)
|
||||
$(OBJCOPY) -O ihex $(TARGET) $(HEX)
|
||||
|
||||
$(OUTPUT_DIR):
|
||||
@mkdir $(OUTPUT_DIR)
|
||||
|
||||
$(OBJ_DIR):
|
||||
@mkdir $(OBJ_DIR)
|
||||
|
||||
_size: $(TARGET)
|
||||
$(SIZE) --format=berkeley $(TARGET)
|
||||
|
||||
|
||||
flash: flash-ocd
|
||||
|
||||
flash-stutil:
|
||||
$(STFLASH) --format ihex write $(HEX)
|
||||
|
||||
flash-ocd:
|
||||
$(OPENOCD) -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c "program $(TARGET) verify reset exit"
|
||||
|
||||
srclist:
|
||||
@echo $(SOURCES)
|
||||
|
||||
objlist:
|
||||
@echo $(OBJECTS)
|
||||
|
||||
clean:
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
-del $(subst /,\\,$(OBJECTS))
|
||||
-del $(subst /,\\,$(DEPS))
|
||||
-rmdir /S /Q $(OBJ_DIR)
|
||||
-del /Q /F $(OUTPUT_DIR)\\$(TARGET_BINARY)
|
||||
-del /Q /F $(OUTPUT_DIR)\\$(TARGET_BINARY).map
|
||||
-del /Q /F $(OUTPUT_DIR)\\$(TARGET_HEX)
|
||||
else
|
||||
-rm -f $(OBJECTS)
|
||||
-rm -f $(DEPS)
|
||||
-rm -rf $(OBJ_DIR)
|
||||
-rm -f $(OUTPUT_DIR)/$(TARGET_BINARY)
|
||||
-rm -f $(OUTPUT_DIR)/$(TARGET_BINARY).map
|
||||
-rm -f $(OUTPUT_DIR)/$(TARGET_HEX)
|
||||
endif
|
||||
|
||||
-include $(DEPS)
|
||||
```
|
BIN
content/other/stm32f1x-makefile/miniature.jpg
(Stored with Git LFS)
Normal file
BIN
content/other/stm32f1x-makefile/stm32f103make.zip
(Stored with Git LFS)
Normal file
18
content/other/thanks/index.md
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "Спасибы"
|
||||
categories: ["misc", "pinned"]
|
||||
date: 2016-05-14T00:00:00+03:00
|
||||
draft: false
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
Нечеловеческое спасибо за всё следующим людям:
|
||||
|
||||
* Иван Истомин ([Istom1n](https://vk.com/id9920588))
|
||||
* Кирилл Иванов
|
||||
* Игорь Окунский ([Clarity](https://vk.com/sundayclarity))
|
||||
* Игорь Водка ([Uhehesh](https://vk.com/id171249225))
|
||||
* Дмитрий Тычинин ([iMityan](https://vk.com/id88536880))
|
||||
* Даня Соломыкин ([CrazyClown](https://vk.com/id23105063))
|
||||
* Алексей Шалпегин (15432)
|
||||
* Валерия ([Mithriss](https://vk.com/id244743608))
|
BIN
content/other/thanks/miniature.jpg
(Stored with Git LFS)
Normal file
BIN
content/posts/avr-freq-meter/3d1.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
content/posts/avr-freq-meter/7seg-freq-corel.zip
(Stored with Git LFS)
Normal file
BIN
content/posts/avr-freq-meter/avr-7seg-freq-curse.docx
(Stored with Git LFS)
Normal file
BIN
content/posts/avr-freq-meter/compas1.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
content/posts/avr-freq-meter/compas2.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
content/posts/avr-freq-meter/compas3.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
content/posts/avr-freq-meter/draft.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
content/posts/avr-freq-meter/freq-meter-KOMPAS.zip
(Stored with Git LFS)
Normal file
BIN
content/posts/avr-freq-meter/freq_sch.png
Normal file
After Width: | Height: | Size: 265 KiB |
239
content/posts/avr-freq-meter/index.md
Normal file
@ -0,0 +1,239 @@
|
||||
---
|
||||
title: "Простой частотомер на AVR - курсовая работа"
|
||||
categories: ["mcu", "archive"]
|
||||
date: 2015-08-16T00:00:00+03:00
|
||||
draft: true
|
||||
featured_image: miniature.jpg
|
||||
---
|
||||
|
||||
|
||||
Итак, пришло время время делать курсовые работы. Мне попалась тема "Частотомер с передачей данных по последовательному порту и динамической индикацией". Значит, будем использовать таймер, внешние прерывания и динамическую индикацию. Использовал семисегментный индикатор с четырьмя разрядами и общим анодом. Микроконтроллер выберем Atmega16. Именно с ним я не чувствовал дефицита ножек. Приступим.
|
||||
|
||||
<!--more-->
|
||||
|
||||
> :warning: Этот текст – древний стыд. Не нужно принимать его всерьёз. Сейчас бы такой бред не сделал.
|
||||
|
||||
Работа заключается в следующем: нужно спроектировать схему устройства, развести печатку, а также изготовить корпус для готового устройства. В КОМПАС 3D, разумеется.
|
||||
|
||||
Для начала нам нужно определиться как именно считать частоту. Я решил использовать таймер, тактированный часовым кварцем и засекать количество внешних прерываний за секунду. Прерывания использовал по нарастающему фронту. Возможно, я не прав, но, во благо, на железе собирать ничего не требуется.
|
||||
|
||||
Делаем всё в протеусе. Схема получилась такая:
|
||||
|
||||
![Схема|786](freq_sch.png)
|
||||
|
||||
Пишем программу. Микроконтроллер должен считать импульсы в секунду и выводить их на семисегментный индикатор. А также отдавать данные по UART.
|
||||
|
||||
main.h:
|
||||
```c
|
||||
#ifndef __MAIN_H_
|
||||
#define __MAIN_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef uint8_t byte;
|
||||
|
||||
byte buf[16];
|
||||
|
||||
uint32_t freq;
|
||||
uint32_t freq_max;
|
||||
uint32_t measure_buf;
|
||||
|
||||
// порт для сегментов
|
||||
#define SEGMENTS_DDR DDRA
|
||||
#define SEGMENTS_PORT PORTA
|
||||
|
||||
|
||||
// порт для разрядов
|
||||
#define DIGITS_DDR DDRC
|
||||
#define DIGITS_PORT PORTC
|
||||
|
||||
|
||||
#define SWITCH_TIME 45 // время между переключениями разрядов; чем меньше, тем меньше мерцает
|
||||
|
||||
#define INPUT 0x00
|
||||
#define OUTPUT 0xFF
|
||||
|
||||
|
||||
#define SYMBOLS_SIZE 11 // количество символов в таблице
|
||||
byte symbols[SYMBOLS_SIZE] = //состояния пинов для символов
|
||||
{
|
||||
0b00111111, // 0
|
||||
0b00000110, // 1
|
||||
0b01011011, // 2
|
||||
0b01001111, // 3
|
||||
0b01100110, // 4
|
||||
0b01101101, // 5
|
||||
0b01111101, // 6
|
||||
0b00000111, // 7
|
||||
0b01111111, // 8
|
||||
0b01101111, // 9
|
||||
0b10000000 // .
|
||||
};
|
||||
|
||||
int main(void);
|
||||
|
||||
void switchDigit(byte digit); // показать нужный разряд, остальные погасить; значения от 0 до 3
|
||||
void showDigit(byte number, bool dot); // вывести символ на разряд, с точкой или без; значения от 0 до SYMBOLS_SIZE
|
||||