\doxysection{E\+:/.WORK/\+STM32/\+Diod\+\_\+\+Test/diode\+\_\+tester/\+Core/\+Modbus/\+Inc/rs\+\_\+message.h File Reference} \hypertarget{rs__message_8h}{}\label{rs__message_8h}\index{E:/.WORK/STM32/Diod\_Test/diode\_tester/Core/Modbus/Inc/rs\_message.h@{E:/.WORK/STM32/Diod\_Test/diode\_tester/Core/Modbus/Inc/rs\_message.h}} Библиотека обмена сообщениями по RS-\/интерфейсу {\ttfamily \#include "{}modbus\+\_\+core.\+h"{}}\newline Include dependency graph for rs\+\_\+message.\+h\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{rs__message_8h__incl} \end{center} \end{figure} This graph shows which files directly or indirectly include this file\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{rs__message_8h__dep__incl} \end{center} \end{figure} \doxysubsubsection*{Classes} \begin{DoxyCompactItemize} \item struct \mbox{\hyperlink{struct_r_s___flags_type_def}{RS\+\_\+\+Flags\+Type\+Def}} \begin{DoxyCompactList}\small\item\em Struct for flags RS. \end{DoxyCompactList}\item struct \mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \begin{DoxyCompactList}\small\item\em Handle for RS communication. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsubsection*{Macros} \begin{DoxyCompactItemize} \item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga00f6ba164717bd919fa6e9b25e1bbc21}{RS\+\_\+\+USER\+\_\+\+VARS\+\_\+\+NUMB}}~0 \begin{DoxyCompactList}\small\item\em Количество переменных в \doxylink{group___r_s___d_e_b_u_g_ga50ccb119acf302969b7fdcb58f2130e4}{Tracker\+Type\+Def}. \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga50ccb119acf302969b7fdcb58f2130e4}{Tracker\+Type\+Def}}(num\+\_\+user\+\_\+vars) \begin{DoxyCompactList}\small\item\em Тип структуры для счетчиков-\/переменных \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga23de0006aa08984cfeddb6aa5e512fa1}{Tracker\+Cnt\+\_\+\+Ok}}(\+\_\+cntstruct\+\_\+) \begin{DoxyCompactList}\small\item\em Инкрементировать переменную -\/ успешных событий \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga49af29ab3927cad105c1d2b018a767e9}{Tracker\+Cnt\+\_\+\+Err}}(\+\_\+cntstruct\+\_\+) \begin{DoxyCompactList}\small\item\em Инкрементировать переменную -\/ ошибок \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga8017fb05a56a1b667244f1f786fa9c57}{Tracker\+Cnt\+\_\+\+Warn}}(\+\_\+cntstruct\+\_\+) \begin{DoxyCompactList}\small\item\em Инкрементировать переменную -\/ предупреждений \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga30a03e8d8912be85a203c829b581f999}{printf\+\_\+rs}}(...) \begin{DoxyCompactList}\small\item\em Printf обычных событий RS/\+UART/\+TIM. \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga830a5ed90667bf50ab8c409dcadb2a39}{printf\+\_\+rs\+\_\+err}}(...) \begin{DoxyCompactList}\small\item\em Printf ошибок RS/\+UART/\+TIM. \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_gab9d308969f924234bc879a93ffb80473}{RS\+\_\+\+TIM\+\_\+\+Handler\+\_\+\+ENTER}}() \begin{DoxyCompactList}\small\item\em Действия при заходе в прерывания таймера \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_gaa026e9bf8672373cfe265f96ea0f6061}{RS\+\_\+\+TIM\+\_\+\+Handler\+\_\+\+EXIT}}() \begin{DoxyCompactList}\small\item\em Действия при выходе из прерывания таймера \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_ga8c401e4d5d440001c1d879984107bb79}{RS\+\_\+\+UART\+\_\+\+Handler\+\_\+\+ENTER}}() \begin{DoxyCompactList}\small\item\em Действия при заходе в прерывания UART. \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___d_e_b_u_g_gade69fd26928788dd6f0278fcd15885ff}{RS\+\_\+\+UART\+\_\+\+Handler\+\_\+\+EXIT}}() \begin{DoxyCompactList}\small\item\em Действия при выходе из прерывания UART. \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___t_o_o_l_s_gae0f359f0af89adf45bac275a3f5ee34d}{RS\+\_\+\+Enable\+Receive}}() \begin{DoxyCompactList}\small\item\em Функция изменения направления передачи на ПРИЕМ для RS-\/485. \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___t_o_o_l_s_gaeddade966945ed376bb152151b493d6f}{RS\+\_\+\+Enable\+Transmit}}() \begin{DoxyCompactList}\small\item\em Функция изменения направления передачи на ПЕРЕДАЧУ для RS-\/485. \end{DoxyCompactList}\item \#define \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga9560ee688d4bcdd90a47c110be4ecf92}{RS\+\_\+\+MASTER\+\_\+\+MODE\+\_\+\+START}}~0x3 \begin{DoxyCompactList}\small\item\em Начало режимов мастера (до него -\/ режим слейв) \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsubsection*{Enumerations} \begin{DoxyCompactItemize} \item enum \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \{ \newline {\bfseries RS\+\_\+\+OK} = 0x01 , {\bfseries RS\+\_\+\+ERR} , {\bfseries RS\+\_\+\+ABORTED} , {\bfseries RS\+\_\+\+BUSY} , \newline {\bfseries RS\+\_\+\+SKIP} , {\bfseries RS\+\_\+\+TIMEOUT} , {\bfseries RS\+\_\+\+COLLECT\+\_\+\+MSG\+\_\+\+ERR} , {\bfseries RS\+\_\+\+PARSE\+\_\+\+MSG\+\_\+\+ERR} \} \begin{DoxyCompactList}\small\item\em Enums for respond CMD about RS status. \end{DoxyCompactList}\item enum \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga13e1c056947b06c7dc29b90d22f683a7}{RS\+\_\+\+Mode\+Type\+Def}} \{ \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7aee8cfd8ce9edacc055a195ed454a49dc}{RS\+\_\+\+SLAVE\+\_\+\+ALWAYS\+\_\+\+WAIT}} = 0x01 , \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7ad118e897a520ddc9c77a905684079550}{RS\+\_\+\+RESERVED}} = 0x02 , \mbox{\hyperlink{group___r_s___t_o_o_l_s_gga13e1c056947b06c7dc29b90d22f683a7a15953c59b7f547b318edab14070873c5}{RS\+\_\+\+MASTER\+\_\+\+REQUEST}} = 0x03 \} \begin{DoxyCompactList}\small\item\em Enums for RS Modes. \end{DoxyCompactList}\item enum \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab7c55bd8bb15b0eecc8c525019d4a1cc}{RS\+\_\+\+Abort\+Type\+Def}} \{ \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca95c6ce0fee466ba98e43213d001ecc16}{ABORT\+\_\+\+TX}} = 0x01 , \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1ccaf0519a0ddda6fff97dd61ce0f3320df9}{ABORT\+\_\+\+RX}} = 0x02 , \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1ccac5554f0ed84242010a53eb518834d8e8}{ABORT\+\_\+\+RX\+\_\+\+TX}} = 0x03 , \mbox{\hyperlink{group___r_s___t_o_o_l_s_ggab7c55bd8bb15b0eecc8c525019d4a1cca5699efe0ab3cdfd4f6ef175ecb809306}{ABORT\+\_\+\+RS}} = 0x04 \} \begin{DoxyCompactList}\small\item\em Enums for Abort modes. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsubsection*{Functions} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga8b7bcc84cb8192a58fe87b662fbd9690}{RS\+\_\+\+Response}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}RS\+\_\+msg) \begin{DoxyCompactList}\small\item\em Пользовательская функция для ответа на запрос по UART. \end{DoxyCompactList}\item \+\_\+\+\_\+weak \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} {\bfseries RS\+\_\+\+Response\+\_\+\+Callback} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}RS\+\_\+msg) \item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1cd98c55f6f359e3ab93d0f9cf912ab5}{RS\+\_\+\+Collect\+\_\+\+Message}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}RS\+\_\+msg, uint8\+\_\+t \texorpdfstring{$\ast$}{*}msg\+\_\+uart\+\_\+buff) \begin{DoxyCompactList}\small\item\em Пользовательская функция для сбора сообщения в буфер UART. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga3500b3fa91d05a94cf8da5cc5ce338f5}{RS\+\_\+\+Parse\+\_\+\+Message}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}RS\+\_\+msg, uint8\+\_\+t \texorpdfstring{$\ast$}{*}msg\+\_\+uart\+\_\+buff) \begin{DoxyCompactList}\small\item\em Пользовательская функция для парса сообщения из буфера UART. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1b59697f4b7fad81f9d5fd9fffebac2f}{RS\+\_\+\+Receive\+\_\+\+IT}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}RS\+\_\+msg) \begin{DoxyCompactList}\small\item\em Начать прием по прерываниям. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga2e69a97a8b6e0b5855116d88c0e17cb9}{RS\+\_\+\+Transmit\+\_\+\+IT}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}RS\+\_\+msg) \begin{DoxyCompactList}\small\item\em Начать передачу по прерываниям. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_gaa261bb0d37e7f18f04fb4353aa0f5c45}{RS\+\_\+\+Init}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}huart, TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim, uint8\+\_\+t \texorpdfstring{$\ast$}{*}p\+RS\+\_\+\+Buffer\+Ptr) \begin{DoxyCompactList}\small\item\em Инициалазация структуры \doxylink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1ffe808b3640f253b1783295d6990962}{RS\+\_\+\+Abort}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab7c55bd8bb15b0eecc8c525019d4a1cc}{RS\+\_\+\+Abort\+Type\+Def}} Abort\+Mode) \begin{DoxyCompactList}\small\item\em Отменить прием/передачу RS/\+UART. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab43a3b93c85adee5e3c561922d7ea2ef}{RS\+\_\+\+Handle\+\_\+\+Receive\+\_\+\+Start}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}RS\+\_\+msg) \begin{DoxyCompactList}\small\item\em Обработчик для начала приема. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga330f6cfcdaab1f239054c0d91be3c5bc}{RS\+\_\+\+Handle\+\_\+\+Transmit\+\_\+\+Start}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS, \mbox{\hyperlink{struct_r_s___msg_type_def}{RS\+\_\+\+Msg\+Type\+Def}} \texorpdfstring{$\ast$}{*}RS\+\_\+msg) \begin{DoxyCompactList}\small\item\em Обработчик для начала передачи. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga7180b913ba795c07637680982d7f45ac}{RS\+\_\+\+UART\+\_\+\+Tx\+Cplt\+Callback}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS) \begin{DoxyCompactList}\small\item\em UART TX Callback\+: коллбек после окончания передачи. \end{DoxyCompactList}\item void \mbox{\hyperlink{group___r_s___t_o_o_l_s_gab27567456df0329130c7fe4fc43c6ee1}{RS\+\_\+\+UART\+\_\+\+Handler}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS) \begin{DoxyCompactList}\small\item\em Обработчик прерывания UART. \end{DoxyCompactList}\item void \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga2d356b2a0b4af43460bb2cacb81779ce}{RS\+\_\+\+TIM\+\_\+\+Handler}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS) \begin{DoxyCompactList}\small\item\em Обработчик прерывания TIM. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_gac3a7bbc060a4250c160d51f0a0ca6cf8}{RS\+\_\+\+Timeout\+\_\+\+Start}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS) \begin{DoxyCompactList}\small\item\em Запуск таймаута приема. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga1de0a597d043b64d0a19bc393cc1b3fd}{RS\+\_\+\+Timeout\+\_\+\+Stop}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS) \begin{DoxyCompactList}\small\item\em Остановка таймаута приема. \end{DoxyCompactList}\item \mbox{\hyperlink{group___r_s___t_o_o_l_s_ga727154b368397b4796aa892de12a2289}{RS\+\_\+\+Status\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_gad3d2e8fb9c2879e1ddb967cff6124521}{RS\+\_\+\+Timeout\+\_\+\+Update}} (\mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \texorpdfstring{$\ast$}{*}h\+RS) \begin{DoxyCompactList}\small\item\em Обновление (сброс) таймаута приема. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsubsection*{Variables} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{struct_r_s___handle_type_def}{RS\+\_\+\+Handle\+Type\+Def}} \mbox{\hyperlink{group___r_s___t_o_o_l_s_gadaef5cb7e494d0fd139199f5b6cbeb86}{hmodbus1}} \begin{DoxyCompactList}\small\item\em Default Handle for Modbus. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Detailed Description} Библиотека обмена сообщениями по RS-\/интерфейсу Definition in file \mbox{\hyperlink{rs__message_8h_source}{rs\+\_\+message.\+h}}.