Document API IEC60730 Library
|
Built In Self Test - Executed periodically. More...
Classes | |
struct | sl_iec60730_safety_check_t |
Functions | |
void | sl_iec60730_safety_check_error_occur (sl_iec60730_test_failure_t failure) |
void | sl_iec60730_safety_check_reset_error (void) |
sl_iec60730_safety_check_t * | sl_iec60730_safety_check_get_error (void) |
void | sl_iec60730_bist (void) |
Built In Self Test - Executed periodically.
sl_iec60730_bist() confirms correct operation of the device during main loop execution. If a module validation fails, sl_iec60730_safe_state() is called.
OEM code must call sl_iec60730_safety_check_error_occur to set iec60730_safety_check to one of the failure conditions in sl_iec60730_test_failure_t if the code determines a failure has occurred. This can be used for communications channels or to trigger Safe State entry due to a failure within an interrupt.
The validation time for the full memory varies between devices depending on the size of memory available, and how frequently sl_iec60730_bist() is called by the main loop. For details see BIST call frequency.
Periodic BIST execution is shown in Figure 1
void sl_iec60730_bist | ( | void | ) |
public IEC60730 Built In Self Test
Each module is tested, and if a failure is detected sl_iec60730_safe_state() is called. If a test failure occurs outside this function (such as comms), called function sl_iec60730_safety_check_error_occur set iec60730_safety_check to sl_iec60730_test_failure_t.
void sl_iec60730_safety_check_error_occur | ( | sl_iec60730_test_failure_t | failure | ) |
public IEC60730 save error to variable iec60730_safety_check
failure | Enum with the failing test, can be preserved for debug. |
Called by OEM and interrupt check functions to set iec60730_safety_check to sl_iec60730_test_failure_t.
sl_iec60730_safety_check_t* sl_iec60730_safety_check_get_error | ( | void | ) |
public IEC60730 return value variable iec60730_safety_check
Called by OEM in sl_iec60730_safe_state functions to get value iec60730_safety_check, so OEM can get all sl_iec60730_test_failure_t occur
void sl_iec60730_safety_check_reset_error | ( | void | ) |
public IEC60730 reset value local iec60730_safety_check
Called by OEM when wanting to reset local variable value iec60730_safety_check which containing the errors that occurred and the number of errors