3.2.3.1 DIAG_BANDGAP_ReferenceVoltage
Returns the status of the BANDGAP_REFERENCE_VOLTAGE diagnostic
DIAG_TEST_STATUS
DIAG_BANDGAP_ReferenceVoltage
(
void
);
Diagnostic verifies the following faults do not exist
- Voltage Output Incorrect
- Cannot be Connected To ADC
Operating Mode
- Interface can be used at POST and ‘On Demand’
-
If running the test On Demand, since it uses ADC) then if ADC1 is being used it must be disabled and reenabled before and after the test. Also if the VREF settings must be saved and restored if they are not the default. See example below:
uint32_t vref;vref = SUPC_REGS->SUPC_VREF; // save off current valueSUPC_REGS->SUPC_VREF = 0; // revert to POST conditionADC1_Disable(); // must disable, then re-enable ADC1 across ADC0 testret = DIAG_BANDGAP_ReferenceVoltage(); // uses ADC0ADC1_Enable();SUPC_REGS->SUPC_VREF = vref; // restore
- none
Parameters
- adc_periph - enum value for which ADC peripheral to be tested
Returns
- DIAG_TEST_PASSED if no faults were found, otherwise, DIAG_TEST_FAILED.
