This set of functions is for controlling/querying the SARMUX switches.
Functions | |
void | Cy_SAR_SetAnalogSwitch (SAR_Type *base, cy_en_sar_switch_register_sel_t switchSelect, uint32_t switchMask, cy_en_sar_switch_state_t state) |
Provide firmware control of the SARMUX switches for firmware sequencing. More... | |
uint32_t | Cy_SAR_GetAnalogSwitch (const SAR_Type *base, cy_en_sar_switch_register_sel_t switchSelect) |
Return the state (open or close) of SARMUX switches. More... | |
__STATIC_INLINE void | Cy_SAR_SetVssaVminusSwitch (SAR_Type *base, cy_en_sar_switch_state_t state) |
Open or close the switch between VSSA and Vminus of the SARADC through firmware. More... | |
void | Cy_SAR_SetSwitchSarSeqCtrl (SAR_Type *base, uint32_t switchMask, cy_en_sar_switch_sar_seq_ctrl_t ctrl) |
Enable or disable SARSEQ control of one or more switches. More... | |
__STATIC_INLINE void | Cy_SAR_SetVssaSarSeqCtrl (SAR_Type *base, cy_en_sar_switch_sar_seq_ctrl_t ctrl) |
Enable or disable SARSEQ control of the switch between VSSA and Vminus of the SARADC. More... | |
void Cy_SAR_SetAnalogSwitch | ( | SAR_Type * | base, |
cy_en_sar_switch_register_sel_t | switchSelect, | ||
uint32_t | switchMask, | ||
cy_en_sar_switch_state_t | state | ||
) |
Provide firmware control of the SARMUX switches for firmware sequencing.
Each call to this function can open or close a set of switches. Previously configured switches are untouched.
If the SARSEQ is enabled, there is no need to use this function.
base | Pointer to structure describing registers |
switchSelect | The switch register that contains the desired switches. Select a value from cy_en_sar_switch_register_sel_t. |
switchMask | The mask of the switches to either open or close. Select one or more values from the cy_en_sar_mux_switch_fw_ctrl_t enum and "OR" them together. |
state | Open or close the desired switches. Select a value from cy_en_sar_switch_state_t. |
uint32_t Cy_SAR_GetAnalogSwitch | ( | const SAR_Type * | base, |
cy_en_sar_switch_register_sel_t | switchSelect | ||
) |
Return the state (open or close) of SARMUX switches.
base | Pointer to structure describing registers |
switchSelect | The switch register that contains the desired switches. Select a value from cy_en_sar_switch_register_sel_t. |
__STATIC_INLINE void Cy_SAR_SetVssaVminusSwitch | ( | SAR_Type * | base, |
cy_en_sar_switch_state_t | state | ||
) |
Open or close the switch between VSSA and Vminus of the SARADC through firmware.
This function calls Cy_SAR_SetAnalogSwitch with switchSelect set to CY_SAR_MUX_SWITCH0 and switchMask set to SAR_MUX_SWITCH0_MUX_FW_VSSA_VMINUS_Msk.
base | Pointer to structure describing registers |
state | Open or close the switch. Select a value from cy_en_sar_switch_state_t. |
void Cy_SAR_SetSwitchSarSeqCtrl | ( | SAR_Type * | base, |
uint32_t | switchMask, | ||
cy_en_sar_switch_sar_seq_ctrl_t | ctrl | ||
) |
Enable or disable SARSEQ control of one or more switches.
Previously configured switches are untouched.
base | Pointer to structure describing registers |
switchMask | The mask of the switches. Select one or more values from the cy_en_sar_mux_switch_sq_ctrl_t enum and "OR" them together. |
ctrl | Enable or disable SARSEQ control. Select a value from cy_en_sar_switch_sar_seq_ctrl_t. |
__STATIC_INLINE void Cy_SAR_SetVssaSarSeqCtrl | ( | SAR_Type * | base, |
cy_en_sar_switch_sar_seq_ctrl_t | ctrl | ||
) |
Enable or disable SARSEQ control of the switch between VSSA and Vminus of the SARADC.
This function calls Cy_SAR_SetSwitchSarSeqCtrl with switchMask set to SAR_MUX_SWITCH_SQ_CTRL_MUX_SQ_CTRL_VSSA_Msk.
base | Pointer to structure describing registers |
ctrl | Enable or disable control. Select a value from cy_en_sar_switch_sar_seq_ctrl_t. |