SimpleModbusSlave allows you to communicate to any slave using the Modbus RTU protocol. The crc calculation is based on https://os.mbed.com/users/jpelletier/code/CRC/ The functions implemented are functions 3 and 16. read holding registers and preset multiple registers of the Modbus RTU Protocol. This implementation DOES NOT fully comply with the Modbus specifications.
lib_crc.h@0:7c5265097fd2, 2017-10-10 (annotated)
- Committer:
- gugani
- Date:
- Tue Oct 10 12:22:31 2017 +0000
- Revision:
- 0:7c5265097fd2
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gugani | 0:7c5265097fd2 | 1 | #ifndef _LIB_CRC_H_ |
gugani | 0:7c5265097fd2 | 2 | #define _LIB_CRC_H_ |
gugani | 0:7c5265097fd2 | 3 | |
gugani | 0:7c5265097fd2 | 4 | #include <stdint.h> |
gugani | 0:7c5265097fd2 | 5 | |
gugani | 0:7c5265097fd2 | 6 | #define CRC_VERSION "2.0" |
gugani | 0:7c5265097fd2 | 7 | |
gugani | 0:7c5265097fd2 | 8 | uint16_t update_crc16_reflected( uint16_t *table, uint16_t crc, char c ); |
gugani | 0:7c5265097fd2 | 9 | uint16_t update_crc16_A001( uint16_t crc, char c ); |
gugani | 0:7c5265097fd2 | 10 | uint16_t calculate_crc16_Modbus(char *p, unsigned int length); |
gugani | 0:7c5265097fd2 | 11 | |
gugani | 0:7c5265097fd2 | 12 | #endif /* _LIB_CRC_H_ */ |