Functions | |
cy_en_sar2_status_t | Cy_SAR2_Init (PASS_SAR_Type *base, const cy_stc_sar2_config_t *config) |
Initializes the SAR2 block. More... | |
__STATIC_INLINE void | Cy_SAR2_DeInit (PASS_SAR_Type *base) |
De-initializes the SAR ADC block, returns the register values to default. More... | |
__STATIC_INLINE void | Cy_SAR2_Enable (PASS_SAR_Type *base) |
Enables the SAR ADC block. More... | |
__STATIC_INLINE void | Cy_SAR2_Disable (PASS_SAR_Type *base) |
Disables the SAR ADC block. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_GetPendingStatus (const PASS_SAR_Type *base) |
Returns the trigger pending status. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_GetWorkValidStatus (const PASS_SAR_Type *base) |
Returns the work register valid status. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_GetWorkRangeStatus (const PASS_SAR_Type *base) |
Returns work register range status. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_GetWorkRangeHiStatus (const PASS_SAR_Type *base) |
Returns work register range high status. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_GetWorkPulseStatus (const PASS_SAR_Type *base) |
Returns the work register pulse status. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_GetResultValidStatus (const PASS_SAR_Type *base) |
Returns result register valid status. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_GetResultRangeHiStatus (const PASS_SAR_Type *base) |
Returns result register range high status. More... | |
cy_en_sar2_status_t | Cy_SAR2_Channel_Init (PASS_SAR_Type *base, uint32_t channel, const cy_stc_sar2_channel_config_t *channelConfig) |
Initializes an SAR channel. More... | |
void | Cy_SAR2_Channel_DeInit (PASS_SAR_Type *base, uint32_t channel) |
Stops and de-initializes the SAR channel register. More... | |
uint16_t | Cy_SAR2_Channel_GetResult (PASS_SAR_Type *base, uint32_t channel, uint32_t *status) |
Returns the conversion result and status. More... | |
uint16_t | Cy_SAR2_Channel_GetWorkingData (PASS_SAR_Type *base, uint32_t channel, uint32_t *status) |
Returns the working data and status. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_Channel_GetGroupStatus (PASS_SAR_Type *base, uint32_t channel) |
Returns the group conversion status. More... | |
__STATIC_INLINE void | Cy_SAR2_Channel_Enable (PASS_SAR_Type *base, uint32_t channel) |
Enables a corresponding channel. More... | |
__STATIC_INLINE void | Cy_SAR2_Channel_Disable (PASS_SAR_Type *base, uint32_t channel) |
Disables a corresponding channel. More... | |
__STATIC_INLINE void | Cy_SAR2_Channel_SoftwareTrigger (PASS_SAR_Type *base, uint32_t channel) |
Issues a software start trigger. More... | |
__STATIC_INLINE void | Cy_SAR2_Channel_SetInterruptMask (PASS_SAR_Type *base, uint32_t channel, uint32_t intrMask) |
Configures the channel interrupt. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_Channel_GetInterruptMask (PASS_SAR_Type *base, uint32_t channel) |
Returns interrupt mask configuration. More... | |
__STATIC_INLINE void | Cy_SAR2_Channel_ClearInterrupt (PASS_SAR_Type *base, uint32_t channel, uint32_t intrMask) |
Clears the interrupt. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_Channel_GetInterruptStatus (PASS_SAR_Type *base, uint32_t channel) |
Returns the channel interrupt register status. More... | |
__STATIC_INLINE uint32_t | Cy_SAR2_Channel_GetInterruptStatusMasked (PASS_SAR_Type *base, uint32_t channel) |
Returns interrupt status. More... | |
__STATIC_INLINE void | Cy_SAR2_Channel_SetInterrupt (PASS_SAR_Type *base, uint32_t channel, uint32_t intrMask) |
Triggers an interrupt with software. More... | |
cy_en_sar2_status_t | Cy_SAR2_Diag_Init (PASS_SAR_Type *base, const cy_stc_sar2_diag_config_t *diagConfig) |
Initializes the diagnosis function. More... | |
__STATIC_INLINE void | Cy_SAR2_Diag_Enable (PASS_SAR_Type *base) |
Enables the diagnostic function. More... | |
__STATIC_INLINE void | Cy_SAR2_Diag_Disable (PASS_SAR_Type *base) |
Disables the diagnostic function. More... | |
__STATIC_INLINE void | Cy_SAR2_TriggerCalibrationUpdate (PASS_SAR_Type *base) |
Triggers calibration update. More... | |
__STATIC_INLINE bool | Cy_SAR2_IsCalibrationUpdateDone (PASS_SAR_Type *base) |
Gets the status of calibration update. More... | |
cy_en_sar2_status_t | Cy_SAR2_SetDigitalCalibrationValue (PASS_SAR_Type *base, const cy_stc_sar2_digital_calibration_config_t *digCalibConfig) |
Configure SAR ADC digital calibration value. More... | |
cy_en_sar2_status_t | Cy_SAR2_GetDigitalCalibrationValue (PASS_SAR_Type *base, cy_stc_sar2_digital_calibration_config_t *digCalibConfig) |
Gets the SAR ADC digital calibration value. More... | |
cy_en_sar2_status_t | Cy_SAR2_SetAltDigitalCalibrationValue (PASS_SAR_Type *base, const cy_stc_sar2_digital_calibration_config_t *altDigCalibConfig) |
Configures an alternate SAR digital calibration value. More... | |
cy_en_sar2_status_t | Cy_SAR2_GetAltDigitalCalibrationValue (PASS_SAR_Type *base, cy_stc_sar2_digital_calibration_config_t *altDigCalibConfig) |
Gets an alternate SAR digital calibration value. More... | |
cy_en_sar2_status_t | Cy_SAR2_SetAnalogCalibrationValue (PASS_SAR_Type *base, cy_stc_sar2_analog_calibration_conifg_t *analogCalibConfig) |
Configures an SAR analog calibration value. More... | |
cy_en_sar2_status_t | Cy_SAR2_GetAnalogCalibrationValue (PASS_SAR_Type *base, cy_stc_sar2_analog_calibration_conifg_t *analogCalibConfig) |
Gets an SAR analog calibration value. More... | |
cy_en_sar2_status_t | Cy_SAR2_SetAltAnalogCalibrationValue (PASS_SAR_Type *base, cy_stc_sar2_analog_calibration_conifg_t *altAnalogCalibConfig) |
Configures an alternate SAR analog calibration value. More... | |
cy_en_sar2_status_t | Cy_SAR2_GetAltAnalogCalibrationValue (PASS_SAR_Type *base, cy_stc_sar2_analog_calibration_conifg_t *altAnalogCalibConfig) |
Gets an alternate SAR analog calibration value. More... | |
__STATIC_INLINE cy_en_sar2_ref_buf_mode_t | Cy_SAR2_GetReferenceBufferMode (PASS_EPASS_MMIO_Type *base) |
Gets ePASS MMIO reference buffer mode. More... | |
__STATIC_INLINE void | Cy_SAR2_SetReferenceBufferMode (PASS_EPASS_MMIO_Type *base, cy_en_sar2_ref_buf_mode_t mode) |
Sets ePASS MMIO reference buffer mode. More... | |
cy_en_sar2_status_t | Cy_SAR2_SetDebugFreezeMode (PASS_EPASS_MMIO_Type *base, const cy_stc_sar2_debug_freeze_config_t *debConfig) |
Configures the debug pause feature. More... | |
cy_en_sar2_status_t | Cy_SAR2_SetGenericTriggerInput (PASS_EPASS_MMIO_Type *base, uint8_t numOfAdc, uint8_t triggerInputNumber, uint8_t genericTriggerValue) |
Configures the generic trigger input selection. More... | |
cy_en_sar2_status_t | Cy_SAR2_SetGenericTriggerOutput (PASS_EPASS_MMIO_Type *base, uint8_t numOfAdc, uint8_t triggerOutputNumber, uint8_t genericTriggerValue) |
Configures the generic output trigger selection. More... | |
double | Cy_SAR2_CalculateDieTemperature (cy_en_sar2_vdda_range_t VDDARange, uint16_t adcVtempRawValue, uint16_t adcVbgRawValue) |
Calculates the internal temperature from ADC core using Vtemp. More... | |
cy_en_sar2_status_t Cy_SAR2_Init | ( | PASS_SAR_Type * | base, |
const cy_stc_sar2_config_t * | config | ||
) |
Initializes the SAR2 block.
base | The pointer to the SAR ADC block instance. |
config | The pointer to the configuration structure cy_stc_sar2_config_t. |
__STATIC_INLINE void Cy_SAR2_DeInit | ( | PASS_SAR_Type * | base | ) |
De-initializes the SAR ADC block, returns the register values to default.
base | : The pointer to the SAR block. |
__STATIC_INLINE void Cy_SAR2_Enable | ( | PASS_SAR_Type * | base | ) |
Enables the SAR ADC block.
base | : The pointer to the SAR block. |
__STATIC_INLINE void Cy_SAR2_Disable | ( | PASS_SAR_Type * | base | ) |
Disables the SAR ADC block.
base | : The pointer to the SAR block. |
__STATIC_INLINE uint32_t Cy_SAR2_GetPendingStatus | ( | const PASS_SAR_Type * | base | ) |
Returns the trigger pending status.
base | The pointer to the SAR instance. |
__STATIC_INLINE uint32_t Cy_SAR2_GetWorkValidStatus | ( | const PASS_SAR_Type * | base | ) |
Returns the work register valid status.
base | The pointer to the SAR instance. |
__STATIC_INLINE uint32_t Cy_SAR2_GetWorkRangeStatus | ( | const PASS_SAR_Type * | base | ) |
Returns work register range status.
base | The pointer to the SAR instance. |
__STATIC_INLINE uint32_t Cy_SAR2_GetWorkRangeHiStatus | ( | const PASS_SAR_Type * | base | ) |
Returns work register range high status.
base | The pointer to the SAR instance. |
__STATIC_INLINE uint32_t Cy_SAR2_GetWorkPulseStatus | ( | const PASS_SAR_Type * | base | ) |
Returns the work register pulse status.
base | The pointer to the SAR instance. |
__STATIC_INLINE uint32_t Cy_SAR2_GetResultValidStatus | ( | const PASS_SAR_Type * | base | ) |
Returns result register valid status.
base | The pointer to the SAR instance. |
__STATIC_INLINE uint32_t Cy_SAR2_GetResultRangeHiStatus | ( | const PASS_SAR_Type * | base | ) |
Returns result register range high status.
base | The pointer to the SAR instance. |
cy_en_sar2_status_t Cy_SAR2_Channel_Init | ( | PASS_SAR_Type * | base, |
uint32_t | channel, | ||
const cy_stc_sar2_channel_config_t * | channelConfig | ||
) |
Initializes an SAR channel.
base | The pointer to the SAR instance. |
channel | The channel number. |
channelConfig | The pointer to the configuration structure cy_stc_sar2_channel_config_t. |
void Cy_SAR2_Channel_DeInit | ( | PASS_SAR_Type * | base, |
uint32_t | channel | ||
) |
Stops and de-initializes the SAR channel register.
base | The pointer to the SAR instance. |
channel | The channel number. |
uint16_t Cy_SAR2_Channel_GetResult | ( | PASS_SAR_Type * | base, |
uint32_t | channel, | ||
uint32_t * | status | ||
) |
Returns the conversion result and status.
base | The pointer to an SAR instance. |
channel | The channel number. |
status | The pointer that will return measurement status bits ORed. The pointer can be NULL, then, s status is not returned. |
uint16_t Cy_SAR2_Channel_GetWorkingData | ( | PASS_SAR_Type * | base, |
uint32_t | channel, | ||
uint32_t * | status | ||
) |
Returns the working data and status.
base | The pointer to the SAR instance. |
channel | The channel number. |
status | The pointer that will return measurement status bits ORed. The pointer can be NULL, then, a status is not returned. |
__STATIC_INLINE uint32_t Cy_SAR2_Channel_GetGroupStatus | ( | PASS_SAR_Type * | base, |
uint32_t | channel | ||
) |
Returns the group conversion status.
base | The pointer to an SAR instance. |
channel | The channel number. |
__STATIC_INLINE void Cy_SAR2_Channel_Enable | ( | PASS_SAR_Type * | base, |
uint32_t | channel | ||
) |
Enables a corresponding channel.
base | The pointer to the SAR instance. |
channel | The channel number. |
__STATIC_INLINE void Cy_SAR2_Channel_Disable | ( | PASS_SAR_Type * | base, |
uint32_t | channel | ||
) |
Disables a corresponding channel.
base | The pointer to the SAR instance. |
channel | The channel number. |
__STATIC_INLINE void Cy_SAR2_Channel_SoftwareTrigger | ( | PASS_SAR_Type * | base, |
uint32_t | channel | ||
) |
Issues a software start trigger.
base | The pointer to the SAR instance. |
channel | The channel number. |
__STATIC_INLINE void Cy_SAR2_Channel_SetInterruptMask | ( | PASS_SAR_Type * | base, |
uint32_t | channel, | ||
uint32_t | intrMask | ||
) |
Configures the channel interrupt.
base | The pointer to the SAR instance. |
channel | The channel number. |
intrMask | The mask of interrupts. Select one or more values from Interrupt Masks and "OR" them together: |
__STATIC_INLINE uint32_t Cy_SAR2_Channel_GetInterruptMask | ( | PASS_SAR_Type * | base, |
uint32_t | channel | ||
) |
Returns interrupt mask configuration.
base | The pointer to the SAR instance. |
channel | The channel number. |
__STATIC_INLINE void Cy_SAR2_Channel_ClearInterrupt | ( | PASS_SAR_Type * | base, |
uint32_t | channel, | ||
uint32_t | intrMask | ||
) |
Clears the interrupt.
The interrupt must be cleared with this function so that the hardware can set subsequent interrupts and those interrupts can be forwarded to the interrupt controller, if enabled.
base | The pointer to the SAR instance. |
channel | The channel number. |
intrMask | The mask of interrupts to clear. Typically this will be the value returned from Cy_SAR_GetInterruptStatus. Alternately, select one or more values from Interrupt Masks and "OR" them together. |
__STATIC_INLINE uint32_t Cy_SAR2_Channel_GetInterruptStatus | ( | PASS_SAR_Type * | base, |
uint32_t | channel | ||
) |
Returns the channel interrupt register status.
base | The pointer to the SAR instance. |
channel | The channel number. |
__STATIC_INLINE uint32_t Cy_SAR2_Channel_GetInterruptStatusMasked | ( | PASS_SAR_Type * | base, |
uint32_t | channel | ||
) |
Returns interrupt status.
base | The pointer to the SAR instance. |
channel | The channel number. |
__STATIC_INLINE void Cy_SAR2_Channel_SetInterrupt | ( | PASS_SAR_Type * | base, |
uint32_t | channel, | ||
uint32_t | intrMask | ||
) |
Triggers an interrupt with software.
base | The pointer to the SAR instance. |
channel | The channel number. |
intrMask | The mask of interrupts to set. Select one or more values from Interrupt Masks and "OR" them together. |
cy_en_sar2_status_t Cy_SAR2_Diag_Init | ( | PASS_SAR_Type * | base, |
const cy_stc_sar2_diag_config_t * | diagConfig | ||
) |
Initializes the diagnosis function.
base | The pointer to the SAR instance. |
diagConfig | The pointer to the configuration structure cy_stc_sar2_diag_config_t. |
__STATIC_INLINE void Cy_SAR2_Diag_Enable | ( | PASS_SAR_Type * | base | ) |
Enables the diagnostic function.
base | The pointer to the hardware SAR block. |
__STATIC_INLINE void Cy_SAR2_Diag_Disable | ( | PASS_SAR_Type * | base | ) |
Disables the diagnostic function.
base | The pointer to the hardware SAR block. |
__STATIC_INLINE void Cy_SAR2_TriggerCalibrationUpdate | ( | PASS_SAR_Type * | base | ) |
Triggers calibration update.
After triggering, coherently copies the values from alternate calibration regs to the current calibration regs.
base | The pointer to the hardware SAR block. |
__STATIC_INLINE bool Cy_SAR2_IsCalibrationUpdateDone | ( | PASS_SAR_Type * | base | ) |
Gets the status of calibration update.
base | The pointer to the hardware SAR block. |
cy_en_sar2_status_t Cy_SAR2_SetDigitalCalibrationValue | ( | PASS_SAR_Type * | base, |
const cy_stc_sar2_digital_calibration_config_t * | digCalibConfig | ||
) |
Configure SAR ADC digital calibration value.
base | The pointer to the SAR instance. |
digCalibConfig | The pointer to the configuration structure cy_stc_sar2_digital_calibration_config_t. |
cy_en_sar2_status_t Cy_SAR2_GetDigitalCalibrationValue | ( | PASS_SAR_Type * | base, |
cy_stc_sar2_digital_calibration_config_t * | digCalibConfig | ||
) |
Gets the SAR ADC digital calibration value.
base | The pointer to the SAR instance. |
digCalibConfig | The pointer to the output configuration structure cy_stc_sar2_digital_calibration_config_t. |
cy_en_sar2_status_t Cy_SAR2_SetAltDigitalCalibrationValue | ( | PASS_SAR_Type * | base, |
const cy_stc_sar2_digital_calibration_config_t * | altDigCalibConfig | ||
) |
Configures an alternate SAR digital calibration value.
base | The pointer to the SAR instance. |
altDigCalibConfig | The pointer to the configuration structure cy_stc_sar2_digital_calibration_config_t. |
cy_en_sar2_status_t Cy_SAR2_GetAltDigitalCalibrationValue | ( | PASS_SAR_Type * | base, |
cy_stc_sar2_digital_calibration_config_t * | altDigCalibConfig | ||
) |
Gets an alternate SAR digital calibration value.
base | The pointer to the SAR instance. |
altDigCalibConfig | The utput pointer to the configuration structure cy_stc_sar2_digital_calibration_config_t. |
cy_en_sar2_status_t Cy_SAR2_SetAnalogCalibrationValue | ( | PASS_SAR_Type * | base, |
cy_stc_sar2_analog_calibration_conifg_t * | analogCalibConfig | ||
) |
Configures an SAR analog calibration value.
base | The pointer to the SAR instance. |
analogCalibConfig | The pointer to the configuration structure cy_stc_sar2_analog_calibration_conifg_t. |
cy_en_sar2_status_t Cy_SAR2_GetAnalogCalibrationValue | ( | PASS_SAR_Type * | base, |
cy_stc_sar2_analog_calibration_conifg_t * | analogCalibConfig | ||
) |
Gets an SAR analog calibration value.
base | The pointer to the SAR instance. |
analogCalibConfig | The utput pointer to the configuration structure cy_stc_sar2_analog_calibration_conifg_t. |
cy_en_sar2_status_t Cy_SAR2_SetAltAnalogCalibrationValue | ( | PASS_SAR_Type * | base, |
cy_stc_sar2_analog_calibration_conifg_t * | altAnalogCalibConfig | ||
) |
Configures an alternate SAR analog calibration value.
base | The pointer to the SAR instance. |
altAnalogCalibConfig | The pointer to the configuration structure cy_stc_sar2_analog_calibration_conifg_t. |
cy_en_sar2_status_t Cy_SAR2_GetAltAnalogCalibrationValue | ( | PASS_SAR_Type * | base, |
cy_stc_sar2_analog_calibration_conifg_t * | altAnalogCalibConfig | ||
) |
Gets an alternate SAR analog calibration value.
base | The pointer to the SAR instance. |
altAnalogCalibConfig | The utput pointer to the configuration structure cy_stc_sar2_analog_calibration_conifg_t. |
__STATIC_INLINE cy_en_sar2_ref_buf_mode_t Cy_SAR2_GetReferenceBufferMode | ( | PASS_EPASS_MMIO_Type * | base | ) |
Gets ePASS MMIO reference buffer mode.
base | The pointer to the PASS instance. |
__STATIC_INLINE void Cy_SAR2_SetReferenceBufferMode | ( | PASS_EPASS_MMIO_Type * | base, |
cy_en_sar2_ref_buf_mode_t | mode | ||
) |
Sets ePASS MMIO reference buffer mode.
base | The pointer to the PASS instance. |
mode | The reference buffer mode number. |
cy_en_sar2_status_t Cy_SAR2_SetDebugFreezeMode | ( | PASS_EPASS_MMIO_Type * | base, |
const cy_stc_sar2_debug_freeze_config_t * | debConfig | ||
) |
Configures the debug pause feature.
base | The pointer to the PASS instance. |
debConfig | The utput pointer to the configuration structure cy_stc_sar2_debug_freeze_config_t. |
cy_en_sar2_status_t Cy_SAR2_SetGenericTriggerInput | ( | PASS_EPASS_MMIO_Type * | base, |
uint8_t | numOfAdc, | ||
uint8_t | triggerInputNumber, | ||
uint8_t | genericTriggerValue | ||
) |
Configures the generic trigger input selection.
base | The pointer to the PASS instance. |
numOfAdc | The ADC channel number. |
triggerInputNumber | The generic input trigger number to be set up. |
genericTriggerValue | The generic input trigger to be used as a corresponding trigger input #. |
cy_en_sar2_status_t Cy_SAR2_SetGenericTriggerOutput | ( | PASS_EPASS_MMIO_Type * | base, |
uint8_t | numOfAdc, | ||
uint8_t | triggerOutputNumber, | ||
uint8_t | genericTriggerValue | ||
) |
Configures the generic output trigger selection.
base | The pointer to the PASS instance. |
numOfAdc | The ADC channel number |
triggerOutputNumber | The generic input trigger number to be set up. |
genericTriggerValue | The generic input trigger to be used as a corresponding trigger input number. |
double Cy_SAR2_CalculateDieTemperature | ( | cy_en_sar2_vdda_range_t | VDDARange, |
uint16_t | adcVtempRawValue, | ||
uint16_t | adcVbgRawValue | ||
) |
Calculates the internal temperature from ADC core using Vtemp.
The API is implemented to calculate the temperature from the 2nd order equation of sort data with corrected class data. The API will convert sort data into [3][3] matrix and class data into [2][2] matrix.
VDDARange | VDDA voltage range, cy_en_sar2_vdda_range_t. |
adcVtempRawValue | The ADC counts the raw value of the temperature diode. |
adcVbgRawValue | The ADC counts raw value of the Vbg voltage. |