This set of functions allows changes to the SAR configuration after initialization.
More...
This set of functions allows changes to the SAR configuration after initialization.
◆ Cy_SAR_SetConvertMode()
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:
- firmware only; hardware triggering is disabled
- firmware and edge sensitive hardware triggering
- firmware and level sensitive hardware triggering
Note that firmware triggering is always enabled.
- Parameters
-
- Function Usage
◆ Cy_SAR_SetChanMask()
__STATIC_INLINE void Cy_SAR_SetChanMask |
( |
SAR_Type * |
base, |
|
|
uint32_t |
enableMask |
|
) |
| |
Set the enable/disable mask for the channels.
- Parameters
-
base | Pointer to structure describing registers |
enableMask | Channel enable/disable mask. Each bit corresponds to a channel.
- 0: the corresponding channel is disabled.
- 1: the corresponding channel is enabled; it will be included in the next scan.
|
- Function Usage
◆ Cy_SAR_GetChanMask()
__STATIC_INLINE uint32_t Cy_SAR_GetChanMask |
( |
SAR_Type * |
base | ) |
|
Get the enable/disable mask for the channels.
- Parameters
-
base | The pointer to the structure, which describes registers. |
- Returns
- Channel enable/disable mask. Each bit corresponds to a channel.
- 0: the corresponding channel is disabled.
- 1: the corresponding channel is enabled; it will be included in the next scan.
◆ Cy_SAR_SetLowLimit()
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.
- Parameters
-
base | Pointer to structure describing registers |
lowLimit | The low threshold for range detection |
- Returns
- None
- Function Usage
◆ Cy_SAR_SetHighLimit()
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.
- Parameters
-
base | Pointer to structure describing registers |
highLimit | The high threshold for range detection |
- Returns
- None
- Function Usage
◆ Cy_SAR_SetVref()
Sets the Vref of the SAR ADC during runtime.
If Vref = BGR or VDDA/2, API enables the Vref buffer, otherwise, disable the Vref buffer. When using this API, the user must:
- Stop the ADC before running this function.
- Configure the correct gain of channels using Cy_SAR_SetChannelGain for raw count conversations APIs to work properly while using a different Vref.
- Allow sufficient time for Vref to settle change when using a bypass cap or the Vref buffer.
- Parameters
-
base | The pointer to the structure, which describes registers. |
vrefSel | The enumerated type of possible Vref settings cy_en_sar_ctrl_vref_sel_t. |
◆ Cy_SAR_SetRangeCond()
Set the condition in which range detection interrupts are triggered.
- Parameters
-
- Function Usage
◆ Cy_SAR_EnableChannels()
__STATIC_INLINE void Cy_SAR_EnableChannels |
( |
SAR_Type * |
base, |
|
|
uint32_t |
chanMask |
|
) |
| |
Enable the specified channels.
- Parameters
-
base | Pointer to structure describing registers |
chanMask | Combined mask of all channels to be enabled. |
- Function Usage
◆ Cy_SAR_DisableChannels()
__STATIC_INLINE void Cy_SAR_DisableChannels |
( |
SAR_Type * |
base, |
|
|
uint32_t |
chanMask |
|
) |
| |
Disable the specified channels.
- Parameters
-
base | Pointer to structure describing registers |
chanMask | Combined mask of all channels to be disabled. |
- Function Usage