![]() |
FuSa 8-Bit Libraries Safety Framework
|
Contains API prototypes and defines for the Error Manager. More...
Files | |
| file | midware_error_manager.c |
| Implements APIs for the Error Manager. | |
| file | midware_error_manager_diag.c |
| Implements APIs for the Error Manager Diagnostics. | |
| file | midware_error_manager_diag.h |
| Contains API prototypes and defines for the Error Manager Diagnostics. | |
Data Structures | |
| struct | errChConfig_t |
| Holds an error channel configuration for configuring the ERRCTRL. More... | |
| struct | errChConfigs_t |
| Holds configurations for all error channels. More... | |
Enumerations | |
| enum | errCh_t { ERRCH_VREGFAIL = 0U , ERRCH_BUSERR , ERRCH_RAM2 , ERRCH_FLASH2 , ERRCH_OPC , ERRCH_SPLIM , ERRCH_RAM1 , ERRCH_FLASH1 , ERRCH_VREGWARN , ERRCH_CFD0 , ERRCH_CFD1 , ERRCH_CFM0 , ERRCH_CFM1 , ERRCH_SWDT , ERRCH_EEPROM , ERRCH_EVSYS0 , ERRCH_EVSYS1 , ERRCH_MAX } |
| Hardware error channels found in the Error Controller. More... | |
| enum | errChSeverity_t { ERRCH_SEVERITY_CRITICAL = 0U , ERRCH_SEVERITY_RESERVED , ERRCH_SEVERITY_NONCRITICAL , ERRCH_SEVERITY_NOTIFICATION , ERRCH_SEVERITY_MAX } |
| Type definitions for error channel severity level. More... | |
Functions | |
| errFlag_t | MW_GetErrorChannel (errCh_t ch) |
| Reads the status of the specified error channel. | |
| errFlag_t | MW_ClearErrorChannel (errCh_t ch) |
| Clears the specified error channel and confirms that the channel is cleared. | |
| errFlag_t | MW_CheckIoSafe (void) |
| Checks if all I/O pins are floated (tri-stated). | |
| void | MW_EnableForceFloat (void) |
| Enables forced floating (tri-stating) of all I/O pins. | |
| errFlag_t | MW_DisableForceFloat (void) |
| Disables forced floating (tri-stating) of all I/O pins. | |
| void | MW_StartHeartbeat (void) |
| Starts the Heartbeat output signal. | |
| void | MW_StopHeartbeat (void) |
| Stops the Heartbeat output signal. | |
| errFlag_t | MW_ConfigErrorChannels (const errChConfigs_t *configs, uint8_t timeout) |
| Sets the error controller timeout duration and configures all error channels with the provided settings. | |
| errFlag_t | MW_DiagErrorChannelSplim (void) |
| Performs error injection diagnostic to detect faults in the SPLIM error channel. | |
| errFlag_t | MW_DiagErrorChannelCfd0 (void) |
| Performs error injection diagnostic to detect faults in the CFD0 error channel. | |
| errFlag_t | MW_DiagErrorChannelCfd1 (void) |
| Performs error injection diagnostic to detect faults in the CFD1 error channel. | |
| errFlag_t | MW_DiagErrorChannelCfm0 (void) |
| Performs error injection diagnostic to detect faults in the CFM0 error channel. | |
| errFlag_t | MW_DiagErrorChannelCfm1 (void) |
| Performs error injection diagnostic to detect faults in the CFM1 error channel. | |
| errFlag_t | MW_DiagErrorChannelEeprom (void) |
| Performs error injection diagnostic to detect faults in the EEPROM error channel. | |
| errFlag_t | MW_DiagErrorChannelEvsys0 (void) |
| Performs error injection diagnostic to detect faults in the EVSYS0 error channel. | |
| errFlag_t | MW_DiagErrorChannelEvsys1 (void) |
| Performs error injection diagnostic to detect faults in the EVSYS1 error channel. | |
Contains API prototypes and defines for the Error Manager.
The Error Manager provides services to Tasks to ensure correct interaction with features of the ERRCTRL peripheral.
| enum errCh_t |
Hardware error channels found in the Error Controller.
Each member of this enum corresponds to an error channel in the ERRCTRL. For a detailed description of each Error Channel, refer to the data sheet.
Definition at line 49 of file midware_error_manager.h.
| enum errChSeverity_t |
Type definitions for error channel severity level.
Definition at line 75 of file midware_error_manager.h.
| errFlag_t MW_CheckIoSafe | ( | void | ) |
Checks if all I/O pins are floated (tri-stated).
This function determines if all I/O pins are floated, indicating that the device is in a Safe State.
| ERROR | One or more I/O pins are not floated. |
| NO_ERROR | All IO pins are floated |
Definition at line 105 of file midware_error_manager.c.
Clears the specified error channel and confirms that the channel is cleared.
This function clears the error channel by clearing its error flag in the Error Status Flag register. If clearing fails, it indicates that one of the error channel sources has not been cleared and an error is returned.
| ch | Which error channel to clear. |
| ERROR | Failed to clear the error channel, or invalid error channel input. |
| NO_ERROR | Error channel was cleared successfully. |
Definition at line 78 of file midware_error_manager.c.
| errFlag_t MW_ConfigErrorChannels | ( | const errChConfigs_t * | configs, |
| uint8_t | timeout ) |
Sets the error controller timeout duration and configures all error channels with the provided settings.
This function configures the severity and floatIo setting for each error channel, and the timeout value for the Error Controller timeout mechanism. A countdown from the current timeout value is automatically started when entering the CONFIG state or ALARM state. If it times out, the Error Controller will automatically reset the device.
If the severity configuration for a channel is invalid, that channel will not be configured, and the function will return errFlag_t ERROR. All other channels with valid input will still be configured.
The system transitions to the CONFIG state for the error channel configuration. After the configuration is complete, the system is transitioned to the NORMAL state which is when the new timeout value is loaded.
| configs | The configuration for all error channels. |
| timeout | The next timeout value to use after configuration. |
| ERROR | Invalid timeout or config detected, or Error Controller is not in NORMAL state. |
| NO_ERROR | No invalid input detected. |
Definition at line 153 of file midware_error_manager.c.
| errFlag_t MW_DiagErrorChannelCfd0 | ( | void | ) |
Performs error injection diagnostic to detect faults in the CFD0 error channel.
This function injects an error on the Clock Failure Detected 0 (CFD0) error channel directly to detect any faults in the error channel mechanism.
| ERROR | Fault detected in the CFD0 error channel, or error injection did not start. |
| NO_ERROR | No fault detected in the CFD0 error channel. |
Definition at line 107 of file midware_error_manager_diag.c.
| errFlag_t MW_DiagErrorChannelCfd1 | ( | void | ) |
Performs error injection diagnostic to detect faults in the CFD1 error channel.
This function injects an error on the Clock Failure Detected 1 (CFD1) error channel directly to detect any faults in the error channel mechanism.
| ERROR | Fault detected in the CFD1 error channel, or error injection did not start. |
| NO_ERROR | No fault detected in the CFD1 error channel. |
Definition at line 133 of file midware_error_manager_diag.c.
| errFlag_t MW_DiagErrorChannelCfm0 | ( | void | ) |
Performs error injection diagnostic to detect faults in the CFM0 error channel.
This function injects an error on the Clock Frequency Measurement Error 0 (CFM0) error channel directly to detect any faults in the error channel mechanism.
| ERROR | Fault detected in the CFM0 error channel, or error injection did not start. |
| NO_ERROR | No fault detected in the CFM0 error channel. |
Definition at line 159 of file midware_error_manager_diag.c.
| errFlag_t MW_DiagErrorChannelCfm1 | ( | void | ) |
Performs error injection diagnostic to detect faults in the CFM1 error channel.
This function injects an error on the Clock Frequency Measurement Error 1 (CFM1) error channel directly to detect any faults in the error channel mechanism.
| ERROR | Fault detected in the CFM1 error channel, or error injection did not start. |
| NO_ERROR | No fault detected in the CFM1 error channel. |
Definition at line 185 of file midware_error_manager_diag.c.
| errFlag_t MW_DiagErrorChannelEeprom | ( | void | ) |
Performs error injection diagnostic to detect faults in the EEPROM error channel.
This function injects an error on the EEPROM error channel directly to detect any faults in the error channel mechanism.
| ERROR | Fault detected in the EEPROM error channel, or error injection did not start. |
| NO_ERROR | No fault detected in the EEPROM error channel. |
Definition at line 211 of file midware_error_manager_diag.c.
| errFlag_t MW_DiagErrorChannelEvsys0 | ( | void | ) |
Performs error injection diagnostic to detect faults in the EVSYS0 error channel.
This function injects an error on the Event System Input 0 (EVSYS0) error channel directly to detect any faults in the error channel mechanism.
| ERROR | Fault detected in the EVSYS0 error channel, or error injection did not start. |
| NO_ERROR | No fault detected in the EVSYS0 error channel. |
Definition at line 237 of file midware_error_manager_diag.c.
| errFlag_t MW_DiagErrorChannelEvsys1 | ( | void | ) |
Performs error injection diagnostic to detect faults in the EVSYS1 error channel.
This function injects an error on the Event System Input 1 (EVSYS1) error channel directly to detect any faults in the error channel mechanism.
| ERROR | Fault detected in the EVSYS1 error channel, or error injection did not start. |
| NO_ERROR | No fault detected in the EVSYS1 error channel. |
Definition at line 263 of file midware_error_manager_diag.c.
| errFlag_t MW_DiagErrorChannelSplim | ( | void | ) |
Performs error injection diagnostic to detect faults in the SPLIM error channel.
This function injects an error on the Stack Pointer Limit (SPLIM) error channel directly to detect any faults in the error channel mechanism.
| ERROR | Fault detected in the SPLIM error channel, or error injection did not start. |
| NO_ERROR | No fault detected in the SPLIM error channel. |
Definition at line 81 of file midware_error_manager_diag.c.
| errFlag_t MW_DisableForceFloat | ( | void | ) |
Disables forced floating (tri-stating) of all I/O pins.
This function attempts to disable the forced floating of all I/O pins and will return an errFlag_t which reflects whether the disabling was successful or not.
| ERROR | Failed to disable forced floating. |
| NO_ERROR | Successfully disabled forced floating. |
Definition at line 125 of file midware_error_manager.c.
| void MW_EnableForceFloat | ( | void | ) |
Enables forced floating (tri-stating) of all I/O pins.
This function will immediately float all I/O pins, thereby transitioning the device into a Safe State.
Definition at line 120 of file midware_error_manager.c.
Reads the status of the specified error channel.
This function reads the Error Status Flag of the specified error channel and returns an error if the flag is set.
| ch | Which error channel to read. |
| ERROR | Error channel is set, or invalid error channel input. |
| NO_ERROR | Error channel is not set. |
Definition at line 55 of file midware_error_manager.c.
| void MW_StartHeartbeat | ( | void | ) |
Starts the Heartbeat output signal.
This function enables the 1 kHz square wave heartbeat signal output on an I/O pin. When enabled, the error controller will tri-state the signal when it enters the FAULT state, and force it low when entering the CONFIG state.
Definition at line 143 of file midware_error_manager.c.
| void MW_StopHeartbeat | ( | void | ) |
Stops the Heartbeat output signal.
This function stops the heartbeat output on the configured I/O pin. Stopping the heartbeat can be used to explicitly signal a failure to the surrounding system. See MW_StartHeartbeat.
Definition at line 148 of file midware_error_manager.c.