ModusToolbox Safety Test Library
Loading...
Searching...
No Matches

General Description

Functions

uint8_t SelfTests_ATOP_DCSG (PPCA_ATOPSS_DCSG_GRP_DAC_R2R_Type *dacBase, PPCA_ATOPSS_DCSG_GRP_DCSG_SLICE_Type *dcsgBase)
 Performs ATOP DCSG (Digital Comparator and Slope Generator) self-test.

Function Documentation

◆ SelfTests_ATOP_DCSG()

uint8_t SelfTests_ATOP_DCSG ( PPCA_ATOPSS_DCSG_GRP_DAC_R2R_Type * dacBase,
PPCA_ATOPSS_DCSG_GRP_DCSG_SLICE_Type * dcsgBase )

Performs ATOP DCSG (Digital Comparator and Slope Generator) self-test.

This function tests the DCSG comparator functionality by:

  1. Configuring DAC R2R to generate known input voltages
  2. Configuring SLGEN to provide threshold values
  3. Verifying CMP_FLAG output matches expected results for both states:
    • Test 1: DAC = MAX (Vcc), Threshold = LOW -> CMP_FLAG should be 1
    • Test 2: DAC = MIN (GND), Threshold = HIGH -> CMP_FLAG should be 0
Parameters
dacBasePointer to DAC R2R base address for the DCSG group. Example: PPCA_ATOPSS_DCSG_GRP0_DAC_R2R, PPCA_ATOPSS_DCSG_GRP1_DAC_R2R
dcsgBasePointer to DCSG slice base address to test. Example: PPCA_ATOPSS_DCSG_GRP0_DCSG_SLICE0, &PPCA_ATOPSS_DCSG_GRP0_DCSG_SLICE0[2]
Returns
OK_STATUS (0) - Test passed, DCSG comparator functioning correctly
ERROR_STATUS (1) - Test failed (CMP_FLAG mismatch or invalid parameters)
Note
The PPCA subsystem must be enabled by calling Cy_PPCA_Enable(PPCA_CNFG) before invoking this function.

Example usage:

Cy_PPCA_Enable(PPCA_CNFG);
// Test Group 0, Slice 0
uint8_t result = SelfTests_ATOP_DCSG(PPCA_ATOPSS_DCSG_GRP0_DAC_R2R,
PPCA_ATOPSS_DCSG_GRP0_DCSG_SLICE0);
// Test all slices in Group 0 (slices 0-5)
for (uint32_t i = 0U; i < 6U; i++)
{
result = SelfTests_ATOP_DCSG(PPCA_ATOPSS_DCSG_GRP0_DAC_R2R,
&PPCA_ATOPSS_DCSG_GRP0_DCSG_SLICE0[i]);
}
uint8_t SelfTests_ATOP_DCSG(PPCA_ATOPSS_DCSG_GRP_DAC_R2R_Type *dacBase, PPCA_ATOPSS_DCSG_GRP_DCSG_SLICE_Type *dcsgBase)
Performs ATOP DCSG (Digital Comparator and Slope Generator) self-test.