markqvist___RNode_Firmware/ROM.h
GlassOnTin 2bf457e2ba Add Settings screen with display timeout, beacon, and GPS controls
Replaces the "Coming soon" placeholder with working LVGL settings:
- Display timeout: slider 5-60s, updates display_blanking_timeout
- Beacon enable: switch, gates beacon_update()
- Beacon interval: roller (10s/30s/1m/5m/10m), replaces #define
- GPS dynamic model: roller (Portable/Stationary/Pedestrian/Automotive),
  sends UBX-CFG-VALSET to MIA-M10Q

All settings persist to EEPROM config region (addresses 0x91-0x94)
and reload on boot. Callbacks save immediately on change.
2026-03-31 01:45:12 +01:00

77 lines
2.7 KiB
C

// Copyright (C) 2024, Mark Qvist
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#ifndef ROM_H
#define ROM_H
#define CHECKSUMMED_SIZE 0x0B
// ROM address map ///////////////
#define ADDR_PRODUCT 0x00
#define ADDR_MODEL 0x01
#define ADDR_HW_REV 0x02
#define ADDR_SERIAL 0x03
#define ADDR_MADE 0x07
#define ADDR_CHKSUM 0x0B
#define ADDR_SIGNATURE 0x1B
#define ADDR_INFO_LOCK 0x9B
#define ADDR_CONF_SF 0x9C
#define ADDR_CONF_CR 0x9D
#define ADDR_CONF_TXP 0x9E
#define ADDR_CONF_BW 0x9F
#define ADDR_CONF_FREQ 0xA3
#define ADDR_CONF_OK 0xA7
#define ADDR_CONF_BT 0xB0
#define ADDR_CONF_DSET 0xB1
#define ADDR_CONF_DINT 0xB2
#define ADDR_CONF_DADR 0xB3
#define ADDR_CONF_DBLK 0xB4
#define ADDR_CONF_DROT 0xB8
#define ADDR_CONF_PSET 0xB5
#define ADDR_CONF_PINT 0xB6
#define ADDR_CONF_BSET 0xB7
#define ADDR_CONF_DIA 0xB9
#define ADDR_CONF_WIFI 0xBA
#define ADDR_CONF_WCHN 0xBB
#define INFO_LOCK_BYTE 0x73
#define CONF_OK_BYTE 0x73
#define BT_ENABLE_BYTE 0x73
#define EEPROM_RESERVED 200
#define CONFIG_SIZE 256
#define ADDR_CONF_SSID 0x00
#define ADDR_CONF_PSK 0x21
#define ADDR_CONF_IP 0x42
#define ADDR_CONF_NM 0x46
// Beacon encryption config — stored in config region via config_addr()
// Primary region (eeprom_addr) is full past 0xBB; these use config space
// after WiFi config (SSID/PSK/IP/NM end at 0x49)
#define ADDR_BCN_OK 0x50 // Config valid flag (0x73 = valid) — 1 byte
#define ADDR_BCN_KEY 0x51 // Collector X25519 public key — 32 bytes (0x51-0x70)
#define ADDR_BCN_IHASH 0x71 // Collector identity hash — 16 bytes (0x71-0x80)
#define ADDR_BCN_DHASH 0x81 // Collector dest hash — 16 bytes (0x81-0x90)
// User settings — stored in config region via config_addr()
#define ADDR_CONF_DISP_TIMEOUT 0x91 // Display blank timeout in seconds — 1 byte
#define ADDR_CONF_BCN_INT 0x92 // Beacon interval index — 1 byte
#define ADDR_CONF_GPS_MODEL 0x93 // GPS dynamic model index — 1 byte
#define ADDR_CONF_BCN_EN 0x94 // Beacon enable (0=off, 1=on) — 1 byte
//////////////////////////////////
#endif