STM32_ExtendedLibs/Doc/html/general__tim_8h_source.html
Razvalyaev 3fb3058a30 Добавлено:
- максимально убрана зависимость от HAL - можно использовать и без него, чисто на cmsis
- документирован uart
- документирован spi
- добавлены примеры использования в general_periph
- всякие фиксы документации
2025-10-21 03:29:10 +03:00

470 lines
85 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MyLibs: E:/.WORK/STM32/STM32_ExtendedLibs/MyLibsGeneral/Inc/general_tim.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<script type="text/javascript" src="darkmode_toggle.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MyLibs<span id="projectnumber">&#160;1.0</span>
</div>
<div id="projectbrief">Расширенные библиотеки для STM32</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(function(){initNavTree('general__tim_8h_source.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">general_tim.h</div></div>
</div><!--header-->
<div class="contents">
<a href="general__tim_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/** </span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">**************************************************************************</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">* @file general_tim.h</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">* @brief Заголовочный файл для модуля инициализации таймеров и работы с ними.</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">**************************************************************************</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">* @defgroup MY_LIBS_TIM TIM Tools</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">* @ingroup MYLIBS_PERIPHERAL</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">* @brief Функции и макросы для удобной работы с TIM.</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">* @details</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">Модуль предоставляет универсальные инструменты для работы с TIM:</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment"> - @ref MYLIBS_TIM_GENERAL — базовая инициализация таймеров и прерываний.</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment"> - @ref MYLIBS_TIM_DELAY — функции задержки через таймеры (blocking и non-blocking).</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"> - @ref MYLIBS_TIM_OC — настройка каналов Output Compare и PWM.</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment"> - @ref MYLIBS_TIM_ENCODER — работа с энкодерами, чтение положения и кнопки.</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment"></span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">* @note Требуется подключение модуля TIM в библиотеке HAL и GPIO (@ref MY_LIBS_GPIO) из MyLibs</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">@code </span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">#define HAL_TIM_MODULE_ENABLED</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment">@endcode</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment">*************************************************************************/</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#ifndef __TIM_GENERAL_H_</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#define __TIM_GENERAL_H_</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment"></span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment">/////////////////////////////////////////////////////////////////////</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment">/////////////////////////---USER SETTINGS---/////////////////////////</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">/** </span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment"> * @addtogroup TIM_INIT Init defines</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="comment"> * @ingroup MYLIBS_TIM_GENERAL</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment"> * @brief Настройка таймеров</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="comment"> * @{</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment"> */</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#define HAL_TIM_MODULE_ENABLED</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga54a98c21365e0bc45b81555d2b101f2b"> 34</a></span><span class="preprocessor">#define USE_TIM1 </span><span class="comment">///&lt; Включить TIM1 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga72535a44955b43cbcd56e25039ab32eb"> 35</a></span><span class="preprocessor">#define USE_TIM2 </span><span class="comment">///&lt; Включить TIM2 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga5b5685a43273b6e37242a4aba3ee0617"> 36</a></span><span class="preprocessor">#define USE_TIM3 </span><span class="comment">///&lt; Включить TIM3 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga1493b39c9214501180b81b4c892f9be0"> 37</a></span><span class="preprocessor">#define USE_TIM4 </span><span class="comment">///&lt; Включить TIM4 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga252f4fba93fc265110e83760e0590af3"> 38</a></span><span class="preprocessor">#define USE_TIM5 </span><span class="comment">///&lt; Включить TIM5 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga8fe31b98160627d19038222910be3f46"> 39</a></span><span class="preprocessor">#define USE_TIM6 </span><span class="comment">///&lt; Включить TIM6 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga7cdc54cc8cbbb6e9f60001f1e3e6ec67"> 40</a></span><span class="preprocessor">#define USE_TIM7 </span><span class="comment">///&lt; Включить TIM7 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga28ba33d7c6bf22821dafa5bcee4854be"> 41</a></span><span class="preprocessor">#define USE_TIM8 </span><span class="comment">///&lt; Включить TIM8 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#gaac627c0e98c9594cc41b1b46eb39e44a"> 42</a></span><span class="preprocessor">#define USE_TIM9 </span><span class="comment">///&lt; Включить TIM9 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga98c0691052d1da2c4053dd3586ff7ce9"> 43</a></span><span class="preprocessor">#define USE_TIM10 </span><span class="comment">///&lt; Включить TIM10 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga176c97f06ebcf14e06e5c5bdbfac44c2"> 44</a></span><span class="preprocessor">#define USE_TIM11 </span><span class="comment">///&lt; Включить TIM11 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga4e2b0e6cdf9eed74581b575c3fd9516b"> 45</a></span><span class="preprocessor">#define USE_TIM12 </span><span class="comment">///&lt; Включить TIM12 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#gaf48ef87650517652ddec039a189507ac"> 46</a></span><span class="preprocessor">#define USE_TIM13 </span><span class="comment">///&lt; Включить TIM13 в @ref TIM_Base_MspInit</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="group___t_i_m___i_n_i_t.html#ga9ae40be31d5271abe3e49f896d916d5c"> 47</a></span><span class="preprocessor">#define USE_TIM14 </span><span class="comment">///&lt; Включить TIM14 в @ref TIM_Base_MspInit</span><span class="comment"></span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment">/** TIM_INIT</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="comment"> * @}</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment"> */</span><span class="preprocessor"></span><span class="comment"></span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">/////////////////////////---USER SETTINGS---/////////////////////////</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="preprocessor">#include &quot;<a class="code" href="mylibs__defs_8h.html">mylibs_defs.h</a>&quot;</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="preprocessor">#include &quot;<a class="code" href="general__gpio_8h.html">general_gpio.h</a>&quot;</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment"></span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="comment">/////////////////////////////////////////////////////////////////////</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment">////////////////////////////---DEFINES---////////////////////////////</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="preprocessor">#define TIM_IT_CONF_Pos 0</span></div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span><span class="comment">//#define TIM_PWM_CONF_Pos 1</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="comment">//#define TIM_CLCK_SRC_CONF_Pos 2</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="comment">//#define TIM_SLAVE_CONF_Pos 3</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="comment">//#define TIM_MASTER_CONF_Pos 4</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="comment">//#define TIM_BDTR_CONF_Pos 5</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span><span class="preprocessor">#define TIM_IT_CONF (1&lt;&lt;(TIM_IT_CONF_Pos))</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="comment">//#define TIM_PWM_CONF (1&lt;&lt;(TIM_PWM_Pos))</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span><span class="comment"></span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment">////////////////////////////---DEFINES---////////////////////////////]</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span><span class="comment"></span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span><span class="comment">/////////////////////////////////////////////////////////////////////</span></div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span><span class="comment">///////////////////////---STRUCTURES &amp; ENUMS---//////////////////////</span></div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span><span class="comment">/**</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span><span class="comment"> * @brief Режим прерываний таймера</span></div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span><span class="comment"> * @ingroup MYLIBS_TIM_GENERAL</span></div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span><span class="comment"> */</span></div>
<div class="foldopen" id="foldopen00077" data-start="{" data-end="};">
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaeb611874216a4661fb83366b99b9e787"> 77</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span></div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span>{</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8"> 79</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8">TIM_DEFAULT</a> = 0, <span class="comment">///&lt; Прерываний отключены</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c"> 80</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c">TIM_IT_MODE</a> = TIM_IT_CONF, <span class="comment">///&lt; Прерываний включены</span></div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="comment">// TIM_PWM_MODE = TIM_PWM_ENABLE,</span></div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="comment">// TIM_PWM_IT_MODE = TIM_PWM_ENABLE | TIM_IT_CONF,</span></div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span>}<a class="code hl_enumeration" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaeb611874216a4661fb83366b99b9e787">TIM_ITModeTypeDef</a>;</div>
</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment"></span> </div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment">/**</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment"> * @brief Длительность тика таймера (частота тактирования таймера)</span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="comment"> * @ingroup MYLIBS_TIM_GENERAL</span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="comment"> * @details enum дает базовые длительности, но можно выставить другие</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment"> * (напр 500 - 0.5 мс)</span></div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment"> */</span></div>
<div class="foldopen" id="foldopen00091" data-start="{" data-end="};">
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaa0a51c870325217ac099881f09dd0800"> 91</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span></div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span>{</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5"> 93</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5">TIM_Base_Disable</a> = 0, <span class="comment">///&lt; Таймер отключен</span></div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2"> 94</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2">TIM_TickBase_1US</a> = 1, <span class="comment">///&lt; Таймер тактируется с частотой 1 МГц</span></div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f"> 95</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f">TIM_TickBase_10US</a> = 10, <span class="comment">///&lt; Таймер тактируется с частотой 100 кГц</span></div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30"> 96</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30">TIM_TickBase_100US</a> = 100, <span class="comment">///&lt; Таймер тактируется с частотой 10 кГц</span></div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25"> 97</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25">TIM_TickBase_1MS</a> = 1000, <span class="comment">///&lt; Таймер тактируется с частотой 1 кГц</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa"> 98</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa">TIM_TickBase_10MS</a> = 10000, <span class="comment">///&lt; Таймер тактируется с частотой 100 Гц</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da"> 99</a></span> <a class="code hl_enumvalue" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da">TIM_TickBase_100MS</a> = 100000, <span class="comment">///&lt; Таймер тактируется с частотой 10 Гц</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span>}<a class="code hl_enumeration" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaa0a51c870325217ac099881f09dd0800">TIM_MHzTickBaseTypeDef</a>;</div>
</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment"></span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment">/**</span></div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="comment"> * @brief Структура инициализации таймера</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment"> * @ingroup MYLIBS_TIM_GENERAL</span></div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="comment"> * @details </span></div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="comment"> * Содержит все базовые структуры, которые нужны для инициализации таймера.</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="comment"> * Если структуры настроек не заданы, то они заполнятся сами дефолтными параметрами </span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="comment"> * </span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="comment"> * Также высокоуровневые настройки частоты работы таймера. </span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="comment"> * Если какая-либо высокоуровневая настройка не задана, то </span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="comment"> * по возможности берется низкоуровневая настройка из структур</span></div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="comment"> */</span></div>
<div class="foldopen" id="foldopen00113" data-start="{" data-end="};">
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html"> 113</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><span class="comment">// struct with settings for custom function</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span>{</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#ada49efdbd35a8e442c3cff630d42f34c"> 115</a></span> TIM_HandleTypeDef <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#ada49efdbd35a8e442c3cff630d42f34c">htim</a>; <span class="comment">///&lt; HAL handle таймера</span></div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#a3805f627567798c3cd1d79a0da42bea0"> 116</a></span> TIM_ClockConfigTypeDef <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#a3805f627567798c3cd1d79a0da42bea0">sClockSourceConfig</a>; <span class="comment">///&lt; Настройки тактирования таймера</span></div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#a9694cf0910a69d48ff94f8aeac106969"> 117</a></span> TIM_SlaveConfigTypeDef <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#a9694cf0910a69d48ff94f8aeac106969">sSlaveConfig</a>; <span class="comment">///&lt; Настройки слейв режима таймера</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#a2d9d277dd395424b964445ec1bc65b21"> 118</a></span> TIM_MasterConfigTypeDef <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#a2d9d277dd395424b964445ec1bc65b21">sMasterConfig</a>; <span class="comment">///&lt; Настройки мастер режима таймера</span></div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#a961f19f0e1672715c27bc94d7871dbb7"> 119</a></span> TIM_BreakDeadTimeConfigTypeDef <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#a961f19f0e1672715c27bc94d7871dbb7">sBreakDeadTimeConfig</a>; <span class="comment">///&lt; Настройки дедтаймов таймера</span></div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#ab90e370c3edda88e76583293c250d2b0"> 121</a></span> <a class="code hl_enumeration" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaeb611874216a4661fb83366b99b9e787">TIM_ITModeTypeDef</a> <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#ab90e370c3edda88e76583293c250d2b0">sTimMode</a>; <span class="comment">///&lt; Настройки прерывания таймера </span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#a58da1b4c0f6d12d7d9fb2f170b9b9e6e"> 122</a></span> <a class="code hl_enumeration" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaa0a51c870325217ac099881f09dd0800">TIM_MHzTickBaseTypeDef</a> <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#a58da1b4c0f6d12d7d9fb2f170b9b9e6e">sTickBaseUS</a>; <span class="comment">///&lt; Длительность одного тика </span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#a11151fe125960cb8e61328ffd06b7718"> 123</a></span> uint8_t <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#a11151fe125960cb8e61328ffd06b7718">sTickBasePrescaler</a>; <span class="comment">///&lt; Дополнительный делитель, для удобного деления @ref sTickBaseUS</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#a7073358fd3a722687eb85238ab570014"> 124</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#a7073358fd3a722687eb85238ab570014">sTimAHBFreqMHz</a>; <span class="comment">///&lt; Частота шины тактирования таймера</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="struct_t_i_m___settings_type_def.html#af6057ff3f60f5e01b41d4a347b79a5e4"> 125</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_t_i_m___settings_type_def.html#af6057ff3f60f5e01b41d4a347b79a5e4">sTimFreqHz</a>; <span class="comment">///&lt; Желаемая частота таймера</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span>}<a class="code hl_struct" href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a>;</div>
</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> </div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span><span class="comment"></span> </div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="comment">/**</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span><span class="comment"> * @brief Структура инициализации енкодера</span></div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span><span class="comment"> * @ingroup MYLIBS_TIM_ENCODER</span></div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="comment"> * @details </span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="comment"> * Содержит все базовые структуры, которые нужны для инициализации таймера.</span></div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="comment"> * Если структуры настроек не заданы, то они заполнятся сами дефолтными параметрами </span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span><span class="comment"> * </span></div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span><span class="comment"> * Также высокоуровневые настройки частоты работы таймера. </span></div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="comment"> * Если какая-либо высокоуровневая настройка не задана, то </span></div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="comment"> * по возможности берется низкоуровневая настройка из структур</span></div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="comment"> */</span></div>
<div class="foldopen" id="foldopen00141" data-start="{" data-end="};">
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html"> 141</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><span class="comment">// struct with variables for encoder</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span>{</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#a6f769f027b760a4b496e2b2b77bf54a3"> 143</a></span> int16_t <a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#a6f769f027b760a4b496e2b2b77bf54a3">Encoder_Diff</a>; <span class="comment">///&lt; Считанная разница</span></div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#a0dacce3dde7df3122583869d96a372a2"> 144</a></span> uint16_t <a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#a0dacce3dde7df3122583869d96a372a2">Encoder_Shdw</a>; <span class="comment">///&lt; Последние считанные тики</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#adc80bd5a90444c31d84157f35c59b95c"> 146</a></span> TIM_HandleTypeDef *<a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#adc80bd5a90444c31d84157f35c59b95c">htim</a>; <span class="comment">///&lt; Указатель на HAL handle таймера</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#a021f0c585e9e62d68a4b09f630d8b6e5"> 147</a></span> TIM_Encoder_InitTypeDef <a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#a021f0c585e9e62d68a4b09f630d8b6e5">sConfig</a>; <span class="comment">///&lt; Указатель на структуру настройки энкодера</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#ad29873fc8cdc71462e6d8744621120e9"> 149</a></span> GPIO_TypeDef *<a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#ad29873fc8cdc71462e6d8744621120e9">GPIOx</a>; <span class="comment">///&lt; Порт, куда подключается энкодер</span></div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#a4fc05ef011205a6702cb3d006bab677e"> 150</a></span> uint32_t <a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#a4fc05ef011205a6702cb3d006bab677e">GPIO_PIN_TI1</a>; <span class="comment">///&lt; Пин, куда подключается канал TI1</span></div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#a67ad037b92162546763fc9c425b5e3c5"> 151</a></span> uint32_t <a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#a67ad037b92162546763fc9c425b5e3c5">GPIO_PIN_TI2</a>; <span class="comment">///&lt; Пин, куда подключается канал TI2</span></div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#a6973108a83d2a3ea4fc3e0e8a501af80"> 152</a></span> uint32_t <a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#a6973108a83d2a3ea4fc3e0e8a501af80">GPIO_PIN_SW</a>; <span class="comment">///&lt; Пин, куда кнопка энкодера (если есть)</span></div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"><a class="line" href="struct_t_i_m___encoder_type_def.html#a99295760ff8b27d1e6f1710f29383a45"> 154</a></span> <a class="code hl_struct" href="struct_g_p_i_o___switch_type_def.html">GPIO_SwitchTypeDef</a> <a class="code hl_variable" href="struct_t_i_m___encoder_type_def.html#a99295760ff8b27d1e6f1710f29383a45">Sw</a>; <span class="comment">///&lt; Структура кнопки</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span>}<a class="code hl_struct" href="struct_t_i_m___encoder_type_def.html">TIM_EncoderTypeDef</a>;<span class="comment"></span></div>
</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span><span class="comment">///////////////////////---STRUCTURES &amp; ENUMS---//////////////////////</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span><span class="comment"></span> </div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="comment">/////////////////////////////////////////////////////////////////////</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span><span class="comment">///////////////////////////---FUNCTIONS---///////////////////////////</span></div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="comment">/** </span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span><span class="comment"> * @addtogroup MYLIBS_TIM_GENERAL General tools</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><span class="comment"> * @ingroup MY_LIBS_TIM</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><span class="comment"> * @brief Функции для базовой инициализации таймеров</span></div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span><span class="comment"> * @par Пример использования:</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span><span class="comment"> @code</span></div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span><span class="comment"> TIM_SettingsTypeDef tim2Settings;</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span><span class="comment"></span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span><span class="comment"> void TIM2_Init(void)</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span><span class="comment"> {</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span><span class="comment"> // Настройка таймера TIM2 на 1 кГц с прерываниями с шагом таймера 10 мкс</span></div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span><span class="comment"> tim2Settings.htim.Instance = TIM2;</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span><span class="comment"> tim2Settings.sTimMode = TIM_IT_MODE;</span></div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="comment"> tim2Settings.sTickBaseUS = TIM_TickBase_10US;</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span><span class="comment"> tim2Settings.sTickBasePrescaler = 1;</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span><span class="comment"> tim2Settings.sTimFreqHz = 1000; // 1 кГц</span></div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="comment"> tim2Settings.sTimAHBFreqMHz = 72000000; // Hz</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span><span class="comment"></span> </div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span><span class="comment"> if(TIM_Base_Init(&amp;tim2Settings) != HAL_OK)</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span><span class="comment"> {</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="comment"> Error_Handler();</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span><span class="comment"> }</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span><span class="comment"> }</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span><span class="comment"> @endcode</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span><span class="comment"> * @{</span></div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span><span class="comment"> */</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span><span class="comment">/* Initialize TIM with TIM_SettingsTypeDef structure */</span></div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span>HAL_StatusTypeDef <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ga7044214f24a9868ba7e1650b55e639ec">TIM_Base_Init</a>(<a class="code hl_struct" href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a>* stim);</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span><span class="comment">/* Initialize TIMs clock and interrupt */</span></div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span><span class="keywordtype">void</span> <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaad47337be7ba2f6c0777c40d7278c931">TIM_Base_MspInit</a>(TIM_HandleTypeDef* htim, <a class="code hl_enumeration" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaeb611874216a4661fb83366b99b9e787">TIM_ITModeTypeDef</a> it_mode);</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span><span class="comment">/* DeInitialize TIMs clock and interrupt */</span></div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span><span class="keywordtype">void</span> <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ga879e3f1c919c02990736730275367115">TIM_Base_MspDeInit</a>(TIM_HandleTypeDef* htim);<span class="comment"></span></div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span><span class="comment">/** MYLIBS_TIM_GENERAL</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span><span class="comment"> * @}</span></div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span><span class="comment"> */</span></div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span><span class="comment"></span> </div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span><span class="comment">/** </span></div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="comment"> * @addtogroup MYLIBS_TIM_DELAY Delay tools</span></div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span><span class="comment"> * @ingroup MY_LIBS_TIM</span></div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span><span class="comment"> * @brief Функции для формирования задержек с помощью таймеров</span></div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span><span class="comment"> * @par Пример использования:</span></div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span><span class="comment"> @code</span></div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span><span class="comment"> TIM_HandleTypeDef htim2;</span></div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span><span class="comment"></span> </div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span><span class="comment"> // блокирующая задержка 500 тиков таймера</span></div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span><span class="comment"> LED_ON();</span></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span><span class="comment"> TIM_Delay(&amp;htim2, 500);</span></div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span><span class="comment"> LED_OFF();</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span><span class="comment"></span> </div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span><span class="comment"></span> </div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span><span class="comment"> while(1)</span></div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span><span class="comment"> {</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span><span class="comment"> // не блокирующая задержка 200 тиков таймера</span></div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span><span class="comment"> if(TIM_Delay_NonBlocking(&amp;htim2, 200) == HAL_OK)</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span><span class="comment"> {</span></div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span><span class="comment"> TIM_Delay_Start(&amp;htim2);</span></div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span><span class="comment"> LED_TOOGLE();</span></div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span><span class="comment"> }</span></div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span><span class="comment"> }</span></div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span><span class="comment"> @endcode</span></div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span><span class="comment"> * @{</span></div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span><span class="comment"> */</span></div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span><span class="comment">/* Start delay via TIM */</span></div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span>HAL_StatusTypeDef <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___d_e_l_a_y.html#ga4c0dfde4e15f677600605348b4e97834">TIM_Delay_Start</a>(TIM_HandleTypeDef *htim);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span><span class="comment">/* Delay via TIM */</span></div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span>HAL_StatusTypeDef <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___d_e_l_a_y.html#ga88c552a133cb6e3015453cccab74c07e">TIM_Delay</a>(TIM_HandleTypeDef *htim, uint16_t delay);</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span><span class="comment">/* Wait Delay via TIM without blocking app */</span></div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span>HAL_StatusTypeDef <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___d_e_l_a_y.html#ga108637af414bff3373059273b815ce9b">TIM_Delay_NonBlocking</a>(TIM_HandleTypeDef *htim, uint16_t delay);<span class="comment"></span></div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span><span class="comment">/** MYLIBS_TIM_DELAY</span></div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span><span class="comment"> * @}</span></div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span><span class="comment"> */</span></div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span><span class="comment"></span> </div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span><span class="comment">/** </span></div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span><span class="comment"> * @addtogroup MYLIBS_TIM_OC PWM/OC Channels tools</span></div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span><span class="comment"> * @ingroup MY_LIBS_TIM</span></div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span><span class="comment"> * @brief Функции для инициализации базовых функций каналов таймера</span></div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span><span class="comment"> * @par Пример использования:</span></div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span><span class="comment"> @code</span></div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span><span class="comment"> void PWM_Channel_Init_Example(void)</span></div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span><span class="comment"> {</span></div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span><span class="comment"> TIM_HandleTypeDef htim3;</span></div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span><span class="comment"> TIM_OC_InitTypeDef sConfigOC;</span></div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span><span class="comment"> GPIO_TypeDef *GPIOx = GPIOB;</span></div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span><span class="comment"> uint32_t PWM_PIN = GPIO_PIN_0;</span></div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span><span class="comment"></span> </div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span><span class="comment"> // Настройка таймера и канала PWM</span></div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span><span class="comment"> TIM_Output_PWM_Init(&amp;htim3, &amp;sConfigOC, TIM_CHANNEL_1, GPIOx, PWM_PIN);</span></div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span><span class="comment"></span> </div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span><span class="comment"> // Настройка компаратора OC</span></div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span><span class="comment"> TIM_OC_Comparator_Init(&amp;htim3, TIM_CHANNEL_1);</span></div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span><span class="comment"> }</span></div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span><span class="comment"> @endcode</span></div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span><span class="comment"> * @{</span></div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span><span class="comment"> */</span></div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span><span class="comment">/* Initialize PWM Channel and GPIO for output */</span></div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span>HAL_StatusTypeDef <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___o_c.html#gadb2f465d89f609e035867e980c3a29c6">TIM_Output_PWM_Init</a>(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfigOC, uint32_t TIM_CHANNEL, GPIO_TypeDef *GPIOx, uint32_t PWM_PIN);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span><span class="comment">/* Initialize OC Comparator */</span></div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span>HAL_StatusTypeDef <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___o_c.html#gae2608ca8023e9a0713af0b4fbfbc1889">TIM_OC_Comparator_Init</a>(TIM_HandleTypeDef *htim, uint32_t TIM_CHANNEL);<span class="comment"></span></div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span><span class="comment">/** MYLIBS_TIM_ENCODER</span></div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span><span class="comment"> * @}</span></div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span><span class="comment"> */</span></div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span><span class="comment"></span> </div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span><span class="comment">/** </span></div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span><span class="comment"> * @addtogroup MYLIBS_TIM_ENCODER Encoder tools</span></div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span><span class="comment"> * @ingroup MY_LIBS_TIM</span></div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span><span class="comment"> * @brief Функции для считывания энкодера</span></div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span><span class="comment"> * @par Пример использования:</span></div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span><span class="comment"> @code</span></div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span><span class="comment"> TIM_EncoderTypeDef henc1;</span></div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span><span class="comment"> TIM_HandleTypeDef htim4;</span></div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span><span class="comment"></span> </div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span><span class="comment"> // инициализация</span></div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span><span class="comment"> henc1.htim = &amp;htim4;</span></div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span><span class="comment"> henc1.GPIOx = GPIOA;</span></div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span><span class="comment"> henc1.GPIO_PIN_TI1 = GPIO_PIN_0;</span></div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span><span class="comment"> henc1.GPIO_PIN_TI2 = GPIO_PIN_1;</span></div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span><span class="comment"> TIM_Encoder_Init(&amp;henc1, &amp;htim4);</span></div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span><span class="comment"></span> </div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span><span class="comment"> // считывание энкодера и кнопки</span></div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span><span class="comment"> int16_t delta = TIM_Encoder_Read(&amp;henc1);</span></div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span><span class="comment"> setpoint_tmp += delta;</span></div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span><span class="comment"> if(TIM_Encoder_ReadSwitch(&amp;henc1))</span></div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span><span class="comment"> {</span></div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span><span class="comment"> setpoint = setpoint_tmp; // подтвердить новое значение</span></div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span><span class="comment"> }</span></div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span><span class="comment"> @endcode</span></div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span><span class="comment"> * @{</span></div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"> 288</span><span class="comment"> */</span></div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span><span class="comment">/* Initialize TIM Encoder functional */</span></div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span>HAL_StatusTypeDef <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r.html#ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc">TIM_Encoder_Init</a>(<a class="code hl_struct" href="struct_t_i_m___encoder_type_def.html">TIM_EncoderTypeDef</a> *henc1, TIM_HandleTypeDef *htim);</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span><span class="comment">/* Считать энкодер */</span></div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span>HAL_StatusTypeDef <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r.html#gac3bc6525f88c275e47eb864e6d567501">TIM_Encoder_Read</a>(<a class="code hl_struct" href="struct_t_i_m___encoder_type_def.html">TIM_EncoderTypeDef</a> *henc);</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span><span class="comment">/* Считать кнопку энкодера */</span></div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span><span class="keywordtype">int</span> <a class="code hl_function" href="group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r.html#ga117b795017e9e3a357ddefe323412761">TIM_Encoder_ReadSwitch</a>(<a class="code hl_struct" href="struct_t_i_m___encoder_type_def.html">TIM_EncoderTypeDef</a> *henc);<span class="comment"></span></div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span><span class="comment">/** MYLIBS_TIM_ENCODER</span></div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span><span class="comment"> * @}</span></div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span><span class="comment"> */</span><span class="comment"></span></div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span><span class="comment">///////////////////////////---FUNCTIONS---///////////////////////////</span></div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> </div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> </div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span><span class="preprocessor">#endif </span><span class="comment">// __TIM_GENERAL_H_</span></div>
<div class="ttc" id="ageneral__gpio_8h_html"><div class="ttname"><a href="general__gpio_8h.html">general_gpio.h</a></div><div class="ttdoc">Заголовочный файл для модуля инициализации портов и работы с ними.</div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___d_e_l_a_y_html_ga108637af414bff3373059273b815ce9b"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___d_e_l_a_y.html#ga108637af414bff3373059273b815ce9b">TIM_Delay_NonBlocking</a></div><div class="ttdeci">HAL_StatusTypeDef TIM_Delay_NonBlocking(TIM_HandleTypeDef *htim, uint16_t delay)</div><div class="ttdoc">Задержка в тиках таймера (неблокирующая).</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00382">general_tim.c:382</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___d_e_l_a_y_html_ga4c0dfde4e15f677600605348b4e97834"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___d_e_l_a_y.html#ga4c0dfde4e15f677600605348b4e97834">TIM_Delay_Start</a></div><div class="ttdeci">HAL_StatusTypeDef TIM_Delay_Start(TIM_HandleTypeDef *htim)</div><div class="ttdoc">Начать отсчет неблокирующей задержки.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00363">general_tim.c:363</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___d_e_l_a_y_html_ga88c552a133cb6e3015453cccab74c07e"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___d_e_l_a_y.html#ga88c552a133cb6e3015453cccab74c07e">TIM_Delay</a></div><div class="ttdeci">HAL_StatusTypeDef TIM_Delay(TIM_HandleTypeDef *htim, uint16_t delay)</div><div class="ttdoc">Задержка в тиках таймера (блокирующая).</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00337">general_tim.c:337</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_html_ga117b795017e9e3a357ddefe323412761"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r.html#ga117b795017e9e3a357ddefe323412761">TIM_Encoder_ReadSwitch</a></div><div class="ttdeci">int TIM_Encoder_ReadSwitch(TIM_EncoderTypeDef *henc)</div><div class="ttdoc">Считать кнопку энкодера.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00322">general_tim.c:322</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_html_ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r.html#ga8d16c3b7e7c6decc54c5c3d1a8bf0fbc">TIM_Encoder_Init</a></div><div class="ttdeci">HAL_StatusTypeDef TIM_Encoder_Init(TIM_EncoderTypeDef *henc1, TIM_HandleTypeDef *htim)</div><div class="ttdoc">Инициализация режима энкодер у таймера.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00168">general_tim.c:168</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r_html_gac3bc6525f88c275e47eb864e6d567501"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___e_n_c_o_d_e_r.html#gac3bc6525f88c275e47eb864e6d567501">TIM_Encoder_Read</a></div><div class="ttdeci">HAL_StatusTypeDef TIM_Encoder_Read(TIM_EncoderTypeDef *henc)</div><div class="ttdoc">Считать энкодер.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00303">general_tim.c:303</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ga7044214f24a9868ba7e1650b55e639ec"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ga7044214f24a9868ba7e1650b55e639ec">TIM_Base_Init</a></div><div class="ttdeci">HAL_StatusTypeDef TIM_Base_Init(TIM_SettingsTypeDef *stim)</div><div class="ttdoc">Инициализация таймера.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00034">general_tim.c:34</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ga879e3f1c919c02990736730275367115"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ga879e3f1c919c02990736730275367115">TIM_Base_MspDeInit</a></div><div class="ttdeci">void TIM_Base_MspDeInit(TIM_HandleTypeDef *htim)</div><div class="ttdoc">Деинициализация CLK и NVIC таймеров.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00617">general_tim.c:617</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_gaa0a51c870325217ac099881f09dd0800"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaa0a51c870325217ac099881f09dd0800">TIM_MHzTickBaseTypeDef</a></div><div class="ttdeci">TIM_MHzTickBaseTypeDef</div><div class="ttdoc">Длительность тика таймера (частота тактирования таймера)</div><div class="ttdef"><b>Definition</b> <a href="#l00091">general_tim.h:92</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_gaad47337be7ba2f6c0777c40d7278c931"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaad47337be7ba2f6c0777c40d7278c931">TIM_Base_MspInit</a></div><div class="ttdeci">void TIM_Base_MspInit(TIM_HandleTypeDef *htim, TIM_ITModeTypeDef it_mode)</div><div class="ttdoc">Инициализация CLK и NVIC таймеров.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00408">general_tim.c:408</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_gaeb611874216a4661fb83366b99b9e787"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#gaeb611874216a4661fb83366b99b9e787">TIM_ITModeTypeDef</a></div><div class="ttdeci">TIM_ITModeTypeDef</div><div class="ttdoc">Режим прерываний таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00077">general_tim.h:78</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a060b01e890891fd17c8f95b55a94139f">TIM_TickBase_10US</a></div><div class="ttdeci">@ TIM_TickBase_10US</div><div class="ttdoc">Таймер тактируется с частотой 100 кГц</div><div class="ttdef"><b>Definition</b> <a href="#l00095">general_tim.h:95</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a096ef0ab67788487f69d8877c6d89b30">TIM_TickBase_100US</a></div><div class="ttdeci">@ TIM_TickBase_100US</div><div class="ttdoc">Таймер тактируется с частотой 10 кГц</div><div class="ttdef"><b>Definition</b> <a href="#l00096">general_tim.h:96</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a18527a2d781eb4365aecd9a3184fc1da">TIM_TickBase_100MS</a></div><div class="ttdeci">@ TIM_TickBase_100MS</div><div class="ttdoc">Таймер тактируется с частотой 10 Гц</div><div class="ttdef"><b>Definition</b> <a href="#l00099">general_tim.h:99</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a63df3123d0ddc592b189ed1594456ea2">TIM_TickBase_1US</a></div><div class="ttdeci">@ TIM_TickBase_1US</div><div class="ttdoc">Таймер тактируется с частотой 1 МГц</div><div class="ttdef"><b>Definition</b> <a href="#l00094">general_tim.h:94</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a6a66c5ed1d966c9e30f0219b664d2b25">TIM_TickBase_1MS</a></div><div class="ttdeci">@ TIM_TickBase_1MS</div><div class="ttdoc">Таймер тактируется с частотой 1 кГц</div><div class="ttdef"><b>Definition</b> <a href="#l00097">general_tim.h:97</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800a7421a08abd119e71aa99eea5ab5d6daa">TIM_TickBase_10MS</a></div><div class="ttdeci">@ TIM_TickBase_10MS</div><div class="ttdoc">Таймер тактируется с частотой 100 Гц</div><div class="ttdef"><b>Definition</b> <a href="#l00098">general_tim.h:98</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaa0a51c870325217ac099881f09dd0800ae838122c0e83bc57ad31b546bf2f00e5">TIM_Base_Disable</a></div><div class="ttdeci">@ TIM_Base_Disable</div><div class="ttdoc">Таймер отключен</div><div class="ttdef"><b>Definition</b> <a href="#l00093">general_tim.h:93</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaeb611874216a4661fb83366b99b9e787a89ecf1ef6d45ead2efcb7dd30396114c">TIM_IT_MODE</a></div><div class="ttdeci">@ TIM_IT_MODE</div><div class="ttdoc">Прерываний включены</div><div class="ttdef"><b>Definition</b> <a href="#l00080">general_tim.h:80</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l_html_ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___g_e_n_e_r_a_l.html#ggaeb611874216a4661fb83366b99b9e787ab0869828a4dfd62eaa44868ca27835f8">TIM_DEFAULT</a></div><div class="ttdeci">@ TIM_DEFAULT</div><div class="ttdoc">Прерываний отключены</div><div class="ttdef"><b>Definition</b> <a href="#l00079">general_tim.h:79</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___o_c_html_gadb2f465d89f609e035867e980c3a29c6"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___o_c.html#gadb2f465d89f609e035867e980c3a29c6">TIM_Output_PWM_Init</a></div><div class="ttdeci">HAL_StatusTypeDef TIM_Output_PWM_Init(TIM_HandleTypeDef *htim, TIM_OC_InitTypeDef *sConfigOC, uint32_t TIM_CHANNEL, GPIO_TypeDef *GPIOx, uint32_t PWM_PIN)</div><div class="ttdoc">Инициализация выхода ШИМ таймера.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00226">general_tim.c:226</a></div></div>
<div class="ttc" id="agroup___m_y_l_i_b_s___t_i_m___o_c_html_gae2608ca8023e9a0713af0b4fbfbc1889"><div class="ttname"><a href="group___m_y_l_i_b_s___t_i_m___o_c.html#gae2608ca8023e9a0713af0b4fbfbc1889">TIM_OC_Comparator_Init</a></div><div class="ttdeci">HAL_StatusTypeDef TIM_OC_Comparator_Init(TIM_HandleTypeDef *htim, uint32_t TIM_CHANNEL)</div><div class="ttdoc">Инициализация OC компаратора таймера.</div><div class="ttdef"><b>Definition</b> <a href="general__tim_8c_source.html#l00272">general_tim.c:272</a></div></div>
<div class="ttc" id="amylibs__defs_8h_html"><div class="ttname"><a href="mylibs__defs_8h.html">mylibs_defs.h</a></div><div class="ttdoc">Заголочный файл для дефайнов библиотеки MyLibsGeneral.</div></div>
<div class="ttc" id="astruct_g_p_i_o___switch_type_def_html"><div class="ttname"><a href="struct_g_p_i_o___switch_type_def.html">GPIO_SwitchTypeDef</a></div><div class="ttdoc">Структура кнопки</div><div class="ttdef"><b>Definition</b> <a href="general__gpio_8h_source.html#l00090">general_gpio.h:91</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html">TIM_EncoderTypeDef</a></div><div class="ttdoc">Структура инициализации енкодера</div><div class="ttdef"><b>Definition</b> <a href="#l00141">general_tim.h:142</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_a021f0c585e9e62d68a4b09f630d8b6e5"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#a021f0c585e9e62d68a4b09f630d8b6e5">TIM_EncoderTypeDef::sConfig</a></div><div class="ttdeci">TIM_Encoder_InitTypeDef sConfig</div><div class="ttdoc">Указатель на структуру настройки энкодера</div><div class="ttdef"><b>Definition</b> <a href="#l00147">general_tim.h:147</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_a0dacce3dde7df3122583869d96a372a2"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#a0dacce3dde7df3122583869d96a372a2">TIM_EncoderTypeDef::Encoder_Shdw</a></div><div class="ttdeci">uint16_t Encoder_Shdw</div><div class="ttdoc">Последние считанные тики</div><div class="ttdef"><b>Definition</b> <a href="#l00144">general_tim.h:144</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_a4fc05ef011205a6702cb3d006bab677e"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#a4fc05ef011205a6702cb3d006bab677e">TIM_EncoderTypeDef::GPIO_PIN_TI1</a></div><div class="ttdeci">uint32_t GPIO_PIN_TI1</div><div class="ttdoc">Пин, куда подключается канал TI1.</div><div class="ttdef"><b>Definition</b> <a href="#l00150">general_tim.h:150</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_a67ad037b92162546763fc9c425b5e3c5"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#a67ad037b92162546763fc9c425b5e3c5">TIM_EncoderTypeDef::GPIO_PIN_TI2</a></div><div class="ttdeci">uint32_t GPIO_PIN_TI2</div><div class="ttdoc">Пин, куда подключается канал TI2.</div><div class="ttdef"><b>Definition</b> <a href="#l00151">general_tim.h:151</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_a6973108a83d2a3ea4fc3e0e8a501af80"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#a6973108a83d2a3ea4fc3e0e8a501af80">TIM_EncoderTypeDef::GPIO_PIN_SW</a></div><div class="ttdeci">uint32_t GPIO_PIN_SW</div><div class="ttdoc">Пин, куда кнопка энкодера (если есть)</div><div class="ttdef"><b>Definition</b> <a href="#l00152">general_tim.h:152</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_a6f769f027b760a4b496e2b2b77bf54a3"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#a6f769f027b760a4b496e2b2b77bf54a3">TIM_EncoderTypeDef::Encoder_Diff</a></div><div class="ttdeci">int16_t Encoder_Diff</div><div class="ttdoc">Считанная разница</div><div class="ttdef"><b>Definition</b> <a href="#l00143">general_tim.h:143</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_a99295760ff8b27d1e6f1710f29383a45"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#a99295760ff8b27d1e6f1710f29383a45">TIM_EncoderTypeDef::Sw</a></div><div class="ttdeci">GPIO_SwitchTypeDef Sw</div><div class="ttdoc">Структура кнопки</div><div class="ttdef"><b>Definition</b> <a href="#l00154">general_tim.h:154</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_ad29873fc8cdc71462e6d8744621120e9"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#ad29873fc8cdc71462e6d8744621120e9">TIM_EncoderTypeDef::GPIOx</a></div><div class="ttdeci">GPIO_TypeDef * GPIOx</div><div class="ttdoc">Порт, куда подключается энкодер</div><div class="ttdef"><b>Definition</b> <a href="#l00149">general_tim.h:149</a></div></div>
<div class="ttc" id="astruct_t_i_m___encoder_type_def_html_adc80bd5a90444c31d84157f35c59b95c"><div class="ttname"><a href="struct_t_i_m___encoder_type_def.html#adc80bd5a90444c31d84157f35c59b95c">TIM_EncoderTypeDef::htim</a></div><div class="ttdeci">TIM_HandleTypeDef * htim</div><div class="ttdoc">Указатель на HAL handle таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00146">general_tim.h:146</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html">TIM_SettingsTypeDef</a></div><div class="ttdoc">Структура инициализации таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00113">general_tim.h:114</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_a11151fe125960cb8e61328ffd06b7718"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#a11151fe125960cb8e61328ffd06b7718">TIM_SettingsTypeDef::sTickBasePrescaler</a></div><div class="ttdeci">uint8_t sTickBasePrescaler</div><div class="ttdoc">Дополнительный делитель, для удобного деления sTickBaseUS.</div><div class="ttdef"><b>Definition</b> <a href="#l00123">general_tim.h:123</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_a2d9d277dd395424b964445ec1bc65b21"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#a2d9d277dd395424b964445ec1bc65b21">TIM_SettingsTypeDef::sMasterConfig</a></div><div class="ttdeci">TIM_MasterConfigTypeDef sMasterConfig</div><div class="ttdoc">Настройки мастер режима таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00118">general_tim.h:118</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_a3805f627567798c3cd1d79a0da42bea0"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#a3805f627567798c3cd1d79a0da42bea0">TIM_SettingsTypeDef::sClockSourceConfig</a></div><div class="ttdeci">TIM_ClockConfigTypeDef sClockSourceConfig</div><div class="ttdoc">Настройки тактирования таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00116">general_tim.h:116</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_a58da1b4c0f6d12d7d9fb2f170b9b9e6e"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#a58da1b4c0f6d12d7d9fb2f170b9b9e6e">TIM_SettingsTypeDef::sTickBaseUS</a></div><div class="ttdeci">TIM_MHzTickBaseTypeDef sTickBaseUS</div><div class="ttdoc">Длительность одного тика</div><div class="ttdef"><b>Definition</b> <a href="#l00122">general_tim.h:122</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_a7073358fd3a722687eb85238ab570014"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#a7073358fd3a722687eb85238ab570014">TIM_SettingsTypeDef::sTimAHBFreqMHz</a></div><div class="ttdeci">float sTimAHBFreqMHz</div><div class="ttdoc">Частота шины тактирования таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00124">general_tim.h:124</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_a961f19f0e1672715c27bc94d7871dbb7"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#a961f19f0e1672715c27bc94d7871dbb7">TIM_SettingsTypeDef::sBreakDeadTimeConfig</a></div><div class="ttdeci">TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig</div><div class="ttdoc">Настройки дедтаймов таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00119">general_tim.h:119</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_a9694cf0910a69d48ff94f8aeac106969"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#a9694cf0910a69d48ff94f8aeac106969">TIM_SettingsTypeDef::sSlaveConfig</a></div><div class="ttdeci">TIM_SlaveConfigTypeDef sSlaveConfig</div><div class="ttdoc">Настройки слейв режима таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00117">general_tim.h:117</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_ab90e370c3edda88e76583293c250d2b0"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#ab90e370c3edda88e76583293c250d2b0">TIM_SettingsTypeDef::sTimMode</a></div><div class="ttdeci">TIM_ITModeTypeDef sTimMode</div><div class="ttdoc">Настройки прерывания таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00121">general_tim.h:121</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_ada49efdbd35a8e442c3cff630d42f34c"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#ada49efdbd35a8e442c3cff630d42f34c">TIM_SettingsTypeDef::htim</a></div><div class="ttdeci">TIM_HandleTypeDef htim</div><div class="ttdoc">HAL handle таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00115">general_tim.h:115</a></div></div>
<div class="ttc" id="astruct_t_i_m___settings_type_def_html_af6057ff3f60f5e01b41d4a347b79a5e4"><div class="ttname"><a href="struct_t_i_m___settings_type_def.html#af6057ff3f60f5e01b41d4a347b79a5e4">TIM_SettingsTypeDef::sTimFreqHz</a></div><div class="ttdeci">float sTimFreqHz</div><div class="ttdoc">Желаемая частота таймера</div><div class="ttdef"><b>Definition</b> <a href="#l00125">general_tim.h:125</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a href="dir_9e11e9a41112194af3eee6cc728f9515.html">MyLibsGeneral</a></li><li class="navelem"><a href="dir_eb423fea8a9c4b9b32b922020ec391e1.html">Inc</a></li><li class="navelem"><a href="general__tim_8h.html">general_tim.h</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
</ul>
</div>
</body>
</html>