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

Detailed Description

Typedefs

typedef IP_CRC_001_POLY_T CRC_POLY_T
 

Functions

STATIC INLINE void Chip_CRC_Init (void)
 Initializes 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)
 Engage 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 directly.
 
STATIC INLINE uint32_t Chip_CRC_GetMode (void)
 Get the CRC Mode bits directly.
 
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 definitions

Definition at line 45 of file crc_17xx_40xx.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: 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: 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: 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 60 of file crc_17xx_40xx.h.

STATIC INLINE uint32_t Chip_CRC_GetMode ( void  )

Get the CRC Mode bits directly.

Returns
The current value of the CRC Mode bits

Definition at line 102 of file crc_17xx_40xx.h.

STATIC INLINE uint32_t Chip_CRC_GetSeed ( void  )

Get the CRC seed value.

Returns
The seeded value

Definition at line 121 of file crc_17xx_40xx.h.

STATIC INLINE void Chip_CRC_Init ( void  )

Initializes the CRC Engine.

Returns
Nothing

Definition at line 51 of file crc_17xx_40xx.h.

STATIC INLINE void Chip_CRC_SetMode ( uint32_t  mode)

Set the CRC Mode bits directly.

Parameters
mode: A value indicating the mode
Returns
Nothing

Definition at line 93 of file crc_17xx_40xx.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 73 of file crc_17xx_40xx.h.

STATIC INLINE void Chip_CRC_SetSeed ( uint32_t  seed)

Set the seed bits used by the CRC_SUM register.

Parameters
seed: The seeded value
Returns
Nothing

Definition at line 112 of file crc_17xx_40xx.h.

STATIC INLINE uint32_t Chip_CRC_Sum ( void  )

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

Returns
The CRC "Checksum."

Definition at line 160 of file crc_17xx_40xx.h.

STATIC INLINE void Chip_CRC_UseDefaultConfig ( CRC_POLY_T  poly)

Engage 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 83 of file crc_17xx_40xx.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 141 of file crc_17xx_40xx.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 151 of file crc_17xx_40xx.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 131 of file crc_17xx_40xx.h.