\doxysection{general\+\_\+tim.\+c}
\hypertarget{general__tim_8c_source}{}\label{general__tim_8c_source}\index{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_tim.c@{E:/.WORK/STM32/STM\_Libs/STM32\_General/Src/general\_tim.c}}
\mbox{\hyperlink{general__tim_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00001}00001\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00002}00002\ \textcolor{comment}{**************************************************************************}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00003}00003\ \textcolor{comment}{*\ @file\ general\_tim.c}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Модуль\ для\ инициализации\ таймеров\ и\ работы\ с\ ними.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00005}00005\ \textcolor{comment}{**************************************************************************}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00006}00006\ \textcolor{comment}{Реализация\ функций\ для\ работы\ с\ TIM:}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00007}00007\ \textcolor{comment}{\ -\/\ Инициализация\ таймера\ и\ его\ каналов}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00008}00008\ \textcolor{comment}{\ -\/\ Формирование\ задержек\ через\ таймеры}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00009}00009\ \textcolor{comment}{\ -\/\ Считывание\ энкодера}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00010}00010\ \textcolor{comment}{*************************************************************************/}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00011}00011\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{general__tim_8h}{general\_tim.h}}"{}}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00012}00012\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00013}00013\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00014}00014\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/TIM\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ }\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00015}00015\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00016}00016\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00017}00017\ \textcolor{comment}{\ \ *\ @param\ \ stim\ Указатель\ на\ структуру\ с\ настройками\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00018}00018\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00019}00019\ \textcolor{comment}{\ \ *\ @details\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00020}00020\ \textcolor{comment}{\ \ *\ Инициализирует\ таймер\ исходя\ из\ настроек\ верхнего\ уровня:}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00021}00021\ \textcolor{comment}{\ \ *\ -\/\ Длительность\ одного\ тика\ @ref\ TIM\_MHzTickBaseTypeDef}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00022}00022\ \textcolor{comment}{\ \ *\ -\/\ Частота\ таймера\ (в\ Гц,\ float)}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00023}00023\ \textcolor{comment}{\ \ *\ -\/\ Частота\ тактирования\ таймера\ от\ шины\ (в\ Гц,\ float)}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00024}00024\ \textcolor{comment}{\ \ *\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00025}00025\ \textcolor{comment}{\ \ *\ При\ невозможности\ выставления\ частоты\ при\ заданой\ длительности\ тика}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00026}00026\ \textcolor{comment}{\ \ *\ длительность\ тика\ увеличивается\ до\ тех\ пор,\ пока\ частота\ не\ будет\ достигнута.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00027}00027\ \textcolor{comment}{\ \ *\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00028}00028\ \textcolor{comment}{\ \ *\ При\ выставлении\ дефайна\ @ref\ UPDATE\_TIM\_PARAMS\_AFTER\_INITIALIZATION}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00029}00029\ \textcolor{comment}{\ \ *\ новая\ длительность\ тика\ записывается\ в\ структуру.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00030}00030\ \textcolor{comment}{\ \ *\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00031}00031\ \textcolor{comment}{\ \ *\ Также\ остается\ возможность\ низкоуровневой\ настройки\ по\ структурам\ @ref\ TIM\_SettingsTypeDef.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00032}00032\ \textcolor{comment}{\ \ *\ Для\ этого\ надо\ высокоуровневые\ настройки\ приравнять\ к\ нулю}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00033}00033\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00034}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{00034}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\_Base\_Init}}(\mbox{\hyperlink{struct_t_i_m___settings_type_def}{TIM\_SettingsTypeDef}}\ *stim)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00035}00035\ \{\ \textcolor{comment}{//\ function\ takes\ structure\ for\ init}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00036}00036\ \ \ \textcolor{comment}{//\ check\ that\ htim\ is\ defined}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00037}00037\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(stim,\ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00038}00038\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00039}00039\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00040}00040\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00041}00041\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00042}00042\ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}})\ \textcolor{comment}{//\ if\ tickbase\ isnt\ disable}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00043}00043\ \ \ \{\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00044}00044\ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}}\ ==\ NULL)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00045}00045\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00046}00046\ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ =\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}}*stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}})\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00047}00047\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00048}00048\ \ \ \ \ \textcolor{keywordflow}{if}\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_af6057ff3f60f5e01b41d4a347b79a5e4}{sTimFreqHz}}\ !=\ NULL))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00049}00049\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ =\ ((1000000/stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}})\ /\ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_af6057ff3f60f5e01b41d4a347b79a5e4}{sTimFreqHz}})\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00050}00050\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ ==\ NULL)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00051}00051\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ =\ 0xFFFF;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00052}00052\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00053}00053\ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}})}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00054}00054\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00055}00055\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ =\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ +\ 1)/stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00056}00056\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ \ \ \ =\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ +\ 1)*stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00057}00057\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00058}00058\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00059}00059\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ =\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00060}00060\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00061}00061\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00062}00062\ \ \ \textcolor{comment}{//\ fix\ overflow\ of\ presc\ and\ period\ if\ need}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00063}00063\ \ \ \textcolor{keywordflow}{for}(\textcolor{keywordtype}{int}\ i\ =\ 0;\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ >\ 0xFFFF)\ ||\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ >\ 0xFFFF);\ i++)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00064}00064\ \ \ \{\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00065}00065\ \ \ \ \ \textcolor{keywordflow}{if}\ (i>10)\ \textcolor{comment}{//\ if\ it\ isnt\ fixed\ after\ 10\ itteration\ -\/\ return\ HAL\_ERRPOR}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00066}00066\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00067}00067\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00068}00068\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00069}00069\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00070}00070\ \ \ \ \ \textcolor{comment}{//\ if\ timbase\ is\ too\ big\ (prescaller\ too\ big\ for\ choosen\ base\ from\ MHZ)}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00071}00071\ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ >\ 0xFFFF)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00072}00072\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00073}00073\ \ \ \ \ \ \ \textcolor{comment}{//\ переносим\ часть\ пресскалера\ в\ период}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00074}00074\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ =\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ +\ 1)/2)\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00075}00075\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ =\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ +\ 1)*2)\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00076}00076\ \ \ \ \ \ \ \textcolor{comment}{//\ обновляем\ TickBase,\ если\ есть\ куда\ обновлять}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00077}00077\ \ \ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ >\ 1)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00078}00078\ \ \ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ /=\ 2;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00079}00079\ \ \ \ \ \ \ \textcolor{comment}{//\ обновляем\ sTickBasePrescaler,\ если\ sTickBaseUS\ -\/\ уже\ в\ минимуме}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00080}00080\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ ==\ 1)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00081}00081\ \ \ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ *=\ 2;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00082}00082\ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{comment}{//\ if\ TickBase\ =\ 0\ -\/\ return\ error}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00083}00083\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00084}00084\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00085}00085\ \ \ \ \ \textcolor{comment}{//\ if\ freq\ is\ too\ low\ (period\ too\ big\ for\ choosen\ base)}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00086}00086\ \ \ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ >\ 0xFFFF)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00087}00087\ \ \ \ \ \{\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00088}00088\ \ \ \ \ \ \ \textcolor{comment}{//\ переносим\ часть\ периода\ в\ прескалер}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00089}00089\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ =\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Period\ +\ 1)/2)\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00090}00090\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ =\ ((stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Init.Prescaler\ +\ 1)*2)\ -\/\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00091}00091\ \ \ \ \ \ \ \textcolor{comment}{//\ обновляем\ TickBase}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00092}00092\ \ \ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ *=\ 2;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00093}00093\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00094}00094\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00095}00095\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00096}00096\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/TIM\ BASE\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00097}00097\ \ \ \textcolor{comment}{//\ tim\ base\ init\ \ \ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00098}00098\ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\_Base\_MspInit}}(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ab90e370c3edda88e76583293c250d2b0}{sTimMode}});}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00099}00099\ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIM\_Base\_Init(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}})\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00100}00100\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00101}00101\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00102}00102\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00103}00103\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00104}00104\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00105}00105\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CLOCK\ SRC\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00106}00106\ \ \ \textcolor{comment}{//\ fill\ sClockSourceConfig\ if\ its\ NULL}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00107}00107\ \ \ \textcolor{keywordflow}{if}\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a3805f627567798c3cd1d79a0da42bea0}{sClockSourceConfig}}.ClockSource\ ==\ NULL)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00108}00108\ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a3805f627567798c3cd1d79a0da42bea0}{sClockSourceConfig}}.ClockSource\ =\ TIM\_CLOCKSOURCE\_INTERNAL;\ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00109}00109\ \ \ \textcolor{comment}{//\ clock\ source\ init\ \ \ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00110}00110\ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIM\_ConfigClockSource(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ \&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a3805f627567798c3cd1d79a0da42bea0}{sClockSourceConfig}})\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00111}00111\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00112}00112\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00113}00113\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00114}00114\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00115}00115\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00116}00116\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/SLAVE\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00117}00117\ \ \ \textcolor{comment}{//\ if\ slave\ mode\ enables\ -\/\ config\ it}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00118}00118\ \ \ \textcolor{keywordflow}{if}\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a9694cf0910a69d48ff94f8aeac106969}{sSlaveConfig}}.SlaveMode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00119}00119\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00120}00120\ \ \ \ \ \textcolor{comment}{//\ slave\ mode\ init\ \ \ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00121}00121\ \ \ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIM\_SlaveConfigSynchro(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ \&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a9694cf0910a69d48ff94f8aeac106969}{sSlaveConfig}})\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00122}00122\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00123}00123\ \ \ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00124}00124\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00125}00125\ \ \ \ \ \}\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00126}00126\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00127}00127\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/MASTER\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ \ \ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00128}00128\ \ \ \textcolor{comment}{//\ master\ mode\ init\ \ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00129}00129\ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIMEx\_MasterConfigSynchronization(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ \&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a2d9d277dd395424b964445ec1bc65b21}{sMasterConfig}})\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00130}00130\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00131}00131\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00132}00132\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00133}00133\ \ \ \}\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00134}00134\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00135}00135\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/BDTR\ INIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ \ \ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00136}00136\ \ \ \textcolor{keywordflow}{if}\ (HAL\_TIMEx\_ConfigBreakDeadTime(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ \&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a961f19f0e1672715c27bc94d7871dbb7}{sBreakDeadTimeConfig}})\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00137}00137\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00138}00138\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00139}00139\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00140}00140\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00141}00141\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00142}00142\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/IT\ CLEAR-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00143}00143\ \ \ \_\_HAL\_TIM\_CLEAR\_IT(\&stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}},\ TIM\_IT\_UPDATE);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00144}00144\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00145}00145\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00146}00146\ \ \ \textcolor{comment}{//\ обновляем\ TickBase}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00147}00147\ \textcolor{preprocessor}{\ \ \#ifdef\ UPDATE\_TIM\_PARAMS\_AFTER\_INITIALIZATION}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00148}00148\ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ =\ (stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance-\/>PSC+1)*stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}/(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}});}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00149}00149\ \ \ \textcolor{keywordflow}{if}(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ ==\ 0)\ \ \textcolor{comment}{//\ if\ prescaler\ is\ too\ high}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00150}00150\ \ \ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ recalc\ what\ is\ prescaler\ irl}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00151}00151\ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a58da1b4c0f6d12d7d9fb2f170b9b9e6e}{sTickBaseUS}}\ =\ 1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00152}00152\ \ \ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a11151fe125960cb8e61328ffd06b7718}{sTickBasePrescaler}}\ =\ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_a7073358fd3a722687eb85238ab570014}{sTimAHBFreqMHz}}/(stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance-\/>PSC+1);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00153}00153\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00154}00154\ \textcolor{preprocessor}{\ \ \#endif}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00155}00155\ \ \ stim-\/>\mbox{\hyperlink{struct_t_i_m___settings_type_def_ada49efdbd35a8e442c3cff630d42f34c}{htim}}.Instance-\/>CNT\ =\ 0;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00156}00156\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00157}00157\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00158}00158\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00159}00159\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00160}00160\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00161}00161\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00162}00162\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ режима\ энкодер\ у\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00163}00163\ \textcolor{comment}{\ \ *\ @param\ \ henc\ Указатель\ на\ хендл\ энкодера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00164}00164\ \textcolor{comment}{\ \ *\ @param\ \ htim\ Указатель\ на\ хендл\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00165}00165\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00166}00166\ \textcolor{comment}{\ \ *\ @note\ \ \ Предварительно\ надо\ инициализировать\ таймер\ @ref\ TIM\_Base\_Init.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00167}00167\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00168}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{00168}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\_Encoder\_Init}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc,\ TIM\_HandleTypeDef\ *htim)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00169}00169\ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00170}00170\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(henc,\ htim,\ htim-\/>Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00171}00171\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00172}00172\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a4fc05ef011205a6702cb3d006bab677e}{GPIO\_PIN\_TI1}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a67ad037b92162546763fc9c425b5e3c5}{GPIO\_PIN\_TI2}}))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00173}00173\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00174}00174\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00175}00175\ \ \ GPIO\_InitTypeDef\ GPIO\_InitStruct\ =\ \{0\};}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00176}00176\ \ \ HAL\_StatusTypeDef\ RES\ =\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00177}00177\ \ \ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}\ =\ htim;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00178}00178\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00179}00179\ \ \ \textcolor{comment}{//\ setup\ channel\ for\ pwm}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00180}00180\ \ \ RES\ =\ HAL\_TIM\_Encoder\_Init(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}},\ \&henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a021f0c585e9e62d68a4b09f630d8b6e5}{sConfig}});}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00181}00181\ \ \ \textcolor{keywordflow}{if}\ (RES\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00182}00182\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00183}00183\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00184}00184\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00185}00185\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00186}00186\ \ \ \textcolor{comment}{//\ choose\ port\ for\ enable\ clock}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00187}00187\ \ \ RES\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}});}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00188}00188\ \ \ \textcolor{keywordflow}{if}(RES\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00189}00189\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00190}00190\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00191}00191\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00192}00192\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00193}00193\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00194}00194\ \ \ GPIO\_InitStruct.Pin\ =\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a4fc05ef011205a6702cb3d006bab677e}{GPIO\_PIN\_TI1}}|henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a67ad037b92162546763fc9c425b5e3c5}{GPIO\_PIN\_TI2}};}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00195}00195\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00196}00196\ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_PULLUP;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00197}00197\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_LOW;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00198}00198\ \ \ GPIO\_InitStruct.Alternate\ =\ GPIO\_TIM\_Alternate\_Mapping(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}-\/>Instance);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00199}00199\ \ \ \textcolor{keywordflow}{if}(GPIO\_InitStruct.Alternate)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00200}00200\ \ \ \ \ HAL\_GPIO\_Init(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}},\ \&GPIO\_InitStruct);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00201}00201\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00202}00202\ \ \ \textcolor{keywordflow}{if}(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6973108a83d2a3ea4fc3e0e8a501af80}{GPIO\_PIN\_SW}})}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00203}00203\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00204}00204\ \ \ \ \ \textcolor{comment}{/*Configure\ switch\ pin\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00205}00205\ \ \ \ \ GPIO\_InitStruct.Pin\ =\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6973108a83d2a3ea4fc3e0e8a501af80}{GPIO\_PIN\_SW}};}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00206}00206\ \ \ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_INPUT;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00207}00207\ \ \ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_PULLUP;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00208}00208\ \ \ \ \ HAL\_GPIO\_Init(henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}},\ \&GPIO\_InitStruct);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00209}00209\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00210}00210\ \ \ \ \ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_gacafee0e68877f2b25df843356871d1f7}{GPIO\_Switch\_Init}}(\&henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a99295760ff8b27d1e6f1710f29383a45}{Sw}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6973108a83d2a3ea4fc3e0e8a501af80}{GPIO\_PIN\_SW}},\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00211}00211\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00212}00212\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00213}00213\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00214}00214\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00215}00215\ \ \ \ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00216}00216\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00217}00217\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ выхода\ ШИМ\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00218}00218\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ \ \ \ \ Указатель\ на\ хендл\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00219}00219\ \textcolor{comment}{\ \ *\ @param\ \ sConfigOC\ \ \ Указатель\ на\ настрйоки\ канала\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00220}00220\ \textcolor{comment}{\ \ *\ @param\ \ TIM\_CHANNEL\ Канал\ таймера\ для\ настройки.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00221}00221\ \textcolor{comment}{\ \ *\ @param\ \ GPIOx\ \ \ \ \ \ \ Порт\ для\ вывода\ ШИМ.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00222}00222\ \textcolor{comment}{\ \ *\ @param\ \ GPIO\_PIN\ \ \ \ Пин\ для\ вывода\ ШИМ.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00223}00223\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00224}00224\ \textcolor{comment}{\ \ *\ @note\ \ \ Предварительно\ надо\ инициализировать\ таймер\ @ref\ TIM\_Base\_Init.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00225}00225\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00226}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{00226}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gadb2f465d89f609e035867e980c3a29c6}{TIM\_Output\_PWM\_Init}}(TIM\_HandleTypeDef\ *htim,\ TIM\_OC\_InitTypeDef\ *sConfigOC,\ uint32\_t\ TIM\_CHANNEL,\ GPIO\_TypeDef\ *GPIOx,\ uint32\_t\ GPIO\_PIN)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00227}00227\ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00228}00228\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(htim,\ htim-\/>Instance,\ sConfigOC))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00229}00229\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00230}00230\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(GPIOx,\ GPIO\_PIN))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00231}00231\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00232}00232\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00233}00233\ \ \ GPIO\_InitTypeDef\ GPIO\_InitStruct\ =\ \{0\};}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00234}00234\ \ \ HAL\_StatusTypeDef\ RES\ =\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00235}00235\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00236}00236\ \ \ \textcolor{comment}{//\ setup\ channel\ for\ pwm}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00237}00237\ \ \ RES\ =\ HAL\_TIM\_PWM\_ConfigChannel(htim,\ sConfigOC,\ TIM\_CHANNEL);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00238}00238\ \ \ \textcolor{keywordflow}{if}\ (RES\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00239}00239\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00240}00240\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00241}00241\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00242}00242\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00243}00243\ \ \ \textcolor{comment}{//\ choose\ port\ for\ enable\ clock}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00244}00244\ \ \ RES\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___g_e_n_e_r_a_l_ga962f010f783b81fcdd27eb6b53db28e6}{GPIO\_Clock\_Enable}}(GPIOx);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00245}00245\ \ \ \textcolor{keywordflow}{if}(RES\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00246}00246\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00247}00247\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00248}00248\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00249}00249\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00250}00250\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00251}00251\ \ \ GPIO\_InitStruct.Pin\ =\ GPIO\_PIN;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00252}00252\ \ \ GPIO\_InitStruct.Mode\ =\ GPIO\_MODE\_AF\_PP;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00253}00253\ \ \ \textcolor{keywordflow}{if}(sConfigOC-\/>OCPolarity\ ==\ TIM\_OCNPOLARITY\_HIGH)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00254}00254\ \ \ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_PULLDOWN;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00255}00255\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00256}00256\ \ \ \ \ GPIO\_InitStruct.Pull\ =\ GPIO\_PULLUP;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00257}00257\ \ \ GPIO\_InitStruct.Speed\ =\ GPIO\_SPEED\_FREQ\_LOW;\ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00258}00258\ \ \ GPIO\_InitStruct.Alternate\ =\ GPIO\_TIM\_Alternate\_Mapping(htim-\/>Instance);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00259}00259\ \ \ \textcolor{keywordflow}{if}(GPIO\_InitStruct.Alternate)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00260}00260\ \ \ \ \ HAL\_GPIO\_Init(GPIOx,\ \&GPIO\_InitStruct);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00261}00261\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00262}00262\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00263}00263\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00264}00264\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00265}00265\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00266}00266\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ OC\ компаратора\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00267}00267\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ \ \ \ \ Указатель\ на\ хендл\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00268}00268\ \textcolor{comment}{\ \ *\ @param\ \ TIM\_CHANNEL\ Канал\ таймера\ для\ настройки.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00269}00269\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00270}00270\ \textcolor{comment}{\ \ *\ @note\ \ \ Предварительно\ надо\ инициализировать\ таймер\ @ref\ TIM\_Base\_Init.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00271}00271\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00272}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{00272}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___o_c_gae2608ca8023e9a0713af0b4fbfbc1889}{TIM\_OC\_Comparator\_Init}}(TIM\_HandleTypeDef\ *htim,\ uint32\_t\ TIM\_CHANNEL)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00273}00273\ \{\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00274}00274\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00275}00275\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00276}00276\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00277}00277\ \ \ TIM\_OC\_InitTypeDef\ \ \ \ \ \ sConfigOC\ =\ \{0\};}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00278}00278\ \ \ HAL\_StatusTypeDef\ RES\ =\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00279}00279\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00280}00280\ \ \ sConfigOC.OCMode\ =\ TIM\_OCMODE\_ACTIVE;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00281}00281\ \ \ sConfigOC.Pulse\ =\ 0;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00282}00282\ \ \ sConfigOC.OCPolarity\ =\ TIM\_OCPOLARITY\_HIGH;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00283}00283\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00284}00284\ \ \ RES\ =\ HAL\_TIM\_OC\_ConfigChannel(htim,\ \&sConfigOC,\ TIM\_CHANNEL);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00285}00285\ \ \ \textcolor{keywordflow}{if}\ (RES\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00286}00286\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00287}00287\ \ \ \ \ MyLibs\_Error\_Handler();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00288}00288\ \ \ \ \ \textcolor{keywordflow}{return}\ RES;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00289}00289\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00290}00290\ \ \ \textcolor{keywordflow}{return}\ RES;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00291}00291\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00292}00292\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00293}00293\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00294}00294\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00295}00295\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/TIM\ USER\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ }\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00296}00296\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00297}00297\ \textcolor{comment}{\ \ *\ @brief\ \ Считать\ энкодер.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00298}00298\ \textcolor{comment}{\ \ *\ @param\ \ henc\ Указатель\ на\ хендл\ энкодера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00299}00299\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00300}00300\ \textcolor{comment}{\ \ *\ @details\ \ Читает\ разницу\ энкодера,\ которую\ он\ накопил\ после\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00301}00301\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ предыдущего\ вызова\ этой\ функции.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00302}00302\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00303}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{00303}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\_Encoder\_Read}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00304}00304\ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00305}00305\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_3(henc,\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}},\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}-\/>Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00306}00306\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00307}00307\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00308}00308\ \ \ uint16\_t\ cnt\_now\ =\ (uint16\_t)henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}-\/>Instance-\/>CNT;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00309}00309\ \ \ int16\_t\ diff\ =\ (int16\_t)(cnt\_now\ -\/\ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a0dacce3dde7df3122583869d96a372a2}{Encoder\_Shdw}});\ \ \textcolor{comment}{//\ переполнение\ корректно\ обрабатывается}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00310}00310\ \ \ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a6f769f027b760a4b496e2b2b77bf54a3}{Encoder\_Diff}}\ =\ diff;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00311}00311\ \ \ henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a0dacce3dde7df3122583869d96a372a2}{Encoder\_Shdw}}\ =\ cnt\_now;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00312}00312\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00313}00313\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00314}00314\ \}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00315}00315\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00316}00316\ \textcolor{comment}{\ \ *\ @brief\ \ Считать\ кнопку\ энкодера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00317}00317\ \textcolor{comment}{\ \ *\ @param\ \ henc\ Указатель\ на\ хендл\ энкодера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00318}00318\ \textcolor{comment}{\ \ *\ @return\ 1\ -\/\ если\ кнопка\ нажата,\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00319}00319\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ 0\ -\/\ если\ отжата,\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00320}00320\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ -\/1\ -\/\ если\ ошибка}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00321}00321\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00322}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{00322}}\ \textcolor{keywordtype}{int}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\_Encoder\_ReadSwitch}}(\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ *henc)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00323}00323\ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00324}00324\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_1(henc))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00325}00325\ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00326}00326\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00327}00327\ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group___m_y_l_i_b_s___g_p_i_o___s_w_i_t_c_h_ga960b24335b2026abcad126ab8c422d70}{GPIO\_Read\_Switch}}(\&henc-\/>\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a99295760ff8b27d1e6f1710f29383a45}{Sw}});}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00328}00328\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00329}00329\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00330}00330\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00331}00331\ \textcolor{comment}{\ \ *\ @brief\ \ Задержка\ в\ тиках\ таймера\ (блокирующая).}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00332}00332\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ Указатель\ на\ хендл\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00333}00333\ \textcolor{comment}{\ \ *\ @param\ \ delay\ \ \ Задержка\ в\ тиках\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00334}00334\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00335}00335\ \textcolor{comment}{\ \ *\ @details\ \ Формирует\ задержку\ с\ блокировкой\ программы.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00336}00336\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00337}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{00337}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga88c552a133cb6e3015453cccab74c07e}{TIM\_Delay}}(TIM\_HandleTypeDef\ *htim,\ uint16\_t\ delay)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00338}00338\ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00339}00339\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00340}00340\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00341}00341\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00342}00342\ \ \ \textcolor{keywordflow}{if}(delay\ >=\ htim-\/>Instance-\/>ARR)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00343}00343\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00344}00344\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00345}00345\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00346}00346\ \ \ htim-\/>Instance-\/>CNT\ =\ 0;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00347}00347\ \ \ \textcolor{keywordflow}{while}(1)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00348}00348\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00349}00349\ \ \ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance-\/>CNT\ >\ delay)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00350}00350\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00351}00351\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00352}00352\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00353}00353\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00354}00354\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00355}00355\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00356}00356\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00357}00357\ \textcolor{comment}{\ \ *\ @brief\ \ Начать\ отсчет\ неблокирующей\ задержки.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00358}00358\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ Указатель\ на\ хендл\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00359}00359\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00360}00360\ \textcolor{comment}{\ \ *\ @details\ \ Сбрасывает\ счетчик\ для\ начала\ отсчета\ неблокирующей\ задержки.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00361}00361\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ @ref\ TIM\_Delay\_NonBlocking\ для\ проверки\ статуса\ задержки}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00362}00362\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00363}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{00363}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga4c0dfde4e15f677600605348b4e97834}{TIM\_Delay\_Start}}(TIM\_HandleTypeDef\ *htim)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00364}00364\ \{\ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00365}00365\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00366}00366\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00367}00367\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00368}00368\ \ \ htim-\/>Instance-\/>CNT\ =\ 0;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00369}00369\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00370}00370\ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00371}00371\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00372}00372\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00373}00373\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00374}00374\ \textcolor{comment}{\ \ *\ @brief\ \ Задержка\ в\ тиках\ таймера\ (неблокирующая).}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00375}00375\ \textcolor{comment}{\ \ *\ @param\ \ htim\ \ \ \ Указатель\ на\ хендл\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00376}00376\ \textcolor{comment}{\ \ *\ @param\ \ delay\ \ \ Задержка\ в\ тиках\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00377}00377\ \textcolor{comment}{\ \ *\ @return\ HAL\ status.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00378}00378\ \textcolor{comment}{\ \ *\ @details\ \ Формирует\ задержку\ с\ блокировкой\ программы.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00379}00379\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ Перед\ ожиданием\ задержки\ надо\ запутстить\ таймер\ @ref\ TIM\_Delay\_Start}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00380}00380\ \textcolor{comment}{\ \ *\ @note\ \ \ \ \ Таймер\ не\ должен\ использоваться\ на\ время\ этой\ задержки}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00381}00381\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00382}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{00382}}\ HAL\_StatusTypeDef\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___d_e_l_a_y_ga108637af414bff3373059273b815ce9b}{TIM\_Delay\_NonBlocking}}(TIM\_HandleTypeDef\ *htim,\ uint16\_t\ delay)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00383}00383\ \{\ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00384}00384\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00385}00385\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00386}00386\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00387}00387\ \ \ \textcolor{keywordflow}{if}(delay\ >=\ htim-\/>Instance-\/>ARR)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00388}00388\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00389}00389\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_ERROR;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00390}00390\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00391}00391\ \ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00392}00392\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance-\/>CNT\ <=\ delay)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00393}00393\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00394}00394\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_BUSY;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00395}00395\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00396}00396\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00397}00397\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00398}00398\ \ \ \ \ \textcolor{keywordflow}{return}\ HAL\_OK;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00399}00399\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00400}00400\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00401}00401\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00402}00402\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00403}00403\ \textcolor{comment}{\ \ *\ @brief\ \ Инициализация\ CLK\ и\ NVIC\ таймеров.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00404}00404\ \textcolor{comment}{\ \ *\ @param\ \ htim\ Указатель\ на\ хендл\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00405}00405\ \textcolor{comment}{\ \ *\ @note\ \ \ Чтобы\ не\ генерировать\ функцию\ с\ иницилизацией\ неиспользуемых\ таймеров,}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00406}00406\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ дефайнами\ @ref\ TIM\_INIT\ в\ @ref\ general\_tim.h\ определяются\ используемые\ таймеры.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00407}00407\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00408}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{00408}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaad47337be7ba2f6c0777c40d7278c931}{TIM\_Base\_MspInit}}(TIM\_HandleTypeDef*\ htim,\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_gaeb611874216a4661fb83366b99b9e787}{TIM\_ITModeTypeDef}}\ it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00409}00409\ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00410}00410\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00411}00411\ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00412}00412\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00413}00413\ \ \ it\_mode\ =\ it\_mode\&TIM\_IT\_CONF;}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00414}00414\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM1}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00415}00415\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM1)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00416}00416\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00417}00417\ \ \ \ \ \textcolor{comment}{/*\ TIM2\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00418}00418\ \ \ \ \ \_\_HAL\_RCC\_TIM1\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00419}00419\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00420}00420\ \ \ \ \ \textcolor{comment}{/*\ TIM2\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00421}00421\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00422}00422\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00423}00423\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM1\_UP\_TIM10\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00424}00424\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM1\_UP\_TIM10\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00425}00425\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00426}00426\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00427}00427\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00428}00428\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM2}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00429}00429\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM2)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00430}00430\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00431}00431\ \ \ \ \ \textcolor{comment}{/*\ TIM2\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00432}00432\ \ \ \ \ \_\_HAL\_RCC\_TIM2\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00433}00433\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00434}00434\ \ \ \ \ \textcolor{comment}{/*\ TIM2\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00435}00435\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00436}00436\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00437}00437\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM2\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00438}00438\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM2\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00439}00439\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00440}00440\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00441}00441\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00442}00442\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM3}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00443}00443\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM3)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00444}00444\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00445}00445\ \ \ \ \ \textcolor{comment}{/*\ TIM3\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00446}00446\ \ \ \ \ \_\_HAL\_RCC\_TIM3\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00447}00447\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00448}00448\ \ \ \ \ \textcolor{comment}{/*\ TIM3\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00449}00449\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00450}00450\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00451}00451\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM3\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00452}00452\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM3\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00453}00453\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00454}00454\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00455}00455\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00456}00456\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM4}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00457}00457\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM4)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00458}00458\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00459}00459\ \ \ \ \ \textcolor{comment}{/*\ TIM4\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00460}00460\ \ \ \ \ \_\_HAL\_RCC\_TIM4\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00461}00461\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00462}00462\ \ \ \ \ \textcolor{comment}{/*\ TIM4\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00463}00463\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00464}00464\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00465}00465\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM4\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00466}00466\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM4\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00467}00467\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00468}00468\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00469}00469\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00470}00470\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM5}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00471}00471\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM5)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00472}00472\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00473}00473\ \ \ \ \ \textcolor{comment}{/*\ TIM5\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00474}00474\ \ \ \ \ \_\_HAL\_RCC\_TIM5\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00475}00475\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00476}00476\ \ \ \ \ \textcolor{comment}{/*\ TIM5\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00477}00477\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00478}00478\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00479}00479\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM5\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00480}00480\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM5\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00481}00481\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00482}00482\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00483}00483\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00484}00484\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM6}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00485}00485\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM6)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00486}00486\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00487}00487\ \ \ \ \ \textcolor{comment}{/*\ TIM6\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00488}00488\ \ \ \ \ \_\_HAL\_RCC\_TIM6\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00489}00489\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00490}00490\ \ \ \ \ \textcolor{comment}{/*\ TIM6\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00491}00491\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00492}00492\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00493}00493\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM6\_DAC\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00494}00494\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM6\_DAC\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00495}00495\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00496}00496\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00497}00497\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00498}00498\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM7}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00499}00499\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM7)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00500}00500\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00501}00501\ \ \ \ \ \textcolor{comment}{/*\ TIM7\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00502}00502\ \ \ \ \ \_\_HAL\_RCC\_TIM7\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00503}00503\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00504}00504\ \ \ \ \ \textcolor{comment}{/*\ TIM7\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00505}00505\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00506}00506\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00507}00507\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM7\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00508}00508\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM7\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00509}00509\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00510}00510\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00511}00511\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00512}00512\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM8}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00513}00513\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM8)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00514}00514\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00515}00515\ \ \ \ \ \textcolor{comment}{/*\ TIM8\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00516}00516\ \ \ \ \ \_\_HAL\_RCC\_TIM8\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00517}00517\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00518}00518\ \ \ \ \ \textcolor{comment}{/*\ TIM8\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00519}00519\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00520}00520\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00521}00521\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM8\_UP\_TIM13\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00522}00522\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM8\_UP\_TIM13\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00523}00523\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00524}00524\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00525}00525\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00526}00526\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM9}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00527}00527\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM9)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00528}00528\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00529}00529\ \ \ \ \ \textcolor{comment}{/*\ TIM9\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00530}00530\ \ \ \ \ \_\_HAL\_RCC\_TIM9\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00531}00531\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00532}00532\ \ \ \ \ \textcolor{comment}{/*\ TIM9\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00533}00533\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00534}00534\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00535}00535\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM1\_BRK\_TIM9\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00536}00536\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM1\_BRK\_TIM9\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00537}00537\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00538}00538\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00539}00539\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00540}00540\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM10}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00541}00541\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM10)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00542}00542\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00543}00543\ \ \ \ \ \textcolor{comment}{/*\ TIM10\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00544}00544\ \ \ \ \ \_\_HAL\_RCC\_TIM10\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00545}00545\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00546}00546\ \ \ \ \ \textcolor{comment}{/*\ TIM10\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00547}00547\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00548}00548\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00549}00549\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM1\_UP\_TIM10\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00550}00550\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM1\_UP\_TIM10\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00551}00551\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00552}00552\ \ \ \}\ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00553}00553\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00554}00554\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM11}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00555}00555\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM11)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00556}00556\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00557}00557\ \ \ \ \ \textcolor{comment}{/*\ TIM11\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00558}00558\ \ \ \ \ \_\_HAL\_RCC\_TIM11\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00559}00559\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00560}00560\ \ \ \ \ \textcolor{comment}{/*\ TIM11\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00561}00561\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00562}00562\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00563}00563\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM1\_TRG\_COM\_TIM11\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00564}00564\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM1\_TRG\_COM\_TIM11\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00565}00565\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00566}00566\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00567}00567\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00568}00568\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM12}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00569}00569\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM12)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00570}00570\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00571}00571\ \ \ \ \ \textcolor{comment}{/*\ TIM12\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00572}00572\ \ \ \ \ \_\_HAL\_RCC\_TIM12\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00573}00573\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00574}00574\ \ \ \ \ \textcolor{comment}{/*\ TIM12\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00575}00575\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00576}00576\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00577}00577\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM8\_BRK\_TIM12\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00578}00578\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM8\_BRK\_TIM12\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00579}00579\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00580}00580\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00581}00581\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00582}00582\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM13}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00583}00583\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM13)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00584}00584\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00585}00585\ \ \ \ \ \textcolor{comment}{/*\ TIM13\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00586}00586\ \ \ \ \ \_\_HAL\_RCC\_TIM13\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00587}00587\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00588}00588\ \ \ \ \ \textcolor{comment}{/*\ TIM13\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00589}00589\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00590}00590\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00591}00591\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM8\_UP\_TIM13\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00592}00592\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM8\_UP\_TIM13\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00593}00593\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00594}00594\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00595}00595\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00596}00596\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM14}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00597}00597\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM14)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00598}00598\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00599}00599\ \ \ \ \ \textcolor{comment}{/*\ TIM14\ clock\ enable\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00600}00600\ \ \ \ \ \_\_HAL\_RCC\_TIM14\_CLK\_ENABLE();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00601}00601\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00602}00602\ \ \ \ \ \textcolor{comment}{/*\ TIM14\ interrupt\ Init\ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00603}00603\ \ \ \textcolor{keywordflow}{if}(it\_mode)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00604}00604\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00605}00605\ \ \ \ \ HAL\_NVIC\_SetPriority(TIM8\_TRG\_COM\_TIM14\_IRQn,\ 0,\ 0);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00606}00606\ \ \ \ \ HAL\_NVIC\_EnableIRQ(TIM8\_TRG\_COM\_TIM14\_IRQn);}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00607}00607\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00608}00608\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00609}00609\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00610}00610\ \}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00611}00611\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00612}00612\ \textcolor{comment}{\ \ *\ @brief\ \ Деинициализация\ CLK\ и\ NVIC\ таймеров.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00613}00613\ \textcolor{comment}{\ \ *\ @param\ \ htim\ Указатель\ на\ хендл\ таймера.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00614}00614\ \textcolor{comment}{\ \ *\ @note\ \ \ Чтобы\ не\ генерировать\ функцию\ с\ деиницилизацией\ неиспользуемых\ таймеров,}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00615}00615\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ дефайнами\ @ref\ TIM\_INIT\ в\ @ref\ general\_tim.h\ определяются\ используемые\ таймеры.}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00616}00616\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00617}\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}{00617}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga879e3f1c919c02990736730275367115}{TIM\_Base\_MspDeInit}}(TIM\_HandleTypeDef*\ htim)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00618}00618\ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00619}00619\ \ \ \textcolor{keywordflow}{if}(check\_null\_ptr\_2(htim,\ htim-\/>Instance))}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00620}00620\ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00621}00621\ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00622}00622\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM1}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00623}00623\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM1)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00624}00624\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00625}00625\ \ \ \ \ \_\_HAL\_RCC\_TIM1\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00626}00626\ \ \ \ \ \_\_HAL\_RCC\_TIM1\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00627}00627\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00628}00628\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00629}00629\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM2}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00630}00630\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM2)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00631}00631\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00632}00632\ \ \ \ \ \_\_HAL\_RCC\_TIM2\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00633}00633\ \ \ \ \ \_\_HAL\_RCC\_TIM2\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00634}00634\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00635}00635\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00636}00636\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM3}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00637}00637\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM3)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00638}00638\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00639}00639\ \ \ \ \ \_\_HAL\_RCC\_TIM3\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00640}00640\ \ \ \ \ \_\_HAL\_RCC\_TIM3\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00641}00641\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00642}00642\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00643}00643\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM4}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00644}00644\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM4)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00645}00645\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00646}00646\ \ \ \ \ \_\_HAL\_RCC\_TIM4\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00647}00647\ \ \ \ \ \_\_HAL\_RCC\_TIM4\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00648}00648\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00649}00649\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00650}00650\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM5}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00651}00651\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM5)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00652}00652\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00653}00653\ \ \ \ \ \_\_HAL\_RCC\_TIM5\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00654}00654\ \ \ \ \ \_\_HAL\_RCC\_TIM5\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00655}00655\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00656}00656\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00657}00657\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM6}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00658}00658\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM6)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00659}00659\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00660}00660\ \ \ \ \ \_\_HAL\_RCC\_TIM6\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00661}00661\ \ \ \ \ \_\_HAL\_RCC\_TIM6\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00662}00662\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00663}00663\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00664}00664\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM7}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00665}00665\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM7)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00666}00666\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00667}00667\ \ \ \ \ \_\_HAL\_RCC\_TIM7\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00668}00668\ \ \ \ \ \_\_HAL\_RCC\_TIM7\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00669}00669\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00670}00670\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00671}00671\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM8}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00672}00672\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM8)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00673}00673\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00674}00674\ \ \ \ \ \_\_HAL\_RCC\_TIM8\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00675}00675\ \ \ \ \ \_\_HAL\_RCC\_TIM8\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00676}00676\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00677}00677\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00678}00678\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM9}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00679}00679\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM9)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00680}00680\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00681}00681\ \ \ \ \ \_\_HAL\_RCC\_TIM9\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00682}00682\ \ \ \ \ \_\_HAL\_RCC\_TIM9\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00683}00683\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00684}00684\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00685}00685\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM10}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00686}00686\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM10)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00687}00687\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00688}00688\ \ \ \ \ \_\_HAL\_RCC\_TIM10\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00689}00689\ \ \ \ \ \_\_HAL\_RCC\_TIM10\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00690}00690\ \ \ \}\ \ }
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00691}00691\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00692}00692\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM11}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00693}00693\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM11)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00694}00694\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00695}00695\ \ \ \ \ \_\_HAL\_RCC\_TIM11\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00696}00696\ \ \ \ \ \_\_HAL\_RCC\_TIM11\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00697}00697\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00698}00698\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00699}00699\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM12}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00700}00700\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM12)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00701}00701\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00702}00702\ \ \ \ \ \_\_HAL\_RCC\_TIM12\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00703}00703\ \ \ \ \ \_\_HAL\_RCC\_TIM12\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00704}00704\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00705}00705\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00706}00706\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM13}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00707}00707\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM13)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00708}00708\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00709}00709\ \ \ \ \ \_\_HAL\_RCC\_TIM13\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00710}00710\ \ \ \ \ \_\_HAL\_RCC\_TIM13\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00711}00711\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00712}00712\ \textcolor{preprocessor}{\#endif\ }}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00713}00713\ \textcolor{preprocessor}{\#ifdef\ USE\_TIM14}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00714}00714\ \ \ \textcolor{keywordflow}{if}(htim-\/>Instance==TIM14)}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00715}00715\ \ \ \{}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00716}00716\ \ \ \ \ \_\_HAL\_RCC\_TIM14\_FORCE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00717}00717\ \ \ \ \ \_\_HAL\_RCC\_TIM14\_RELEASE\_RESET();}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00718}00718\ \ \ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00719}00719\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00720}00720\ \}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00721}00721\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/TIM\ INIT\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{general__tim_8c_source_l00722}00722\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}

\end{DoxyCode}
