|
STM CMSIS
|
Macros | |
| #define | ADC_IS_ENABLE(__HANDLE__) |
| Verification of ADC state: enabled or disabled. More... | |
| #define | ADC_IS_SOFTWARE_START_REGULAR(__HANDLE__) (((__HANDLE__)->Instance->CR2 & ADC_CR2_EXTEN) == RESET) |
| Test if conversion trigger of regular group is software start or external trigger. More... | |
| #define | ADC_IS_SOFTWARE_START_INJECTED(__HANDLE__) (((__HANDLE__)->Instance->CR2 & ADC_CR2_JEXTEN) == RESET) |
| Test if conversion trigger of injected group is software start or external trigger. More... | |
| #define | ADC_STATE_CLR_SET MODIFY_REG |
| Simultaneously clears and sets specific bits of the handle State. More... | |
| #define | ADC_CLEAR_ERRORCODE(__HANDLE__) ((__HANDLE__)->ErrorCode = HAL_ADC_ERROR_NONE) |
| Clear ADC error code (set it to error code: "no error") More... | |
| #define | IS_ADC_CLOCKPRESCALER(ADC_CLOCK) |
| #define | IS_ADC_SAMPLING_DELAY(DELAY) |
| #define | IS_ADC_RESOLUTION(RESOLUTION) |
| #define | IS_ADC_EXT_TRIG_EDGE(EDGE) |
| #define | IS_ADC_EXT_TRIG(REGTRIG) |
| #define | IS_ADC_DATA_ALIGN(ALIGN) |
| #define | IS_ADC_SAMPLE_TIME(TIME) |
| #define | IS_ADC_EOCSelection(EOCSelection) |
| #define | IS_ADC_EVENT_TYPE(EVENT) |
| #define | IS_ADC_ANALOG_WATCHDOG(WATCHDOG) |
| #define | IS_ADC_CHANNELS_TYPE(CHANNEL_TYPE) |
| #define | IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= ((uint32_t)0xFFFU)) |
| #define | IS_ADC_REGULAR_LENGTH(LENGTH) (((LENGTH) >= ((uint32_t)1U)) && ((LENGTH) <= ((uint32_t)16U))) |
| #define | IS_ADC_REGULAR_RANK(RANK) (((RANK) >= ((uint32_t)1U)) && ((RANK) <= ((uint32_t)16U))) |
| #define | IS_ADC_REGULAR_DISC_NUMBER(NUMBER) (((NUMBER) >= ((uint32_t)1U)) && ((NUMBER) <= ((uint32_t)8U))) |
| #define | IS_ADC_RANGE(RESOLUTION, ADC_VALUE) |
| #define | ADC_SQR1(_NbrOfConversion_) (((_NbrOfConversion_) - (uint8_t)1U) << 20U) |
| Set ADC Regular channel sequence length. More... | |
| #define | ADC_SMPR1(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3U * (((uint32_t)((uint16_t)(_CHANNELNB_))) - 10U))) |
| Set the ADC's sample time for channel numbers between 10 and 18. More... | |
| #define | ADC_SMPR2(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3U * ((uint32_t)((uint16_t)(_CHANNELNB_))))) |
| Set the ADC's sample time for channel numbers between 0 and 9. More... | |
| #define | ADC_SQR3_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5U * ((_RANKNB_) - 1U))) |
| Set the selected regular channel rank for rank between 1 and 6. More... | |
| #define | ADC_SQR2_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5U * ((_RANKNB_) - 7U))) |
| Set the selected regular channel rank for rank between 7 and 12. More... | |
| #define | ADC_SQR1_RK(_CHANNELNB_, _RANKNB_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5U * ((_RANKNB_) - 13U))) |
| Set the selected regular channel rank for rank between 13 and 16. More... | |
| #define | ADC_CR2_CONTINUOUS(_CONTINUOUS_MODE_) ((_CONTINUOUS_MODE_) << 1U) |
| Enable ADC continuous conversion mode. More... | |
| #define | ADC_CR1_DISCONTINUOUS(_NBR_DISCONTINUOUSCONV_) (((_NBR_DISCONTINUOUSCONV_) - 1U) << POSITION_VAL(ADC_CR1_DISCNUM)) |
| Configures the number of discontinuous conversions for the regular group channels. More... | |
| #define | ADC_CR1_SCANCONV(_SCANCONV_MODE_) ((_SCANCONV_MODE_) << 8U) |
| Enable ADC scan mode. More... | |
| #define | ADC_CR2_EOCSelection(_EOCSelection_MODE_) ((_EOCSelection_MODE_) << 10U) |
| Enable the ADC end of conversion selection. More... | |
| #define | ADC_CR2_DMAContReq(_DMAContReq_MODE_) ((_DMAContReq_MODE_) << 9U) |
| Enable the ADC DMA continuous request. More... | |
| #define | ADC_GET_RESOLUTION(__HANDLE__) (((__HANDLE__)->Instance->CR1) & ADC_CR1_RES) |
| Return resolution bits in CR1 register. More... | |
| #define ADC_CLEAR_ERRORCODE | ( | __HANDLE__ | ) | ((__HANDLE__)->ErrorCode = HAL_ADC_ERROR_NONE) |
Clear ADC error code (set it to error code: "no error")
| <strong>HANDLE</strong> | ADC handle |
| None |
| #define ADC_CR1_DISCONTINUOUS | ( | _NBR_DISCONTINUOUSCONV_ | ) | (((_NBR_DISCONTINUOUSCONV_) - 1U) << POSITION_VAL(ADC_CR1_DISCNUM)) |
Configures the number of discontinuous conversions for the regular group channels.
| <em>NBR_DISCONTINUOUSCONV</em> | Number of discontinuous conversions. |
| None |
| #define ADC_CR1_SCANCONV | ( | _SCANCONV_MODE_ | ) | ((_SCANCONV_MODE_) << 8U) |
Enable ADC scan mode.
| <em>SCANCONV_MODE</em> | Scan conversion mode. |
| None |
| #define ADC_CR2_CONTINUOUS | ( | _CONTINUOUS_MODE_ | ) | ((_CONTINUOUS_MODE_) << 1U) |
Enable ADC continuous conversion mode.
| <em>CONTINUOUS_MODE</em> | Continuous mode. |
| None |
| #define ADC_CR2_DMAContReq | ( | _DMAContReq_MODE_ | ) | ((_DMAContReq_MODE_) << 9U) |
Enable the ADC DMA continuous request.
| <em>DMAContReq_MODE</em> | DMA continuous request mode. |
| None |
| #define ADC_CR2_EOCSelection | ( | _EOCSelection_MODE_ | ) | ((_EOCSelection_MODE_) << 10U) |
Enable the ADC end of conversion selection.
| <em>EOCSelection_MODE</em> | End of conversion selection mode. |
| None |
| #define ADC_GET_RESOLUTION | ( | __HANDLE__ | ) | (((__HANDLE__)->Instance->CR1) & ADC_CR1_RES) |
Return resolution bits in CR1 register.
| <strong>HANDLE</strong> | ADC handle |
| None |
| #define ADC_IS_ENABLE | ( | __HANDLE__ | ) |
Verification of ADC state: enabled or disabled.
| <strong>HANDLE</strong> | ADC handle |
| SET | (ADC enabled) or RESET (ADC disabled) |
| #define ADC_IS_SOFTWARE_START_INJECTED | ( | __HANDLE__ | ) | (((__HANDLE__)->Instance->CR2 & ADC_CR2_JEXTEN) == RESET) |
Test if conversion trigger of injected group is software start or external trigger.
| <strong>HANDLE</strong> | ADC handle |
| SET | (software start) or RESET (external trigger) |
| #define ADC_IS_SOFTWARE_START_REGULAR | ( | __HANDLE__ | ) | (((__HANDLE__)->Instance->CR2 & ADC_CR2_EXTEN) == RESET) |
Test if conversion trigger of regular group is software start or external trigger.
| <strong>HANDLE</strong> | ADC handle |
| SET | (software start) or RESET (external trigger) |
| #define ADC_SMPR1 | ( | _SAMPLETIME_, | |
| _CHANNELNB_ | |||
| ) | ((_SAMPLETIME_) << (3U * (((uint32_t)((uint16_t)(_CHANNELNB_))) - 10U))) |
Set the ADC's sample time for channel numbers between 10 and 18.
| <em>SAMPLETIME</em> | Sample time parameter. |
| <em>CHANNELNB</em> | Channel number. |
| None |
| #define ADC_SMPR2 | ( | _SAMPLETIME_, | |
| _CHANNELNB_ | |||
| ) | ((_SAMPLETIME_) << (3U * ((uint32_t)((uint16_t)(_CHANNELNB_))))) |
Set the ADC's sample time for channel numbers between 0 and 9.
| <em>SAMPLETIME</em> | Sample time parameter. |
| <em>CHANNELNB</em> | Channel number. |
| None |
| #define ADC_SQR1 | ( | _NbrOfConversion_ | ) | (((_NbrOfConversion_) - (uint8_t)1U) << 20U) |
Set ADC Regular channel sequence length.
| <em>NbrOfConversion</em> | Regular channel sequence length. |
| None |
| #define ADC_SQR1_RK | ( | _CHANNELNB_, | |
| _RANKNB_ | |||
| ) | (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5U * ((_RANKNB_) - 13U))) |
Set the selected regular channel rank for rank between 13 and 16.
| <em>CHANNELNB</em> | Channel number. |
| <em>RANKNB</em> | Rank number. |
| None |
| #define ADC_SQR2_RK | ( | _CHANNELNB_, | |
| _RANKNB_ | |||
| ) | (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5U * ((_RANKNB_) - 7U))) |
Set the selected regular channel rank for rank between 7 and 12.
| <em>CHANNELNB</em> | Channel number. |
| <em>RANKNB</em> | Rank number. |
| None |
| #define ADC_SQR3_RK | ( | _CHANNELNB_, | |
| _RANKNB_ | |||
| ) | (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5U * ((_RANKNB_) - 1U))) |
Set the selected regular channel rank for rank between 1 and 6.
| <em>CHANNELNB</em> | Channel number. |
| <em>RANKNB</em> | Rank number. |
| None |
| #define ADC_STATE_CLR_SET MODIFY_REG |
Simultaneously clears and sets specific bits of the handle State.
| None |
| #define IS_ADC_ANALOG_WATCHDOG | ( | WATCHDOG | ) |
| #define IS_ADC_CHANNELS_TYPE | ( | CHANNEL_TYPE | ) |
| #define IS_ADC_CLOCKPRESCALER | ( | ADC_CLOCK | ) |
| #define IS_ADC_DATA_ALIGN | ( | ALIGN | ) |
| #define IS_ADC_EOCSelection | ( | EOCSelection | ) |
| #define IS_ADC_EVENT_TYPE | ( | EVENT | ) |
| #define IS_ADC_EXT_TRIG | ( | REGTRIG | ) |
| #define IS_ADC_EXT_TRIG_EDGE | ( | EDGE | ) |
| #define IS_ADC_RANGE | ( | RESOLUTION, | |
| ADC_VALUE | |||
| ) |
| #define IS_ADC_RESOLUTION | ( | RESOLUTION | ) |
| #define IS_ADC_SAMPLE_TIME | ( | TIME | ) |
| #define IS_ADC_SAMPLING_DELAY | ( | DELAY | ) |