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...
 
uint8_t Cy_DSADC_AgcGetGainLevel (const PACSS_MMIO_Type *base)
 Get current gain level. More...
 
uint16_t Cy_DSADC_AgcGetFastDecimatorResult (const PACSS_MMIO_Type *base)
 Get the AGC Fast Decimator Result. 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...
 
void Cy_DSADC_OcdInit (PACSS_MMIO_Type *base, uint8_t index, cy_stc_dsadc_ocd_config_t *config)
 Initializes the OCD. More...
 
void Cy_DSADC_OcdGetConfig (PACSS_MMIO_Type *base, uint8_t index, cy_stc_dsadc_ocd_config_t *config)
 Get the OCD configuration. More...
 
void Cy_DSADC_OcdEnable (PACSS_MMIO_Type *base, uint8_t index)
 Enable the OCD. More...
 
void Cy_DSADC_OcdDisable (PACSS_MMIO_Type *base, uint8_t index)
 Disable the OCD. More...
 
bool Cy_DSADC_OcdIsEnabled (PACSS_MMIO_Type *base, uint8_t index)
 Get OCD enabled status. More...
 
uint32_t Cy_DSADC_OcdGetStatus (const PACSS_MMIO_Type *base, uint8_t index)
 Returns the OCD status register value. More...
 
void Cy_DSADC_OcdClearHoldStatus (PACSS_MMIO_Type *base, uint8_t index)
 Clear the OCD hold status. More...
 
void Cy_DSADC_OcdSetTestMode (PACSS_MMIO_Type *base, uint8_t index, cy_en_dsadc_ocd_test_mode_t mode)
 Set OCD self test mode. More...
 
void Cy_DSADC_OcdSetOutputMode (PACSS_MMIO_Type *base, cy_en_dsadc_ocd_output_mode_t mode)
 Select output mode for condensing OCD1 output onto OCD0 output pin. More...
 
cy_en_dsadc_ocd_output_mode_t Cy_DSADC_OcdGetOutputMode (PACSS_MMIO_Type *base)
 Return current OCD0 output mode. 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
Note
This API is available only on devices that include the High Voltage Divider. Refer to the device datasheet for more details.

◆ 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_AgcGetGainLevel()

uint8_t Cy_DSADC_AgcGetGainLevel ( const PACSS_MMIO_Type *  base)

Get current gain level.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
Returns
Current gain level.

◆ Cy_DSADC_AgcGetFastDecimatorResult()

uint16_t Cy_DSADC_AgcGetFastDecimatorResult ( const PACSS_MMIO_Type *  base)

Get the AGC Fast Decimator Result.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
Returns
AGC Fast Decimator Result.

◆ 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.

◆ Cy_DSADC_OcdInit()

void Cy_DSADC_OcdInit ( PACSS_MMIO_Type *  base,
uint8_t  index,
cy_stc_dsadc_ocd_config_t config 
)

Initializes the OCD.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexOCD index. Valid inputs are between 0 and 1 (inclusive).
configConfiguration options for the OCD. See cy_stc_dsadc_ocd_config_t
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdGetConfig()

void Cy_DSADC_OcdGetConfig ( PACSS_MMIO_Type *  base,
uint8_t  index,
cy_stc_dsadc_ocd_config_t config 
)

Get the OCD configuration.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexOCD index. Valid inputs are between 0 and 1 (inclusive).
configPointer to the configuration options for the OCD. See cy_stc_dsadc_ocd_config_t
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdEnable()

void Cy_DSADC_OcdEnable ( PACSS_MMIO_Type *  base,
uint8_t  index 
)

Enable the OCD.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexOCD index. Valid inputs are between 0 and 1 (inclusive).
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdDisable()

void Cy_DSADC_OcdDisable ( PACSS_MMIO_Type *  base,
uint8_t  index 
)

Disable the OCD.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexOCD index. Valid inputs are between 0 and 1 (inclusive).
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdIsEnabled()

bool Cy_DSADC_OcdIsEnabled ( PACSS_MMIO_Type *  base,
uint8_t  index 
)

Get OCD enabled status.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexOCD index. Valid inputs are between 0 and 1 (inclusive).
Returns
Current OCD status.
  • true : OCD enabled.
  • false : OCD disabled.
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdGetStatus()

uint32_t Cy_DSADC_OcdGetStatus ( const PACSS_MMIO_Type *  base,
uint8_t  index 
)

Returns the OCD status register value.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexOCD index. Valid inputs are between 0 and 1 (inclusive).
Returns
Over Current Detector Status. See OCD Status Masks
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdClearHoldStatus()

void Cy_DSADC_OcdClearHoldStatus ( PACSS_MMIO_Type *  base,
uint8_t  index 
)

Clear the OCD hold status.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexOCD index. Valid inputs are between 0 and 1 (inclusive).
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdSetTestMode()

void Cy_DSADC_OcdSetTestMode ( PACSS_MMIO_Type *  base,
uint8_t  index,
cy_en_dsadc_ocd_test_mode_t  mode 
)

Set OCD self test mode.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
indexOCD index. Valid inputs are between 0 and 1 (inclusive).
modeOCD self test mode to set. See cy_en_dsadc_ocd_test_mode_t
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdSetOutputMode()

void Cy_DSADC_OcdSetOutputMode ( PACSS_MMIO_Type *  base,
cy_en_dsadc_ocd_output_mode_t  mode 
)

Select output mode for condensing OCD1 output onto OCD0 output pin.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
modeOCD output mode to set. See cy_en_dsadc_ocd_output_mode_t
Note
Applicable to PSOC4 HVPA SPM only.

◆ Cy_DSADC_OcdGetOutputMode()

cy_en_dsadc_ocd_output_mode_t Cy_DSADC_OcdGetOutputMode ( PACSS_MMIO_Type *  base)

Return current OCD0 output mode.

Parameters
baseThe pointer to the MMIO instance of the PACSS.
Returns
OCD output mode. See cy_en_dsadc_ocd_output_mode_t
Note
Applicable to PSOC4 HVPA SPM only.