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.
|
|
|
//
|
|
|
|
// Created by MightyPork on 2018/02/01.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef GEX_F072_OW_CHECKSUM_H
|
|
|
|
#define GEX_F072_OW_CHECKSUM_H
|
|
|
|
|
|
|
|
#ifndef OW_INTERNAL
|
|
|
|
#error bad include!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#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, uint32_t len);
|
|
|
|
|
|
|
|
#endif //GEX_F072_OW_CHECKSUM_H
|