Добавлено:

- максимально убрана зависимость от HAL - можно использовать и без него, чисто на cmsis
- документирован uart
- документирован spi
- добавлены примеры использования в general_periph
- всякие фиксы документации
This commit is contained in:
2025-10-21 03:27:45 +03:00
parent 81a0b1c010
commit 3fb3058a30
388 changed files with 20522 additions and 9544 deletions

View File

@@ -1,5 +1,5 @@
\doxysection{mainpage.\+h}
\hypertarget{mainpage_8h_source}{}\label{mainpage_8h_source}\index{F:/Work/Projects/STM/.Elementary/STM32\_ExtendedLibs/MyLibsGeneral/mainpage.h@{F:/Work/Projects/STM/.Elementary/STM32\_ExtendedLibs/MyLibsGeneral/mainpage.h}}
\hypertarget{mainpage_8h_source}{}\label{mainpage_8h_source}\index{E:/.WORK/STM32/STM32\_ExtendedLibs/MyLibsGeneral/mainpage.h@{E:/.WORK/STM32/STM32\_ExtendedLibs/MyLibsGeneral/mainpage.h}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00001}00001\ \textcolor{comment}{}}
@@ -7,7 +7,7 @@
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00003}00003\ \textcolor{comment}{@mainpage}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00004}00004\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00005}00005\ \textcolor{comment}{@section\ overview\ Обзор}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00006}00006\ \textcolor{comment}{MyLibs\ -\/\ это\ набор\ библиотек\ для\ удобной\ работы\ с\ периферией\ микроконтроллеров\ STM32.}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00006}00006\ \textcolor{comment}{MyLibs\ -\/\ это\ набор\ библиотек\ для\ удобной\ работы\ с\ STM32.}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00007}00007\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00008}00008\ \textcolor{comment}{@subsection\ features\ Основные\ возможности}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00009}00009\ \textcolor{comment}{}}
@@ -34,77 +34,47 @@
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00030}00030\ \textcolor{comment}{-\/\ Работа\ с\ энкодерами\ (чтение\ положения,\ обработка\ кнопок)\ (@ref\ MYLIBS\_TIM\_ENCODER)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00031}00031\ \textcolor{comment}{-\/\ Настройка\ ШИМ\ и\ Output\ Compare\ (@ref\ MYLIBS\_TIM\_OC)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00032}00032\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00033}00033\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00034}00034\ \textcolor{comment}{@subsection\ structure\ Структура\ проекта}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00033}00033\ \textcolor{comment}{@subsubsection\ uart\_module\ Модуль\ UART\ @ref\ MY\_LIBS\_UART}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00034}00034\ \textcolor{comment}{-\/\ Базовая\ инициализация\ UART\ и\ его\ пинов\ одной\ функцией\ (@ref\ UART\_Base\_Init)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00035}00035\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00036}00036\ \textcolor{comment}{@code}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00037}00037\ \textcolor{comment}{├──\ inc/\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\ Заголовочные\ файлы}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00038}00038\ \textcolor{comment}{│\ \ \ ├──\ mylibs\_include.h\ \ \ \ \ \#\ Главный\ include\ файл}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00039}00039\ \textcolor{comment}{│\ \ \ ├──\ mylibs\_config.h\ \ \ \ \ \ \#\ Конфигурация\ библиотек}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00040}00040\ \textcolor{comment}{│\ \ \ ├──\ mylibs\_defs.h\ \ \ \ \ \ \ \ \#\ Общие\ определения\ и\ макросы}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00041}00041\ \textcolor{comment}{│\ \ \ ├──\ bit\_access.h\ \ \ \ \ \ \ \ \ \#\ Битовый\ доступ\ к\ регистрам}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00042}00042\ \textcolor{comment}{│\ \ \ ├──\ trackers.h\ \ \ \ \ \ \ \ \ \ \ \#\ Трекеры\ для\ отладки}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00043}00043\ \textcolor{comment}{│\ \ \ ├──\ trace.h\ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\ Трассировка\ и\ логирование}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00044}00044\ \textcolor{comment}{│\ \ \ ├──\ general\_gpio.h\ \ \ \ \ \ \ \#\ Работа\ с\ GPIO}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00045}00045\ \textcolor{comment}{│\ \ \ ──\ general\_tim.h\ \ \ \ \ \ \ \ \#\ Работа\ с\ таймерами}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00046}00046\ \textcolor{comment}{└──\ src/\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\ Исходные\ файлы}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00047}00047\ \textcolor{comment}{\ \ \ \ ├──\ general\_gpio.c\ \ \ \ \ \ \ \#\ Реализация\ GPIO}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00048}00048\ \textcolor{comment}{\ \ \ \ └──\ general\_tim.c\ \ \ \ \ \ \ \ \#\ Реализация\ TIM}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00049}00049\ \textcolor{comment}{@endcode}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00050}00050\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00051}00051\ \textcolor{comment}{@subsection\ usage\_basic\ Использование}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00052}00052\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00053}00053\ \textcolor{comment}{Инструкция\ по\ подключению:}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00054}00054\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00055}00055\ \textcolor{comment}{1.\ Настройте\ конфигурацию\ @ref\ MYLIBS\_CONFIG\ в\ @ref\ mylibs\_config.h\ }}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00056}00056\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00057}00057\ \textcolor{comment}{2.\ Подключите\ главный\ заголовочный\ файл:}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00058}00058\ \textcolor{comment}{@code}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00059}00059\ \textcolor{comment}{\#include\ "{}mylibs\_include.h"{}}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00060}00060\ \textcolor{comment}{@endcode}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00061}00061\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00062}00062\ \textcolor{comment}{3.\ Используйте\ нужные\ модули\ в\ своем\ коде}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00063}00063\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00064}00064\ \textcolor{comment}{@subsubsection\ gpio\_example\ Пример\ работы\ с\ GPIO}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00065}00065\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00066}00066\ \textcolor{comment}{@code}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00067}00067\ \textcolor{comment}{//\ Инициализация\ светодиода}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00068}00068\ \textcolor{comment}{MX\_GPIO\_Init();}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00069}00069\ \textcolor{comment}{GPIO\_LEDTypeDef\ led;}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00070}00070\ \textcolor{comment}{GPIO\_LED\_Init(\&led,\ GPIOA,\ GPIO\_PIN\_5,\ 1);}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00036}00036\ \textcolor{comment}{@subsubsection\ spi\_module\ Модуль\ SPI\ @ref\ MY\_LIBS\_SPI}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00037}00037\ \textcolor{comment}{-\/\ Базовая\ инициализация\ SPI\ и\ пинов\ одной\ функцией\ (@ref\ SPI\_Base\_Init)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00038}00038\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00039}00039\ \textcolor{comment}{@subsection\ structure\ Структура\ проекта}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00040}00040\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00041}00041\ \textcolor{comment}{@code}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00042}00042\ \textcolor{comment}{├──\ inc/\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\ Заголовочные\ файлы}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00043}00043\ \textcolor{comment}{│\ \ \ ├──\ mylibs\_include.h\ \ \ \ \ \#\ Главный\ include\ файл}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00044}00044\ \textcolor{comment}{│\ \ \ ├──\ mylibs\_config.h\ \ \ \ \ \ \#\ Конфигурация\ библиотек}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00045}00045\ \textcolor{comment}{│\ \ \ ──\ mylibs\_defs.h\ \ \ \ \ \ \ \ \#\ Общие\ определения\ и\ макросы}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00046}00046\ \textcolor{comment}{│\ \ \ ├──\ bit\_access.h\ \ \ \ \ \ \ \ \ \#\ Битовый\ доступ\ к\ регистрам}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00047}00047\ \textcolor{comment}{\ \ \ ├──\ evolve\_optimizer.h\ \ \ \#\ Оптимизатор\ (генетический\ алгоритм)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00048}00048\ \textcolor{comment}{\ \ \ ──\ trackers.h\ \ \ \ \ \ \ \ \ \ \ \#\ Трекеры\ для\ отладки}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00049}00049\ \textcolor{comment}{│\ \ \ ├──\ trace.h\ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\ Трассировка\ и\ логирование}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00050}00050\ \textcolor{comment}{│\ \ \ ├──\ general\_gpio.h\ \ \ \ \ \ \ \#\ Работа\ с\ GPIO}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00051}00051\ \textcolor{comment}{\ \ \ \ ├──\ general\_spi.h\ \ \ \ \ \ \ \ \#\ Работа\ с\ SPI}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00052}00052\ \textcolor{comment}{│\ \ \ └──\ general\_tim.h\ \ \ \ \ \ \ \ \#\ Работа\ с\ таймерами}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00053}00053\ \textcolor{comment}{\ \ \ \ ├──\ general\_uart.h\ \ \ \ \ \ \ \#\ Работа\ с\ UART}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00054}00054\ \textcolor{comment}{└──\ src/\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \#\ Исходные\ файлы}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00055}00055\ \textcolor{comment}{\ \ \ \ ├──\ general\_gpio.c\ \ \ \ \ \ \ \#\ Реализация\ GPIO}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00056}00056\ \textcolor{comment}{\ \ \ \ ├──\ general\_spi.c\ \ \ \ \ \ \ \ \#\ Реализация\ SPI}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00057}00057\ \textcolor{comment}{\ \ \ \ └──\ general\_tim.c\ \ \ \ \ \ \ \ \#\ Реализация\ TIM}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00058}00058\ \textcolor{comment}{\ \ \ \ ├──\ general\_uart.c\ \ \ \ \ \ \ \#\ Реализация\ UART}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00059}00059\ \textcolor{comment}{@endcode}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00060}00060\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00061}00061\ \textcolor{comment}{@subsection\ usage\_basic\ Использование}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00062}00062\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00063}00063\ \textcolor{comment}{Инструкция\ по\ подключению:}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00064}00064\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00065}00065\ \textcolor{comment}{1.\ Настройте\ конфигурацию\ @ref\ MYLIBS\_CONFIG\ в\ @ref\ mylibs\_config.h\ }}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00066}00066\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00067}00067\ \textcolor{comment}{2.\ Подключите\ главный\ заголовочный\ файл:}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00068}00068\ \textcolor{comment}{@code}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00069}00069\ \textcolor{comment}{\#include\ "{}mylibs\_include.h"{}}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00070}00070\ \textcolor{comment}{@endcode}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00071}00071\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00072}00072\ \textcolor{comment}{//\ Включение\ светодиода}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00073}00073\ \textcolor{comment}{GPIO\_LED\_On(\&led);}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00074}00074\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00075}00075\ \textcolor{comment}{//\ Запуск\ моргания}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00076}00076\ \textcolor{comment}{GPIO\_LED\_Blink\_Start(\&led,\ 500);\ //\ Период\ 500\ мс}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00077}00077\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00078}00078\ \textcolor{comment}{//\ В\ основном\ цикле}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00079}00079\ \textcolor{comment}{while\ (1)\ \{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00080}00080\ \textcolor{comment}{GPIO\_LED\_Dynamic\_Handle(\&led);}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00081}00081\ \textcolor{comment}{\}}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00082}00082\ \textcolor{comment}{@endcode}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00083}00083\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00084}00084\ \textcolor{comment}{@subsubsection\ tim\_example\ Пример\ работы\ с\ таймером}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00085}00085\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00086}00086\ \textcolor{comment}{@code}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00087}00087\ \textcolor{comment}{//\ Настройка\ таймера}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00088}00088\ \textcolor{comment}{TIM\_SettingsTypeDef\ tim\_settings\ =\ \{0\};}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00089}00089\ \textcolor{comment}{tim\_settings.htim.Instance\ =\ TIM2;}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00090}00090\ \textcolor{comment}{tim\_settings.sTimAHBFreqMHz\ =\ SystemCoreClock;}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00091}00091\ \textcolor{comment}{tim\_settings.sTickBaseUS\ =\ TIM\_TickBase\_1MS;}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00092}00092\ \textcolor{comment}{tim\_settings.sTimFreqHz\ =\ 1000;\ //\ 1\ кГц}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00093}00093\ \textcolor{comment}{tim\_settings.sTimMode\ =\ TIM\_IT\_CONF;}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00094}00094\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00095}00095\ \textcolor{comment}{TIM\_Base\_Init(\&tim\_settings);}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00096}00096\ \textcolor{comment}{HAL\_TIM\_Base\_Start(\&tim\_settings.htim);}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00097}00097\ \textcolor{comment}{@endcode}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00098}00098\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00099}00099\ \textcolor{comment}{@subsection\ dependencies\ Зависимости}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00100}00100\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00101}00101\ \textcolor{comment}{-\/\ HAL\ библиотека\ STM32}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00102}00102\ \textcolor{comment}{-\/\ SEGGER\ RTT\ (опционально,\ для\ RTT\ трассировки)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00103}00103\ \textcolor{comment}{-\/\ FreeRTOS\ (опционально,\ для\ FreeRTOS\ задержек)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00104}00104\ \textcolor{comment}{\ */}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00072}00072\ \textcolor{comment}{3.\ Используйте\ нужные\ модули\ в\ своем\ коде.\ Примеры\ использования\ приведены\ в\ соответствующей\ теме}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00073}00073\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00074}00074\ \textcolor{comment}{\ */}}
\end{DoxyCode}