This repository has been archived on 2023-07-17. You can view files and clone it, but cannot push or open issues or pull requests.
bl_mcu_sdk/drivers/lhal/include/bflb_cks.h
jzlv a77b0dc866 [update][lhal] update lhal
* update lhal api comments
* add cam driver
* add efuse driver
* add iso11898 driver
2022-12-21 20:20:40 +08:00

65 lines
968 B
C

#ifndef _BFLB_CKS_H
#define _BFLB_CKS_H
#include "bflb_core.h"
/** @addtogroup LHAL
* @{
*/
/** @addtogroup CKS
* @{
*/
/** @defgroup CKS_ENDIAN cks endian definition
* @{
*/
#define CKS_LITTLE_ENDIAN 0
#define CKS_BIG_ENDIAN 1
/**
* @}
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Reset checksum module.
*
* @param [in] dev device handle
*/
void bflb_cks_reset(struct bflb_device_s *dev);
/**
* @brief Set checksum bitorder.
*
* @param [in] dev device handle
* @param [in] endian cks endian, use @ref CKS_ENDIAN
*/
void bflb_cks_set_endian(struct bflb_device_s *dev, uint8_t endian);
/**
* @brief Compute data with checksum.
*
* @param [in] dev device handle
* @param [in] data input data buffer
* @param [in] length data length
* @return checksum value
*/
uint16_t bflb_cks_compute(struct bflb_device_s *dev, uint8_t *data, uint32_t length);
#ifdef __cplusplus
}
#endif
/**
* @}
*/
/**
* @}
*/
#endif