ESPHome 2025.5.0
Loading...
Searching...
No Matches
sen0321.h
Go to the documentation of this file.
1#pragma once
2
6
7// ref:
8// https://github.com/DFRobot/DFRobot_OzoneSensor
9
10namespace esphome {
11namespace sen0321_sensor {
12// Sensor Mode
13// While passive is supposedly supported, it does not appear to work reliably.
14static const uint8_t SENSOR_MODE_REGISTER = 0x03;
15static const uint8_t SENSOR_MODE_AUTO = 0x00;
16static const uint8_t SENSOR_MODE_PASSIVE = 0x01;
17static const uint8_t SET_REGISTER = 0x04;
18
19// Each register is 2 wide, so 0x07-0x08 for passive, or 0x09-0x0A for auto
20// First register is high bits, next low.
21static const uint8_t SENSOR_PASS_READ_REG = 0x07;
22static const uint8_t SENSOR_AUTO_READ_REG = 0x09;
23
25 public:
26 void update() override;
27 void dump_config() override;
28 void setup() override;
29
30 protected:
31 void read_data_();
32};
33
34} // namespace sen0321_sensor
35} // namespace esphome
This class simplifies creating components that periodically check a state.
Definition component.h:301
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
Base-class for all sensors.
Definition sensor.h:57
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7