Solar panel
Loading...
Searching...
No Matches
crc.h File Reference

CRC calculation for Modbus. More...

#include <stdint.h>

Go to the source code of this file.

Functions

uint16_t CRC16 (const uint8_t *msg, uint16_t length)
 

Detailed Description

CRC calculation for Modbus.

Definition in file crc.h.

Function Documentation

◆ CRC16()

uint16_t CRC16 ( const uint8_t *  msg,
uint16_t  length 
)

Compute the CRC using the MODBUS formulae

Parameters
msg: message to be sent
length: length of the message
Returns
the computed CRC value

Definition at line 48 of file crc.c.