added codegen-scripts and updated libs
This commit is contained in:
54
Software/codegen/templates/dtc_defs.h.j2
Normal file
54
Software/codegen/templates/dtc_defs.h.j2
Normal file
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @file dtc_defs.h
|
||||
*
|
||||
* @brief Header file for Diagnostic Trouble Code (DTC) definitions in the DE-Timer application.
|
||||
*
|
||||
* This file contains definitions for Diagnostic Trouble Codes (DTC) in the DE-Timer project.
|
||||
* It includes enums for DTC active status, severity levels, and specific DTC codes.
|
||||
* The file also defines an array of DTC definitions and a timestamp indicating the generation time.
|
||||
*
|
||||
* @note This file is auto-generated by a script on {{ timestamp }}.
|
||||
*
|
||||
* @author Marcel Peterkau
|
||||
* @date {{ date }}
|
||||
*/
|
||||
|
||||
#ifndef DTC_DEFS_H
|
||||
#define DTC_DEFS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint32_t DTCNum_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DTC_INACTIVE,
|
||||
DTC_ACTIVE,
|
||||
DTC_PREVIOUS
|
||||
} DTCActive_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DTC_NONE,
|
||||
DTC_INFO,
|
||||
DTC_WARN,
|
||||
DTC_CRITICAL
|
||||
} DTCSeverity_t;
|
||||
|
||||
typedef struct {
|
||||
DTCNum_t code;
|
||||
DTCSeverity_t severity;
|
||||
} DTC_t;
|
||||
|
||||
{% for dtc in dtc_macros -%}
|
||||
{{ dtc }}
|
||||
{% endfor %}
|
||||
const DTC_t dtc_definitions[] = {
|
||||
{% for struct in dtc_structs -%}
|
||||
{{ struct }}
|
||||
{% endfor -%}
|
||||
};
|
||||
|
||||
#endif // DTC_DEFS_H
|
||||
|
||||
// CODEGENERATOR_CHECKSUM: {{ checksum }}
|
25
Software/codegen/templates/struct2json.cpp.j2
Normal file
25
Software/codegen/templates/struct2json.cpp.j2
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @file struct2json.cpp
|
||||
*
|
||||
* @brief Implementation file for converting structs to JSON objects.
|
||||
*
|
||||
* @note This file is auto-generated by a script on {{ timestamp }}.
|
||||
*
|
||||
* @author Marcel Peterkau
|
||||
* @date {{ date }}
|
||||
*/
|
||||
|
||||
|
||||
#include "struct2json.h"
|
||||
|
||||
{% for var_name, var_info in structs.items() -%}
|
||||
void generateJsonObject_{{ var_name }}(JsonObject data)
|
||||
{
|
||||
{% for field_name, field_type in var_info['fields'].items() -%}
|
||||
data["{{ field_name }}"] = {{ var_name }}.{{ field_name }};
|
||||
{% endfor -%}
|
||||
}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
// CODEGENERATOR_CHECKSUM: {{ checksum }}
|
26
Software/codegen/templates/struct2json.h.j2
Normal file
26
Software/codegen/templates/struct2json.h.j2
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @file struct2json.h
|
||||
*
|
||||
* @brief Header file for converting structs to JSON objects.
|
||||
*
|
||||
* @note This file is auto-generated by a script on {{ timestamp }}.
|
||||
*
|
||||
* @author Marcel Peterkau
|
||||
* @date {{ date }}
|
||||
*/
|
||||
|
||||
#ifndef _STRUCT2JSON_H_
|
||||
#define _STRUCT2JSON_H_
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
#include "eeprom.h"
|
||||
|
||||
{% for var_name, var_info in structs.items() -%}
|
||||
void generateJsonObject_{{ var_name }}(JsonObject data);
|
||||
{% endfor %}
|
||||
|
||||
#endif /* _STRUCT2JSON_H_ */
|
||||
|
||||
// CODEGENERATOR_CHECKSUM: {{ checksum }}
|
Reference in New Issue
Block a user