Files
nanopsx_sen66/firmware/components/sen5x/sen5x_app.h
T

25 lines
819 B
C

#pragma once
#include <stdbool.h>
#include <stdint.h>
#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);