Go to the documentation of this file.
38 #define SDS011_DEVID_WILDCARD (0xFFFF)
99 uint8_t rx_mem[SDS011_FRAME_RECV_LEN];
void * cbctx
user context for the callback
@ SDS011_RMODE_ACTIVE
continuously reporting values
mutex_t dev_lock
mutex to synchronize device access
Device descriptor definition for SDS011 Laser Dust Sensor.
@ SDS011_ERROR
internal error
int sds011_set_reporting_mode(sds011_t *dev, sds011_reporting_mode_t mode)
Set the reporting mode of the sensor.
@ SDS011_WMODE_WORK
laser & fan are enabled
sds011_params_t params
parameters for SDS011 device
int sds011_read(sds011_t *dev, sds011_data_t *data)
Read measurement values from SDS011 laser dust sensor.
int sds011_set_working_period(sds011_t *dev, uint8_t minutes)
Set working period of the sensor.
@ SDS011_INVALID_RESPONSE
invalid response
Data type for storing SDS011 sensor readings.
@ SDS011_WMODE_SLEEP
laser & fan are disabled
uint16_t checksum
iteratively calculated checksum
sds011_reporting_mode
Report mode of the SDS011 sensor.
@ SDS011_RMODE_QUERY
sensor needs to be queried
@ SDS011_INVALID_CHKSUM
invalid checksum
Configuration parameters for SDS011 Laser Dust Sensor.
unsigned int uart_t
Define default UART type identifier.
uint8_t pos
receive buffer position counter
int sds011_get_fw_version(sds011_t *dev, uint8_t *year, uint8_t *mon, uint8_t *day)
Get firmware version of the sensor.
Low-level UART peripheral driver interface definition.
int sds011_register_callback(sds011_t *dev, sds011_callback_t cb, void *ctx)
Register measurement callback.
enum sds011_reporting_mode sds011_reporting_mode_t
Report mode of the SDS011 sensor.
Internal constants etc. for the SDS011 laser dust sensor.
void sds011_power_on(const sds011_t *dev)
Enable power supply of SDS011 laser dust sensor.
int sds011_init(sds011_t *dev, const sds011_params_t *params)
Initialize SDS011 Laser Dust Sensor.
void(* sds011_callback_t)(sds011_data_t *data, void *ctx)
callback for measurements actively reported by the SDS011 sensor
uint16_t pm_2_5
Particulate Matter 2.5 concentration [0.1µg/m^3].
uint16_t dev_id
Unique sensor device ID.
sds011_working_mode
Work/sleep mode of the SDS011 sensor.
gpio_t pwr_pin
GPIO pin for disabling supply voltage for the sensor.
enum sds011_working_mode sds011_working_mode_t
Work/sleep mode of the SDS011 sensor.
uart_t uart
UART device the sensor is connected to.
int sds011_get_working_period(sds011_t *dev, uint8_t *minutes)
Get current working period of the sensor.
bool pwr_ah
Logic level of the power pin (true for active high)
int sds011_get_working_mode(sds011_t *dev, sds011_working_mode_t *mode)
Get current working mode of the sensor.
Mutex for thread synchronization.
void sds011_power_off(const sds011_t *dev)
Disable power supply of SDS011 laser dust sensor.
mutex_t cb_lock
mutex to synchronize callbacks
Low-level GPIO peripheral driver interface definitions.
int sds011_get_reporting_mode(sds011_t *dev, sds011_reporting_mode_t *mode)
Get the current reporting mode of the sensor.
uint16_t pm_10
Particulate Matter 10 concentration [0.1µg/m^3].
int sds011_set_dev_id(sds011_t *dev, uint16_t sens_dev_id)
Set device ID of the sensor.
sds011_callback_t cb
callback deliver values async
int sds011_set_working_mode(sds011_t *dev, sds011_working_mode_t mode)
Set working mode of the sensor.