This repository has been archived on 2024-01-25. You can view files and clone it, but cannot push or open issues or pull requests.
Solar-Panel/crc.h

19 lines
494 B
C
Raw Normal View History

2023-02-28 14:00:54 +00:00
/************************************************************************//**
* \file crc.h
* \brief CRC calculation for Modbus
***************************************************************************/
#ifndef CRC_H
#define CRC_H
#include <stdint.h>
/**
* Compute the CRC using the MODBUS formulae
* @param msg : message to be sent
* @param length : length of the message
* @return the computed CRC value
*/
uint16_t CRC16(const uint8_t *msg, uint16_t length);
#endif /* CRC_H */