Prusa MINI Firmware overview
|
Go to the documentation of this file.
37 #ifndef __STM32F4xx_ADC_EX_H
38 #define __STM32F4xx_ADC_EX_H
153 #define ADC_MODE_INDEPENDENT 0x00000000U
154 #define ADC_DUALMODE_REGSIMULT_INJECSIMULT ((uint32_t)ADC_CCR_MULTI_0)
155 #define ADC_DUALMODE_REGSIMULT_ALTERTRIG ((uint32_t)ADC_CCR_MULTI_1)
156 #define ADC_DUALMODE_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_0))
157 #define ADC_DUALMODE_REGSIMULT ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1))
158 #define ADC_DUALMODE_INTERL ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1 | ADC_CCR_MULTI_0))
159 #define ADC_DUALMODE_ALTERTRIG ((uint32_t)(ADC_CCR_MULTI_3 | ADC_CCR_MULTI_0))
160 #define ADC_TRIPLEMODE_REGSIMULT_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_0))
161 #define ADC_TRIPLEMODE_REGSIMULT_AlterTrig ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_1))
162 #define ADC_TRIPLEMODE_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_0))
163 #define ADC_TRIPLEMODE_REGSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1))
164 #define ADC_TRIPLEMODE_INTERL ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1 | ADC_CCR_MULTI_0))
165 #define ADC_TRIPLEMODE_ALTERTRIG ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_3 | ADC_CCR_MULTI_0))
173 #define ADC_DMAACCESSMODE_DISABLED 0x00000000U
174 #define ADC_DMAACCESSMODE_1 ((uint32_t)ADC_CCR_DMA_0)
175 #define ADC_DMAACCESSMODE_2 ((uint32_t)ADC_CCR_DMA_1)
176 #define ADC_DMAACCESSMODE_3 ((uint32_t)ADC_CCR_DMA)
184 #define ADC_EXTERNALTRIGINJECCONVEDGE_NONE 0x00000000U
185 #define ADC_EXTERNALTRIGINJECCONVEDGE_RISING ((uint32_t)ADC_CR2_JEXTEN_0)
186 #define ADC_EXTERNALTRIGINJECCONVEDGE_FALLING ((uint32_t)ADC_CR2_JEXTEN_1)
187 #define ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING ((uint32_t)ADC_CR2_JEXTEN)
195 #define ADC_EXTERNALTRIGINJECCONV_T1_CC4 0x00000000U
196 #define ADC_EXTERNALTRIGINJECCONV_T1_TRGO ((uint32_t)ADC_CR2_JEXTSEL_0)
197 #define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ((uint32_t)ADC_CR2_JEXTSEL_1)
198 #define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
199 #define ADC_EXTERNALTRIGINJECCONV_T3_CC2 ((uint32_t)ADC_CR2_JEXTSEL_2)
200 #define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0))
201 #define ADC_EXTERNALTRIGINJECCONV_T4_CC1 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1))
202 #define ADC_EXTERNALTRIGINJECCONV_T4_CC2 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
203 #define ADC_EXTERNALTRIGINJECCONV_T4_CC3 ((uint32_t)ADC_CR2_JEXTSEL_3)
204 #define ADC_EXTERNALTRIGINJECCONV_T4_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_0))
205 #define ADC_EXTERNALTRIGINJECCONV_T5_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_1))
206 #define ADC_EXTERNALTRIGINJECCONV_T5_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
207 #define ADC_EXTERNALTRIGINJECCONV_T8_CC2 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2))
208 #define ADC_EXTERNALTRIGINJECCONV_T8_CC3 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0))
209 #define ADC_EXTERNALTRIGINJECCONV_T8_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1))
210 #define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ((uint32_t)ADC_CR2_JEXTSEL)
211 #define ADC_INJECTED_SOFTWARE_START ((uint32_t)ADC_CR2_JEXTSEL + 1U)
219 #define ADC_INJECTED_RANK_1 0x00000001U
220 #define ADC_INJECTED_RANK_2 0x00000002U
221 #define ADC_INJECTED_RANK_3 0x00000003U
222 #define ADC_INJECTED_RANK_4 0x00000004U
230 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
231 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) || \
232 defined(STM32F410Rx) || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || \
234 #define ADC_CHANNEL_TEMPSENSOR ((uint32_t)ADC_CHANNEL_16)
238 #if defined(STM32F413xx) || defined(STM32F423xx)
239 #define ADC_CHANNEL_TEMPSENSOR ((uint32_t)ADC_CHANNEL_18)
242 #if defined(STM32F411xE) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
243 defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
244 #define ADC_CHANNEL_DIFFERENCIATION_TEMPSENSOR_VBAT 0x10000000U
245 #define ADC_CHANNEL_TEMPSENSOR ((uint32_t)ADC_CHANNEL_18 | ADC_CHANNEL_DIFFERENCIATION_TEMPSENSOR_VBAT)
260 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx)
272 #define __HAL_ADC_PATH_INTERNAL_VBAT_DISABLE() (ADC->CCR &= ~(ADC_CCR_VBATE))
325 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
326 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) || \
327 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F412Zx) || defined(STM32F412Vx) || \
328 defined(STM32F412Rx) || defined(STM32F412Cx) || defined(STM32F413xx) || defined(STM32F423xx)
329 #define IS_ADC_CHANNEL(CHANNEL) ((CHANNEL) <= ADC_CHANNEL_18)
333 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
334 defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
335 #define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) <= ADC_CHANNEL_18) || \
336 ((CHANNEL) == ADC_CHANNEL_TEMPSENSOR))
339 #define IS_ADC_MODE(MODE) (((MODE) == ADC_MODE_INDEPENDENT) || \
340 ((MODE) == ADC_DUALMODE_REGSIMULT_INJECSIMULT) || \
341 ((MODE) == ADC_DUALMODE_REGSIMULT_ALTERTRIG) || \
342 ((MODE) == ADC_DUALMODE_INJECSIMULT) || \
343 ((MODE) == ADC_DUALMODE_REGSIMULT) || \
344 ((MODE) == ADC_DUALMODE_INTERL) || \
345 ((MODE) == ADC_DUALMODE_ALTERTRIG) || \
346 ((MODE) == ADC_TRIPLEMODE_REGSIMULT_INJECSIMULT) || \
347 ((MODE) == ADC_TRIPLEMODE_REGSIMULT_AlterTrig) || \
348 ((MODE) == ADC_TRIPLEMODE_INJECSIMULT) || \
349 ((MODE) == ADC_TRIPLEMODE_REGSIMULT) || \
350 ((MODE) == ADC_TRIPLEMODE_INTERL) || \
351 ((MODE) == ADC_TRIPLEMODE_ALTERTRIG))
352 #define IS_ADC_DMA_ACCESS_MODE(MODE) (((MODE) == ADC_DMAACCESSMODE_DISABLED) || \
353 ((MODE) == ADC_DMAACCESSMODE_1) || \
354 ((MODE) == ADC_DMAACCESSMODE_2) || \
355 ((MODE) == ADC_DMAACCESSMODE_3))
356 #define IS_ADC_EXT_INJEC_TRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_NONE) || \
357 ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISING) || \
358 ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_FALLING) || \
359 ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING))
360 #define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \
361 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \
362 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \
363 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \
364 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC2) || \
365 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \
366 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC1) || \
367 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC2) || \
368 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \
369 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \
370 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_CC4) || \
371 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_TRGO) || \
372 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \
373 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC3) || \
374 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \
375 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15)|| \
376 ((INJTRIG) == ADC_INJECTED_SOFTWARE_START))
377 #define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= 1U) && ((LENGTH) <= 4U))
378 #define IS_ADC_INJECTED_RANK(RANK) (((RANK) >= 1U) && ((RANK) <= 4U))
387 #define ADC_JSQR(_CHANNELNB_, _RANKNB_, _JSQR_JL_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5U * (uint8_t)(((_RANKNB_) + 3U) - (_JSQR_JL_))))
395 #if defined(STM32F405xx) || defined(STM32F407xx) || defined(STM32F415xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F429xx) || defined(STM32F437xx) || defined(STM32F439xx) || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
396 #define ADC_COMMON_REGISTER(__HANDLE__) ADC123_COMMON
398 #define ADC_COMMON_REGISTER(__HANDLE__) ADC1_COMMON
uint32_t InjectedNbrOfConversion
Definition: stm32f4xx_hal_adc_ex.h:93
HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef *hadc)
HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef *hadc, ADC_InjectionConfTypeDef *sConfigInjected)
This file contains HAL common defines, enumeration, macros and structures definitions.
uint32_t Mode
Definition: stm32f4xx_hal_adc_ex.h:133
HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef *hadc)
uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef *hadc, uint32_t InjectedRank)
HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef *hadc)
HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef *hadc, uint32_t Timeout)
HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(ADC_HandleTypeDef *hadc, ADC_MultiModeTypeDef *multimode)
uint32_t InjectedDiscontinuousConvMode
Definition: stm32f4xx_hal_adc_ex.h:98
uint32_t TwoSamplingDelay
Definition: stm32f4xx_hal_adc_ex.h:137
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32f4xx_hal_def.h:55
uint32_t InjectedRank
Definition: stm32f4xx_hal_adc_ex.h:77
HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(ADC_HandleTypeDef *hadc)
uint32_t InjectedSamplingTime
Definition: stm32f4xx_hal_adc_ex.h:80
ADC handle Structure definition.
Definition: stm32f4xx_hal_adc.h:208
uint32_t InjectedOffset
Definition: stm32f4xx_hal_adc_ex.h:89
uint32_t DMAAccessMode
Definition: stm32f4xx_hal_adc_ex.h:135
uint32_t ExternalTrigInjecConvEdge
Definition: stm32f4xx_hal_adc_ex.h:121
uint32_t InjectedChannel
Definition: stm32f4xx_hal_adc_ex.h:74
ADC Configuration injected Channel structure definition.
Definition: stm32f4xx_hal_adc_ex.h:72
void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef *hadc)
HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef *hadc, uint32_t *pData, uint32_t Length)
uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef *hadc)
uint32_t ExternalTrigInjecConv
Definition: stm32f4xx_hal_adc_ex.h:113
ADC Configuration multi-mode structure definition.
Definition: stm32f4xx_hal_adc_ex.h:131
HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef *hadc)
uint32_t AutoInjectedConv
Definition: stm32f4xx_hal_adc_ex.h:105