Files
Balsam_167/Source/Internal/Include/gas167.h
Andrey 5d9818291b feat: add M95M02-only GAS and EEPROM profiles
Expose the existing registers through Modbus and service CAN using one GAS provider only in M95M02 builds.
Include the EEPROM layout/driver, LOAD protection and calibration, firmware identity and shared CCS build workflow.
Add transport/profile and SCI8 validation tests, documentation and the checked M95M02 firmware image.
2026-10-09 16:17:37 +03:00

29 lines
1.2 KiB
C

#ifndef BALSAM167_GAS_H
#define BALSAM167_GAS_H
#include "eeprom_config.h"
#include <stdint.h>
/* Board profile 167/v1, word addresses, independent of the wire transport.
* The original register and UMP addresses remain valid in both builds.
* Only the physically fitted M95M02 version exposes the additional regions. */
#if EEPROM_M95M02
#define GAS167_REG_BASE 0x5000U
#define GAS167_REG_COUNT 128U
#define GAS167_INFO_BASE 0x5F00U
#define GAS167_INFO_WORDS 8U
#define GAS167_MAX_WORDS 124U
#define GAS167_PROFILE_VERSION 1U
#define GAS167_CAPABILITIES 7U /* bit 0 RTU, bit 1 service CAN, bit 2 FC06 */
/* Called by the main-loop transports under their snapshot IRQ lock.
* Capacity: at least GAS167_MAX_WORDS uint16_t words.
* RTU reads: 1..124 words; paired service CAN reads: 2..124, even.
* Successful reads return their count. Writes/errors return address/value.
* error uses Modbus codes 0 (success), 1 (function), 2 (address), 3 (value).
* No EEPROM I/O, allocation, or changes to the existing logger. */
int gas167_contains(uint16_t address);
unsigned gas167_prepare(unsigned function, uint16_t address, uint16_t value,
int can, uint16_t *reply, unsigned *error);
#endif
#endif