LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CHIP: LPC8xx CRC Driver

Detailed Description

This driver provides Cyclic Redundancy Check (CRC) support for the device. The driver requires the following IP drivers:
IP: CRC register block and driver

Typedefs

typedef IP_CRC_001_POLY_T CRC_POLY_T
 

Functions

STATIC INLINE void Chip_CRC_Init (void)
 Initialize the CRC Engine.
 
STATIC INLINE void Chip_CRC_Deinit (void)
 Deinitializes the CRC Engine.
 
STATIC INLINE void Chip_CRC_SetPoly (CRC_POLY_T poly, uint32_t flags)
 Set the polynomial used for the CRC calculation.
 
STATIC INLINE void Chip_CRC_UseDefaultConfig (CRC_POLY_T poly)
 Set up the CRC engine with defaults based on the polynomial to be used.
 
STATIC INLINE void Chip_CRC_SetMode (uint32_t mode)
 Set the CRC Mode bits.
 
STATIC INLINE uint32_t Chip_CRC_GetMode (void)
 Get the CRC Mode bits.
 
STATIC INLINE void Chip_CRC_SetSeed (uint32_t seed)
 Set the seed bits used by the CRC_SUM register.
 
STATIC INLINE uint32_t Chip_CRC_GetSeed (void)
 Get the CRC seed value.
 
STATIC INLINE void Chip_CRC_Write8 (uint8_t data)
 Convenience function for writing 8-bit data to the CRC engine.
 
STATIC INLINE void Chip_CRC_Write16 (uint16_t data)
 Convenience function for writing 16-bit data to the CRC engine.
 
STATIC INLINE void Chip_CRC_Write32 (uint32_t data)
 Convenience function for writing 32-bit data to the CRC engine.
 
STATIC INLINE uint32_t Chip_CRC_Sum (void)
 Gets the CRC Sum based on the Mode and Seed as previously configured.
 
uint32_t Chip_CRC_CRC8 (const uint8_t *data, uint32_t bytes)
 Convenience function for computing a standard CCITT checksum from an 8-bit data block.
 
uint32_t Chip_CRC_CRC16 (const uint16_t *data, uint32_t hwords)
 Convenience function for computing a standard CRC16 checksum from 16-bit data block.
 
uint32_t Chip_CRC_CRC32 (const uint32_t *data, uint32_t words)
 Convenience function for computing a standard CRC32 checksum from 32-bit data block.
 

Typedef Documentation

CRC polynomial definition normalize type

Definition at line 48 of file crc_8xx.h.

Function Documentation

uint32_t Chip_CRC_CRC16 ( const uint16_t *  data,
uint32_t  hwords 
)

Convenience function for computing a standard CRC16 checksum from 16-bit data block.

Parameters
data: Pointer to the block of 16-bit data
hwords: The number of 16 byte entries pointed to by data
Returns
Check sum value
Parameters
data: A pointer to the block of 16-bit data
hwords: The number of 16 byte entries pointed to by data
Returns
Nothing

Definition at line 59 of file crc_17xx_40xx.c.

uint32_t Chip_CRC_CRC32 ( const uint32_t data,
uint32_t  words 
)

Convenience function for computing a standard CRC32 checksum from 32-bit data block.

Parameters
data: Pointer to the block of 32-bit data
words: The number of 32-bit entries pointed to by data
Returns
Check sum value
Parameters
data: A pointer to the block of 32-bit data
words: The number of 32 byte entries pointed to by data
Returns
Nothing

Definition at line 66 of file crc_17xx_40xx.c.

uint32_t Chip_CRC_CRC8 ( const uint8_t *  data,
uint32_t  bytes 
)

Convenience function for computing a standard CCITT checksum from an 8-bit data block.

Parameters
data: Pointer to the block of 8-bit data
bytes: The number of bytes pointed to by data
Returns
Check sum value
Parameters
data: A pointer to the block of 8 bit data
bytes: The number of bytes pointed to by data
Returns
Nothing

Definition at line 52 of file crc_17xx_40xx.c.

STATIC INLINE void Chip_CRC_Deinit ( void  )

Deinitializes the CRC Engine.

Returns
Nothing

Definition at line 65 of file crc_8xx.h.

STATIC INLINE uint32_t Chip_CRC_GetMode ( void  )

Get the CRC Mode bits.

Returns
The current value of the CRC Mode bits

Definition at line 109 of file crc_8xx.h.

STATIC INLINE uint32_t Chip_CRC_GetSeed ( void  )

Get the CRC seed value.

Returns
Seed value

Definition at line 128 of file crc_8xx.h.

STATIC INLINE void Chip_CRC_Init ( void  )

Initialize the CRC Engine.

Returns
Nothing

Definition at line 54 of file crc_8xx.h.

STATIC INLINE void Chip_CRC_SetMode ( uint32_t  mode)

Set the CRC Mode bits.

Parameters
mode: Mode value
Returns
Nothing

Definition at line 100 of file crc_8xx.h.

STATIC INLINE void Chip_CRC_SetPoly ( CRC_POLY_T  poly,
uint32_t  flags 
)

Set the polynomial used for the CRC calculation.

Parameters
poly: The enumerated polynomial to be used
flags: An Or'ed value of flags that setup the mode
Returns
Nothing
Note
Flags for setting up the mode word include CRC_MODE_WRDATA_BIT_RVS, CRC_MODE_WRDATA_CMPL, CRC_MODE_SUM_BIT_RVS, and CRC_MODE_SUM_CMPL.

Definition at line 80 of file crc_8xx.h.

STATIC INLINE void Chip_CRC_SetSeed ( uint32_t  seed)

Set the seed bits used by the CRC_SUM register.

Parameters
seed: Seed value
Returns
Nothing

Definition at line 119 of file crc_8xx.h.

STATIC INLINE uint32_t Chip_CRC_Sum ( void  )

Gets the CRC Sum based on the Mode and Seed as previously configured.

Returns
CRC Checksum value

Definition at line 167 of file crc_8xx.h.

STATIC INLINE void Chip_CRC_UseDefaultConfig ( CRC_POLY_T  poly)

Set up the CRC engine with defaults based on the polynomial to be used.

Parameters
poly: The enumerated polynomial to be used
Returns
Nothing

Definition at line 90 of file crc_8xx.h.

STATIC INLINE void Chip_CRC_Write16 ( uint16_t  data)

Convenience function for writing 16-bit data to the CRC engine.

Parameters
data: 16-bit data to write
Returns
Nothing

Definition at line 148 of file crc_8xx.h.

STATIC INLINE void Chip_CRC_Write32 ( uint32_t  data)

Convenience function for writing 32-bit data to the CRC engine.

Parameters
data: 32-bit data to write
Returns
Nothing

Definition at line 158 of file crc_8xx.h.

STATIC INLINE void Chip_CRC_Write8 ( uint8_t  data)

Convenience function for writing 8-bit data to the CRC engine.

Parameters
data: 8-bit data to write
Returns
Nothing

Definition at line 138 of file crc_8xx.h.