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.
24 lines
578 B
24 lines
578 B
7 years ago
|
//
|
||
|
// Created by MightyPork on 2018/02/01.
|
||
|
//
|
||
|
|
||
|
#ifndef GEX_F072_OW_CHECKSUM_H
|
||
|
#define GEX_F072_OW_CHECKSUM_H
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
/**
|
||
|
* Compute a 1-wire type checksum.
|
||
|
* If the buffer includes the checksum, the result should be 0.
|
||
|
*
|
||
|
* (this function may be used externally, or you can delete the implementation
|
||
|
* from the c file if another implementation is already available)
|
||
|
*
|
||
|
* @param[in] buf - buffer of bytes to verify
|
||
|
* @param[in] len - buffer length
|
||
|
* @return checksum
|
||
|
*/
|
||
|
uint8_t ow_checksum(const uint8_t *buf, uint16_t len);
|
||
|
|
||
|
#endif //GEX_F072_OW_CHECKSUM_H
|