You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
1.3 KiB
20 lines
1.3 KiB
//###################################################################################################################################################
|
|
#ifndef _MODBUS_CRC_H_
|
|
#define _MODBUS_CRC_H_
|
|
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
|
#include "avr/io.h"
|
|
#include <avr/pgmspace.h>
|
|
#include <inttypes.h>
|
|
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
|
#define MODBUS_CRC16_SIZE 2
|
|
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
|
class MODBUS_CRC16 {
|
|
public :
|
|
static uint16_t CRC16_TF(uint8_t *MODBUS_puchMsg, uint16_t MODBUS_usDataLen);
|
|
static uint16_t CRC16_TR(uint8_t *MODBUS_puchMsg, uint16_t MODBUS_usDataLen);
|
|
static uint16_t CRC16_S(uint8_t *MODBUS_buf, uint16_t MODBUS_len);
|
|
private :
|
|
};
|
|
//---------------------------------------------------------------------------------------------------------------------------------------------------
|
|
#endif //#define _CRC_MODBUS_
|
|
//###################################################################################################################################################
|