3.2.10 DIAG_EIC

The DIAG_EIC module is designed to verify the correct functionality of the External Interrupt Controller (EIC) through a set of C function calls.

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

Table 3-11. 
FunctionDiagnostic MechanismUse CaseElasped Timer (μs) ~
DIAG_EIC_Interrupts()EIC_INTERRUPTSPOST54.1
DIAG_EIC_SFRReset()SFR_RESET_STATEPOST77
DIAG_EIC_SFRWriteRead()SFR_WRITE_READPOST / OnDemand 76

Configuring the Diagnostic

DIAG_EIC Safe-Plib must be configured as illustrated to supported to support all diagnostics:

Using the Diagnostic

#include "definitions.h"

// EIC SFR Tests
DIAG_TEST_STATUS DIAG_EIC_SFRPost( void )
{
    DIAG_TEST_STATUS result;
    
    result = DIAG_EIC_SFRReset(NULL, 0, false);
    if (result == DIAG_TEST_PASSED)
    {
        result = DIAG_EIC_SFRWriteRead(NULL, 0, false);
    }
    return result;
}


// EIC Post Tests
DIAG_TEST_STATUS DIAG_EIC_Post( void )
{
    DIAG_TEST_STATUS result = DIAG_TEST_FAILED;
    // Check if all dependencies have been tested
    PAC_PeripheralProtectSetup(PAC_PERIPHERAL_EIC, PAC_PROTECTION_CLEAR);
    
    // Test EXTINT0
    result = DIAG_EIC_Interrupts( PORTA, PIN9, PORTB, PIN31);
    if (result == DIAG_TEST_PASSED)
    {
        // Test EXTNMI
        result = DIAG_EIC_Interrupts( PORTA, PIN8, PORTB, PIN0);
    }

    return result;
}