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

General Description

Functions

uint8_t SelfTest_ATOP_ADC_Filter (uint8_t adcGroup, uint8_t testMask)
 Performs a self-test of the ATOP ADC digital filter chain for the given ADC group by running the selected filter types on each filter instance of that group.

Function Documentation

◆ SelfTest_ATOP_ADC_Filter()

uint8_t SelfTest_ATOP_ADC_Filter ( uint8_t adcGroup,
uint8_t testMask )

Performs a self-test of the ATOP ADC digital filter chain for the given ADC group by running the selected filter types on each filter instance of that group.

The filter types to run are chosen with a bit mask (like SelfTest_CLB).

For each selected filter type, a known input sample sequence is applied with only that filter enabled (all other stages bypassed), and the read-back output is compared against the value expected for the filter's transfer function within a tolerance. The original ADC / filter configuration is preserved and restored on return so the test can be interleaved with normal use of the other ADC groups.

Parameters
adcGroupADC group selector. One of ATOP_ADC_FILTER_GROUP_0 .. ATOP_ADC_FILTER_GROUP_3.
testMaskBit mask selecting which filter types to run: any OR-combination of ATOP_ADC_FILTER_TEST_MEDIAN, ATOP_ADC_FILTER_TEST_LINTP, ATOP_ADC_FILTER_TEST_LPF, ATOP_ADC_FILTER_TEST_CIC3, ATOP_ADC_FILTER_TEST_AVG, ATOP_ADC_FILTER_TEST_MINMAX, or ATOP_ADC_FILTER_TEST_ALL for all types.
Returns
OK_STATUS (0) - All selected filter types passed on every instance
ERROR_STATUS (1) - A filter output was out of tolerance or a timeout occurred
ERROR_BAD_PARAM (9) - Invalid adcGroup, or testMask selects no valid type (no HW access performed)