Full kline refactor, passes 815 verification initialization

This commit is contained in:
2026-04-10 12:19:58 +02:00
parent e22b9c681f
commit 02787c3e34
27 changed files with 2827 additions and 1783 deletions

View File

@@ -1,5 +1,9 @@
/*
* psg_prop.h
* PSG device properties dictionary.
*
* All K-Line ROM and EEPROM read responses are defined here.
* Edit the values in this file to configure what the master sees.
*
* Created on: Aug 19, 2025
* Author: herli
@@ -8,18 +12,95 @@
#ifndef INC_PSG_PROP_H_
#define INC_PSG_PROP_H_
typedef struct {
char client_ident[13]; // 12 + null
char unk_ident1[11];
char soft_info[11];
char unk_ident2[11];
char unk_ident3[11];
} PSGControllerInfo;
#include <stdint.h>
#include <stddef.h>
#define i_Ident "0470504005"
#define i_SerialN "225832"
#define i_modIndex "000004"
// ================================================================
// Device identity strings (used in ASCII init stream and ROM reads)
// ================================================================
/* Part number / ECU identifier — 10 ASCII chars, ROM 0x93BA */
#define PSG_IDENT_STR "0470004004"
//#define PSG_IDENT_STR "0470504009"
/* Serial number — 6 ASCII chars, EEPROM 0x0080 */
#define PSG_SERIAL_STR "297523"
/* Modification index — 6 ASCII chars, ROM 0x93A7 */
#define PSG_MOD_INDEX_STR "000000"
/* Software version — 10 ASCII chars, ROM 0x9F80 */
//#define PSG_SOFTWARE_VER_STR "C063_2.V61"
#define PSG_SOFTWARE_VER_STR "HCPS_G2.04"
#define PSG_SOFTWARE_VER2_STR "C062_0.P64" //no la lee directamente, solo al principio
/* Steuergeraet (controller unit number) — 10 ASCII chars, ROM 0x9F94 */
#define PSG_STEUERGERAET_STR "0281010888"
/* Fahrsoftware (driving software code) — 10 ASCII chars, ROM 0x9F76 */
#define PSG_FAHRSOFTWARE_STR "1469946013"
/* Datensatz (dataset code) — 10 ASCII chars, ROM 0x9C1C */
#define PSG_DATENSATZ_STR "2469947023"
/* Referenz-Kennfeld (reference map code) — 10 ASCII chars, ROM 0x93B0 */
#define PSG_REFERENZ_STR "2469948008"
/* Fertigungsdatum (manufacturing date) — 3 ASCII chars, EEPROM 0x0086 */
//#define FERTIGUNGSDATUM_STR "489"
#define FERTIGUNGSDATUM_STR "420"
/* Fertigungswerk (manufacturing plant) — 3 ASCII chars, ROM 0x93A4 */
//#define PSG_FERTIGUNGSWERK_STR "015"
#define PSG_FERTIGUNGSWERK_STR "069"
#define PSG_ANDERUNGSINDEX_STR "000"
#define PSG_KUNDENNUMMER_STR "YC1Q9A543EF "
#define PSG_KUNDENNUMMER1_STR "YC1Q9A543E"
#define PSG_KUNDENNUMMER2_STR "F "
#define PSG_UNKNOWN_STR "\xFF\xFF\xFF\xFF\xFF\xFF"
// ================================================================
// Key address constants
// ================================================================
/*
* Address returned by the ReadIdentAdress (0x01) command.
* The ROM ident string lives at (PSG_IDENT_ADDR - 10) = 0x93BA.
*/
#define PSG_IDENT_ADDR 0x93C4U
#define PSG_FAHRSOFTWARE_ADDR 0x9C28U
#define PSG_START55_ADDR 0x60U
/*
* Customer change address — returned at ROM 0x9FFE (little-endian).
* The mod-index string lives at (PSG_CUST_CHANGE_ADDR + 3) = 0x93A7.
*/
#define PSG_CUST_CHANGE_ADDR 0x93A4U
// ================================================================
// ROM lookup interface (implemented in psg_prop.c)
// ================================================================
/*
* PSG_ROM_GetData — fill 'out' with 'len' bytes for the given ROM address.
* Returns 1 if the address is known, 0 if unhandled.
* Access-control (lock checks) is the caller's responsibility.
*/
uint8_t PSG_ROM_GetData(uint16_t addr, uint8_t len, uint8_t *out);
/*
* PSG_EEPROM_GetData — fill 'out' with 'len' bytes for the given EEPROM address.
* Returns 1 if the address is known, 0 if unhandled.
* Access-control (lock checks) is the caller's responsibility.
*/
uint8_t PSG_EEPROM_GetData(uint16_t addr, uint8_t len, uint8_t *out);
#endif /* INC_PSG_PROP_H_ */