
Oregon Scientific Decoder V2 and V3 for Nucleo-F401RE
Oregon-Scientific Decoder for V2 and V3 protocol. As exemple it handles THGR122NX (V2) and THGR810 (V3) sensors.
The software use interrupts to collect frames in a buffer and decode them in a background task.
Diff: Regul.h
- Revision:
- 1:265557f4b6b8
- Parent:
- 0:7d471396cb64
--- a/Regul.h Sat Oct 12 11:55:05 2019 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -#include "mbed.h" - -extern Serial pc; - -//#define __DEBUG__ -#define Level 1 -#define DBG(x, ...) if (Level>=3) pc.printf("[DBG]"x"\r\n", ##__VA_ARGS__); -#define WARN(x, ...) if (Level>=2) pc.printf("[WARN]"x"\r\n", ##__VA_ARGS__); -#define ERR(x, ...) if (Level>=1) pc.printf("[ERR]"x"\r\n", ##__VA_ARGS__); - -#define BUF_SIZE 1024 - -#define DEVICE_ID 1 -#define FA - -#define NB_CHAN 3 - -typedef struct { - char deviceID; - unsigned long timestamp; - float hum1; - float temp1; - float hum2; - float temp2; - unsigned char pwm; - int speed; -}measure_t; - -typedef struct { - int first; - int prev; - int last; - measure_t data[BUF_SIZE]; -}s_meas_t; - -typedef struct { - int v; - bool update; -}pwm_t; - -int Init_Regul(); -int Mesurement(measure_t *); -int RegulPWM(measure_t *, pwm_t *); -//int SendRcvData(NetworkStack *, s_meas_t *, pwm_t *); -//int SendLoger(NetworkStack *, const char * );