This set of functions allows changes to the SAR configuration after initialization.
Functions | |
void | Cy_SAR_SetConvertMode (SAR_Type *base, cy_en_sar_sample_ctrl_trigger_mode_t mode) |
Set the mode in which conversions are triggered. More... | |
__STATIC_INLINE void | Cy_SAR_SetChanMask (SAR_Type *base, uint32_t enableMask) |
Set the enable/disable mask for the channels. More... | |
void | Cy_SAR_SetLowLimit (SAR_Type *base, uint32_t lowLimit) |
Set the low threshold for range detection. More... | |
void | Cy_SAR_SetHighLimit (SAR_Type *base, uint32_t highLimit) |
Set the high threshold for range detection. More... | |
__STATIC_INLINE void | Cy_SAR_SetRangeCond (SAR_Type *base, cy_en_sar_range_detect_condition_t cond) |
Set the condition in which range detection interrupts are triggered. More... | |
void Cy_SAR_SetConvertMode | ( | SAR_Type * | base, |
cy_en_sar_sample_ctrl_trigger_mode_t | mode | ||
) |
Set the mode in which conversions are triggered.
This function does not start any conversions; it only configures the mode for subsequent conversions.
There are three modes:
Note that firmware triggering is always enabled.
base | Pointer to structure describing registers |
mode | A value of the enum cy_en_sar_sample_ctrl_trigger_mode_t |
__STATIC_INLINE void Cy_SAR_SetChanMask | ( | SAR_Type * | base, |
uint32_t | enableMask | ||
) |
Set the enable/disable mask for the channels.
base | Pointer to structure describing registers |
enableMask | Channel enable/disable mask. Each bit corresponds to a channel.
|
void Cy_SAR_SetLowLimit | ( | SAR_Type * | base, |
uint32_t | lowLimit | ||
) |
Set the low threshold for range detection.
The values are interpreted as signed or unsigned according to the channel configuration. Range detection is done on the value stored in the result register. That is, after averaging, shifting sign extension, and left/right alignment.
base | Pointer to structure describing registers |
lowLimit | The low threshold for range detection |
void Cy_SAR_SetHighLimit | ( | SAR_Type * | base, |
uint32_t | highLimit | ||
) |
Set the high threshold for range detection.
The values are interpreted as signed or unsigned according to the channel configuration. Range detection is done on the value stored in the result register. That is, after averaging, shifting sign extension, and left/right alignment.
base | Pointer to structure describing registers |
highLimit | The high threshold for range detection |
__STATIC_INLINE void Cy_SAR_SetRangeCond | ( | SAR_Type * | base, |
cy_en_sar_range_detect_condition_t | cond | ||
) |
Set the condition in which range detection interrupts are triggered.
base | Pointer to structure describing registers |
cond | A value of the enum cy_en_sar_range_detect_condition_t. |