3.2.18 DIAG_PAC

The DIAG_PAC module is designed to verify the correct functionality of the Peripheral Access Controller (PAC) through a set of C function calls.

The DIAG_PAC software test API is mapped to the following safety mechanisms:

Table 3-18. 
FunctionDiagnostic MechanismUse CaseElapse Time (μs)~
DIAG_PAC_Protection()PAC_PROTECTIONPOST 359.04
DIAG_PAC_SFRReset()SFR_RESET_STATEPOST48.08

Configuring the Diagnostic

DIAG_PAC does not require additional configuration.

Using the Diagnostic

#include "diag_pac.h"

DIAG_TEST_STATUS DIAG_PAC_SFRPost( void )
{
    return DIAG_PAC_SFRReset(NULL, 0, false);
}

DIAG_TEST_STATUS DIAG_PAC_Post( void )
{
    pac_periphs_t periphs;
    
    // Select all peripherals to be tested
    periphs.intflaga = PAC_INTFLAGA_Msk;
    periphs.intflagb = PAC_INTFLAGB_Msk;
    periphs.intflagc = PAC_INTFLAGC_Msk;
    periphs.intflagahb = 0;
        
    return DIAG_PAC_Protection(&periphs);
}