CRC APIs. More...
Data Structures | |
| struct | crc_channel_config |
| Channel config. More... | |
Macros | |
| #define | CRC_POLY_WIDTH_4 (4U) |
| #define | CRC_POLY_WIDTH_5 (5U) |
| #define | CRC_POLY_WIDTH_6 (6U) |
| #define | CRC_POLY_WIDTH_7 (7U) |
| #define | CRC_POLY_WIDTH_8 (8U) |
| #define | CRC_POLY_WIDTH_16 (16U) |
| #define | CRC_POLY_WIDTH_24 (24U) |
| #define | CRC_POLY_WIDTH_32 (32U) |
| #define | CRC_REG_WRITE8(addr, data) |
| #define | CRC_REG_WRITE16(addr, data) |
| #define | CRC_REG_WRITE32(addr, data) |
Typedefs | |
| typedef enum crc_preset_enum | crc_preset_t |
| CRC preset definitions. More... | |
| typedef enum crc_refin_enum | crc_refin_t |
| CRC Refin definitions. More... | |
| typedef enum crc_refout_enum | crc_refout_t |
| CRC Refout definitions. More... | |
| typedef enum crc_in_byte_order_enum | crc_in_byte_order_t |
| crc input data stream byte order definitions. More... | |
| typedef struct crc_channel_config | crc_channel_config_t |
| Channel config. More... | |
Enumerations | |
| enum | crc_preset_enum { crc_preset_none = 0 , crc_preset_crc32 , crc_preset_crc32_autosar , crc_preset_crc16_ccitt , crc_preset_crc16_xmodem , crc_preset_crc16_modbus , crc_preset_crc16_dnp , crc_preset_crc16_x25 , crc_preset_crc16_usb , crc_preset_crc16_maxim , crc_preset_crc16_ibm , crc_preset_crc8_maxim , crc_preset_crc8_rohc , crc_preset_crc8_itu , crc_preset_crc8 , crc_preset_crc5_usb } |
| CRC preset definitions. More... | |
| enum | crc_refin_enum { crc_refin_false = 0 , crc_refin_true = 1 } |
| CRC Refin definitions. More... | |
| enum | crc_refout_enum { crc_refout_false = 0 , crc_refout_true = 1 } |
| CRC Refout definitions. More... | |
| enum | crc_in_byte_order_enum { crc_in_byte_order_lsb = 0 , crc_in_byte_order_msb = 1 } |
| crc input data stream byte order definitions. More... | |
Functions | |
| void | crc_get_default_channel_config (crc_channel_config_t *cfg) |
| Get default channel config. More... | |
| hpm_stat_t | crc_setup_channel_config (CRC_Type *ptr, uint32_t ch_index, crc_channel_config_t *cfg) |
| Setup CRC channel. More... | |
| static void | crc_calc_byte (CRC_Type *ptr, uint32_t ch_index, uint8_t data) |
| Calculate one byte data crc. More... | |
| void | crc_calc_block_bytes (CRC_Type *ptr, uint32_t ch_index, uint8_t *pbuffer, uint32_t length) |
| Calculate length bytes data block crc. More... | |
| static void | crc_calc_half_word (CRC_Type *ptr, uint32_t ch_index, uint16_t data) |
| Calculate half-word data crc. More... | |
| void | crc_calc_block_half_words (CRC_Type *ptr, uint32_t ch_index, uint16_t *pbuffer, uint32_t length) |
| Calculate length half-words data block crc. More... | |
| static void | crc_calc_word (CRC_Type *ptr, uint32_t ch_index, uint32_t data) |
| Calculate word data crc. More... | |
| void | crc_calc_block_words (CRC_Type *ptr, uint32_t ch_index, uint32_t *pbuffer, uint32_t length) |
| Calculate length words data block crc. More... | |
| void | crc_calc_large_block_fast (CRC_Type *ptr, uint32_t ch_index, uint8_t *pbuffer, uint32_t length) |
| Fast calculate length bytes large data block crc. More... | |
| static uint32_t | crc_get_result (CRC_Type *ptr, uint32_t ch_index) |
| Get CRC result. More... | |
CRC APIs.
| #define CRC_POLY_WIDTH_16 (16U) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_POLY_WIDTH_24 (24U) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_POLY_WIDTH_32 (32U) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_POLY_WIDTH_4 (4U) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_POLY_WIDTH_5 (5U) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_POLY_WIDTH_6 (6U) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_POLY_WIDTH_7 (7U) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_POLY_WIDTH_8 (8U) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_REG_WRITE16 | ( | addr, | |
| data | |||
| ) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_REG_WRITE32 | ( | addr, | |
| data | |||
| ) |
#include <drivers/inc/hpm_crc_drv.h>
| #define CRC_REG_WRITE8 | ( | addr, | |
| data | |||
| ) |
#include <drivers/inc/hpm_crc_drv.h>
| typedef struct crc_channel_config crc_channel_config_t |
#include <drivers/inc/hpm_crc_drv.h>
Channel config.
| typedef enum crc_in_byte_order_enum crc_in_byte_order_t |
#include <drivers/inc/hpm_crc_drv.h>
crc input data stream byte order definitions.
| typedef enum crc_preset_enum crc_preset_t |
#include <drivers/inc/hpm_crc_drv.h>
CRC preset definitions.
| typedef enum crc_refin_enum crc_refin_t |
#include <drivers/inc/hpm_crc_drv.h>
CRC Refin definitions.
| typedef enum crc_refout_enum crc_refout_t |
#include <drivers/inc/hpm_crc_drv.h>
CRC Refout definitions.
#include <drivers/inc/hpm_crc_drv.h>
crc input data stream byte order definitions.
| Enumerator | |
|---|---|
| crc_in_byte_order_lsb | Byte order of the CRC DATA LS Byte first. |
| crc_in_byte_order_msb | Byte order of the CRC DATA MS Byte first. |
| enum crc_preset_enum |
#include <drivers/inc/hpm_crc_drv.h>
CRC preset definitions.
| enum crc_refin_enum |
#include <drivers/inc/hpm_crc_drv.h>
CRC Refin definitions.
| Enumerator | |
|---|---|
| crc_refin_false | Do not manipulate input data stream. |
| crc_refin_true | Reflect each byte in the input stream bitwise. |
| enum crc_refout_enum |
#include <drivers/inc/hpm_crc_drv.h>
CRC Refout definitions.
| Enumerator | |
|---|---|
| crc_refout_false | Do not manipulate output data stream. |
| crc_refout_true | Reflect each byte in the output stream bitwise. |
| void crc_calc_block_bytes | ( | CRC_Type * | ptr, |
| uint32_t | ch_index, | ||
| uint8_t * | pbuffer, | ||
| uint32_t | length | ||
| ) |
#include <drivers/inc/hpm_crc_drv.h>
Calculate length bytes data block crc.
| [in] | ptr | CRC base address |
| [in] | ch_index | CRC channel index |
| [in] | pbuffer | Data to be calculate buffer |
| [in] | length | Number of pbuffer, unit is byte |
| void crc_calc_block_half_words | ( | CRC_Type * | ptr, |
| uint32_t | ch_index, | ||
| uint16_t * | pbuffer, | ||
| uint32_t | length | ||
| ) |
#include <drivers/inc/hpm_crc_drv.h>
Calculate length half-words data block crc.
| [in] | ptr | CRC base address |
| [in] | ch_index | CRC channel index |
| [in] | pbuffer | Data to be calculate buffer |
| [in] | length | Number of pbuffer, unit is half word(2 bytes) |
| void crc_calc_block_words | ( | CRC_Type * | ptr, |
| uint32_t | ch_index, | ||
| uint32_t * | pbuffer, | ||
| uint32_t | length | ||
| ) |
#include <drivers/inc/hpm_crc_drv.h>
Calculate length words data block crc.
| [in] | ptr | CRC base address |
| [in] | ch_index | CRC channel index |
| [in] | pbuffer | Data to be calculate buffer |
| [in] | length | Number of pbuffer, unit is word(4 bytes) |
|
inlinestatic |
#include <drivers/inc/hpm_crc_drv.h>
Calculate one byte data crc.
| [in] | ptr | CRC base address |
| [in] | ch_index | CRC channel index |
| [in] | data | Data that to be calculate |
|
inlinestatic |
#include <drivers/inc/hpm_crc_drv.h>
Calculate half-word data crc.
| [in] | ptr | CRC base address |
| [in] | ch_index | CRC channel index |
| [in] | data | Data that to be calculate |
| void crc_calc_large_block_fast | ( | CRC_Type * | ptr, |
| uint32_t | ch_index, | ||
| uint8_t * | pbuffer, | ||
| uint32_t | length | ||
| ) |
#include <drivers/inc/hpm_crc_drv.h>
Fast calculate length bytes large data block crc.
| [in] | ptr | CRC base address |
| [in] | ch_index | CRC channel index |
| [in] | pbuffer | Data to be calculate buffer |
| [in] | length | Number of pbuffer, unit is byte |
|
inlinestatic |
#include <drivers/inc/hpm_crc_drv.h>
Calculate word data crc.
| [in] | ptr | CRC base address |
| [in] | ch_index | CRC channel index |
| [in] | data | Data that to be calculate |
| void crc_get_default_channel_config | ( | crc_channel_config_t * | cfg | ) |
|
inlinestatic |
#include <drivers/inc/hpm_crc_drv.h>
Get CRC result.
| [in] | ptr | CRC base address |
| [in] | ch_index | Index of the channel to be get |
| hpm_stat_t crc_setup_channel_config | ( | CRC_Type * | ptr, |
| uint32_t | ch_index, | ||
| crc_channel_config_t * | cfg | ||
| ) |
#include <drivers/inc/hpm_crc_drv.h>
Setup CRC channel.
| [in] | ptr | CRC base address |
| [in] | ch_index | Target channel index to be configured |
| [in] | cfg | Channel config |