Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
a61c4d726This file is pinned to the selected release. Download the original to open it in your design tool.
<!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DIY Logging Volt/Ampmeter: STM32F103C8T6_powermeter-interface/Core/Src/adc.c 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>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">DIY Logging Volt/Ampmeter
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',false,false,'search.php','Search');
});
/* @license-end */</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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('adc_8c_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">adc.c</div> </div>
</div><!--header-->
<div class="contents">
<a href="adc_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> ******************************************************************************</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * @file adc.c</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * @brief This file provides code for the configuration</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * of the ADC instances.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> ******************************************************************************</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * @attention</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * All rights reserved.</center></h2></span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * This software component is licensed by ST under BSD 3-Clause license,</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * the "License"; You may not use this file except in compliance with the</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * License. You may obtain a copy of the License at:</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * opensource.org/licenses/BSD-3-Clause</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> ******************************************************************************</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  </div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">/* Includes ------------------------------------------------------------------*/</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="adc_8h.html">adc.h</a>"</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">/* USER CODE BEGIN 0 */</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">// TODO Got example from https://github.com/STMicroelectronics/STM32CubeF1/tree/master/Projects/STM32F103RB-Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerSW_IT</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  </div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="SEGGER__RTT_8h.html">SEGGER_RTT.h</a>"</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="util_8h.html">util.h</a>"</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="conversion_8h.html">conversion.h</a>"</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  </div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment">/* Private typedef -----------------------------------------------------------*/</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">/* Private define ------------------------------------------------------------*/</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  </div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">/* Definitions of ADC hardware constraints delays */</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">/* Note: Only ADC IP HW delays are defined in ADC LL driver driver, */</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">/* not timeout values: */</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">/* Timeout values for ADC operations are dependent to device clock */</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">/* configuration (system clock versus ADC clock), */</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">/* and therefore must be defined in user application. */</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">/* Refer to @ref ADC_LL_EC_HW_DELAYS for description of ADC timeout */</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">/* values definition. */</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  </div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="comment">/* Timeout values for ADC operations. */</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="comment">/* (enable settling time, disable settling time, ...) */</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="comment">/* Values defined to be higher than worst cases: low clock frequency, */</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="comment">/* maximum prescalers. */</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="comment">/* Example of profile very low frequency : ADC clock frequency 12MHz */</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="comment">/* prescaler 6, sampling time 1.5 ADC clock cycles, resolution 12 bits. */</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="comment">/* - ADC enable time: maximum delay is 1 us */</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="comment">/* (refer to device datasheet, parameter "tSTAB") */</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">/* - ADC disable time: maximum delay should be a few ADC clock cycles */</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="comment">/* - ADC stop conversion time: maximum delay should be a few ADC clock */</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="comment">/* cycles */</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="comment">/* - ADC conversion time: with this hypothesis of clock settings, maximum */</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="comment">/* delay will be 7us. */</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="comment">/* (refer to device reference manual, section "Timing") */</span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="comment">/* Unit: ms */</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="adc_8c.html#a83fafc83fe94ab26162d8b6420d5cc22"> 59</a></span> <span class="preprocessor"> #define ADC_CALIBRATION_TIMEOUT_MS ((uint32_t) 1)</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="adc_8c.html#a06d33caf6933dc600cd1e7fa49739082"> 60</a></span> <span class="preprocessor"> #define ADC_ENABLE_TIMEOUT_MS ((uint32_t) 1)</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="adc_8c.html#a897f368ac3513254eebc3ed4f823e799"> 61</a></span> <span class="preprocessor"> #define ADC_DISABLE_TIMEOUT_MS ((uint32_t) 1)</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="adc_8c.html#a5e463da99974bafc12b3f01f7c0ff04c"> 62</a></span> <span class="preprocessor"> #define ADC_STOP_CONVERSION_TIMEOUT_MS ((uint32_t) 1)</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="adc_8c.html#a2cd8b7986735f470bfdd2340c81e4647"> 63</a></span> <span class="preprocessor"> #define ADC_CONVERSION_TIMEOUT_MS ((uint32_t) 2)</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  </div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="comment">/* Delay between ADC enable and ADC end of calibration. */</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="comment">/* Delay estimation in CPU cycles: Case of ADC calibration done */</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="comment">/* immediately after ADC enable, ADC clock setting slow */</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment">/* (LL_ADC_CLOCK_ASYNC_DIV32). Use a higher delay if ratio */</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="comment">/* (CPU clock / ADC clock) is above 32. */</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="adc_8c.html#a5a7ff3a87fd625aee30cdc438882808d"> 70</a></span> <span class="preprocessor"> #define ADC_DELAY_ENABLE_CALIB_CPU_CYCLES (LL_ADC_DELAY_ENABLE_CALIB_ADC_CYCLES * 32)</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  </div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  </div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment">/* Definitions of environment analog values */</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="comment">/* Value of analog reference voltage (Vref+), connected to analog voltage */</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="comment">/* supply Vdda (unit: mV). */</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="adc_8c.html#a773a2f94399984a865880e64f40a6172"> 76</a></span> <span class="preprocessor"> #define VDDA_APPLI ((uint32_t)3300)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  </div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment">/* Definitions of data related to this example */</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="comment">/* Init variable out of expected ADC conversion data range */</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="adc_8c.html#a282661c18968d3e21445df8a0f9aa133"> 80</a></span> <span class="preprocessor"> #define VAR_CONVERTED_DATA_INIT_VALUE (__LL_ADC_DIGITAL_SCALE(LL_ADC_RESOLUTION_12B) + 1)</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  </div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment">/* Private macro -------------------------------------------------------------*/</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment">/* Private variables ---------------------------------------------------------*/</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment">/* Value to add to the converted ADC voltage as a sort of calibration */</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="adc_8c.html#ad1db3a3aa5980bc80f76c9b1c882917d"> 86</a></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> <a class="code" href="adc_8c.html#ad1db3a3aa5980bc80f76c9b1c882917d">adcVoltReadoutCalbration</a> = 0.03;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  </div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="comment">/* Variables for ADC conversion data */</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="adc_8c.html#ab2a875c39ff7e245f2cb5e214ab022ee"> 89</a></span> <a class="code" href="core__armv8mbl_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint16_t <a class="code" href="adc_8c.html#ab2a875c39ff7e245f2cb5e214ab022ee">uhADCxConvertedData</a> = <a class="code" href="adc_8c.html#a282661c18968d3e21445df8a0f9aa133">VAR_CONVERTED_DATA_INIT_VALUE</a>; <span class="comment">/* ADC group regular conversion data */</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  </div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <span class="comment">/* Variables for ADC conversion data computation to physical values */</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="adc_8c.html#a6bdba988fece39131212dfb24914f38e"> 92</a></span> <a class="code" href="core__armv8mbl_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint16_t <a class="code" href="adc_8c.html#a6bdba988fece39131212dfb24914f38e">uhADCxConvertedData_Voltage_mVolt</a> = 0; <span class="comment">/* Value of voltage calculated from ADC conversion data (unit: mV) */</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="comment">/* Variable to report status of ADC group regular unitary conversion */</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="comment">/* 0: ADC group regular unitary conversion is not completed */</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment">/* 1: ADC group regular unitary conversion is completed */</span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment">/* 2: ADC group regular unitary conversion has not been started yet */</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment">/* (initial state) */</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="adc_8c.html#aa2462e1dd02f072d5ed9a6b9439153c6"> 99</a></span> <a class="code" href="core__armv8mbl_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint8_t <a class="code" href="adc_8c.html#aa2462e1dd02f072d5ed9a6b9439153c6">ubAdcGrpRegularUnitaryConvStatus</a> = 2; <span class="comment">/* Variable set into ADC interruption callback */</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  </div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="comment">/* USER CODE END 0 */</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  </div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="comment">/* ADC1 init function */</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="adc_8c.html#acccd58aa70215a6b184ad242312ffd0c"> 105</a></span> <span class="keywordtype">void</span> <a class="code" href="adc_8c.html#acccd58aa70215a6b184ad242312ffd0c">MX_ADC1_Init</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> {</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  LL_ADC_InitTypeDef ADC_InitStruct = {0};</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  LL_ADC_CommonInitTypeDef ADC_CommonInitStruct = {0};</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  LL_ADC_REG_InitTypeDef ADC_REG_InitStruct = {0};</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="comment">/* Peripheral clock enable */</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC1);</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  </div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  <span class="comment">/* ADC1 interrupt Init */</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <a class="code" href="group__CMSIS__Core__NVICFunctions.html#gae0e9d0e2f7b6133828c71b57d4941c35">NVIC_SetPriority</a>(<a class="code" href="group__Peripheral__interrupt__number__definition.html#gga7e1129cd8a196f4284d41db3e82ad5c8a19cf421347f52d547d370887640c158a">ADC1_2_IRQn</a>, <a class="code" href="group__CMSIS__Core__NVICFunctions.html#gadb94ac5d892b376e4f3555ae0418ebac">NVIC_EncodePriority</a>(<a class="code" href="group__CMSIS__Core__NVICFunctions.html#ga4eeb9214f2264fc23c34ad5de2d3fa11">NVIC_GetPriorityGrouping</a>(),0, 0));</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <a class="code" href="group__CMSIS__Core__NVICFunctions.html#ga57b3064413dbc7459d9646020fdd8bef">NVIC_EnableIRQ</a>(<a class="code" href="group__Peripheral__interrupt__number__definition.html#gga7e1129cd8a196f4284d41db3e82ad5c8a19cf421347f52d547d370887640c158a">ADC1_2_IRQn</a>);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"></span> </div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"> /** Common config</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  ADC_InitStruct.DataAlignment = LL_ADC_DATA_ALIGN_RIGHT;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  ADC_InitStruct.SequencersScanMode = LL_ADC_SEQ_SCAN_DISABLE;</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  LL_ADC_Init(<a class="code" href="group__Peripheral__declaration.html#ga90d2d5c526ce5c0a551f533eccbee71a">ADC1</a>, &ADC_InitStruct);</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  ADC_CommonInitStruct.Multimode = LL_ADC_MULTI_INDEPENDENT;</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  LL_ADC_CommonInit(__LL_ADC_COMMON_INSTANCE(<a class="code" href="group__Peripheral__declaration.html#ga90d2d5c526ce5c0a551f533eccbee71a">ADC1</a>), &ADC_CommonInitStruct);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  ADC_REG_InitStruct.TriggerSource = LL_ADC_REG_TRIG_SOFTWARE;</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  ADC_REG_InitStruct.SequencerLength = LL_ADC_REG_SEQ_SCAN_DISABLE;</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  ADC_REG_InitStruct.SequencerDiscont = LL_ADC_REG_SEQ_DISCONT_DISABLE;</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  ADC_REG_InitStruct.ContinuousMode = LL_ADC_REG_CONV_SINGLE;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  ADC_REG_InitStruct.DMATransfer = LL_ADC_REG_DMA_TRANSFER_NONE;</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  LL_ADC_REG_Init(<a class="code" href="group__Peripheral__declaration.html#ga90d2d5c526ce5c0a551f533eccbee71a">ADC1</a>, &ADC_REG_InitStruct);<span class="comment"></span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment"> /** Configure Regular Channel</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  LL_ADC_REG_SetSequencerRanks(<a class="code" href="group__Peripheral__declaration.html#ga90d2d5c526ce5c0a551f533eccbee71a">ADC1</a>, LL_ADC_REG_RANK_1, LL_ADC_CHANNEL_TEMPSENSOR);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  LL_ADC_SetChannelSamplingTime(<a class="code" href="group__Peripheral__declaration.html#ga90d2d5c526ce5c0a551f533eccbee71a">ADC1</a>, LL_ADC_CHANNEL_TEMPSENSOR, LL_ADC_SAMPLINGTIME_1CYCLE_5);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(<a class="code" href="group__Peripheral__declaration.html#ga90d2d5c526ce5c0a551f533eccbee71a">ADC1</a>), LL_ADC_PATH_INTERNAL_TEMPSENSOR);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span> }</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  </div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  </div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span> <span class="comment">/* ADC2 init function */</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="adc_8c.html#a101e2e3433dfe72bbbd0ae3a84489263"> 140</a></span> <span class="keywordtype">void</span> <a class="code" href="adc_8c.html#a101e2e3433dfe72bbbd0ae3a84489263">MX_ADC2_Init</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span> {</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  LL_ADC_InitTypeDef ADC_InitStruct = {0};</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  LL_ADC_REG_InitTypeDef ADC_REG_InitStruct = {0};</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  LL_GPIO_InitTypeDef GPIO_InitStruct = {0};</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  </div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="comment">/* Peripheral clock enable */</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC2);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  </div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB);<span class="comment"></span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="comment"> /**ADC2 GPIO Configuration</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> <span class="comment"> PB0 ------> ADC2_IN8</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  GPIO_InitStruct.Pin = LL_GPIO_PIN_0;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  LL_GPIO_Init(<a class="code" href="group__Peripheral__declaration.html#ga68b66ac73be4c836db878a42e1fea3cd">GPIOB</a>, &GPIO_InitStruct);</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  </div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="comment">/* ADC2 interrupt Init */</span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <a class="code" href="group__CMSIS__Core__NVICFunctions.html#gae0e9d0e2f7b6133828c71b57d4941c35">NVIC_SetPriority</a>(<a class="code" href="group__Peripheral__interrupt__number__definition.html#gga7e1129cd8a196f4284d41db3e82ad5c8a19cf421347f52d547d370887640c158a">ADC1_2_IRQn</a>, <a class="code" href="group__CMSIS__Core__NVICFunctions.html#gadb94ac5d892b376e4f3555ae0418ebac">NVIC_EncodePriority</a>(<a class="code" href="group__CMSIS__Core__NVICFunctions.html#ga4eeb9214f2264fc23c34ad5de2d3fa11">NVIC_GetPriorityGrouping</a>(),0, 0));</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <a class="code" href="group__CMSIS__Core__NVICFunctions.html#ga57b3064413dbc7459d9646020fdd8bef">NVIC_EnableIRQ</a>(<a class="code" href="group__Peripheral__interrupt__number__definition.html#gga7e1129cd8a196f4284d41db3e82ad5c8a19cf421347f52d547d370887640c158a">ADC1_2_IRQn</a>);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <span class="comment"></span> </div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span> <span class="comment"> /** Common config</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  ADC_InitStruct.DataAlignment = LL_ADC_DATA_ALIGN_RIGHT;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  ADC_InitStruct.SequencersScanMode = LL_ADC_SEQ_SCAN_DISABLE;</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  LL_ADC_Init(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>, &ADC_InitStruct);</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  ADC_REG_InitStruct.TriggerSource = LL_ADC_REG_TRIG_SOFTWARE;</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  ADC_REG_InitStruct.SequencerLength = LL_ADC_REG_SEQ_SCAN_DISABLE;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  ADC_REG_InitStruct.SequencerDiscont = LL_ADC_REG_SEQ_DISCONT_DISABLE;</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  ADC_REG_InitStruct.ContinuousMode = LL_ADC_REG_CONV_SINGLE;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  ADC_REG_InitStruct.DMATransfer = LL_ADC_REG_DMA_TRANSFER_NONE;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  LL_ADC_REG_Init(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>, &ADC_REG_InitStruct);<span class="comment"></span></div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span> <span class="comment"> /** Configure Regular Channel</span></div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  LL_ADC_REG_SetSequencerRanks(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>, LL_ADC_REG_RANK_1, LL_ADC_CHANNEL_8);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  LL_ADC_SetChannelSamplingTime(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>, LL_ADC_CHANNEL_8, LL_ADC_SAMPLINGTIME_1CYCLE_5);</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span> }</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span> <span class="comment">/* USER CODE BEGIN 1 */</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span> <span class="comment"></span> </div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span> <span class="comment"> * @brief Perform ADC activation procedure to make it ready to convert</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span> <span class="comment"> * (ADC instance: ADC2).</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> <span class="comment"> * @note Operations:</span></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span> <span class="comment"> * - ADC instance</span></div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span> <span class="comment"> * - Run ADC self calibration</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span> <span class="comment"> * - Enable ADC</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span> <span class="comment"> * - ADC group regular</span></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span> <span class="comment"> * none: ADC conversion start-stop to be performed</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span> <span class="comment"> * after this function</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span> <span class="comment"> * - ADC group injected</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span> <span class="comment"> * none: ADC conversion start-stop to be performed</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span> <span class="comment"> * after this function</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span> <span class="comment"> * @param None</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span> <span class="comment"> * @retval None</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"><a class="line" href="adc_8c.html#ac0aa640580894b00afb3c80b9f41d5a3"> 197</a></span> <span class="keywordtype">void</span> <a class="code" href="adc_8c.html#ac0aa640580894b00afb3c80b9f41d5a3">Activate_ADC</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span> {</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="comment">/* Increase sampling time */</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  LL_ADC_SetChannelSamplingTime(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>, LL_ADC_CHANNEL_8, LL_ADC_SAMPLINGTIME_28CYCLES_5);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  </div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="comment">/* Enable interruption ADC group regular end of unitary conversion */</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  LL_ADC_EnableIT_EOS(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  </div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  </div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="comment">/* Logic discribe in the note now follows */</span></div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <a class="code" href="core__armv8mbl_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a> uint32_t wait_loop_index = 0;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  </div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  uint32_t <a class="code" href="rtc_8c.html#ac32e3b19d6fb5d4056cebee773e128ed">Timeout</a> = 0; <span class="comment">/* Variable used for timeout management */</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  </div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="comment">/*## Operation on ADC hierarchical scope: ADC instance #####################*/</span></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  </div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  <span class="comment">/* Note: Hardware constraint (refer to description of the functions */</span></div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="comment">/* below): */</span></div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="comment">/* On this STM32 serie, setting of these features are not */</span></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="comment">/* conditioned to ADC state. */</span></div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="comment">/* However, in order to be compliant with other STM32 series */</span></div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="comment">/* and to show the best practice usages, ADC state is checked. */</span></div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="comment">/* Software can be optimized by removing some of these checks, if */</span></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="comment">/* they are not relevant considering previous settings and actions */</span></div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="comment">/* in user application. */</span></div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  <span class="keywordflow">if</span> (LL_ADC_IsEnabled(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>) == 0)</div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  {</div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="comment">/* Enable ADC */</span></div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  LL_ADC_Enable(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>);</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  </div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="comment">/* Delay between ADC enable and ADC start of calibration. */</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="comment">/* Note: Variable divided by 2 to compensate partially */</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="comment">/* CPU processing cycles (depends on compilation optimization). */</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  wait_loop_index = (<a class="code" href="adc_8c.html#a5a7ff3a87fd625aee30cdc438882808d">ADC_DELAY_ENABLE_CALIB_CPU_CYCLES</a> >> 1);</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="keywordflow">while</span> (wait_loop_index != 0) wait_loop_index--;</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  </div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="comment">/* Run ADC self calibration */</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  LL_ADC_StartCalibration(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>);</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  </div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="comment">/* Poll for ADC effectively calibrated */</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <a class="code" href="rtc_8c.html#ac32e3b19d6fb5d4056cebee773e128ed">Timeout</a> = <a class="code" href="adc_8c.html#a83fafc83fe94ab26162d8b6420d5cc22">ADC_CALIBRATION_TIMEOUT_MS</a>;</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  </div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keywordflow">while</span> (LL_ADC_IsCalibrationOnGoing(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>) != 0)</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  {</div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="comment">/* Check Systick counter flag to decrement the time-out value */</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="keywordflow">if</span> (<a class="code" href="group__CORTEX__LL__EF__SYSTICK.html#gaf5dfb37d859552753594f9cc66431ba6">LL_SYSTICK_IsActiveCounterFlag</a>())</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  {</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keywordflow">if</span> (<a class="code" href="rtc_8c.html#ac32e3b19d6fb5d4056cebee773e128ed">Timeout</a>-- == 0) <span class="keywordflow">while</span> (1); <span class="comment">/* Time-out occurred */</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  }</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  }</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  }</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  </div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="comment">/*## Operation on ADC hierarchical scope: ADC group regular ################*/</span></div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  <span class="comment">/* Note: No operation on ADC group regular performed here. */</span></div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="comment">/* ADC group regular conversions to be performed after this function */</span></div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="comment">/* using function: */</span></div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="comment">/* "LL_ADC_REG_StartConversion();" */</span></div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  </div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="comment">/*## Operation on ADC hierarchical scope: ADC group injected ###############*/</span></div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="comment">/* Note: No operation on ADC group injected performed here. */</span></div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="comment">/* ADC group injected conversions to be performed after this function */</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="comment">/* using function: */</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="comment">/* "LL_ADC_INJ_StartConversion();" */</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  </div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span> }</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  </div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  </div>
<div class="line"><a name="l00264"></a><span class="lineno"><a class="line" href="adc_8c.html#a61aef7b164db37436193cbf93475659f"> 264</a></span> <span class="keywordtype">void</span> <a class="code" href="adc_8c.html#a61aef7b164db37436193cbf93475659f">startBattVoltMeasurement</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span> {</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <span class="comment">/* Reset status variable of ADC group regular unitary conversion before */</span></div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="comment">/* performing a new ADC group regular conversion start. */</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="comment">/* Note: Optionally, for this example purpose, check ADC unitary */</span></div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="comment">/* conversion status before starting another ADC conversion. */</span></div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  </div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordflow">if</span> (<a class="code" href="adc_8c.html#aa2462e1dd02f072d5ed9a6b9439153c6">ubAdcGrpRegularUnitaryConvStatus</a> != 0)</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  {</div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <a class="code" href="adc_8c.html#aa2462e1dd02f072d5ed9a6b9439153c6">ubAdcGrpRegularUnitaryConvStatus</a> = 0;</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  }</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  {</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="comment">/* Error: Previous action (ADC conversion or DMA transfer) not yet */</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="comment">/* completed. */</span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="keywordflow">while</span> (1);</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  }</div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  </div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  <span class="comment">/* Init variable containing ADC conversion data */</span></div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <a class="code" href="adc_8c.html#ab2a875c39ff7e245f2cb5e214ab022ee">uhADCxConvertedData</a> = <a class="code" href="adc_8c.html#a282661c18968d3e21445df8a0f9aa133">VAR_CONVERTED_DATA_INIT_VALUE</a>;</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  </div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="comment">/* Start ADC group regular conversion */</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="comment">/* Note: Hardware constraint (refer to description of the functions */</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  <span class="comment">/* below): */</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <span class="comment">/* On this STM32 serie, setting of these features are not */</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  <span class="comment">/* conditioned to ADC state. */</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="comment">/* However, in order to be compliant with other STM32 series */</span></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  <span class="comment">/* and to show the best practice usages, ADC state is checked. */</span></div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  <span class="comment">/* Software can be optimized by removing some of these checks, if */</span></div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="comment">/* they are not relevant considering previous settings and actions */</span></div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="comment">/* in user application. */</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <span class="keywordflow">if</span> (LL_ADC_IsEnabled(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>) == 1) LL_ADC_REG_StartConversionSWStart(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>);</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="keywordflow">else</span></div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  {</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="comment">/* Error: ADC conversion start could not be performed */</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordflow">while</span>(1);</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  }</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  </div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span> }</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  </div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> <span class="comment"></span> </div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span> <span class="comment"> * @brief ADC group regular end of unitary conversion interruption callback</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span> <span class="comment"> * @note This function is executed when the ADC group regular</span></div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span> <span class="comment"> * sequencer has converted one rank of the sequence.</span></div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span> <span class="comment"> * Therefore, this function is executed as many times as number</span></div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span> <span class="comment"> * of ranks in the sequence.</span></div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span> <span class="comment"> * @retval None</span></div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00313"></a><span class="lineno"><a class="line" href="adc_8c.html#a82dd342d00d066ee6abb6a9e3e87215f"> 313</a></span> <span class="keywordtype">void</span> <a class="code" href="adc_8c.html#a82dd342d00d066ee6abb6a9e3e87215f">AdcGrpRegularUnitaryConvComplete_Callback</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span> {</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <span class="comment">/* Retrieve ADC conversion data */</span></div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="comment">/* (data maximum amplitude corresponds to ADC resolution: 12 bits) */</span></div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <a class="code" href="adc_8c.html#ab2a875c39ff7e245f2cb5e214ab022ee">uhADCxConvertedData</a> = LL_ADC_REG_ReadConversionData12(<a class="code" href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a>);</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  </div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="comment">/* Computation of ADC conversions raw data to physical values */</span></div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="comment">/* using LL ADC driver helper macro. */</span></div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <a class="code" href="adc_8c.html#a6bdba988fece39131212dfb24914f38e">uhADCxConvertedData_Voltage_mVolt</a> = __LL_ADC_CALC_DATA_TO_VOLTAGE(<a class="code" href="adc_8c.html#a773a2f94399984a865880e64f40a6172">VDDA_APPLI</a>, <a class="code" href="adc_8c.html#ab2a875c39ff7e245f2cb5e214ab022ee">uhADCxConvertedData</a>, LL_ADC_RESOLUTION_12B);</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  </div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="comment">/* Update status variable of ADC unitary conversion */</span></div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <a class="code" href="adc_8c.html#aa2462e1dd02f072d5ed9a6b9439153c6">ubAdcGrpRegularUnitaryConvStatus</a> = 1;</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  </div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="comment">/* Calculate real voltage */</span></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <a class="code" href="conversion_8h.html#a47ab28c40b7f9b4c052ce56dc1ab27e2">settings</a>.<a class="code" href="structSettings__t.html#a40f0ecbd00ba9da8670c339a9cc616fe">vbat</a> = ((<a class="code" href="adc_8c.html#a6bdba988fece39131212dfb24914f38e">uhADCxConvertedData_Voltage_mVolt</a> * 0.001) * 3.2) / 2.2; <span class="comment">/* Voltage divider of 1kohm and 2.2kohm */</span></div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  </div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="comment">/* Read voltage tends to be 0.03V lower so add this value manually (~calibration) */</span></div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <a class="code" href="conversion_8h.html#a47ab28c40b7f9b4c052ce56dc1ab27e2">settings</a>.<a class="code" href="structSettings__t.html#a40f0ecbd00ba9da8670c339a9cc616fe">vbat</a> += <a class="code" href="adc_8c.html#ad1db3a3aa5980bc80f76c9b1c882917d">adcVoltReadoutCalbration</a>;</div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  </div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span> <span class="comment">// SEGGER_RTT_printf(0, "ADC = %u mV vbat = %u mV\n\r", uhADCxConvertedData_Voltage_mVolt, (uint16_t)(settings.vbat * 1000));</span></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  </div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <span class="comment">/* Signal logic that the battery voltage needs to be converted */</span></div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <a class="code" href="conversion_8h.html#a47ab28c40b7f9b4c052ce56dc1ab27e2">settings</a>.<a class="code" href="structSettings__t.html#aaaaef4ebd837f5b0928a3f8b2e3e8f2f">newVbat</a> = 1;</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span> }</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  </div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span> <span class="comment">/* USER CODE END 1 */</span></div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  </div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span> <span class="comment">/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aadc_8c_html_a83fafc83fe94ab26162d8b6420d5cc22"><div class="ttname"><a href="adc_8c.html#a83fafc83fe94ab26162d8b6420d5cc22">ADC_CALIBRATION_TIMEOUT_MS</a></div><div class="ttdeci">#define ADC_CALIBRATION_TIMEOUT_MS</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00059">adc.c:59</a></div></div>
<div class="ttc" id="aadc_8c_html_aa2462e1dd02f072d5ed9a6b9439153c6"><div class="ttname"><a href="adc_8c.html#aa2462e1dd02f072d5ed9a6b9439153c6">ubAdcGrpRegularUnitaryConvStatus</a></div><div class="ttdeci">__IO uint8_t ubAdcGrpRegularUnitaryConvStatus</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00099">adc.c:99</a></div></div>
<div class="ttc" id="artc_8c_html_ac32e3b19d6fb5d4056cebee773e128ed"><div class="ttname"><a href="rtc_8c.html#ac32e3b19d6fb5d4056cebee773e128ed">Timeout</a></div><div class="ttdeci">static uint32_t Timeout</div><div class="ttdef"><b>Definition:</b> <a href="rtc_8c_source.html#l00085">rtc.c:85</a></div></div>
<div class="ttc" id="aconversion_8h_html_a47ab28c40b7f9b4c052ce56dc1ab27e2"><div class="ttname"><a href="conversion_8h.html#a47ab28c40b7f9b4c052ce56dc1ab27e2">settings</a></div><div class="ttdeci">struct Settings_t settings</div></div>
<div class="ttc" id="agroup__CMSIS__Core__NVICFunctions_html_ga4eeb9214f2264fc23c34ad5de2d3fa11"><div class="ttname"><a href="group__CMSIS__Core__NVICFunctions.html#ga4eeb9214f2264fc23c34ad5de2d3fa11">NVIC_GetPriorityGrouping</a></div><div class="ttdeci">#define NVIC_GetPriorityGrouping</div><div class="ttdef"><b>Definition:</b> <a href="core__armv8mbl_8h_source.html#l01189">core_armv8mbl.h:1189</a></div></div>
<div class="ttc" id="aadc_8c_html_a6bdba988fece39131212dfb24914f38e"><div class="ttname"><a href="adc_8c.html#a6bdba988fece39131212dfb24914f38e">uhADCxConvertedData_Voltage_mVolt</a></div><div class="ttdeci">__IO uint16_t uhADCxConvertedData_Voltage_mVolt</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00092">adc.c:92</a></div></div>
<div class="ttc" id="aadc_8c_html_a5a7ff3a87fd625aee30cdc438882808d"><div class="ttname"><a href="adc_8c.html#a5a7ff3a87fd625aee30cdc438882808d">ADC_DELAY_ENABLE_CALIB_CPU_CYCLES</a></div><div class="ttdeci">#define ADC_DELAY_ENABLE_CALIB_CPU_CYCLES</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00070">adc.c:70</a></div></div>
<div class="ttc" id="aadc_8c_html_a61aef7b164db37436193cbf93475659f"><div class="ttname"><a href="adc_8c.html#a61aef7b164db37436193cbf93475659f">startBattVoltMeasurement</a></div><div class="ttdeci">void startBattVoltMeasurement(void)</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00264">adc.c:264</a></div></div>
<div class="ttc" id="aadc_8c_html_ab2a875c39ff7e245f2cb5e214ab022ee"><div class="ttname"><a href="adc_8c.html#ab2a875c39ff7e245f2cb5e214ab022ee">uhADCxConvertedData</a></div><div class="ttdeci">__IO uint16_t uhADCxConvertedData</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00089">adc.c:89</a></div></div>
<div class="ttc" id="agroup__CORTEX__LL__EF__SYSTICK_html_gaf5dfb37d859552753594f9cc66431ba6"><div class="ttname"><a href="group__CORTEX__LL__EF__SYSTICK.html#gaf5dfb37d859552753594f9cc66431ba6">LL_SYSTICK_IsActiveCounterFlag</a></div><div class="ttdeci">__STATIC_INLINE uint32_t LL_SYSTICK_IsActiveCounterFlag(void)</div><div class="ttdoc">This function checks if the Systick counter flag is active or not.</div><div class="ttdef"><b>Definition:</b> <a href="stm32f1xx__ll__cortex_8h_source.html#l00231">stm32f1xx_ll_cortex.h:231</a></div></div>
<div class="ttc" id="agroup__CMSIS__Core__NVICFunctions_html_gadb94ac5d892b376e4f3555ae0418ebac"><div class="ttname"><a href="group__CMSIS__Core__NVICFunctions.html#gadb94ac5d892b376e4f3555ae0418ebac">NVIC_EncodePriority</a></div><div class="ttdeci">__STATIC_INLINE uint32_t NVIC_EncodePriority(uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)</div><div class="ttdoc">Encode Priority.</div><div class="ttdef"><b>Definition:</b> <a href="core__armv8mbl_8h_source.html#l01496">core_armv8mbl.h:1496</a></div></div>
<div class="ttc" id="aadc_8h_html"><div class="ttname"><a href="adc_8h.html">adc.h</a></div><div class="ttdoc">This file contains all the function prototypes for the adc.c file.</div></div>
<div class="ttc" id="aadc_8c_html_a282661c18968d3e21445df8a0f9aa133"><div class="ttname"><a href="adc_8c.html#a282661c18968d3e21445df8a0f9aa133">VAR_CONVERTED_DATA_INIT_VALUE</a></div><div class="ttdeci">#define VAR_CONVERTED_DATA_INIT_VALUE</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00080">adc.c:80</a></div></div>
<div class="ttc" id="agroup__Peripheral__interrupt__number__definition_html_gga7e1129cd8a196f4284d41db3e82ad5c8a19cf421347f52d547d370887640c158a"><div class="ttname"><a href="group__Peripheral__interrupt__number__definition.html#gga7e1129cd8a196f4284d41db3e82ad5c8a19cf421347f52d547d370887640c158a">ADC1_2_IRQn</a></div><div class="ttdeci">@ ADC1_2_IRQn</div><div class="ttdef"><b>Definition:</b> <a href="stm32f103xb_8h_source.html#l00101">stm32f103xb.h:101</a></div></div>
<div class="ttc" id="aadc_8c_html_ad1db3a3aa5980bc80f76c9b1c882917d"><div class="ttname"><a href="adc_8c.html#ad1db3a3aa5980bc80f76c9b1c882917d">adcVoltReadoutCalbration</a></div><div class="ttdeci">static const float adcVoltReadoutCalbration</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00086">adc.c:86</a></div></div>
<div class="ttc" id="agroup__Peripheral__declaration_html_ga90d2d5c526ce5c0a551f533eccbee71a"><div class="ttname"><a href="group__Peripheral__declaration.html#ga90d2d5c526ce5c0a551f533eccbee71a">ADC1</a></div><div class="ttdeci">#define ADC1</div><div class="ttdef"><b>Definition:</b> <a href="stm32f103xb_8h_source.html#l00670">stm32f103xb.h:670</a></div></div>
<div class="ttc" id="aadc_8c_html_ac0aa640580894b00afb3c80b9f41d5a3"><div class="ttname"><a href="adc_8c.html#ac0aa640580894b00afb3c80b9f41d5a3">Activate_ADC</a></div><div class="ttdeci">void Activate_ADC(void)</div><div class="ttdoc">Perform ADC activation procedure to make it ready to convert (ADC instance: ADC2).</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00197">adc.c:197</a></div></div>
<div class="ttc" id="aconversion_8h_html"><div class="ttname"><a href="conversion_8h.html">conversion.h</a></div><div class="ttdoc">Conversion and settings-related methods and structs for high-precision logging voltage/current meter.</div></div>
<div class="ttc" id="agroup__Peripheral__declaration_html_ga68b66ac73be4c836db878a42e1fea3cd"><div class="ttname"><a href="group__Peripheral__declaration.html#ga68b66ac73be4c836db878a42e1fea3cd">GPIOB</a></div><div class="ttdeci">#define GPIOB</div><div class="ttdef"><b>Definition:</b> <a href="stm32f103xb_8h_source.html#l00666">stm32f103xb.h:666</a></div></div>
<div class="ttc" id="acore__armv8mbl_8h_html_aec43007d9998a0a0e01faede4133d6be"><div class="ttname"><a href="core__armv8mbl_8h.html#aec43007d9998a0a0e01faede4133d6be">__IO</a></div><div class="ttdeci">#define __IO</div><div class="ttdef"><b>Definition:</b> <a href="core__armv8mbl_8h_source.html#l00196">core_armv8mbl.h:196</a></div></div>
<div class="ttc" id="aadc_8c_html_a101e2e3433dfe72bbbd0ae3a84489263"><div class="ttname"><a href="adc_8c.html#a101e2e3433dfe72bbbd0ae3a84489263">MX_ADC2_Init</a></div><div class="ttdeci">void MX_ADC2_Init(void)</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00140">adc.c:140</a></div></div>
<div class="ttc" id="agroup__CMSIS__Core__NVICFunctions_html_gae0e9d0e2f7b6133828c71b57d4941c35"><div class="ttname"><a href="group__CMSIS__Core__NVICFunctions.html#gae0e9d0e2f7b6133828c71b57d4941c35">NVIC_SetPriority</a></div><div class="ttdeci">#define NVIC_SetPriority</div><div class="ttdef"><b>Definition:</b> <a href="core__armv8mbl_8h_source.html#l01197">core_armv8mbl.h:1197</a></div></div>
<div class="ttc" id="aadc_8c_html_a82dd342d00d066ee6abb6a9e3e87215f"><div class="ttname"><a href="adc_8c.html#a82dd342d00d066ee6abb6a9e3e87215f">AdcGrpRegularUnitaryConvComplete_Callback</a></div><div class="ttdeci">void AdcGrpRegularUnitaryConvComplete_Callback(void)</div><div class="ttdoc">ADC group regular end of unitary conversion interruption callback.</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00313">adc.c:313</a></div></div>
<div class="ttc" id="agroup__CMSIS__Core__NVICFunctions_html_ga57b3064413dbc7459d9646020fdd8bef"><div class="ttname"><a href="group__CMSIS__Core__NVICFunctions.html#ga57b3064413dbc7459d9646020fdd8bef">NVIC_EnableIRQ</a></div><div class="ttdeci">#define NVIC_EnableIRQ</div><div class="ttdef"><b>Definition:</b> <a href="core__armv8mbl_8h_source.html#l01190">core_armv8mbl.h:1190</a></div></div>
<div class="ttc" id="aadc_8c_html_acccd58aa70215a6b184ad242312ffd0c"><div class="ttname"><a href="adc_8c.html#acccd58aa70215a6b184ad242312ffd0c">MX_ADC1_Init</a></div><div class="ttdeci">void MX_ADC1_Init(void)</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00105">adc.c:105</a></div></div>
<div class="ttc" id="agroup__Peripheral__declaration_html_gac5503ae96c26b4475226f96715a1bf1e"><div class="ttname"><a href="group__Peripheral__declaration.html#gac5503ae96c26b4475226f96715a1bf1e">ADC2</a></div><div class="ttdeci">#define ADC2</div><div class="ttdef"><b>Definition:</b> <a href="stm32f103xb_8h_source.html#l00671">stm32f103xb.h:671</a></div></div>
<div class="ttc" id="aSEGGER__RTT_8h_html"><div class="ttname"><a href="SEGGER__RTT_8h.html">SEGGER_RTT.h</a></div></div>
<div class="ttc" id="astructSettings__t_html_a40f0ecbd00ba9da8670c339a9cc616fe"><div class="ttname"><a href="structSettings__t.html#a40f0ecbd00ba9da8670c339a9cc616fe">Settings_t::vbat</a></div><div class="ttdeci">volatile float vbat</div><div class="ttdef"><b>Definition:</b> <a href="conversion_8h_source.html#l00139">conversion.h:139</a></div></div>
<div class="ttc" id="astructSettings__t_html_aaaaef4ebd837f5b0928a3f8b2e3e8f2f"><div class="ttname"><a href="structSettings__t.html#aaaaef4ebd837f5b0928a3f8b2e3e8f2f">Settings_t::newVbat</a></div><div class="ttdeci">volatile uint8_t newVbat</div><div class="ttdef"><b>Definition:</b> <a href="conversion_8h_source.html#l00140">conversion.h:140</a></div></div>
<div class="ttc" id="autil_8h_html"><div class="ttname"><a href="util_8h.html">util.h</a></div><div class="ttdoc">Utility functionality for high-precision logging voltage/current meter.</div></div>
<div class="ttc" id="aadc_8c_html_a773a2f94399984a865880e64f40a6172"><div class="ttname"><a href="adc_8c.html#a773a2f94399984a865880e64f40a6172">VDDA_APPLI</a></div><div class="ttdeci">#define VDDA_APPLI</div><div class="ttdef"><b>Definition:</b> <a href="adc_8c_source.html#l00076">adc.c:76</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_4e5f16ccb0512908371dae1ef268cc7e.html">STM32F103C8T6_powermeter-interface</a></li><li class="navelem"><a class="el" href="dir_d3d6b284553cfaba32c11712cc550725.html">Core</a></li><li class="navelem"><a class="el" href="dir_6185d3036c2b6b09746b0c6dc781bc09.html">Src</a></li><li class="navelem"><a class="el" href="adc_8c.html">adc.c</a></li>
<li class="footer">Generated on Mon Dec 13 2021 16:18:48 for DIY Logging Volt/Ampmeter by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
</ul>
</div>
</body>
</html>