Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

This section describes the programming interface of the CRC driver.

CRC Driver Initialization

To initialize the CRC module, call CRC_DRV_Init() function and pass the user configuration data structure to it.

CRC Driver Operation

The CRC_DRV_Configure() function is used to write the user configuration to the CRC hardware module before starting operation by calling the CRC_DRV_GetCrcBlock() function.

Data Structures

struct  crc_user_config_t
 Defines a structure to initialize the CRC module. More...
 

Functions

crc_status_t CRC_DRV_Init (uint32_t instance, const crc_user_config_t *userConfigPtr)
 Initializes the CRC module. More...
 
void CRC_DRV_Deinit (uint32_t instance)
 CRC_DRV_Deinit. More...
 
uint32_t CRC_DRV_GetCrcBlock (uint32_t instance, uint8_t *data, uint32_t dataLen)
 CRC_DRV_GetCrcBlock. More...
 
crc_status_t CRC_DRV_Configure (uint32_t instance, const crc_user_config_t *userConfigPtr)
 CRC_DRV_Configure. More...
 

Variables

CRC_Type *const g_crcBase [CRC_INSTANCE_COUNT]
 Table of base addresses for the CRC instances. More...
 

Data Structure Documentation

struct crc_user_config_t

This structure holds the configuration for the CRC.

Data Fields

crc_prot_width_t crcWidth
 Selects 16 or 32-bit CRC protocol.
 
uint32_t seed
 Value of the seed (initial) CRC value.
 
uint32_t polynomial
 Value of the polynomial for the CRC calculation
Example polynomial: 0x1021 = 1_0000_0010_0001 = x^12+x^5+1.
 
crc_transpose_t writeTranspose
 Defines transpose configuration of the data written to the CRC data register.
 
crc_transpose_t readTranspose
 Defines transpose configuration of the value read from the CRC data register.
 
bool complementRead
 Enables complement read of CRC data register.
 

Function Documentation

crc_status_t CRC_DRV_Init ( uint32_t  instance,
const crc_user_config_t userConfigPtr 
)

This API should be called with the initial configuration before any other operations.

Parameters
instanceCRC instance ID.
userConfigPtrPointer to structure of initialization, see to "crc_user_config_t".
Returns
Execution status.
void CRC_DRV_Deinit ( uint32_t  instance)

Shuts down the CRC instance.

Parameters
instanceCRC instance ID.
Returns
Execution status.
uint32_t CRC_DRV_GetCrcBlock ( uint32_t  instance,
uint8_t *  data,
uint32_t  dataLen 
)

This function appends a block of bytes to the current CRC calculation and returns a new result.

Parameters
instanceCRC instance ID.
datadata for current CRC calculation
dataLenlength of data to be calculated
Returns
Execution status.
crc_status_t CRC_DRV_Configure ( uint32_t  instance,
const crc_user_config_t userConfigPtr 
)

This function configures the CRC module from a user configuration structure.

Parameters
instanceCRC instance ID.
userConfigPtrPointer to structure of initialization, see to "crc_user_config_t".
Returns
Execution status.

Variable Documentation

CRC_Type* const g_crcBase[CRC_INSTANCE_COUNT]