add template

This commit is contained in:
2023-02-28 15:00:54 +01:00
parent 3af88e8337
commit e16f81e018
7 changed files with 357 additions and 0 deletions

19
solar_panel.X/crc.h Normal file
View File

@@ -0,0 +1,19 @@
/************************************************************************//**
* \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 */