STM32_ExtendedLibs/Doc/latex/mainpage_8h_source.tex
Razvalyaev 03a203fe2a evovle перенесен на float + добавлены некоторые опциональные параметры
т.к. нет особо смысла супер быстро рассчитывать параметры. это просто вспомогательный инструмент для их параметров
2025-10-20 18:57:00 +03:00

111 lines
14 KiB
TeX
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

\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}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00001}00001\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00002}00002\ \textcolor{comment}{/**}}
\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_l00007}00007\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00008}00008\ \textcolor{comment}{@subsection\ features\ Основные\ возможности}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00009}00009\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00010}00010\ \textcolor{comment}{@subsubsection\ utils\_module\ Общие\ утилиты\ (@ref\ MYLIBS\_DEFINES)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00011}00011\ \textcolor{comment}{-\/\ Макросы\ для\ задержек\ и\ утилит\ (@ref\ DELAYS\_DEFINES\ и\ @ref\ UTILS\_DEFINES)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00012}00012\ \textcolor{comment}{-\/\ Трекеры\ для\ статистики\ и\ отладки\ \ (@ref\ TRACKERS\ и\ @ref\ TRACE)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00013}00013\ \textcolor{comment}{-\/\ Эволюционный\ алгоритм\ для\ оптимизации\ параметров\ \ (@ref\ EVOLVE\_OPTIMIZER)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00014}00014\ \textcolor{comment}{-\/\ Битовый\ доступ\ к\ регистрам\ через\ union\ \ (@ref\ BIT\_ACCESS\_DEFINES)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00015}00015\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00016}00016\ \textcolor{comment}{@subsubsection\ trace\_module\ Трассировка\ @ref\ TRACE}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00017}00017\ \textcolor{comment}{-\/\ Serial\ трассировка\ через\ SWO\ и\ RTT\ (@ref\ TRACE\_SERIAL)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00018}00018\ \textcolor{comment}{-\/\ GPIO\ трассировка\ для\ отладки\ (@ref\ TRACE\_GPIO)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00019}00019\ \textcolor{comment}{-\/\ Сохранение\ логов\ в\ Flash\ память\ (@ref\ TRACE\_RTT\_FLASH)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00020}00020\ \textcolor{comment}{-\/\ Обработка\ HardFault\ с\ сохранением\ контекста\ (@ref\ TRACE\_HARDFAULT)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00021}00021\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00022}00022\ \textcolor{comment}{@subsubsection\ gpio\_module\ Модуль\ GPIO\ @ref\ MY\_LIBS\_GPIO}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00023}00023\ \textcolor{comment}{-\/\ Инициализация\ портов\ и\ тактирования\ (@ref\ MYLIBS\_GPIO\_GENERAL)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00024}00024\ \textcolor{comment}{-\/\ Управление\ светодиодами\ (включение/выключение,\ моргание,\ плавное\ затухание)\ (@ref\ MYLIBS\_GPIO\_LEDS)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00025}00025\ \textcolor{comment}{-\/\ Работа\ с\ кнопками\ (чтение\ состояния,\ фильтрация\ дребезга)\ (@ref\ MYLIBS\_GPIO\_SWITCH)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00026}00026\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00027}00027\ \textcolor{comment}{@subsubsection\ tim\_module\ Модуль\ таймеров\ @ref\ MY\_LIBS\_TIM}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00028}00028\ \textcolor{comment}{-\/\ Базовая\ инициализация\ таймеров\ (@ref\ MYLIBS\_TIM\_GENERAL)}}
\DoxyCodeLine{\Hypertarget{mainpage_8h_source_l00029}00029\ \textcolor{comment}{-\/\ Формирование\ задержек\ (блокирующие\ и\ неблокирующие)\ (@ref\ MYLIBS\_TIM\_DELAY)}}
\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_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_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}{\ */}}
\end{DoxyCode}