MTB CAT1 Peripheral driver library

General Description

Functions

__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_SAR_ChannelConfig (uint8_t chanIdx, const cy_stc_hppass_sar_chan_t *chanCfg)
 Initializes the ADC channel. More...
 
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_GetStatus (void)
 Returns the combined status of all the ADC channels and FIRs results. More...
 
__STATIC_INLINE void Cy_HPPASS_SAR_Result_ClearStatus (uint32_t mask)
 Clears all the ADC channels and FIRs results status. More...
 
__STATIC_INLINE int16_t Cy_HPPASS_SAR_Result_ChannelRead (uint8_t chanIdx)
 Returns the ADC channel results. More...
 
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_ChannelPackedRead (uint8_t pairIdx)
 Returns the specified adjacent even/odd channel results from the channel result packed register. More...
 
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_GetOverflowStatus (void)
 Returns the ADC groups and FIRs result overflow status. More...
 
__STATIC_INLINE void Cy_HPPASS_SAR_Result_ClearOverflowStatus (uint32_t mask)
 Clears the ADC groups and FIRs result overflow status. More...
 
__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Limit_GetStatus (void)
 Returns the combined limit crossing detection status of all the ADC and FIR channels. More...
 
__STATIC_INLINE void Cy_HPPASS_SAR_Limit_ClearStatus (uint32_t mask)
 Clears the limit crossing detection status for all the ADC and FIR channels. More...
 

Function Documentation

◆ Cy_HPPASS_SAR_ChannelConfig()

__STATIC_INLINE cy_en_hppass_status_t Cy_HPPASS_SAR_ChannelConfig ( uint8_t  chanIdx,
const cy_stc_hppass_sar_chan_t chanCfg 
)

Initializes the ADC channel.

Note
If AC is running this configuration is not allowed (CY_HPPASS_AC_INVALID_STATE will be returned).
If the SAR block is currently busy the initialization is not allowed (CY_HPPASS_SAR_INVALID_STATE will be returned).
Since the 'block ready' status is combined SAR and CSG, this particular SAR function cannot be protected from reinitialization during the 'block ready' == true condition, so it is on user's responsibility when and from where to call this function to reconfigure this SAR sub-block.
Parameters
chanIdxThe index of the channel. Valid range 0..27.
chanCfgPointer to the channel configuration structure cy_stc_hppass_sar_chan_t. The pointer cannot be NULL.
Returns
Status, cy_en_hppass_status_t.
Function Usage
{
.diff = false,
.sign = false,
.result = true,
};

◆ Cy_HPPASS_SAR_Result_GetStatus()

__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_GetStatus ( void  )

Returns the combined status of all the ADC channels and FIRs results.

Returns
The ADC channels and FIRs results status Result Status Masks.
Function Usage

◆ Cy_HPPASS_SAR_Result_ClearStatus()

__STATIC_INLINE void Cy_HPPASS_SAR_Result_ClearStatus ( uint32_t  mask)

Clears all the ADC channels and FIRs results status.

Parameters
maskThe channels and FIRs status mask Result Status Masks.
Function Usage

◆ Cy_HPPASS_SAR_Result_ChannelRead()

__STATIC_INLINE int16_t Cy_HPPASS_SAR_Result_ChannelRead ( uint8_t  chanIdx)

Returns the ADC channel results.

Parameters
chanIdxThe index of the channel instance. Valid range 0..27. Channel Indexes except FIR items.
Returns
The ADC channels results.
Function Usage
/* Read channel 0 measurement result */
printf("SAR0 Result: %x ", Cy_HPPASS_SAR_Result_ChannelRead(0));
printf("SAR12 Result: %x ", Cy_HPPASS_SAR_Result_ChannelRead(12));
printf("SAR16 Result: %x ", Cy_HPPASS_SAR_Result_ChannelRead(16));
printf("SAR20 Result: %x ", Cy_HPPASS_SAR_Result_ChannelRead(20));
printf("SAR24 Result: %x\r\n", Cy_HPPASS_SAR_Result_ChannelRead(24));

◆ Cy_HPPASS_SAR_Result_ChannelPackedRead()

__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_ChannelPackedRead ( uint8_t  pairIdx)

Returns the specified adjacent even/odd channel results from the channel result packed register.

Parameters
pairIdxThe index of the adjacent even/odd channels pair instance. Valid range 0..13.
Returns
The ADC even (low two bytes) and odd (high two bytes) channels results.
Function Usage
/* Read results from channels 0 and 1 */
uint32_t packedResult = Cy_HPPASS_SAR_Result_ChannelPackedRead(0U);

◆ Cy_HPPASS_SAR_Result_GetOverflowStatus()

__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Result_GetOverflowStatus ( void  )

Returns the ADC groups and FIRs result overflow status.

Returns
The ADC groups and FIRs results status Result Interrupt Masks
Function Usage

◆ Cy_HPPASS_SAR_Result_ClearOverflowStatus()

__STATIC_INLINE void Cy_HPPASS_SAR_Result_ClearOverflowStatus ( uint32_t  mask)

Clears the ADC groups and FIRs result overflow status.

Parameters
maskThe groups and FIRs result overflow status mask Result Interrupt Masks
Function Usage

◆ Cy_HPPASS_SAR_Limit_GetStatus()

__STATIC_INLINE uint32_t Cy_HPPASS_SAR_Limit_GetStatus ( void  )

Returns the combined limit crossing detection status of all the ADC and FIR channels.

Returns
The limit crossing detection status Result Status Masks
Function Usage
/* Check for limit crossing */
/* Scenario: Get combined limit crossing detection status of all the ADC and FIR channels */
{
/* Process limit crossing case */
}

◆ Cy_HPPASS_SAR_Limit_ClearStatus()

__STATIC_INLINE void Cy_HPPASS_SAR_Limit_ClearStatus ( uint32_t  mask)

Clears the limit crossing detection status for all the ADC and FIR channels.

Parameters
maskThe limit crossing detection status mask Result Status Masks
Function Usage
/* Clear the limit crossing detection status for all the ADC and FIR channels */