39 lines
1.0 KiB
C

/**
* @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>
#include "dtc_defs.h"
#define MAX_DTC_STORAGE 6
typedef struct
{
DTCNum_t Number;
uint32_t timestamp;
DTCActive_t active;
uint32_t debugVal;
} DTCEntry_t;
void MaintainDTC(DTCNum_t DTC_no, boolean active, uint32_t DebugValue = 0);
void ClearDTC(DTCNum_t DTC_no);
void ClearAllDTC();
DTCNum_t getlastDTC(boolean only_active);
DTCNum_t ActiveDTCseverity(DTCSeverity_t severity);
DTCSeverity_t getSeverityForDTC(DTCNum_t targetCode);
void DTC_Process();
extern DTCEntry_t DTCStorage[MAX_DTC_STORAGE];
#endif