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.
22 lines
712 B
C
22 lines
712 B
C
#pragma once
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
/* Single-master, open-drain GPIO bus. 1 means release, never drive high.
|
|
* Port callbacks make the wire protocol testable without ESP hardware.
|
|
*/
|
|
typedef struct {
|
|
void *context;
|
|
void (*sda)(void *, int);
|
|
void (*scl)(void *, int);
|
|
int (*read_sda)(void *);
|
|
int (*read_scl)(void *);
|
|
void (*delay_us)(void *, unsigned);
|
|
unsigned half_period_us;
|
|
unsigned stretch_timeout_us;
|
|
} sensor_soft_i2c_t;
|
|
|
|
/* 0 success, 1 NACK, -1 bus/argument error. Always releases lines on failure. */
|
|
int sensor_soft_i2c_transfer(const sensor_soft_i2c_t *io, uint8_t address,
|
|
uint8_t *data, uint16_t count, bool read);
|