Functions | |
| uint8_t | SelfTest_ADC_Config_Save (PASS_SAR_Type *base, const stl_adc_config_mask_t *userMask, stl_adc_config_snapshot_t *snapshot) |
Captures a CRC-protected snapshot of one SAR2 ADC instance's configuration registers, applying the driver-known-fixed masks and the caller-provided userMask before storing each value. | |
| uint8_t | SelfTest_ADC_MMIO_Config_Save (PASS_EPASS_MMIO_Type *mmioBase, const stl_adc_mmio_config_mask_t *userMask, stl_adc_mmio_config_snapshot_t *snapshot) |
Captures a CRC-protected snapshot of the PASS-level registers shared by every SAR2 ADC instance, applying the driver-known-fixed mask and the caller-provided userMask before storing each value. | |
| uint8_t | SelfTest_ADC_Config_Verify (PASS_SAR_Type *base, const stl_adc_config_snapshot_t *snapshot) |
| Verifies the live SAR2 ADC configuration registers against a snapshot previously captured by SelfTest_ADC_Config_Save. | |
| uint8_t | SelfTest_ADC_MMIO_Config_Verify (PASS_EPASS_MMIO_Type *mmioBase, const stl_adc_mmio_config_snapshot_t *snapshot) |
| Verifies the live shared PASS-level registers against a snapshot previously captured by SelfTest_ADC_MMIO_Config_Save. | |
| uint8_t SelfTest_ADC_Config_Save | ( | PASS_SAR_Type * | base, |
| const stl_adc_config_mask_t * | userMask, | ||
| stl_adc_config_snapshot_t * | snapshot ) |
Captures a CRC-protected snapshot of one SAR2 ADC instance's configuration registers, applying the driver-known-fixed masks and the caller-provided userMask before storing each value.
Shared PASS-level registers are captured separately by SelfTest_ADC_MMIO_Config_Save.
Any channel index with its bit set in userMask->channelSkipMask is zero-filled in the snapshot and excluded from SelfTest_ADC_Config_Verify.
Call this once after the ADC is fully configured (Cy_SAR2_Init and any subsequent Cy_SAR2_Channel_Init, Cy_SAR2_Diag_Init, or calibration setter calls), before entering the periodic self-test schedule. Because CTL.ENABLED and CH.ENABLE.CHAN_EN are masked, calling it before or after Cy_SAR2_Enable gives the same result.
| base | The pointer to the SAR ADC instance whose registers are captured. |
| userMask | Application-provided mask describing fields to exclude from future comparisons. Must not be NULL - pass an all-zero stl_adc_config_mask_t to compare every field in every channel. |
| snapshot | Destination for the captured, CRC-protected snapshot. Stored snapshot used for later SelfTest_ADC_Config_Verify calls. |
base, userMask, or snapshot is NULL. | uint8_t SelfTest_ADC_MMIO_Config_Save | ( | PASS_EPASS_MMIO_Type * | mmioBase, |
| const stl_adc_mmio_config_mask_t * | userMask, | ||
| stl_adc_mmio_config_snapshot_t * | snapshot ) |
Captures a CRC-protected snapshot of the PASS-level registers shared by every SAR2 ADC instance, applying the driver-known-fixed mask and the caller-provided userMask before storing each value.
Call this once for the whole PASS block after initialization (including any Cy_SAR2_SetGenericTriggerInput, Cy_SAR2_SetGenericTriggerOutput, or Cy_SAR2_SetReferenceBufferMode calls), alongside SelfTest_ADC_Config_Save.
| mmioBase | The pointer to the shared PASS top-level MMIO block (PASS0->EPASS_MMIO). |
| userMask | Application-provided mask describing fields to exclude from future comparisons. Must not be NULL - pass an all-zero stl_adc_mmio_config_mask_t to compare every field. |
| snapshot | Destination for the captured, CRC-protected snapshot. Stored snapshot used for later SelfTest_ADC_MMIO_Config_Verify calls. |
mmioBase, userMask, or snapshot is NULL. | uint8_t SelfTest_ADC_Config_Verify | ( | PASS_SAR_Type * | base, |
| const stl_adc_config_snapshot_t * | snapshot ) |
Verifies the live SAR2 ADC configuration registers against a snapshot previously captured by SelfTest_ADC_Config_Save.
The snapshot's own CRC is checked first, a CRC mismatch returns ERROR_ADC_CONFIG_SNAPSHOT_INVALID without comparing any register. If the CRC matches, the live registers are read, masked with the driver-known-fixed masks and the snapshot's stored userMask, and then compared. Channels excluded by userMask.channelSkipMask are not compared.
| base | The pointer to the SAR ADC instance to verify. Must be the same instance passed to SelfTest_ADC_Config_Save when snapshot was captured. |
| snapshot | The snapshot captured by SelfTest_ADC_Config_Save. |
base or snapshot is NULL. | uint8_t SelfTest_ADC_MMIO_Config_Verify | ( | PASS_EPASS_MMIO_Type * | mmioBase, |
| const stl_adc_mmio_config_snapshot_t * | snapshot ) |
Verifies the live shared PASS-level registers against a snapshot previously captured by SelfTest_ADC_MMIO_Config_Save.
The snapshot's own CRC is checked first; a CRC mismatch returns ERROR_ADC_CONFIG_SNAPSHOT_INVALID without comparing any register. If the CRC matches, the live registers are read, masked with the driver-known-fixed mask and the snapshot's stored userMask, and then compared.
| mmioBase | The pointer to the shared PASS top-level MMIO block (PASS0->EPASS_MMIO). |
| snapshot | The snapshot captured by SelfTest_ADC_MMIO_Config_Save. |
mmioBase or snapshot is NULL.