\doxysection{rs\+\_\+message.\+c}
\hypertarget{rs__message_8c_source}{}\label{rs__message_8c_source}\index{E:/.WORK/STM32/Diod\_Test/diode\_tester/Core/Modbus/Src/rs\_message.c@{E:/.WORK/STM32/Diod\_Test/diode\_tester/Core/Modbus/Src/rs\_message.c}}
\mbox{\hyperlink{rs__message_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00001}00001\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00002}00002\ \textcolor{comment}{*******************************************************************************}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00003}00003\ \textcolor{comment}{*\ @file\ rs\_message.c}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00004}00004\ \textcolor{comment}{*\ @brief\ Реализация\ протоколов\ обмена\ по\ RS/UART}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00005}00005\ \textcolor{comment}{*******************************************************************************}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00006}00006\ \textcolor{comment}{*\ @details}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00007}00007\ \textcolor{comment}{Модуль\ реализует\ асинхронный\ обмен\ сообщениями\ через\ UART\ с\ использованием:}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00008}00008\ \textcolor{comment}{-\/\ Прерываний\ по\ приему/передаче}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00009}00009\ \textcolor{comment}{-\/\ Детектирования\ конца\ фрейма\ по\ IDLE\ линии}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00010}00010\ \textcolor{comment}{-\/\ Таймаутов\ через\ таймер}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00011}00011\ \textcolor{comment}{-\/\ Двухстадийного\ приема\ (заголовок\ +\ данные)}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00012}00012\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00013}00013\ \textcolor{comment}{@section\ arch\ Архитектура:}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00014}00014\ \textcolor{comment}{В\ режиме\ слейв:}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00015}00015\ \textcolor{comment}{\ \ -\/\ Инициализация\ приема\ с\ сообщения\ с\ максимальным\ размером\ MSG\_SIZE\_MAX}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00016}00016\ \textcolor{comment}{\ \ -\/\ При\ срабатывании\ прерывания\ IDLE\ -\/\ обработка\ полученного\ сообщения}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00017}00017\ \textcolor{comment}{В\ режиме\ мастер\ (пока\ не\ реализовано):}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00018}00018\ \textcolor{comment}{\ \ -\/\ Отправка\ запроса\ и\ переход\ в\ режим\ приема\ сообщения\ с\ максимальным\ размером\ MSG\_SIZE\_MAX}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00019}00019\ \textcolor{comment}{\ \ -\/\ При\ срабатывании\ прерывания\ IDLE\ -\/\ обработка\ полученного\ ответа}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00020}00020\ \textcolor{comment}{\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00021}00021\ \textcolor{comment}{@section\ ithandler\ Необходимые\ обработчики:}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00022}00022\ \textcolor{comment}{-\/\ RS\_UART\_Handler()\ в\ UARTx\_IRQHandler\ вместо\ HAL\_UART\_IRQHandler()}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00023}00023\ \textcolor{comment}{-\/\ RS\_TIM\_Handler()\ в\ TIMx\_IRQHandler\ вместо\ HAL\_TIM\_IRQHandler()}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00024}00024\ \textcolor{comment}{******************************************************************************/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00025}00025\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{rs__message_8h}{rs\_message.h}}"{}}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00026}00026\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{modbus__diag_8h}{modbus\_diag.h}}"{}}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00027}00027\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00028}00028\ uint8\_t\ RS\_Buffer[\mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga7d1e9e8bb8f40ce788836da0739f897c}{MSG\_SIZE\_MAX}}];\ \textcolor{comment}{//\ uart\ buffer}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00029}00029\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00030}00030\ \textcolor{keyword}{extern}\ \textcolor{keywordtype}{void}\ RS\_UART\_Init(\textcolor{keywordtype}{void});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00031}00031\ \textcolor{keyword}{extern}\ \textcolor{keywordtype}{void}\ RS\_UART\_DeInit(UART\_HandleTypeDef\ *huart);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00032}00032\ \textcolor{keyword}{extern}\ \textcolor{keywordtype}{void}\ RS\_TIM\_Init(\textcolor{keywordtype}{void});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00033}00033\ \textcolor{keyword}{extern}\ \textcolor{keywordtype}{void}\ RS\_TIM\_DeInit(TIM\_HandleTypeDef\ *htim);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00034}00034\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00035}00035\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00036}00036\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GENERAL\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00037}00037\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00038}00038\ \textcolor{comment}{\ \ *\ @brief\ \ Начать\ прием\ по\ прерываниям.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00039}00039\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00040}00040\ \textcolor{comment}{\ \ *\ @param\ \ RS\_msg\ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00041}00041\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ о\ состоянии\ RS\ после\ инициализации\ приема.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00042}00042\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00043}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1b59697f4b7fad81f9d5fd9fffebac2f}{00043}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1b59697f4b7fad81f9d5fd9fffebac2f}{RS\_Receive\_IT}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00044}00044\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00045}00045\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ RS\_RES\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00046}00046\ \ \ HAL\_StatusTypeDef\ uart\_res\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00047}00047\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00048}00048\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CHECK\ RS\ LINE-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00049}00049\ \ \ \textcolor{comment}{//\ check\ that\ receive\ isnt\ busy}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00050}00050\ \ \ \textcolor{keywordflow}{if}(\ RS\_Is\_RX\_Busy(hRS)\ )\ \textcolor{comment}{//\ if\ tx\ busy\ -\/\ return\ busy\ status}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00051}00051\ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_BUSY;\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00052}00052\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00053}00053\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/INITIALIZE\ RECEIVE-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00054}00054\ \ \ \textcolor{comment}{//\ if\ all\ OK:\ start\ receiving}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00055}00055\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gae0f359f0af89adf45bac275a3f5ee34d}{RS\_EnableReceive}}();}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00056}00056\ \ \ RS\_Set\_Busy(hRS);\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ set\ RS\ busy\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00057}00057\ \ \ RS\_Set\_RX\_Flags(hRS);\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ initialize\ flags\ for\ receive}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00058}00058\ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}}\ =\ RS\_msg;\ \ \ \ \textcolor{comment}{//\ set\ pointer\ to\ message\ structire\ for\ filling\ it\ from\ UARTHandler\ fucntions}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00059}00059\ \ \ \textcolor{keywordflow}{if}(!hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a1513dc1265334c20a82b55b1090024c8}{RX\_Continue}})\ \ \ \ \ \ \ \textcolor{comment}{//\ if\ not\ continue\ receiving}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00060}00060\ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ =\ 0;\ \ \ \textcolor{comment}{//\ set\ ptr\ to\ start\ buffer}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00061}00061\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00062}00062\ \ \ \textcolor{comment}{//\ start\ receiving}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00063}00063\ \ \ \_\_HAL\_UART\_ENABLE\_IT(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}},\ UART\_IT\_IDLE);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00064}00064\ \ \ uart\_res\ =\ HAL\_UART\_Receive\_IT(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}},\ \&hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a1bc8d1ccb57c20cad4f70a04f751a67a}{pBufferPtr}}[hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}],\ \mbox{\hyperlink{group___m_o_d_b_u_s___m_e_s_s_a_g_e___d_e_f_i_n_e_s_ga7d1e9e8bb8f40ce788836da0739f897c}{MSG\_SIZE\_MAX}});\ \textcolor{comment}{//\ receive\ until\ ByteCnt+1\ byte,\ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00065}00065\ \ \ \textcolor{comment}{//\ then\ in\ Callback\ restart\ receive\ for\ rest\ bytes\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00066}00066\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00067}00067\ \ \ \textcolor{comment}{//\ if\ receive\ isnt\ started\ -\/\ abort\ RS}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00068}00068\ \ \ \textcolor{keywordflow}{if}(uart\_res\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00069}00069\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00070}00070\ \ \ \ \ RS\_RES\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\_Abort}}(hRS,\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca5699efe0ab3cdfd4f6ef175ecb809306}{ABORT\_RS}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00071}00071\ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga830a5ed90667bf50ab8c409dcadb2a39}{printf\_rs\_err}}(\textcolor{stringliteral}{"{}Failed\ to\ start\ RS\ receiving..."{}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00072}00072\ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hRS-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00073}00073\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00074}00074\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00075}00075\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00076}00076\ \ \ \ \ RS\_RES\ =\ RS\_OK;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00077}00077\ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga30a03e8d8912be85a203c829b581f999}{printf\_rs}}(\textcolor{stringliteral}{"{}Start\ Receiving..."{}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00078}00078\ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga23de0006aa08984cfeddb6aa5e512fa1}{TrackerCnt\_Ok}}(hRS-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00079}00079\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00080}00080\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00081}00081\ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ =\ RS\_RES;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00082}00082\ \ \ \textcolor{keywordflow}{return}\ RS\_RES;\ \textcolor{comment}{//\ returns\ result\ of\ receive\ init\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00083}00083\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00084}00084\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00085}00085\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00086}00086\ \textcolor{comment}{\ \ *\ @brief\ \ Начать\ передачу\ по\ прерываниям.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00087}00087\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00088}00088\ \textcolor{comment}{\ \ *\ @param\ \ RS\_msg\ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00089}00089\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ о\ состоянии\ RS\ после\ инициализации\ передачи.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00090}00090\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00091}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga2e69a97a8b6e0b5855116d88c0e17cb9}{00091}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga2e69a97a8b6e0b5855116d88c0e17cb9}{RS\_Transmit\_IT}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00092}00092\ \{\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00093}00093\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ RS\_RES\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00094}00094\ \ \ HAL\_StatusTypeDef\ uart\_res\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00095}00095\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00096}00096\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CHECK\ RS\ LINE-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00097}00097\ \ \ \textcolor{comment}{//\ check\ that\ transmit\ isnt\ busy}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00098}00098\ \ \ \textcolor{keywordflow}{if}(\ RS\_Is\_TX\_Busy(hRS)\ )\ \textcolor{comment}{//\ if\ tx\ busy\ -\/\ return\ busy\ status}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00099}00099\ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_BUSY;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00100}00100\ \ \ \ \ \textcolor{comment}{//\ check\ receive\ line}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00101}00101\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00102}00102\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00103}00103\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/COLLECT\ MESSAGE-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00104}00104\ \ \ RS\_RES\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1cd98c55f6f359e3ab93d0f9cf912ab5}{RS\_Collect\_Message}}(hRS,\ RS\_msg,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a1bc8d1ccb57c20cad4f70a04f751a67a}{pBufferPtr}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00105}00105\ \ \ \textcolor{keywordflow}{if}\ (RS\_RES\ !=\ RS\_OK)\ \textcolor{comment}{//\ if\ message\ isnt\ collect\ -\/\ stop\ RS\ and\ return\ error\ in\ RS\_RES}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00106}00106\ \ \ \{\textcolor{comment}{//\ need\ collect\ message\ status,\ so\ doesnt\ write\ abort\ to\ RS\_RES}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00107}00107\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\_Abort}}(hRS,\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca5699efe0ab3cdfd4f6ef175ecb809306}{ABORT\_RS}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00108}00108\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});\ \textcolor{comment}{//\ restart\ receive}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00109}00109\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00110}00110\ \ \ \textcolor{keywordflow}{else}\ \textcolor{comment}{//\ if\ collect\ successful}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00111}00111\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00112}00112\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00113}00113\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/INITIALIZE\ TRANSMIT-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00114}00114\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gaeddade966945ed376bb152151b493d6f}{RS\_EnableTransmit}}();}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00115}00115\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00116}00116\ \ \ \ \ RS\_Set\_Busy(hRS);\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ set\ RS\ busy}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00117}00117\ \ \ \ \ RS\_Set\_TX\_Flags(hRS);\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ initialize\ flags\ for\ transmit\ IT}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00118}00118\ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}}\ =\ RS\_msg;\ \ \ \ \textcolor{comment}{//\ set\ pointer\ for\ filling\ given\ structure\ from\ UARTHandler\ fucntion}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00119}00119\ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ <=\ 0)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00120}00120\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00121}00121\ \ \ \ \ \ \ RS\_RES\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\_Abort}}(hRS,\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca5699efe0ab3cdfd4f6ef175ecb809306}{ABORT\_RS}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00122}00122\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hRS-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00123}00123\ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_ERR;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00124}00124\ \ \ \ \ \}\ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00125}00125\ \ \ \ \ \textcolor{comment}{//\ if\ all\ OK:\ start\ transmitting}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00126}00126\ \ \ \ \ uart\_res\ =\ HAL\_UART\_Transmit\_IT(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}},\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a1bc8d1ccb57c20cad4f70a04f751a67a}{pBufferPtr}},\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}});\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00127}00127\ \ \ \ \ \textcolor{comment}{//\ if\ transmit\ isnt\ started\ -\/\ abort\ RS}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00128}00128\ \ \ \ \ \textcolor{keywordflow}{if}(uart\_res\ !=\ HAL\_OK)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00129}00129\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00130}00130\ \ \ \ \ \ \ RS\_RES\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\_Abort}}(hRS,\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca5699efe0ab3cdfd4f6ef175ecb809306}{ABORT\_RS}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00131}00131\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga830a5ed90667bf50ab8c409dcadb2a39}{printf\_rs\_err}}(\textcolor{stringliteral}{"{}Failed\ to\ start\ RS\ transmitting..."{}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00132}00132\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hRS-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00133}00133\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00134}00134\ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00135}00135\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00136}00136\ \ \ \ \ \ \ RS\_RES\ =\ RS\_OK;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00137}00137\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga30a03e8d8912be85a203c829b581f999}{printf\_rs}}(\textcolor{stringliteral}{"{}Start\ Transmitting..."{}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00138}00138\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga23de0006aa08984cfeddb6aa5e512fa1}{TrackerCnt\_Ok}}(hRS-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00139}00139\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00140}00140\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00141}00141\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00142}00142\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00143}00143\ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ =\ RS\_RES;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00144}00144\ \ \ \textcolor{keywordflow}{return}\ RS\_RES;\ \textcolor{comment}{//\ returns\ result\ of\ transmit\ init\ \ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00145}00145\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00146}00146\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00147}00147\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00148}00148\ \textcolor{comment}{\ \ *\ @brief\ \ Инициалазация\ структуры\ @ref\ RS\_HandleTypeDef.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00149}00149\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00150}00150\ \textcolor{comment}{\ \ *\ @param\ \ suart\ \ \ \ \ \ \ \ \ Указатель\ на\ структуру\ с\ настройками\ UART.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00151}00151\ \textcolor{comment}{\ \ *\ @param\ \ stim\ \ \ \ \ \ \ \ \ \ Указатель\ на\ структуру\ с\ настройками\ таймера.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00152}00152\ \textcolor{comment}{\ \ *\ @param\ \ pRS\_BufferPtr\ Указатель\ на\ буффер\ для\ приема-\/передачи\ по\ UART.\ Если\ он\ NULL,\ то\ поставиться\ библиотечный\ буфер.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00153}00153\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ \ \ \ \ \ \ Статус\ о\ состоянии\ RS\ после\ инициализации.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00154}00154\ \textcolor{comment}{\ \ *\ @details\ \ Инициализация\ перефирии\ и\ структуры\ для\ приема-\/передачи\ по\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00155}00155\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00156}\mbox{\hyperlink{group___r_s___t_o_o_l_s_gaa261bb0d37e7f18f04fb4353aa0f5c45}{00156}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gaa261bb0d37e7f18f04fb4353aa0f5c45}{RS\_Init}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ UART\_HandleTypeDef\ *huart,\ TIM\_HandleTypeDef\ *htim,\ uint8\_t\ *pRS\_BufferPtr)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00157}00157\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00158}00158\ \ \ \textcolor{comment}{//\ check\ that\ hRS\ is\ defined}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00159}00159\ \ \ \textcolor{keywordflow}{if}\ (hRS\ ==\ NULL)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00160}00160\ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_ERR;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00161}00161\ \ \ \textcolor{comment}{//\ check\ that\ huart\ is\ defined}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00162}00162\ \ \ \textcolor{keywordflow}{if}\ (huart\ ==\ NULL)\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00163}00163\ \ \ \ \ \textcolor{keywordflow}{return}\ RS\_ERR;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00164}00164\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00165}00165\ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}\ =\ huart;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00166}00166\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00167}00167\ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}}\ =\ htim;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00168}00168\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00169}00169\ \ \ \textcolor{comment}{//\ check\ that\ buffer\ is\ defined}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00170}00170\ \ \ \textcolor{keywordflow}{if}\ (hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a1bc8d1ccb57c20cad4f70a04f751a67a}{pBufferPtr}}\ ==\ NULL)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00171}00171\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00172}00172\ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a1bc8d1ccb57c20cad4f70a04f751a67a}{pBufferPtr}}\ =\ RS\_Buffer;\ \ \ \ \textcolor{comment}{//\ if\ no\ -\/\ set\ default}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00173}00173\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00174}00174\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00175}00175\ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a1bc8d1ccb57c20cad4f70a04f751a67a}{pBufferPtr}}\ =\ pRS\_BufferPtr;\ \textcolor{comment}{//\ if\ yes\ -\/\ set\ by\ user}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00176}00176\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00177}00177\ \ \ \textcolor{keywordflow}{return}\ RS\_OK;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00178}00178\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00179}00179\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00180}00180\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00181}00181\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00182}00182\ \textcolor{comment}{\ \ *\ @brief\ \ Отменить\ прием/передачу\ RS/UART.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00183}00183\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00184}00184\ \textcolor{comment}{\ \ *\ @param\ \ AbortMode\ \ \ Выбор,\ что\ надо\ отменить.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00185}00185\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\/\ ABORT\_TX:\ \ \ \ Отмена\ передачи\ по\ ЮАРТ,\ с\ очищением\ флагов\ TX,}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00186}00186\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\/\ ABORT\_RX:\ \ \ \ Отмена\ приема\ по\ ЮАРТ,\ с\ очищением\ флагов\ RX,}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00187}00187\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\/\ ABORT\_RX\_TX:\ Отмена\ приема\ и\ передачи\ по\ ЮАРТ,}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00188}00188\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\/\ ABORT\_RS:\ \ \ \ Отмена\ приема-\/передачи\ RS,\ с\ очищением\ всей\ структуры.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00189}00189\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ \ \ \ \ Статус\ о\ состоянии\ RS\ после\ аборта.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00190}00190\ \textcolor{comment}{\ \ *\ @details\ \ Отмена\ работы\ UART\ в\ целом\ или\ отмена\ приема/передачи\ RS.\ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00191}00191\ \textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ Также\ очищается\ хендл\ hRS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00192}00192\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00193}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{00193}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\_Abort}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab7c55bd8bb15b0eecc8c525019d4a1cc}{RS\_AbortTypeDef}}\ AbortMode)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00194}00194\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00195}00195\ \ \ HAL\_StatusTypeDef\ uart\_res\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00196}00196\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00197}00197\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1de0a597d043b64d0a19bc393cc1b3fd}{RS\_Timeout\_Stop}}(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00198}00198\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00199}00199\ \ \ \textcolor{keywordflow}{if}((AbortMode\&\mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca5699efe0ab3cdfd4f6ef175ecb809306}{ABORT\_RS}})\ ==\ 0x00)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00200}00200\ \ \ \{\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00201}00201\ \ \ \ \ \textcolor{keywordflow}{if}((AbortMode\&\mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1ccaf0519a0ddda6fff97dd61ce0f3320df9}{ABORT\_RX}})\ ==\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1ccaf0519a0ddda6fff97dd61ce0f3320df9}{ABORT\_RX}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00202}00202\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00203}00203\ \ \ \ \ \ \ uart\_res\ =\ HAL\_UART\_AbortReceive(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}});\ \ \ \textcolor{comment}{//\ abort\ receive}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00204}00204\ \ \ \ \ \ \ RS\_Reset\_RX\_Flags(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00205}00205\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00206}00206\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00207}00207\ \ \ \ \ \textcolor{keywordflow}{if}((AbortMode\&\mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca95c6ce0fee466ba98e43213d001ecc16}{ABORT\_TX}})\ ==\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca95c6ce0fee466ba98e43213d001ecc16}{ABORT\_TX}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00208}00208\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00209}00209\ \ \ \ \ \ \ uart\_res\ =\ HAL\_UART\_AbortTransmit(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}});\ \ \textcolor{comment}{//\ abort\ transmit}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00210}00210\ \ \ \ \ \ \ RS\_Reset\_TX\_Flags(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00211}00211\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00212}00212\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00213}00213\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00214}00214\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00215}00215\ \ \ \ \ uart\_res\ =\ HAL\_UART\_Abort(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00216}00216\ \ \ \ \ RS\_Clear\_All(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00217}00217\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00218}00218\ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ =\ RS\_ABORTED;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00219}00219\ \ \ \textcolor{keywordflow}{return}\ RS\_ABORTED;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00220}00220\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00221}00221\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00222}00222\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00223}00223\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/GENERAL\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00224}00224\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00225}00225\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00226}00226\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00227}00227\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00228}00228\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00229}00229\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CALLBACK/HANDLER\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00230}00230\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00231}00231\ \textcolor{comment}{\ \ *\ @brief\ \ Обработчик\ для\ начала\ приема.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00232}00232\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00233}00233\ \textcolor{comment}{\ \ *\ @param\ \ RS\_msg\ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00234}00234\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ о\ состоянии\ RS\ после\ инициализации\ приема\ или\ окончания\ общения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00235}00235\ \textcolor{comment}{\ \ *\ @details\ \ Определяет\ начинать\ прием\ команды/ответа\ или\ нет.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00236}00236\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00237}\mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{00237}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00238}00238\ \{\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00239}00239\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ RS\_RES\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00240}00240\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00241}00241\ \ \ \textcolor{keywordflow}{switch}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a82f0ad79cd234cd26076bfcfbc5c1194}{sRS\_Mode}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00242}00242\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00243}00243\ \ \ \ \ \textcolor{comment}{//\ В\ режиме\ мастер}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00244}00244\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7a15953c59b7f547b318edab14070873c5}{RS\_MASTER\_REQUEST}}:\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00245}00245\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gac3a7bbc060a4250c160d51f0a0ca6cf8}{RS\_Timeout\_Start}}(hRS);\ \textcolor{comment}{//\ сразу\ запускаем\ таймаут\ и\ начинаем\ прием}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00246}00246\ \ \ \ \ \ \ \textcolor{comment}{//\ В\ режиме\ слейв}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00247}00247\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7aee8cfd8ce9edacc055a195ed454a49dc}{RS\_SLAVE\_ALWAYS\_WAIT}}:}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00248}00248\ \ \ \ \ \ \ RS\_RES\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1b59697f4b7fad81f9d5fd9fffebac2f}{RS\_Receive\_IT}}(hRS,\ RS\_msg);\ \textcolor{comment}{//\ Просто\ запускаем\ фоновый\ прием}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00249}00249\ \ \ \ \ \ \ \textcolor{keywordflow}{break};\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00250}00250\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00251}00251\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7ad118e897a520ddc9c77a905684079550}{RS\_RESERVED}}:}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00252}00252\ \ \ \ \ \ \ RS\_Set\_Free(hRS);\ \ RS\_RES\ =\ RS\_OK;\ \textcolor{keywordflow}{break};\ \ \ \textcolor{comment}{//\ end\ RS\ communication\ (set\ RS\ unbusy)}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00253}00253\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00254}00254\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00255}00255\ \ \ \textcolor{keywordflow}{if}(RS\_RES\ !=\ RS\_OK)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00256}00256\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00257}00257\ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hRS-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00258}00258\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00259}00259\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00260}00260\ \ \ \textcolor{keywordflow}{return}\ RS\_RES;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00261}00261\ \}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00262}00262\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00263}00263\ \textcolor{comment}{\ \ *\ @brief\ \ Обработчик\ для\ начала\ передачи.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00264}00264\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00265}00265\ \textcolor{comment}{\ \ *\ @param\ \ RS\_msg\ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00266}00266\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ о\ состоянии\ RS\ после\ инициализации\ передачи.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00267}00267\ \textcolor{comment}{\ \ *\ @details\ \ Определяет\ отвечать\ ли\ на\ команду\ или\ нет.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00268}00268\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00269}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga330f6cfcdaab1f239054c0d91be3c5bc}{00269}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga330f6cfcdaab1f239054c0d91be3c5bc}{RS\_Handle\_Transmit\_Start}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00270}00270\ \{\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00271}00271\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ RS\_RES\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00272}00272\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00273}00273\ \ \ \textcolor{keywordflow}{switch}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a82f0ad79cd234cd26076bfcfbc5c1194}{sRS\_Mode}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00274}00274\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00275}00275\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7aee8cfd8ce9edacc055a195ed454a49dc}{RS\_SLAVE\_ALWAYS\_WAIT}}:\ \ \ \textcolor{comment}{//\ in\ slave\ mode\ always\ response}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00276}00276\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7ad118e897a520ddc9c77a905684079550}{RS\_RESERVED}}:\ \ \textcolor{comment}{//\ transmit\ response}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00277}00277\ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7a15953c59b7f547b318edab14070873c5}{RS\_MASTER\_REQUEST}}:\ \ \textcolor{comment}{//\ transmit\ response}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00278}00278\ \ \ \ \ \ \ RS\_RES\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga2e69a97a8b6e0b5855116d88c0e17cb9}{RS\_Transmit\_IT}}(hRS,\ RS\_msg);\ \textcolor{keywordflow}{break};\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00279}00279\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00280}00280\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00281}00281\ \ \ \textcolor{keywordflow}{if}(RS\_RES\ !=\ RS\_OK)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00282}00282\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00283}00283\ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a82f0ad79cd234cd26076bfcfbc5c1194}{sRS\_Mode}}\ <\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga9560ee688d4bcdd90a47c110be4ecf92}{RS\_MASTER\_MODE\_START}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00284}00284\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00285}00285\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hRS,\ RS\_msg);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00286}00286\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00287}00287\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00288}00288\ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hRS-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00289}00289\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00290}00290\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00291}00291\ \ \ \textcolor{keywordflow}{return}\ RS\_RES;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00292}00292\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00293}00293\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00294}00294\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00295}00295\ \textcolor{comment}{\ \ *\ @brief\ \ UART\ TX\ Callback:\ коллбек\ после\ окончания\ передачи.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00296}00296\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00297}00297\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ о\ состоянии\ RS\ после\ обработки\ приема.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00298}00298\ \textcolor{comment}{\ \ *\ @details\ \ Определяет\ поведение\ RS\ после\ передачи\ сообщения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00299}00299\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00300}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga7180b913ba795c07637680982d7f45ac}{00300}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga7180b913ba795c07637680982d7f45ac}{RS\_UART\_TxCpltCallback}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00301}00301\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00302}00302\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ RS\_RES\ =\ RS\_OK;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00303}00303\ \ \ HAL\_StatusTypeDef\ uart\_res\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00304}00304\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00305}00305\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/ENDING\ TRANSMITTING-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00306}00306\ \ \ RS\_Set\_TX\_End(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00307}00307\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00308}00308\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/START\ RECEIVING\ or\ END\ RS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00309}00309\ \ \ RS\_RES\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00310}00310\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00311}00311\ \ \ \textcolor{keywordflow}{return}\ RS\_RES;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00312}00312\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00313}00313\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00314}00314\ \textcolor{comment}{/**\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00315}00315\ \textcolor{comment}{*\ @brief\ \ Обработчик\ прерывания\ UART.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00316}00316\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00317}00317\ \textcolor{comment}{\ \ *\ @details\ \ Обрабатывает\ ошибки\ если\ есть\ и\ вызывает\ RS\ Коллбеки.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00318}00318\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ Добавить\ вызов\ этой\ функции\ в\ UARTx\_IRQHandler()\ ВМЕСТО\ HAL\_UART\_IRQHandler().}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00319}00319\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00320}\mbox{\hyperlink{group___r_s___t_o_o_l_s_gab27567456df0329130c7fe4fc43c6ee1}{00320}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab27567456df0329130c7fe4fc43c6ee1}{RS\_UART\_Handler}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00321}00321\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00322}00322\ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}\ ==\ NULL)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00323}00323\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00324}00324\ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00325}00325\ \ \ \}\ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00326}00326\ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga8c401e4d5d440001c1d879984107bb79}{RS\_UART\_Handler\_ENTER}}();}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00327}00327\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CHECK\ IDLE\ FLAG\ FIRST-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00328}00328\ \ \ \textcolor{comment}{/*\ Проверяем\ флаг\ IDLE\ в\ первую\ очередь\ -\/\ это\ гарантирует\ обработку\ только\ после\ idle\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00329}00329\ \ \ \textcolor{keywordflow}{if}(\_\_HAL\_UART\_GET\_FLAG(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}},\ UART\_FLAG\_IDLE)\ \&\&\ \_\_HAL\_UART\_GET\_IT\_SOURCE(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}},\ UART\_IT\_IDLE))}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00330}00330\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00331}00331\ \ \ \ \ \_\_HAL\_UART\_CLEAR\_IDLEFLAG(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}});\ \textcolor{comment}{//\ Важно:\ очистить\ флаг\ IDLE}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00332}00332\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/STANDARD\ UART\ HANDLING-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00333}00333\ \ \ \ \ HAL\_UART\_IRQHandler(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00334}00334\ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_a1513dc1265334c20a82b55b1090024c8}{RX\_Continue}}\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00335}00335\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00336}00336\ \ \ \ \ \textcolor{comment}{//\ Если\ прием\ активен\ и\ мы\ получили\ IDLE\ -\/\ это\ конец\ фрейма}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00337}00337\ \ \ \ \ \textcolor{keywordflow}{if}(RS\_Is\_RX\_Busy(hRS)\ \&\&\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6fa98c2955d01e07dc59f73d072bb37e}{f}}.\mbox{\hyperlink{struct_r_s___flags_type_def_adfc04070a08e90f514072fff20efc744}{RX\_Ongoing}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00338}00338\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00339}00339\ \ \ \ \ \ \ \textcolor{comment}{//\ Получаем\ количество\ фактически\ принятых\ байтов}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00340}00340\ \ \ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ +=\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}-\/>RxXferSize\ -\/\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}-\/>RxXferCount;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00341}00341\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00342}00342\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00343}00343\ \ \ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a495a29011412451e53459f9e1513814d}{RS\_Message\_Size}}\ >\ 0)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00344}00344\ \ \ \ \ \ \ \{\ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00345}00345\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Принудительно\ завершаем\ прием\ (получили\ сообщение)}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00346}00346\ \ \ \ \ \ \ \ \ HAL\_UART\_AbortReceive(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}});\ \ \ \textcolor{comment}{//\ abort\ receive\ \ \ \ \ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00347}00347\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00348}00348\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Завершаем\ прием\ в\ нашей\ структуре}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00349}00349\ \ \ \ \ \ \ \ \ RS\_Set\_RX\_End(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00350}00350\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00351}00351\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Парсим\ наше\ сообщение}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00352}00352\ \ \ \ \ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ =\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga3500b3fa91d05a94cf8da5cc5ce338f5}{RS\_Parse\_Message}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}},\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a1bc8d1ccb57c20cad4f70a04f751a67a}{pBufferPtr}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00353}00353\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00354}00354\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Если\ сообещине\ принято\ корректно}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00355}00355\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ ==\ RS\_OK)\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00356}00356\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00357}00357\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1de0a597d043b64d0a19bc393cc1b3fd}{RS\_Timeout\_Stop}}(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00358}00358\ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00359}00359\ \ \ \ \ \ \ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a3b377cb0eabf384a7e715fb030218290}{lastPacketTick}}\ =\ local\_time();}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00360}00360\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a82f0ad79cd234cd26076bfcfbc5c1194}{sRS\_Mode}}\ <\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga9560ee688d4bcdd90a47c110be4ecf92}{RS\_MASTER\_MODE\_START}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00361}00361\ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00362}00362\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga8b7bcc84cb8192a58fe87b662fbd9690}{RS\_Response}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});\ \textcolor{comment}{//\ отвечаем\ на\ запрос}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00363}00363\ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00364}00364\ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00365}00365\ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00366}00366\ \ \ \ \ \ \ \ \ \ \ \ \ RS\_Set\_Free(hRS);\ \textcolor{comment}{//\ освобожднаем\ RS}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00367}00367\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6e584c7559c702d3382dbb9aa572b71b}{pCallback}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00368}00368\ \ \ \ \ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00369}00369\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6e584c7559c702d3382dbb9aa572b71b}{pCallback}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});\ \textcolor{comment}{//\ обрабатываем\ ответ}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00370}00370\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00371}00371\ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00372}00372\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00373}00373\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00374}00374\ \ \ \ \ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00375}00375\ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});\ \textcolor{comment}{//\ если\ сообщение\ пришло\ не\ полностью\ -\/\ продолжаем\ прием\ до\ таймаута}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00376}00376\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00377}00377\ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00378}00378\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00379}00379\ \ \ \ \ \textcolor{keywordflow}{return};\ \textcolor{comment}{//\ Выходим\ после\ обработки\ IDLE}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00380}00380\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00381}00381\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00382}00382\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00383}00383\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/STANDARD\ UART\ HANDLING-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00384}00384\ \ \ \ \ HAL\_UART\_IRQHandler(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00385}00385\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00386}00386\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00387}00387\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00388}00388\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CALL\ RS\ CALLBACKS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00389}00389\ \ \ \textcolor{comment}{/*\ IF\ NO\ ERROR\ OCCURS\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00390}00390\ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}-\/>ErrorCode\ ==\ 0)\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00391}00391\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00392}00392\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00393}00393\ \ \ \ \ \textcolor{comment}{//\ if\ first\ byte\ is\ received\ and\ receive\ is\ active}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00394}00394\ \ \ \ \ \textcolor{keywordflow}{if}((hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}-\/>RxXferCount+1\ ==\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}-\/>RxXferSize)\ \&\&\ RS\_Is\_RX\_Busy(hRS))\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00395}00395\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00396}00396\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gac3a7bbc060a4250c160d51f0a0ca6cf8}{RS\_Timeout\_Start}}(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00397}00397\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00398}00398\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gad3d2e8fb9c2879e1ddb967cff6124521}{RS\_Timeout\_Update}}(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00399}00399\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00400}00400\ \ \ \ \ \textcolor{comment}{/*\ RX\ Callback\ -\/\ теперь\ НЕ\ вызываем\ здесь,\ ждем\ IDLE\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00401}00401\ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00402}00402\ \ \ \ \ \textcolor{comment}{/*\ TX\ Callback\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00403}00403\ \ \ \ \ \textcolor{keywordflow}{if}\ ((hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}-\/>TxXferCount\ ==\ 0U)\ \&\&\ RS\_Is\_TX\_Busy(hRS)\ \&\&\ \ \textcolor{comment}{//\ if\ all\ bytes\ are\ transmited\ and\ transmit\ is\ active}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00404}00404\ \ \ \ \ \ \ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}-\/>gState\ !=\ HAL\_UART\_STATE\_BUSY\_TX)\ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ also\ check\ that\ receive\ "{}REALLY"{}\ isnt\ busy}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00405}00405\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga7180b913ba795c07637680982d7f45ac}{RS\_UART\_TxCpltCallback}}(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00406}00406\ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00407}00407\ \ \ \ \ \textcolor{comment}{/*\ NOTE:\ RX\ Callback\ больше\ не\ вызывается\ здесь\ -\/\ ждем\ IDLE\ для\ гарантии\ конца\ фрейма\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00408}00408\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00409}00409\ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/ERRORS\ HANDLER-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00410}00410\ \ \ \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00411}00411\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00412}00412\ \ \ \ \ \textcolor{keywordflow}{if}\ (hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_ade93e3a680f5fbc5275f58e20227198b}{huart}}-\/>ErrorCode\ \&\ HAL\_UART\_ERROR\_ORE)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00413}00413\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00414}00414\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{group___m_o_d_b_u_s___d_a_t_a___a_c_c_e_s_s___f_u_n_c_t_i_o_n_s_gaff7c464d7d66399232770bac78b653a4}{MB\_Diagnostics\_CharacterOverrunCnt}}();\ \ \textcolor{comment}{//\ <-\/-\/\ Обнаружено\ переполнение}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00415}00415\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00416}00416\ \ \ \ \ \textcolor{comment}{//TrackerCnt\_Err(hRS-\/>rs\_err);}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00417}00417\ \ \ \ \ \textcolor{comment}{/*\ de-\/init\ uart\ transfer\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00418}00418\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\_Abort}}(hRS,\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca5699efe0ab3cdfd4f6ef175ecb809306}{ABORT\_RS}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00419}00419\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00420}00420\ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00421}00421\ \ \ \ \ \textcolor{comment}{//\ later,\ maybe,\ will\ be\ added\ specific\ handlers\ for\ err\ \ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00422}00422\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00423}00423\ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_gade69fd26928788dd6f0278fcd15885ff}{RS\_UART\_Handler\_EXIT}}();}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00424}00424\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00425}00425\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00426}00426\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00427}00427\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00428}00428\ \textcolor{comment}{\ \ *\ @brief\ \ Обработчик\ прерывания\ TIM.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00429}00429\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00430}00430\ \textcolor{comment}{\ \ *\ @details\ \ Попадание\ сюда\ =\ таймаут\ и\ перезапуск\ RS\ приема}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00431}00431\ \textcolor{comment}{\ \ *\ \ \ \ \ \ \ \ \ \ \ Добавить\ вызов\ этой\ функции\ в\ TIMx\_IRQHandler()\ ВМЕСТО\ HAL\_TIM\_IRQHandler().}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00432}00432\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00433}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga2d356b2a0b4af43460bb2cacb81779ce}{00433}}\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga2d356b2a0b4af43460bb2cacb81779ce}{RS\_TIM\_Handler}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00434}00434\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00435}00435\ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}}\ ==\ NULL)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00436}00436\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00437}00437\ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00438}00438\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00439}00439\ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_gab9d308969f924234bc879a93ffb80473}{RS\_TIM\_Handler\_ENTER}}();}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00440}00440\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00441}00441\ \ \ HAL\_TIM\_IRQHandler(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00442}00442\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00443}00443\ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\_Abort}}(hRS,\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca5699efe0ab3cdfd4f6ef175ecb809306}{ABORT\_RS}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00444}00444\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00445}00445\ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a8bbcb263ae7a61790b559bcb55cd9aa9}{RS\_STATUS}}\ =\ RS\_TIMEOUT;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00446}00446\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00447}00447\ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a82f0ad79cd234cd26076bfcfbc5c1194}{sRS\_Mode}}\ <\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga9560ee688d4bcdd90a47c110be4ecf92}{RS\_MASTER\_MODE\_START}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00448}00448\ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}}-\/>\mbox{\hyperlink{struct_r_s___msg_type_def_a277ed439b65aedbf03bd112c073e6a32}{MbAddr}}\ ==\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a01e2c95a23aa3eed1f002e2329a10942}{ID}})\ \textcolor{comment}{//\ ошибка\ если\ таймаут\ по\ нашему\ сообщению}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00449}00449\ \ \ \ \ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{TrackerCnt\_Err}}(hRS-\/>rs\_err);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00450}00450\ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00451}00451\ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a82f0ad79cd234cd26076bfcfbc5c1194}{sRS\_Mode}}\ >=\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga9560ee688d4bcdd90a47c110be4ecf92}{RS\_MASTER\_MODE\_START}})\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00452}00452\ \ \ \{\ \textcolor{comment}{//\ Мастер:\ коллбек\ и\ освобождение\ для\ нового\ запроса}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00453}00453\ \ \ \ \ RS\_Set\_Free(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00454}00454\ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6e584c7559c702d3382dbb9aa572b71b}{pCallback}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00455}00455\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00456}00456\ \ \ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6e584c7559c702d3382dbb9aa572b71b}{pCallback}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});\ \textcolor{comment}{//\ обрабатываем\ ответ}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00457}00457\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00458}00458\ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00459}00459\ \ \ \ \ \textcolor{comment}{//\ Слейв:\ перезапускаем\ прием}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00460}00460\ \ \ \ \ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\_Handle\_Receive\_Start}}(hRS,\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_a6a3f47a1a3476d6e9df997e1dc9da8c4}{pMessagePtr}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00461}00461\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00462}00462\ \ \ \mbox{\hyperlink{group___r_s___d_e_b_u_g_gaa026e9bf8672373cfe265f96ea0f6061}{RS\_TIM\_Handler\_EXIT}}();}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00463}00463\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00464}00464\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00465}00465\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00466}00466\ \textcolor{comment}{\ \ *\ @brief\ \ Запуск\ таймаута\ приема.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00467}00467\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00468}00468\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ операции.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00469}00469\ \textcolor{comment}{\ \ *\ @details\ \ Запускает\ таймер\ для\ отсчета\ времени\ ожидания\ следующего\ байта.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00470}00470\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00471}\mbox{\hyperlink{group___r_s___t_o_o_l_s_gac3a7bbc060a4250c160d51f0a0ca6cf8}{00471}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gac3a7bbc060a4250c160d51f0a0ca6cf8}{RS\_Timeout\_Start}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00472}00472\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00473}00473\ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00474}00474\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00475}00475\ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}}-\/>Instance-\/>CNT\ =\ 0;\ \textcolor{comment}{//\ reset\ cnt;}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00476}00476\ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aa6da72b8ad446f76484783ca8af0e565}{sRS\_Timeout}})\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ if\ timeout\ setted}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00477}00477\ \ \ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00478}00478\ \ \ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}}-\/>Instance-\/>ARR\ =\ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aa6da72b8ad446f76484783ca8af0e565}{sRS\_Timeout}};}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00479}00479\ \ \ \ \ \ \ HAL\_TIM\_Base\_Start\_IT(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00480}00480\ \ \ \ \ \ \ RS\_Set\_RX\_Active\_Flags(hRS);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00481}00481\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00482}00482\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00483}00483\ \ \ \textcolor{keywordflow}{return}\ RS\_OK;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00484}00484\ \}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00485}00485\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00486}00486\ \textcolor{comment}{\ \ *\ @brief\ \ Остановка\ таймаута\ приема.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00487}00487\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00488}00488\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ операции.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00489}00489\ \textcolor{comment}{\ \ *\ @details\ \ Останавливает\ таймер\ ожидания.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00490}00490\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00491}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1de0a597d043b64d0a19bc393cc1b3fd}{00491}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1de0a597d043b64d0a19bc393cc1b3fd}{RS\_Timeout\_Stop}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00492}00492\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00493}00493\ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00494}00494\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00495}00495\ \ \ \ \ \textcolor{comment}{//\ Останавливаем\ таймаут}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00496}00496\ \ \ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aa6da72b8ad446f76484783ca8af0e565}{sRS\_Timeout}})\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00497}00497\ \ \ \ \ \ \ HAL\_TIM\_Base\_Stop\_IT(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}});}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00498}00498\ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}}-\/>Instance-\/>CNT\ =\ 0;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00499}00499\ \ \ \ \ \_\_HAL\_TIM\_CLEAR\_IT(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}},\ TIM\_IT\_UPDATE);}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00500}00500\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00501}00501\ \ \ \textcolor{keywordflow}{return}\ RS\_OK;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00502}00502\ \}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00503}00503\ \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00504}00504\ \textcolor{comment}{\ \ *\ @brief\ \ Обновление\ (сброс)\ таймаута\ приема.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00505}00505\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00506}00506\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ операции.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00507}00507\ \textcolor{comment}{\ \ *\ @details\ \ Сбрасывает\ счетчик\ таймера\ в\ 0.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00508}00508\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00509}\mbox{\hyperlink{group___r_s___t_o_o_l_s_gad3d2e8fb9c2879e1ddb967cff6124521}{00509}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gad3d2e8fb9c2879e1ddb967cff6124521}{RS\_Timeout\_Update}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00510}00510\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00511}00511\ \ \ \textcolor{keywordflow}{if}(hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}})}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00512}00512\ \ \ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00513}00513\ \ \ \ \ hRS-\/>\mbox{\hyperlink{struct_r_s___handle_type_def_aef8875f7628f280ed88f74eb762e0d99}{htim}}-\/>Instance-\/>CNT\ =\ 0;\ \textcolor{comment}{//\ reset\ cnt;}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00514}00514\ \ \ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00515}00515\ \ \ \textcolor{keywordflow}{return}\ RS\_OK;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00516}00516\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00517}00517\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00518}00518\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/CALLBACK/HANDLER\ FUNCTIONS-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00519}00519\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00520}00520\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00521}00521\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00522}00522\ }
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00523}00523\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00524}00524\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/WEAK\ PROTOTYPES\ FOR\ PROCESSING\ MESSAGE-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}\textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00525}00525\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00526}00526\ \textcolor{comment}{\ \ *\ @brief\ \ Пользовательская\ функция\ для\ ответа\ на\ запрос\ по\ UART.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00527}00527\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00528}00528\ \textcolor{comment}{\ \ *\ @param\ \ RS\_msg\ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00529}00529\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ Статус\ о\ результате\ ответа\ на\ комманду.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00530}00530\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00531}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga8b7bcc84cb8192a58fe87b662fbd9690}{00531}}\ \_\_weak\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga8b7bcc84cb8192a58fe87b662fbd9690}{RS\_Response}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00532}00532\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00533}00533\ \ \ \textcolor{comment}{/*\ Redefine\ function\ for\ user\ purposes\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00534}00534\ \ \ \textcolor{keywordflow}{return}\ RS\_ERR;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00535}00535\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00536}00536\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00537}00537\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00538}00538\ \textcolor{comment}{\ \ *\ @brief\ \ Пользовательская\ функция\ для\ сбора\ сообщения\ в\ буфер\ UART.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00539}00539\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00540}00540\ \textcolor{comment}{\ \ *\ @param\ \ RS\_msg\ \ \ \ \ \ \ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00541}00541\ \textcolor{comment}{\ \ *\ @param\ \ msg\_uart\_buff\ Указатель\ на\ буффер\ UART.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00542}00542\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ \ \ \ \ \ \ Статус\ о\ результате\ заполнения\ буфера.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00543}00543\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00544}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1cd98c55f6f359e3ab93d0f9cf912ab5}{00544}}\ \_\_weak\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1cd98c55f6f359e3ab93d0f9cf912ab5}{RS\_Collect\_Message}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg,\ uint8\_t\ *msg\_uart\_buff)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00545}00545\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00546}00546\ \ \ \textcolor{comment}{/*\ Redefine\ function\ for\ user\ purposes\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00547}00547\ \ \ \textcolor{keywordflow}{return}\ RS\_ERR;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00548}00548\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00549}00549\ \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00550}00550\ \textcolor{comment}{/**\ }}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00551}00551\ \textcolor{comment}{\ \ *\ @brief\ \ Пользовательская\ функция\ для\ парса\ сообщения\ из\ буфера\ UART.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00552}00552\ \textcolor{comment}{\ \ *\ @param\ \ hRS\ \ \ \ \ \ \ \ \ \ \ Указатель\ на\ хендлер\ RS.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00553}00553\ \textcolor{comment}{\ \ *\ @param\ \ RS\_msg\ \ \ \ \ \ \ \ Указатель\ на\ структуру\ сообщения.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00554}00554\ \textcolor{comment}{\ \ *\ @param\ \ msg\_uart\_buff\ Указатель\ на\ буффер\ UART.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00555}00555\ \textcolor{comment}{\ \ *\ @return\ RS\_RES\ \ \ \ \ \ \ \ Статус\ о\ результате\ заполнения\ структуры.}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00556}00556\ \textcolor{comment}{\ \ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00557}\mbox{\hyperlink{group___r_s___t_o_o_l_s_ga3500b3fa91d05a94cf8da5cc5ce338f5}{00557}}\ \_\_weak\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\_StatusTypeDef}}\ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga3500b3fa91d05a94cf8da5cc5ce338f5}{RS\_Parse\_Message}}(\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\_HandleTypeDef}}\ *hRS,\ \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\_MsgTypeDef}}\ *RS\_msg,\ uint8\_t\ *msg\_uart\_buff)}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00558}00558\ \{}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00559}00559\ \ \ \textcolor{comment}{/*\ Redefine\ function\ for\ user\ purposes\ */}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00560}00560\ \ \ \textcolor{keywordflow}{return}\ RS\_ERR;}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00561}00561\ \}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00562}00562\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/WEAK\ PROTOTYPES\ FOR\ PROCESSING\ MESSAGE-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{rs__message_8c_source_l00563}00563\ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}

\end{DoxyCode}
