Добавлено:

- максимально убрана зависимость от 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{general\+\_\+gpio.\+c}
\hypertarget{general__gpio_8c_source}{}\label{general__gpio_8c_source}\index{F:/Work/Projects/STM/.Elementary/STM32\_ExtendedLibs/MyLibsGeneral/Src/general\_gpio.c@{F:/Work/Projects/STM/.Elementary/STM32\_ExtendedLibs/MyLibsGeneral/Src/general\_gpio.c}}
\hypertarget{general__gpio_8c_source}{}\label{general__gpio_8c_source}\index{E:/.WORK/STM32/STM32\_ExtendedLibs/MyLibsGeneral/Src/general\_gpio.c@{E:/.WORK/STM32/STM32\_ExtendedLibs/MyLibsGeneral/Src/general\_gpio.c}}
\mbox{\hyperlink{general__gpio_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00001}00001\ \textcolor{comment}{/**\ }}
@@ -193,7 +193,7 @@
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00189}00189\ \ \ \textcolor{comment}{/*\ Режим\ моргания\ светодиода\ */}}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00190}00190\ \ \ \textcolor{keywordflow}{if}(led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_ad28d93023a00e3c5669bd3deda122435}{state}}\ ==\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___l_e_d_s_ggaac2b90d8b8c9579b6aa5d3bbda9b1ff1a2445895bed5dcbedc82ea3ef02bec6fb}{LED\_IS\_BLINKING}})}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00191}00191\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00192}00192\ \ \ \ \ uint32\_t\ tickcurrent\ =\ HAL\_GetTick();}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00192}00192\ \ \ \ \ uint32\_t\ tickcurrent\ =\ \mbox{\hyperlink{group___l_i_b_s___c_o_n_f_i_g_ga9c853b02c22f26023c34d1d404b6d653}{local\_time}}();}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00193}00193\ \ \ \ \ \textcolor{comment}{/*\ Ожидание\ истечения\ периода\ моргания\ */}}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00194}00194\ \ \ \ \ \textcolor{keywordflow}{if}((tickcurrent\ -\/\ led-\/>tickprev)\ >\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a6cc026931a4681732f9a329ae03098ec}{LED\_Period}})}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00195}00195\ \ \ \ \ \{}
@@ -208,7 +208,7 @@
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00204}00204\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00205}00205\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{unsigned}\ direction\ =\ 0;}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00206}00206\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{int}\ duty\ =\ 0;}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00207}00207\ \ \ \ \ uint32\_t\ tickcurrent\ =\ HAL\_GetTick();}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00207}00207\ \ \ \ \ uint32\_t\ tickcurrent\ =\ \mbox{\hyperlink{group___l_i_b_s___c_o_n_f_i_g_ga9c853b02c22f26023c34d1d404b6d653}{local\_time}}();}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00208}00208\ \ \ \ \ \textcolor{comment}{/*\ Ожидание\ момента\ изменения\ яркости\ */}}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00209}00209\ \ \ \ \ \textcolor{comment}{/*\ Период\ ШИМ\ 20\ мс,\ поэтому\ менять\ яроксть\ надо\ 40\ раз\ за\ период\ (туда\ обратно)\ */}}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00210}00210\ \ \ \ \ \textcolor{keywordflow}{if}((tickcurrent\ -\/\ led-\/>tickprev)\ >\ led-\/>\mbox{\hyperlink{struct_g_p_i_o___l_e_d_type_def_a6cc026931a4681732f9a329ae03098ec}{LED\_Period}}/(\mbox{\hyperlink{group___g_p_i_o___i_n_i_t_ga1d42e219765ec526d99e306638ac0023}{LED\_PWM\_TICKS}}*2))}
@@ -292,9 +292,9 @@
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00288}00288\ \ \ \ \ \textcolor{keywordflow}{if}(sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a2600e599a961af2e280c721894df4c06}{Sw\_FilterDelay}})\ \textcolor{comment}{//\ если\ включена\ защита\ от\ дребезга}}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00289}00289\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00290}00290\ \ \ \ \ \ \ \textcolor{keywordflow}{if}(sw-\/>tickprev\ ==\ 0)}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00291}00291\ \ \ \ \ \ \ \ \ sw-\/>tickprev\ =\ HAL\_GetTick();}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00291}00291\ \ \ \ \ \ \ \ \ sw-\/>tickprev\ =\ \mbox{\hyperlink{group___l_i_b_s___c_o_n_f_i_g_ga9c853b02c22f26023c34d1d404b6d653}{local\_time}}();}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00292}00292\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00293}00293\ \ \ \ \ \ \ \textcolor{keywordflow}{if}((HAL\_GetTick()\ -\/\ sw-\/>tickprev)\ >=\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a2600e599a961af2e280c721894df4c06}{Sw\_FilterDelay}})}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00293}00293\ \ \ \ \ \ \ \textcolor{keywordflow}{if}((\mbox{\hyperlink{group___l_i_b_s___c_o_n_f_i_g_ga9c853b02c22f26023c34d1d404b6d653}{local\_time}}()\ -\/\ sw-\/>tickprev)\ >=\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a2600e599a961af2e280c721894df4c06}{Sw\_FilterDelay}})}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00294}00294\ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00295}00295\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(HAL\_GPIO\_ReadPin(sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_afb369df75a6065fd89ac4ba97d98ab1a}{Sw\_Port}},\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a63d58d9cba49a5823175585ef2996032}{Sw\_Pin}})\ ==\ sw-\/>\mbox{\hyperlink{struct_g_p_i_o___switch_type_def_a4fadf5ead3ebccad521a52c064eeb405}{Sw\_ActiveLvl}})}
\DoxyCodeLine{\Hypertarget{general__gpio_8c_source_l00296}00296\ \ \ \ \ \ \ \ \ \{}