balcony_weather_station/pms5003.h

22 lines
492 B
C

#ifndef PMS5003_H
#define PMS5003_H
#include "hardware/uart.h"
#include <stdint.h>
typedef struct {
float pm1;
float pm2_5;
float pm10;
} pms5003_reading;
typedef struct {
uart_inst_t *uart;
uint8_t enable_pin;
uint8_t reset_pin;
} pms5003_config;
void pms5003_init(pms5003_config *config, uart_inst_t *uart, uint8_t tx_pin,
uint8_t rx_pin, uint8_t enable_pin, uint8_t reset_pin);
pms5003_reading pms5003_read(pms5003_config *config);
#endif /* PMS5003_H */