init pms5003 lib

This commit is contained in:
Travis Shears 2025-04-09 17:51:28 +02:00
parent 98748d3e6d
commit f2638dddce
4 changed files with 77 additions and 8 deletions

20
pms5003.h Normal file
View file

@ -0,0 +1,20 @@
#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;
} pms5003_config;
void pms5003_init(pms5003_config *config, uart_inst_t *uart, uint8_t tx_pin,
uint8_t rx_pin);
pms5003_reading pms5003_read(pms5003_config *config);
#endif /* PMS5003_H */