\doxysubsection{Encoder tools }
\hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}{}\label{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}\index{Encoder tools@{Encoder tools}}


Функции для считывания энкодера  


Collaboration diagram for Encoder tools\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=251pt]{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r}
\end{center}
\end{figure}
\doxysubsubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}}
\begin{DoxyCompactList}\small\item\em Структура инициализации енкодера \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\+\_\+\+Encoder\+\_\+\+Init}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc1, TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}htim)
\begin{DoxyCompactList}\small\item\em Инициализация режима энкодер у таймера. \end{DoxyCompactList}\item 
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\+\_\+\+Encoder\+\_\+\+Read}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc)
\begin{DoxyCompactList}\small\item\em Считать энкодер. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\+\_\+\+Encoder\+\_\+\+Read\+Switch}} (\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}henc)
\begin{DoxyCompactList}\small\item\em Считать кнопку энкодера. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
Функции для считывания энкодера 

\begin{DoxyParagraph}{Пример использования\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\_EncoderTypeDef}}\ henc1;}
\DoxyCodeLine{TIM\_HandleTypeDef\ htim4;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{//\ инициализация}}
\DoxyCodeLine{henc1.\mbox{\hyperlink{struct_t_i_m___encoder_type_def_adc80bd5a90444c31d84157f35c59b95c}{htim}}\ =\ \&htim4;}
\DoxyCodeLine{henc1.\mbox{\hyperlink{struct_t_i_m___encoder_type_def_ad29873fc8cdc71462e6d8744621120e9}{GPIOx}}\ =\ GPIOA;}
\DoxyCodeLine{henc1.\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a4fc05ef011205a6702cb3d006bab677e}{GPIO\_PIN\_TI1}}\ =\ GPIO\_PIN\_0;}
\DoxyCodeLine{henc1.\mbox{\hyperlink{struct_t_i_m___encoder_type_def_a67ad037b92162546763fc9c425b5e3c5}{GPIO\_PIN\_TI2}}\ =\ GPIO\_PIN\_1;}
\DoxyCodeLine{\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}{TIM\_Encoder\_Init}}(\&henc1,\ \&htim4);}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{//\ считывание\ энкодера\ и\ кнопки}}
\DoxyCodeLine{int16\_t\ delta\ =\ \mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}{TIM\_Encoder\_Read}}(\&henc1);}
\DoxyCodeLine{setpoint\_tmp\ +=\ delta;}
\DoxyCodeLine{\textcolor{keywordflow}{if}(\mbox{\hyperlink{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}{TIM\_Encoder\_ReadSwitch}}(\&henc1))}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ setpoint\ =\ setpoint\_tmp;\ \textcolor{comment}{//\ подтвердить\ новое\ значение}}
\DoxyCodeLine{\}}

\end{DoxyCode}
 
\end{DoxyParagraph}


\label{doc-func-members}
\Hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_doc-func-members}
\doxysubsubsection{Function Documentation}
\Hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc}\index{Encoder tools@{Encoder tools}!TIM\_Encoder\_Init@{TIM\_Encoder\_Init}}
\index{TIM\_Encoder\_Init@{TIM\_Encoder\_Init}!Encoder tools@{Encoder tools}}
\doxysubsubsubsection{\texorpdfstring{TIM\_Encoder\_Init()}{TIM\_Encoder\_Init()}}
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc} 
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Encoder\+\_\+\+Init (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{henc}{, }\item[{TIM\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{htim}{}\end{DoxyParamCaption})}



Инициализация режима энкодер у таймера. 


\begin{DoxyParams}{Parameters}
{\em henc} & Указатель на хендл энкодера. \\
\hline
{\em htim} & Указатель на хендл таймера. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
HAL status. 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
Предварительно надо инициализировать таймер \doxylink{group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_ga7044214f24a9868ba7e1650b55e639ec}{TIM\+\_\+\+Base\+\_\+\+Init}. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{general__tim_8c_source_l00168}{168}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.

\Hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501}\index{Encoder tools@{Encoder tools}!TIM\_Encoder\_Read@{TIM\_Encoder\_Read}}
\index{TIM\_Encoder\_Read@{TIM\_Encoder\_Read}!Encoder tools@{Encoder tools}}
\doxysubsubsubsection{\texorpdfstring{TIM\_Encoder\_Read()}{TIM\_Encoder\_Read()}}
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_gac3bc6525f88c275e47eb864e6d567501} 
HAL\+\_\+\+Status\+Type\+Def TIM\+\_\+\+Encoder\+\_\+\+Read (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{henc}{}\end{DoxyParamCaption})}



Считать энкодер. 


\begin{DoxyParams}{Parameters}
{\em henc} & Указатель на хендл энкодера. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
HAL status.
\end{DoxyReturn}
Читает разницу энкодера, которую он накопил после предыдущего вызова этой функции. 

Definition at line \mbox{\hyperlink{general__tim_8c_source_l00303}{303}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.

\Hypertarget{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761}\index{Encoder tools@{Encoder tools}!TIM\_Encoder\_ReadSwitch@{TIM\_Encoder\_ReadSwitch}}
\index{TIM\_Encoder\_ReadSwitch@{TIM\_Encoder\_ReadSwitch}!Encoder tools@{Encoder tools}}
\doxysubsubsubsection{\texorpdfstring{TIM\_Encoder\_ReadSwitch()}{TIM\_Encoder\_ReadSwitch()}}
{\footnotesize\ttfamily \label{group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_ga117b795017e9e3a357ddefe323412761} 
int TIM\+\_\+\+Encoder\+\_\+\+Read\+Switch (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_t_i_m___encoder_type_def}{TIM\+\_\+\+Encoder\+Type\+Def}} \texorpdfstring{$\ast$}{*}}]{henc}{}\end{DoxyParamCaption})}



Считать кнопку энкодера. 


\begin{DoxyParams}{Parameters}
{\em henc} & Указатель на хендл энкодера. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 -\/ если кнопка нажата, 0 -\/ если отжата, -\/1 -\/ если ошибка 
\end{DoxyReturn}


Definition at line \mbox{\hyperlink{general__tim_8c_source_l00322}{322}} of file \mbox{\hyperlink{general__tim_8c_source}{general\+\_\+tim.\+c}}.

