lhakpa dorji
/
Modbus
Modbus with stm 32
Diff: modbus.h
- Revision:
- 0:40b96f9186c3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modbus.h Wed Mar 14 11:28:39 2018 +0000 @@ -0,0 +1,14 @@ +#ifndef MODBUS_H +#define MODBUS_H + +#define FUNC_CODE 3 +#define ADDR_BASE 0x0000 +#define ADDR_RANGE 2 +#define MAX_FRAME_SIZE 20 + +void modbus_init(uint8_t id); +uint16_t modbus_read(uint16_t offset); +uint16_t modbus_update(uint8_t offset, uint16_t val); +int modbus_parser(char ch, uint8_t *frame); + +#endif // MODBUS_H