#pragma once #include #include #include "esp_err.h" // Schlanke I2C/HAL-Konfiguration (wie zuvor genutzt) typedef struct { uint8_t addr; // 7-bit I2C-Adresse (0x69) int port; // I2C Port (0) int sda; // GPIO SDA int scl; // GPIO SCL bool sda_pullup; // interne Pullups bool scl_pullup; // interne Pullups uint32_t freq; // I2C Takt (Hz, z.B. 400000) } sen5x_i2c_cfg_t; // Initialisiert I2C/Treiber/HAL und startet die Messung esp_err_t sen5x_app_init(const sen5x_i2c_cfg_t* cfg); // Endlosschleife (Pollt "data ready" und loggt Messwerte); als FreeRTOS-Task nutzbar void sen5x_app_task(void* arg); // Stoppt Messung & gibt Ressourcen frei (optional aufzurufen z.B. bei Shutdown) void sen5x_app_deinit(void);