27 lines
1.0 KiB
C
27 lines
1.0 KiB
C
#ifndef __WATERLEVEL_SENSOR_H__
|
|
#define __WATERLEVEL_SENSOR_H__
|
|
|
|
#define WATERLEVEL_SENSOR_STACK_SIZE (512)
|
|
#define WATERLEVEL_SENSOR_THREAD_PRIORITY (2)
|
|
#define WATERLEVEL_MESSAGE_QUEUE_SIZE (5) // Size of the message queue for water level sensor thread
|
|
#define WATERLEVEL_SENSOR_READ_INTERVAL_MS (5000) // Interval for reading the water level sensor in milliseconds
|
|
#define WATERLEVEL_SENSOR_MIN_DELTA (2) // Minimum change in water level to trigger an update
|
|
#define WATERLEVEL_SENSOR_MAX_UPDATE_INTERVAL_MS (600000) // Maximum interval for updating the water level in milliseconds
|
|
|
|
#define WATERLEVEL_SENSOR_MODBUS_NODE_ID (0x01) // Modbus node ID for the water level sensor
|
|
#define WATERLEVEL_SENSOR_MODBUS_BAUD_RATE (9600) // Baud rate for Modbus communication
|
|
|
|
#include <inttypes.h>
|
|
|
|
int waterlevel_sensor_start_thread(void);
|
|
|
|
typedef struct {
|
|
uint8_t reg;
|
|
enum {
|
|
WATERLEVEL_CMD_SET,
|
|
WATERLEVEL_CMD_GET,
|
|
} cmd;
|
|
int16_t data; // Data to be set
|
|
} waterlevel_command_t;
|
|
|
|
#endif // __WATERLEVEL_SENSOR_H__
|