2022-02-10 22:32:40 +01:00
|
|
|
#ifndef _DTC_H_
|
|
|
|
#define _DTC_H_
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
2023-09-27 19:13:54 +02:00
|
|
|
#include "dtc_defs.h"
|
2022-02-10 22:32:40 +01:00
|
|
|
|
2022-03-09 23:05:17 +01:00
|
|
|
#define MAX_DTC_STORAGE 6
|
2022-02-10 22:32:40 +01:00
|
|
|
|
2023-09-27 19:13:54 +02:00
|
|
|
typedef struct
|
2022-03-09 20:25:02 +01:00
|
|
|
{
|
2023-09-27 19:13:54 +02:00
|
|
|
DTCNum_t Number;
|
2022-02-10 22:32:40 +01:00
|
|
|
uint32_t timestamp;
|
2022-03-09 20:25:02 +01:00
|
|
|
DTCActive_t active;
|
2022-09-01 22:46:00 +02:00
|
|
|
uint32_t debugVal;
|
2022-02-10 22:32:40 +01:00
|
|
|
} DTCEntry_t;
|
|
|
|
|
2023-09-27 19:13:54 +02:00
|
|
|
void MaintainDTC(DTCNum_t DTC_no, boolean active, uint32_t DebugValue = 0);
|
|
|
|
void ClearDTC(DTCNum_t DTC_no);
|
2022-02-10 22:32:40 +01:00
|
|
|
void ClearAllDTC();
|
2023-09-27 19:13:54 +02:00
|
|
|
DTCNum_t getlastDTC(boolean only_active);
|
|
|
|
DTCNum_t ActiveDTCseverity(DTCSeverity_t severity);
|
|
|
|
DTCSeverity_t getSeverityForDTC(DTCNum_t targetCode);
|
2023-02-24 19:24:26 +01:00
|
|
|
void DTC_Process();
|
2022-02-10 22:32:40 +01:00
|
|
|
|
2023-09-27 19:13:54 +02:00
|
|
|
extern DTCEntry_t DTCStorage[MAX_DTC_STORAGE];
|
2022-02-10 22:32:40 +01:00
|
|
|
#endif
|