This self-diagnostic test for the ADC, DAC and analog multiplexer.
A plausibility check is done to make sure that ADC and DAC work correctly. The test is implemented in classb_analog_io_test() and consists on the following: the DAC generates 5 values (0%, 25%, 50%, 75% and 100% of the scale) and the ADC will read them. If the read values should deviate from the expected values more than a configurable threshold, the test would call the error handler CLASSB_ERROR_HANDLER_ANALOG().
The test checks one ADC module and one DAC module at a time, i.e. it has to be repeated until all modules are tested. Further, the ADC module to test should be able to read from the DAC module it is tested together with.
Class B Test | |
| void | classb_analog_io_test (DAC_t *dacptr, ADC_t *adcptr) |
| Functional test for the ADC, DAC and analog MUX. | |
| void classb_analog_io_test | ( | DAC_t * | dacptr, |
| ADC_t * | adcptr | ||
| ) |
Functional test for the ADC, DAC and analog MUX.
This function configures the DAC to output a constant voltage, after which the ADC is set to do 12 bit, signed conversions of the DAC. Range checking of the conversion results is then done to verify that ADC and DAC are working correctly.
| dacptr | Base address for registers of DAC module to test. |
| adcptr | Base address for registers of ADC module to test. |
Definition at line 114 of file classb_analog.c.
Referenced by ISR().
Here is the caller graph for this function: