MTB CAT1 Peripheral driver library
Useful Configuration Query Functions

General Description

This set of functions is for useful configuration query.

Functions

bool Cy_SAR_IsChannelSigned (const SAR_Type *base, uint32_t chan)
 Return true if channel result is configured for signed format, else false. More...
 
bool Cy_SAR_IsChannelSingleEnded (const SAR_Type *base, uint32_t chan)
 Return true if channel is single ended, else false. More...
 
__STATIC_INLINE bool Cy_SAR_IsChannelDifferential (const SAR_Type *base, uint32_t chan)
 Return true of channel is differential, else false. More...
 

Function Documentation

◆ Cy_SAR_IsChannelSigned()

bool Cy_SAR_IsChannelSigned ( const SAR_Type base,
uint32_t  chan 
)

Return true if channel result is configured for signed format, else false.

The formats for single-ended and differential channels are independent. This function will first check whether the channel is single-ended or differential.

Parameters
basePointer to structure describing registers
chanThe channel to check, between 0 and CY_SAR_INJ_CHANNEL
Returns
If channel number is invalid, false is returned
Function Usage
/* Query if channel 0 is signed. */
bool isSigned;
isSigned = Cy_SAR_IsChannelSigned(SAR_HW, 0UL);

◆ Cy_SAR_IsChannelSingleEnded()

bool Cy_SAR_IsChannelSingleEnded ( const SAR_Type base,
uint32_t  chan 
)

Return true if channel is single ended, else false.

Parameters
basePointer to structure describing registers
chanThe channel to check, between 0 and CY_SAR_INJ_CHANNEL
Returns
If channel number is invalid, false is returned
Function Usage
/* Query if channel 0 is single ended. */
bool isSingleEnded;
isSingleEnded = Cy_SAR_IsChannelSingleEnded(SAR_HW, 0UL);

◆ Cy_SAR_IsChannelDifferential()

__STATIC_INLINE bool Cy_SAR_IsChannelDifferential ( const SAR_Type base,
uint32_t  chan 
)

Return true of channel is differential, else false.

Parameters
basePointer to structure describing registers
chanThe channel to check, starting at 0.
Returns
A false is return if chan is invalid.
Function Usage
/* Query if channel 0 is differential. */
bool isDifferential;
isDifferential = Cy_SAR_IsChannelDifferential(SAR_HW, 0UL);