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

Committer:
gugani
Date:
2017-10-10
Revision:
0:7c5265097fd2

File content as of revision 0:7c5265097fd2:

#ifndef _LIB_CRC_H_
#define _LIB_CRC_H_

#include <stdint.h>

#define CRC_VERSION     "2.0"

uint16_t update_crc16_reflected( uint16_t *table, uint16_t crc, char c );
uint16_t update_crc16_A001( uint16_t crc, char c );
uint16_t calculate_crc16_Modbus(char *p, unsigned int length);

#endif /* _LIB_CRC_H_ */