39 lines
1.0 KiB
C
Raw Permalink Normal View History

/**
* @file dtc.h
*
* @brief Header file for handling Diagnostic Trouble Codes (DTC) in the ChainLube application.
*
* This file provides definitions and functions for handling Diagnostic Trouble Codes (DTC)
* in the ChainLube project. It includes structures for DTC entries, severity levels,
* and functions for DTC maintenance and processing. DTCs are used to track system errors and issues.
*
* @author Marcel Peterkau
* @date 09.01.2024
*/
#ifndef _DTC_H_
#define _DTC_H_
#include <Arduino.h>
2023-09-27 19:13:54 +02:00
#include "dtc_defs.h"
2022-03-09 23:05:17 +01:00
#define MAX_DTC_STORAGE 6
2023-09-27 19:13:54 +02:00
typedef struct
{
2023-09-27 19:13:54 +02:00
DTCNum_t Number;
uint32_t timestamp;
DTCActive_t active;
uint32_t debugVal;
} 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);
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();
2023-09-27 19:13:54 +02:00
extern DTCEntry_t DTCStorage[MAX_DTC_STORAGE];
#endif