STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
Loading...
Searching...
No Matches
Det.h File Reference

DET driver configuration More...

#include "Det_Cfg.h"

Go to the source code of this file.

Data Structures

struct  _Det_ConfigType
 Det Config type More...
 
struct  Module
 Module Config type More...
 

Macros

#define DET_ID_INIT   0x00u
 
#define DET_ID_REPORT_ERROR   0x01u
 
#define DET_ID_DE_START   0x02u
 
#define DET_ID_GET_VERSION_INFO   0x03u
 
#define DET_ID_REPORT_RUNTIME_ERROR   0x04u
 
#define DET_ID_REPORT_TRANSIENT_FAULT   0x05u
 
#define DET_E_PARAM_POINTER   0x01u
 
#define MAX_MODULE_ID   10u
 

Typedefs

typedef struct _Det_ConfigType Det_ConfigType
 Det Config type
 

Functions

void Det_Init (const Det_ConfigType *ConfigPtr)
 Det Initialization
 
void Det_Start (void)
 Det Start
 
Std_ReturnType Det_ReportError (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId)
 Det Report Error
 
Std_ReturnType Det_ReportRuntimeError (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 ErrorId)
 Det Report Runtime Error
 
Std_ReturnType Det_ReportTransientFault (uint16 ModuleId, uint8 InstanceId, uint8 ApiId, uint8 FaultId)
 Det Report Transient Fault
 
void Det_GetVersionInfo (Std_VersionInfoType *versioninfo)
 Det Get Version Info
 

Detailed Description

DET driver configuration

Author
Oscar Gonzalez

The driver Default Error Tracer serve as a mechanisim for reporting and tracing development and runtime errors within the Basic Software.

Macro Definition Documentation

◆ MAX_MODULE_ID

#define MAX_MODULE_ID   10u

Maximum index for the modules array

Typedef Documentation

◆ Det_ConfigType

Det Config type

Configuration data structure of the Det module
Requirement
SWS_Det_00210

Function Documentation

◆ Det_GetVersionInfo()

void Det_GetVersionInfo ( Std_VersionInfoType * versioninfo)

Det Get Version Info

Returns the version information of this module.

Parameters
versioninfoPointer to where to store the version information of this module.
Requirement
SWS_Det_00011

< Det_GetVersionInfo() api service id

< Det_GetVersionInfo called with null parameter pointer

◆ Det_Init()

void Det_Init ( const Det_ConfigType * ConfigPtr)

Det Initialization

Service to initialize the Default Error Tracer.

Parameters
ConfigPtrPointer to the selected configuration set.
Requirement
SWS_Det_00008

◆ Det_ReportError()

Std_ReturnType Det_ReportError ( uint16 ModuleId,
uint8 InstanceId,
uint8 ApiId,
uint8 ErrorId )

Det Report Error

Service to report development errors.

Parameters
ModuleIdID of calling module.
InstanceIdThe identifier of the index based instance of a module, starting from 0, If the module is a single instance module it shall pass 0 as the InstanceId.
ApiIdID of API service in which error is detected (defined in SWS of calling module).
ErrorIdID of detected development error (defined in SWS of calling module).
Return values
Std_ReturnTypenever returns a value, but has a return type for compatibility with services and hooks.
Note
Det_ReportError may be callable in interrupt context. Since the DET can be called in normal mode or in interrupt context from stack or integration) this has to be considered during implementation of the hook functions:Det_ReportError can be called in interrupt context; this should be considered when halting the system.
Requirement
SWS_Det_00009

< Maximum index for the modules array

◆ Det_ReportRuntimeError()

Std_ReturnType Det_ReportRuntimeError ( uint16 ModuleId,
uint8 InstanceId,
uint8 ApiId,
uint8 ErrorId )

Det Report Runtime Error

Service to report runtime errors. If a callout has been configured then this callout shall be called.

Parameters
ModuleIdID of calling module.
InstanceIdThe identifier of the index based instance of a module, starting from 0, If the module is a single instance module it shall pass 0 as the InstanceId.
ApiIdID of API service in which error is detected (defined in SWS of calling module).
ErrorIdID of detected development error (defined in SWS of calling module).
Return values
Std_ReturnTypereturns always E_OK (is required for services)
Note
Det_ReportRuntime Error may be callable in interrupt context. Since the DET can be called in normal mode or in interrupt context (from stack or integration) this has to be considered during implementation of the hook functions:Det_ReportRuntimeError can be called in interrupt context; this hook should be reentrant and sufficiently performant.
Requirement
SWS_Det_01001

< Maximum index for the modules array

◆ Det_ReportTransientFault()

Std_ReturnType Det_ReportTransientFault ( uint16 ModuleId,
uint8 InstanceId,
uint8 ApiId,
uint8 FaultId )

Det Report Transient Fault

Service to report transient faults. If a callout has been configured than this callout shall be called and the returned value of the callout shall be returned. Otherwise it returns immediately with E_OK.

Parameters
ModuleIdID of calling module.
InstanceIdThe identifier of the index based instance of a module, starting from 0, If the module is a single instance module it shall pass 0 as the InstanceId.
ApiIdID of API service in which error is detected (defined in SWS of calling module).
FaultIdID of detected transient fault (defined in SWS of calling module).
Return values
Ifno callout exists it shall return E_OK, otherwise it shall return the value of the configured callout. In case several callouts are configured the logical or (sum) of the callout return values shall be returned. Rationale: since E_OK=0, E_OK will be only returned if all are E_OK, and for multiple error codes there is a good chance to detect several of them.
Note
Det_ReportTransient Fault may be callable in interrupt context. Since the DET can be called in normal mode or in interrupt context (from stack or integration) this has to be considered during implementation of the hook functions: Det_ReportTransientFault can be called in interrupt context; his hook should be reentrant and sufficiently performant.
Requirement
SWS_Det_01003

< Maximum index for the modules array

◆ Det_Start()

void Det_Start ( void )

Det Start

Service to initialize the Default Error Tracer.

Requirement
SWS_Det_00010