feat(firmware): support configurable SEN54 and SEN66 boards

Add the pinned Sensirion SEN66 driver, central sensor and board profiles, and a separate GPIO I2C bus for SEN66 with display. Preserve the original display layout and keep NOx and CO2 in InfluxDB. Include protocol tests, hardware workflow documentation and verified deployment results without credentials.
This commit is contained in:
root
2026-11-09 21:44:04 +00:00
parent 45b05d045a
commit 69bb47dda1
27 changed files with 2634 additions and 111 deletions
@@ -0,0 +1,72 @@
#pragma once
/* Central build-time hardware selection. See firmware/HARDWARE.md.
* Select sensor and board independently; no credentials belong in this file.
*/
#define NANOPSX_SENSOR_SEN54 54
#define NANOPSX_SENSOR_SEN66 66
#define NANOPSX_BOARD_C6_DISPLAY_8MB 1
#define NANOPSX_BOARD_C6_DEVKIT_8MB 2
#ifndef NANOPSX_SENSOR
#define NANOPSX_SENSOR NANOPSX_SENSOR_SEN66
#endif
#ifndef NANOPSX_BOARD
#define NANOPSX_BOARD NANOPSX_BOARD_C6_DISPLAY_8MB
#endif
/* SEN66 retains its known GPIO7/8 wiring. With a display the sole HP I2C
* controller serves touch on GPIO18/19, so the sensor uses a GPIO bus.
* SEN54 retains the existing shared hardware-bus wiring.
*/
#if NANOPSX_SENSOR == NANOPSX_SENSOR_SEN66
#define NANOPSX_SENSOR_SDA 7
#define NANOPSX_SENSOR_SCL 8
#else
#define NANOPSX_SENSOR_SDA NANOPSX_I2C_SDA
#define NANOPSX_SENSOR_SCL NANOPSX_I2C_SCL
#endif
#define NANOPSX_SENSOR_SOFT_I2C \
(NANOPSX_SENSOR_SDA != NANOPSX_I2C_SDA || NANOPSX_SENSOR_SCL != NANOPSX_I2C_SCL)
#if NANOPSX_BOARD == NANOPSX_BOARD_C6_DISPLAY_8MB
#define NANOPSX_BOARD_NAME "ESP32-C6 display / 8 MB"
#define NANOPSX_HAS_DISPLAY 1
#define NANOPSX_I2C_SDA 18
#define NANOPSX_I2C_SCL 19
#elif NANOPSX_BOARD == NANOPSX_BOARD_C6_DEVKIT_8MB
#define NANOPSX_BOARD_NAME "ESP32-C6 devkit / 8 MB"
#define NANOPSX_HAS_DISPLAY 0
#define NANOPSX_I2C_SDA 7
#define NANOPSX_I2C_SCL 8
#else
#error "Unsupported NANOPSX_BOARD: add a reviewed board profile first"
#endif
#define NANOPSX_I2C_PORT 0
#define NANOPSX_FLASH_BYTES 8388608
#if NANOPSX_SENSOR == NANOPSX_SENSOR_SEN54
#define NANOPSX_SENSOR_NAME "SEN54"
#define NANOPSX_SENSOR_ADDRESS 0x69
#define NANOPSX_SENSOR_I2C_HZ 400000
#elif NANOPSX_SENSOR == NANOPSX_SENSOR_SEN66
#define NANOPSX_SENSOR_NAME "SEN66"
#define NANOPSX_SENSOR_ADDRESS 0x6b
#define NANOPSX_SENSOR_I2C_HZ 100000
#else
#error "Unsupported NANOPSX_SENSOR: use SEN54 or SEN66"
#endif
/* Board profiles describe wiring/peripherals, not a replacement for the
* PlatformIO chip, SDK configuration and partition-table selection.
*/
#ifdef ESP_PLATFORM
#include "sdkconfig.h"
#if !CONFIG_IDF_TARGET_ESP32C6
#error "These board profiles require ESP32-C6"
#endif
#if !CONFIG_ESPTOOLPY_FLASHSIZE_8MB
#error "These board profiles require the 8 MB SDK/partition configuration"
#endif
#endif