#ifndef BALSAM167_GAS_H #define BALSAM167_GAS_H #include "eeprom_config.h" #include /* 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