CAT2 Peripheral Driver Library

Functions

void Cy_DSADC_EnableHPBGR (PACSS_MMIO_Type *base, const cy_stc_dsadc_hpbgr_config_t *config)
 Configure and enable the High Precision Band Gap Reference (HPBGR). More...
 
void Cy_DSADC_DisableHPBGR (PACSS_MMIO_Type *base)
 Disable the High Precision Band Gap Reference (HPBGR). More...
 
void Cy_DSADC_SetGroundReference (PACSS_MMIO_Type *base, cy_en_dsadc_ground_reference_t select)
 Set the ground connection for the high voltage divider. More...
 
uint16_t Cy_DSADC_GetThresholdCount (const PACSS_MMIO_Type *base, cy_en_dsadc_threshold_select_t select)
 Get the status counter value that indicates how many time low or high threshold is crossed. More...
 
void Cy_DSADC_SetChoppingPosition (PACSS_MMIO_Type *base, cy_en_dsadc_hpbgr_chopping_phase_t select)
 Set the chopping position. More...
 
cy_en_dsadc_hpbgr_chopping_phase_t Cy_DSADC_GetChoppingPosition (const PACSS_MMIO_Type *base)
 Get the chopping position. More...
 
void Cy_DSADC_AgcInit (PACSS_MMIO_Type *base, const cy_stc_dsadc_agc_config_t *config)
 Configure the Automatic Gain Correction (AGC). More...
 
void Cy_DSADC_AgcEnable (PACSS_MMIO_Type *base)
 Enable Automatic Gain Correction (AGC). More...
 
void Cy_DSADC_AgcDisable (PACSS_MMIO_Type *base)
 Disable Automatic Gain Correction (AGC). More...
 
bool Cy_DSADC_AgcIsEnabled (const PACSS_MMIO_Type *base)
 Returns the AGC status register value. More...
 
void Cy_DSADC_AgcSetGainCorrection (PACSS_MMIO_Type *base, uint8_t index, uint16_t gain)
 Set the gain correction factor for the specified AGC gain level. More...
 
void Cy_DSADC_AgcSetOffsetCorrection (PACSS_MMIO_Type *base, uint8_t index, int16_t offset)
 Set the offset correction factor for the specified AGC gain level. More...
 
void Cy_DSADC_EnableLowDropoutRegulator (PACSS_MMIO_Type *base)
 Enables the LDO, which provides voltage to the modulator. More...
 
void Cy_DSADC_DisableLowDropoutRegulator (PACSS_MMIO_Type *base)
 Disables the LDO, which provides voltage to the modulator. More...
 
void Cy_DSADC_SetAccumulatorThreshold (PACSS_DCHAN_Type *base, int32_t threshold)
 Sets the threshold for the accumulator. More...
 
void Cy_DSADC_ResetAccumulator (PACSS_DCHAN_Type *base)
 Resets the accumulated result to zero. More...
 
void Cy_DSADC_StartConversionAll (PACSS_MMIO_Type *base)
 Triggers the conversion for all enabled primary channels. More...
 
void Cy_DSADC_PendSecondConvAll (PACSS_MMIO_Type *base)
 Triggers the conversion for all enabled secondary channels. More...
 

Detailed Description

Function Documentation

◆ Cy_DSADC_EnableHPBGR()

void Cy_DSADC_EnableHPBGR ( PACSS_MMIO_Type *  base,
const cy_stc_dsadc_hpbgr_config_t config 
)

Configure and enable the High Precision Band Gap Reference (HPBGR).

Parameters
baseThe pointer to the MMIO instance of the PACSS.
configConfiguration options for the HPBGR. See cy_stc_dsadc_hpbgr_config_t.

◆ Cy_DSADC_DisableHPBGR()

void Cy_DSADC_DisableHPBGR ( PACSS_MMIO_Type *  base)

Disable the High Precision Band Gap Reference (HPBGR).

Parameters
baseThe pointer to the MMIO instance of the PACSS.

◆ Cy_DSADC_SetGroundReference()

void Cy_DSADC_SetGroundReference ( PACSS_MMIO_Type *  base,
cy_en_dsadc_ground_reference_t  select 
)

Set the ground connection for the high voltage divider.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
selectGround Reference Selection. see cy_en_dsadc_ground_reference_t

◆ Cy_DSADC_GetThresholdCount()

uint16_t Cy_DSADC_GetThresholdCount ( const PACSS_MMIO_Type *  base,
cy_en_dsadc_threshold_select_t  select 
)

Get the status counter value that indicates how many time low or high threshold is crossed.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
selectSelect to get low ot high threshold count value. See cy_en_dsadc_threshold_select_t
Returns
Threshold count status.

◆ Cy_DSADC_SetChoppingPosition()

void Cy_DSADC_SetChoppingPosition ( PACSS_MMIO_Type *  base,
cy_en_dsadc_hpbgr_chopping_phase_t  select 
)

Set the chopping position.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
selectChopping position select CY_DSADC_HPBGR_CHOPPING_PHASE_NORMAL or CY_DSADC_HPBGR_CHOPPING_PHASE_REVERSE. See cy_en_dsadc_hpbgr_chopping_phase_t
Note
Only applies when CHOP_EN=0. Use this function before Cy_DSADC_EnableHPBGR().

◆ Cy_DSADC_GetChoppingPosition()

cy_en_dsadc_hpbgr_chopping_phase_t Cy_DSADC_GetChoppingPosition ( const PACSS_MMIO_Type *  base)

Get the chopping position.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
Returns
Chopping position CY_DSADC_HPBGR_CHOPPING_PHASE_NORMAL or CY_DSADC_HPBGR_CHOPPING_PHASE_REVERSE. See cy_en_dsadc_hpbgr_chopping_phase_t

◆ Cy_DSADC_AgcInit()

void Cy_DSADC_AgcInit ( PACSS_MMIO_Type *  base,
const cy_stc_dsadc_agc_config_t config 
)

Configure the Automatic Gain Correction (AGC).

Parameters
baseThe pointer to the MMIO instance of the PACSS.
configConfiguration options for the AGC. See cy_stc_dsadc_agc_config_t

◆ Cy_DSADC_AgcEnable()

void Cy_DSADC_AgcEnable ( PACSS_MMIO_Type *  base)

Enable Automatic Gain Correction (AGC).

Parameters
baseThe pointer to the MMIO instance of the PACSS.

◆ Cy_DSADC_AgcDisable()

void Cy_DSADC_AgcDisable ( PACSS_MMIO_Type *  base)

Disable Automatic Gain Correction (AGC).

Parameters
baseThe pointer to the MMIO instance of the PACSS.

◆ Cy_DSADC_AgcIsEnabled()

bool Cy_DSADC_AgcIsEnabled ( const PACSS_MMIO_Type *  base)

Returns the AGC status register value.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
Returns
Current AGC status.
  • true : AGC enabled.
  • false : AGC disabled.

◆ Cy_DSADC_AgcSetGainCorrection()

void Cy_DSADC_AgcSetGainCorrection ( PACSS_MMIO_Type *  base,
uint8_t  index,
uint16_t  gain 
)

Set the gain correction factor for the specified AGC gain level.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexAGC gain level. Valid inputs are between 0 and 9.
gainGain correction factor.

◆ Cy_DSADC_AgcSetOffsetCorrection()

void Cy_DSADC_AgcSetOffsetCorrection ( PACSS_MMIO_Type *  base,
uint8_t  index,
int16_t  offset 
)

Set the offset correction factor for the specified AGC gain level.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexAGC gain level. Valid inputs are between 0 and 9.
offsetOffset correction factor. Valid inputs are between -32768 and 32767.

◆ Cy_DSADC_EnableLowDropoutRegulator()

void Cy_DSADC_EnableLowDropoutRegulator ( PACSS_MMIO_Type *  base)

Enables the LDO, which provides voltage to the modulator.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
Warning
The LDO must be enabled before enabling Analog Channel (ACHAN). Simply disabling and re-enabling the LDO will not work correctly. To ensure proper functionality, the LDO must be enabled before enabling the ACHAN, and the LDO should be disabled only after the ACHAN is disabled.

◆ Cy_DSADC_DisableLowDropoutRegulator()

void Cy_DSADC_DisableLowDropoutRegulator ( PACSS_MMIO_Type *  base)

Disables the LDO, which provides voltage to the modulator.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
Warning
The LDO must be enabled before enabling Analog Channel (ACHAN). Simply disabling and re-enabling the LDO will not work correctly. To ensure proper functionality, the LDO must be enabled before enabling the ACHAN, and the LDO should be disabled only after the ACHAN is disabled.

◆ Cy_DSADC_SetAccumulatorThreshold()

void Cy_DSADC_SetAccumulatorThreshold ( PACSS_DCHAN_Type *  base,
int32_t  threshold 
)

Sets the threshold for the accumulator.

Parameters
baseThe base address for the Digital Channel.
thresholdAccumulator Threshold valid value are between -2147483648 and 2147483647.

◆ Cy_DSADC_ResetAccumulator()

void Cy_DSADC_ResetAccumulator ( PACSS_DCHAN_Type *  base)

Resets the accumulated result to zero.

Parameters
baseThe base address for the Digital Channel.

◆ Cy_DSADC_StartConversionAll()

void Cy_DSADC_StartConversionAll ( PACSS_MMIO_Type *  base)

Triggers the conversion for all enabled primary channels.

Parameters
baseThe pointer to the MMIO instance of the PACSS.

◆ Cy_DSADC_PendSecondConvAll()

void Cy_DSADC_PendSecondConvAll ( PACSS_MMIO_Type *  base)

Triggers the conversion for all enabled secondary channels.

Parameters
baseThe pointer to the MMIO instance of the PACSS.