| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
crc_001.h File Reference
`#include "sys_config.h"`
`#include "cmsis.h"`

Go to the source code of this file.

## Data Structures
struct | IP_CRC_001_T
| CRC register block structure. More...

## Macros
#define | CRC_MODE_POLY_BITMASK ((0x03)) /** CRC polynomial Bit mask */
| CRC MODE register description.
#define | CRC_MODE_POLY_CCITT (0x00) /** Select CRC-CCITT polynomial */
#define | CRC_MODE_POLY_CRC16 (0x01) /** Select CRC-16 polynomial */
#define | CRC_MODE_POLY_CRC32 (0x02) /** Select CRC-32 polynomial */
#define | CRC_MODE_WRDATA_BITMASK (0x03 << 2) /** CRC WR_Data Config Bit mask */
#define | CRC_MODE_WRDATA_BIT_RVS (1 << 2) /** Select Bit order reverse for WR_DATA (per byte) */
#define | CRC_MODE_WRDATA_CMPL (1 << 3) /** Select One's complement for WR_DATA */
#define | CRC_MODE_SUM_BITMASK (0x03 << 4) /** CRC Sum Config Bit mask */
#define | CRC_MODE_SUM_BIT_RVS (1 << 4) /** Select Bit order reverse for CRC_SUM */
#define | CRC_MODE_SUM_CMPL (1 << 5) /** Select One's complement for CRC_SUM */
#define | MODE_CFG_CCITT (0x00) /** Pre-defined mode word for default CCITT setup */
#define | MODE_CFG_CRC16 (0x15) /** Pre-defined mode word for default CRC16 setup */
#define | MODE_CFG_CRC32 (0x36) /** Pre-defined mode word for default CRC32 setup */
#define | CRC_SEED_CCITT (0x0000FFFF)/** Initial seed value for CCITT mode */
#define | CRC_SEED_CRC16 (0x00000000)/** Initial seed value for CRC16 mode */
#define | CRC_SEED_CRC32 (0xFFFFFFFF)/** Initial seed value for CRC32 mode */

## Enumerations
enum | IP_CRC_001_POLY_T { CRC_POLY_CCITT = CRC_MODE_POLY_CCITT, CRC_POLY_CRC16 = CRC_MODE_POLY_CRC16, CRC_POLY_CRC32 = CRC_MODE_POLY_CRC32, CRC_POLY_LAST }

## Functions
STATIC INLINE void | IP_CRC_Init (IP_CRC_001_T *pCRC)
| Initializes the CRC Engine.
STATIC INLINE void | IP_CRC_DeInit (IP_CRC_001_T *pCRC)
| De-initializes the CRC Engine.
STATIC INLINE void | IP_CRC_SetPoly (IP_CRC_001_T *pCRC, IP_CRC_001_POLY_T poly, uint32_t flags)
| Select polynomial for CRC Engine.
void | IP_CRC_UseDefaultConfig (IP_CRC_001_T *pCRC, IP_CRC_001_POLY_T poly)
| Sets up the CRC engine with defaults based on the polynomial to be used.
STATIC INLINE uint32_t | IP_CRC_GetMode (IP_CRC_001_T *pCRC)
| Get mode register of CRC Engine.
STATIC INLINE void | IP_CRC_SetMode (IP_CRC_001_T *pCRC, uint32_t mode)
| Set mode register of CRC Engine.
STATIC INLINE void | IP_CRC_SetSeed (IP_CRC_001_T *pCRC, uint32_t Seed)
| Set Seed value.
STATIC INLINE uint32_t | IP_CRC_GetSeed (IP_CRC_001_T *pCRC)
| Get Seed value.
STATIC INLINE void | IP_CRC_Write8 (IP_CRC_001_T *pCRC, uint8_t data)
| Write 8-bit data to CRC WR Data register.
STATIC INLINE void | IP_CRC_Write16 (IP_CRC_001_T *pCRC, uint16_t data)
| Write 16-bit data to CRC WR Data register.
STATIC INLINE void | IP_CRC_Write32 (IP_CRC_001_T *pCRC, uint32_t data)
| Write 32-bit data to CRC WR Data register.
STATIC INLINE uint32_t | IP_CRC_ReadSum (IP_CRC_001_T *pCRC)
| Read current calculated checksum from CRC Engine.
uint32_t | IP_CRC_CRC8 (IP_CRC_001_T *pCRC, const uint8_t *data, uint32_t bytes)
| Convenience function for computing a standard CCITT checksum from an 8-bit data block.
uint32_t | IP_CRC_CRC16 (IP_CRC_001_T *pCRC, const uint16_t *data, uint32_t hwords)
| Convenience function for computing a standard CRC16 checksum from 16-bit data block.
uint32_t | IP_CRC_CRC32 (IP_CRC_001_T *pCRC, const uint32_t *data, uint32_t words)
| Convenience function for computing a standard CRC32 checksum from 32-bit data block.