lhakpa dorji
/
Modbus
Modbus with stm 32
modbus.h@0:40b96f9186c3, 2018-03-14 (annotated)
- Committer:
- lhakpa
- Date:
- Wed Mar 14 11:28:39 2018 +0000
- Revision:
- 0:40b96f9186c3
modbus Work
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lhakpa | 0:40b96f9186c3 | 1 | #ifndef MODBUS_H |
lhakpa | 0:40b96f9186c3 | 2 | #define MODBUS_H |
lhakpa | 0:40b96f9186c3 | 3 | |
lhakpa | 0:40b96f9186c3 | 4 | #define FUNC_CODE 3 |
lhakpa | 0:40b96f9186c3 | 5 | #define ADDR_BASE 0x0000 |
lhakpa | 0:40b96f9186c3 | 6 | #define ADDR_RANGE 2 |
lhakpa | 0:40b96f9186c3 | 7 | #define MAX_FRAME_SIZE 20 |
lhakpa | 0:40b96f9186c3 | 8 | |
lhakpa | 0:40b96f9186c3 | 9 | void modbus_init(uint8_t id); |
lhakpa | 0:40b96f9186c3 | 10 | uint16_t modbus_read(uint16_t offset); |
lhakpa | 0:40b96f9186c3 | 11 | uint16_t modbus_update(uint8_t offset, uint16_t val); |
lhakpa | 0:40b96f9186c3 | 12 | int modbus_parser(char ch, uint8_t *frame); |
lhakpa | 0:40b96f9186c3 | 13 | |
lhakpa | 0:40b96f9186c3 | 14 | #endif // MODBUS_H |