API Reference | |
Channel functions | |
FIR functions | |
FIFO functions | |
Functions | |
cy_en_hppass_status_t | Cy_HPPASS_SAR_Init (const cy_stc_hppass_sar_t *sarCfg) |
Loads the SAR ADC configuration. More... | |
void | Cy_HPPASS_SAR_DeInit (void) |
Resets all the SAR registers to their default state. | |
__STATIC_INLINE bool | Cy_HPPASS_SAR_IsBusy (void) |
Returns the SAR ADC busy status. More... | |
__STATIC_INLINE cy_en_hppass_status_t | Cy_HPPASS_SAR_Limit_Config (uint8_t limIdx, const cy_stc_hppass_sar_limit_t *limCfg) |
Configures the ADC limit crossing detection block. More... | |
__STATIC_INLINE cy_en_hppass_status_t | Cy_HPPASS_SAR_GroupConfig (uint8_t grpIdx, const cy_stc_hppass_sar_grp_t *grpCfg) |
Configures a single Sequencer Group. More... | |
__STATIC_INLINE cy_en_hppass_status_t | Cy_HPPASS_SAR_DisableGroupContConvert (uint8_t grpIdx) |
Disables continuous conversion for the specified SAR group. More... | |
__STATIC_INLINE uint8_t | Cy_HPPASS_SAR_GetTriggerCollisionStatus (void) |
Returns the Sequencer Group Trigger Collision Status for all the Groups. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_ClearTriggerCollisionStatus (uint8_t trigCollision) |
Clears the Sequencer Group Trigger Collision Status for the specified Sequences. More... | |
__STATIC_INLINE uint8_t | Cy_HPPASS_SAR_GetHoldViolationStatus (void) |
Returns the Sequencer Group Hold Violation Status for all the Sequences. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_ClearHoldViolationStatus (uint8_t holdViolation) |
Clears the Sequencer Group Hold Violation Status for the specified Sequences. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_SetHoldViolationCnt (uint16_t cnt) |
Sets the common maximum hold count value for all the Sequencer Groups. More... | |
__STATIC_INLINE uint16_t | Cy_HPPASS_SAR_GetHoldViolationCnt (void) |
Returns the common maximum hold count value for all the Sequencer Groups. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_SetTempSensorCurrent (cy_en_hppass_sar_temp_sensor_current_t curr) |
Selects low or high current for temperature sensor. More... | |
__STATIC_INLINE int16_t | Cy_HPPASS_TEMP_Calc (int16_t tempHi, int16_t tempLo) |
Calculates the temperature based on two ADC reading results of temperature sensor. More... | |
void | Cy_HPPASS_SAR_Adjust (int16_t temp, uint16_t vRef) |
Adjusts the offset calibration value according to input temperature value. More... | |
__STATIC_INLINE uint32_t | Cy_HPPASS_SAR_Limit_GetInterruptStatus (void) |
Returns the limit crossing interrupt register status. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_Limit_ClearInterrupt (uint32_t interrupt) |
Clears the limit crossing interrupt for SAR. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_Limit_SetInterrupt (uint32_t interrupt) |
Sets a software interrupt request for the specified limit crossing detection block. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_Limit_SetInterruptMask (uint32_t interrupt) |
Enables the interrupt for the specified limit crossing detection block. More... | |
__STATIC_INLINE uint32_t | Cy_HPPASS_SAR_Limit_GetInterruptMask (void) |
Returns the interrupt mask for the specified limit crossing detection block. More... | |
__STATIC_INLINE uint32_t | Cy_HPPASS_SAR_Limit_GetInterruptStatusMasked (void) |
Gets limit crossing interrupt masked status. More... | |
__STATIC_INLINE uint32_t | Cy_HPPASS_SAR_Result_GetInterruptStatus (void) |
Gets the SAR result interrupt status (ENTRY done, FIR done). More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_Result_ClearInterrupt (uint32_t interrupt) |
Clears SAR result interrupt. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_Result_SetInterrupt (uint32_t interrupt) |
Sets a software SAR result interrupt request. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_Result_SetInterruptMask (uint32_t interrupt) |
Enables the SAR result interrupt. More... | |
__STATIC_INLINE uint32_t | Cy_HPPASS_SAR_Result_GetInterruptMask (void) |
Gets the SAR result interrupt mask. More... | |
__STATIC_INLINE uint32_t | Cy_HPPASS_SAR_Result_GetInterruptStatusMasked (void) |
Gets the SAR result interrupt masked status. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_SetSwitch (uint16_t muxMask) |
Sets selected AROUTE switch closed. More... | |
__STATIC_INLINE void | Cy_HPPASS_SAR_ClearSwitch (uint16_t muxMask) |
Clears selected AROUTE switch open. More... | |
__STATIC_INLINE uint16_t | Cy_HPPASS_SAR_GetSwitchStatus (void) |
Reads the current state of the AROUTE switch. More... | |
float32_t | Cy_HPPASS_SAR_CountsTo_Volts (uint8_t chanIdx, uint16_t vRef, int16_t chanCounts) |
Converts the raw ADC result in counts into the analog pin voltage in volts. More... | |
int16_t | Cy_HPPASS_SAR_CountsTo_mVolts (uint8_t chanIdx, uint16_t vRef, int16_t chanCounts) |
Converts the raw ADC result in counts into the analog pin voltage in millivolts. More... | |
int32_t | Cy_HPPASS_SAR_CountsTo_uVolts (uint8_t chanIdx, uint16_t vRef, int16_t chanCounts) |
Converts the raw ADC result in counts into the analog pin voltage in microvolts. More... | |
cy_en_hppass_status_t Cy_HPPASS_SAR_Init | ( | const cy_stc_hppass_sar_t * | sarCfg | ) |
Loads the SAR ADC configuration.
Can be used after the Cy_HPPASS_Init function to update the SAR settings.
sarCfg | Pointer to the SAR configuration structure cy_stc_hppass_sar_t. The pointer cannot be NULL. |
__STATIC_INLINE bool Cy_HPPASS_SAR_IsBusy | ( | void | ) |
Returns the SAR ADC busy status.
__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_SAR_Limit_Config | ( | uint8_t | limIdx, |
const cy_stc_hppass_sar_limit_t * | limCfg | ||
) |
Configures the ADC limit crossing detection block.
limIdx | The index of the limit crossing detection block. Valid range 0..7. |
limCfg | Pointer to the limit crossing detection configuration structure cy_stc_hppass_sar_limit_t. The pointer cannot be NULL. |
__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_SAR_GroupConfig | ( | uint8_t | grpIdx, |
const cy_stc_hppass_sar_grp_t * | grpCfg | ||
) |
Configures a single Sequencer Group.
grpIdx | The index of the Sequencer Group. Valid range 0..7. |
grpCfg | Pointer to the Sequencer Group configuration structure cy_stc_hppass_sar_grp_t. The pointer cannot be NULL. |
__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_SAR_DisableGroupContConvert | ( | uint8_t | grpIdx | ) |
Disables continuous conversion for the specified SAR group.
grpIdx | The index of the Sequencer Group. Valid range 0..7. |
__STATIC_INLINE uint8_t Cy_HPPASS_SAR_GetTriggerCollisionStatus | ( | void | ) |
Returns the Sequencer Group Trigger Collision Status for all the Groups.
__STATIC_INLINE void Cy_HPPASS_SAR_ClearTriggerCollisionStatus | ( | uint8_t | trigCollision | ) |
Clears the Sequencer Group Trigger Collision Status for the specified Sequences.
trigCollision | The 8-bit Group mask (a bit per each Group). See Sequencer Group Trigger Collision Status Masks. |
__STATIC_INLINE uint8_t Cy_HPPASS_SAR_GetHoldViolationStatus | ( | void | ) |
Returns the Sequencer Group Hold Violation Status for all the Sequences.
__STATIC_INLINE void Cy_HPPASS_SAR_ClearHoldViolationStatus | ( | uint8_t | holdViolation | ) |
Clears the Sequencer Group Hold Violation Status for the specified Sequences.
holdViolation | The 8-bit Group mask (a bit per each Group). |
__STATIC_INLINE void Cy_HPPASS_SAR_SetHoldViolationCnt | ( | uint16_t | cnt | ) |
Sets the common maximum hold count value for all the Sequencer Groups.
cnt | The hold count value. |
__STATIC_INLINE uint16_t Cy_HPPASS_SAR_GetHoldViolationCnt | ( | void | ) |
Returns the common maximum hold count value for all the Sequencer Groups.
__STATIC_INLINE void Cy_HPPASS_SAR_SetTempSensorCurrent | ( | cy_en_hppass_sar_temp_sensor_current_t | curr | ) |
Selects low or high current for temperature sensor.
curr | Current: false - BJT current is 1uA (default), true - Add 8uA to BJT current. |
__STATIC_INLINE int16_t Cy_HPPASS_TEMP_Calc | ( | int16_t | tempHi, |
int16_t | tempLo | ||
) |
Calculates the temperature based on two ADC reading results of temperature sensor.
See the device Architecture Technical Reference Manual for more detail.
tempHi | ADC reading when the selected temp sensor is biased with a additional 8uA current. |
tempLo | ADC reading when the selected temp sensor is biased with a 1uA current. |
void Cy_HPPASS_SAR_Adjust | ( | int16_t | temp, |
uint16_t | vRef | ||
) |
Adjusts the offset calibration value according to input temperature value.
temp | The temperature value. |
vRef | The reference voltage in mV used by the system in the field. |
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Limit_GetInterruptStatus | ( | void | ) |
Returns the limit crossing interrupt register status.
__STATIC_INLINE void Cy_HPPASS_SAR_Limit_ClearInterrupt | ( | uint32_t | interrupt | ) |
Clears the limit crossing interrupt for SAR.
interrupt | The mask of interrupts to clear. Each bit of this mask is responsible for clearing of the particular interrupt in the SAR Group_hppass_sar_limit_interrupts. |
__STATIC_INLINE void Cy_HPPASS_SAR_Limit_SetInterrupt | ( | uint32_t | interrupt | ) |
Sets a software interrupt request for the specified limit crossing detection block.
interrupt | The mask of interrupts to set. Each bit of this mask is responsible for triggering of the particular interrupt in the SAR Group_hppass_sar_limit_interrupts. |
__STATIC_INLINE void Cy_HPPASS_SAR_Limit_SetInterruptMask | ( | uint32_t | interrupt | ) |
Enables the interrupt for the specified limit crossing detection block.
interrupt | The mask of interrupts allowable for activation. Each bit of this mask allows triggering of the particular interrupt in the SAR Group_hppass_sar_limit_interrupts. |
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Limit_GetInterruptMask | ( | void | ) |
Returns the interrupt mask for the specified limit crossing detection block.
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Limit_GetInterruptStatusMasked | ( | void | ) |
Gets limit crossing interrupt masked status.
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_GetInterruptStatus | ( | void | ) |
Gets the SAR result interrupt status (ENTRY done, FIR done).
__STATIC_INLINE void Cy_HPPASS_SAR_Result_ClearInterrupt | ( | uint32_t | interrupt | ) |
Clears SAR result interrupt.
interrupt | The mask of interrupts to clear. Each bit of this mask is responsible for clearing of the particular interrupt in the SAR Result Interrupt Masks. |
__STATIC_INLINE void Cy_HPPASS_SAR_Result_SetInterrupt | ( | uint32_t | interrupt | ) |
Sets a software SAR result interrupt request.
interrupt | The mask of interrupts to set. Each bit of this mask is responsible for triggering of the particular interrupt in the SAR Result Interrupt Masks. |
__STATIC_INLINE void Cy_HPPASS_SAR_Result_SetInterruptMask | ( | uint32_t | interrupt | ) |
Enables the SAR result interrupt.
interrupt | The mask of interrupts allowable for activation. Each bit of this mask allows triggering of the particular interrupt in the SAR Result Interrupt Masks. |
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_GetInterruptMask | ( | void | ) |
Gets the SAR result interrupt mask.
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_GetInterruptStatusMasked | ( | void | ) |
Gets the SAR result interrupt masked status.
__STATIC_INLINE void Cy_HPPASS_SAR_SetSwitch | ( | uint16_t | muxMask | ) |
Sets selected AROUTE switch closed.
Used for FW control input connections of the muxed samplers.
muxMask | The mask of AROUTE switch. |
__STATIC_INLINE void Cy_HPPASS_SAR_ClearSwitch | ( | uint16_t | muxMask | ) |
Clears selected AROUTE switch open.
Used for FW control input connections of the muxed samplers.
muxMask | The mask of AROUTE switch. |
__STATIC_INLINE uint16_t Cy_HPPASS_SAR_GetSwitchStatus | ( | void | ) |
Reads the current state of the AROUTE switch.
float32_t Cy_HPPASS_SAR_CountsTo_Volts | ( | uint8_t | chanIdx, |
uint16_t | vRef, | ||
int16_t | chanCounts | ||
) |
Converts the raw ADC result in counts into the analog pin voltage in volts.
For example, for the 0.534-volt ADC, the return value is 0.534. Voltage calculation depends on ADC channel work modes: Averaging, Signed, Pseudo-Differential, and Sampler Gain.
The equation:
V = ((chanCounts + chanOffset * avgMultiplier) * vRef / 1000) / (4095 * avgMultiplier * samplerGain)
where,
chanIdx | The channel index . Valid range - 0..27. |
vRef | The SAR ADC reference voltage in millivolts |
chanCounts | Conversion result from Cy_HPPASS_SAR_Result_ChannelRead |
int16_t Cy_HPPASS_SAR_CountsTo_mVolts | ( | uint8_t | chanIdx, |
uint16_t | vRef, | ||
int16_t | chanCounts | ||
) |
Converts the raw ADC result in counts into the analog pin voltage in millivolts.
For example, for the 0.534-volts ADC, the return value is 534. Voltage calculation depends on ADC channel work modes: Averaging, Signed, Pseudo-Differential, and Sampler Gain.
The equation:
mV = ((chanCounts + chanOffset * avgMultiplier) * vRef) / (4095 * avgMultiplier * samplerGain)
where,
chanIdx | The channel index . Valid range - 0..27. |
vRef | The SAR ADC reference voltage in millivolts |
chanCounts | Conversion result from Cy_HPPASS_SAR_Result_ChannelRead |
int32_t Cy_HPPASS_SAR_CountsTo_uVolts | ( | uint8_t | chanIdx, |
uint16_t | vRef, | ||
int16_t | chanCounts | ||
) |
Converts the raw ADC result in counts into the analog pin voltage in microvolts.
For example, for the 0.534-volts ADC, the return value is 534000. Voltage calculation depends on ADC channel work modes: Averaging, Signed, Pseudo-Differential, and Sampler Gain.
The equation:
uV = ((chanCounts + chanOffset * avgMultiplier) * vRef * 1000)/ (4095 * avgMultiplier * samplerGain)
where,
chanIdx | The channel index . Valid range - 0..27. |
vRef | The SAR ADC reference voltage in millivolts |
chanCounts | Conversion result from Cy_HPPASS_SAR_Result_ChannelRead |