Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the CRC HAL driver.
Files | |
file | fsl_crc_hal.h |
Enumerations | |
enum | crc_status_t { kStatus_CRC_Success = 0U, kStatus_CRC_InvalidArgument = 1U, kStatus_CRC_Failed = 2U } |
Definitions More... | |
enum | crc_transpose_t { kCrcNoTranspose = 0U, kCrcTransposeBits = 1U, kCrcTransposeBoth = 2U, kCrcTransposeBytes = 3U } |
Define type of enumerating transpose modes for CRC peripheral. More... | |
enum | crc_prot_width_t { kCrc16Bits = 0U, kCrc32Bits = 1U } |
Define type of enumerating CRC protocol widths for CRC peripheral. More... | |
CRC-related feature APIs | |
API | |
void | CRC_HAL_Init (CRC_Type *base) |
This function initializes the module to a known state. More... | |
static uint32_t | CRC_HAL_GetDataReg (CRC_Type *base) |
Returns the current CRC result from the data register. More... | |
static uint16_t | CRC_HAL_GetDataHReg (CRC_Type *base) |
Returns the upper 16 bits of the current CRC result from the data register. More... | |
static uint16_t | CRC_HAL_GetDataLReg (CRC_Type *base) |
Returns the lower 16 bits of the current CRC result from the data register. More... | |
static void | CRC_HAL_SetDataReg (CRC_Type *base, uint32_t value) |
Sets the CRC data register (4 bytes). More... | |
static void | CRC_HAL_SetDataHReg (CRC_Type *base, uint16_t value) |
Sets the CRC data register (upper 2 bytes). More... | |
static void | CRC_HAL_SetDataLReg (CRC_Type *base, uint16_t value) |
Sets the CRC data register (lower 2 bytes). More... | |
static void | CRC_HAL_SetDataHLReg (CRC_Type *base, uint8_t value) |
Sets the CRC data register (HL byte). More... | |
static void | CRC_HAL_SetDataHUReg (CRC_Type *base, uint8_t value) |
Sets the CRC data register (HU byte). More... | |
static void | CRC_HAL_SetDataLLReg (CRC_Type *base, uint8_t value) |
Sets the CRC data register (LL byte). More... | |
static void | CRC_HAL_SetDataLUReg (CRC_Type *base, uint8_t value) |
Sets the CRC data register (LU byte). More... | |
static uint32_t | CRC_HAL_GetPolyReg (CRC_Type *base) |
Returns the polynomial register value. More... | |
static uint16_t | CRC_HAL_GetPolyHReg (CRC_Type *base) |
Returns the upper 16 bits of polynomial register. More... | |
static uint16_t | CRC_HAL_GetPolyLReg (CRC_Type *base) |
Returns the lower 16 bits of polynomial register. More... | |
static void | CRC_HAL_SetPolyReg (CRC_Type *base, uint32_t value) |
Sets the polynomial register. More... | |
static void | CRC_HAL_SetPolyHReg (CRC_Type *base, uint16_t value) |
Sets the upper 16 bits of polynomial register. More... | |
static void | CRC_HAL_SetPolyLReg (CRC_Type *base, uint16_t value) |
Sets the lower 16 bits of polynomial register. More... | |
static uint32_t | CRC_HAL_GetCtrlReg (CRC_Type *base) |
Returns the CRC control register. More... | |
static void | CRC_HAL_SetCtrlReg (CRC_Type *base, uint32_t value) |
Sets the CRC control register. More... | |
static bool | CRC_HAL_GetSeedOrDataMode (CRC_Type *base) |
Gets the CRC seed mode. More... | |
static void | CRC_HAL_SetSeedOrDataMode (CRC_Type *base, bool enable) |
Sets the CRC seed mode. More... | |
static crc_transpose_t | CRC_HAL_GetWriteTranspose (CRC_Type *base) |
Gets the CRC transpose type for writes. More... | |
static void | CRC_HAL_SetWriteTranspose (CRC_Type *base, crc_transpose_t transp) |
Sets the CRC transpose type for writes. More... | |
static crc_transpose_t | CRC_HAL_GetReadTranspose (CRC_Type *base) |
Gets the CRC transpose type for reads. More... | |
static void | CRC_HAL_SetReadTranspose (CRC_Type *base, crc_transpose_t transp) |
Sets the CRC transpose type for reads. More... | |
static bool | CRC_HAL_GetXorMode (CRC_Type *base) |
Gets the CRC XOR mode. More... | |
static void | CRC_HAL_SetXorMode (CRC_Type *base, bool enable) |
Sets the CRC XOR mode. More... | |
static crc_prot_width_t | CRC_HAL_GetProtocolWidth (CRC_Type *base) |
Gets the CRC protocol width. More... | |
static void | CRC_HAL_SetProtocolWidth (CRC_Type *base, crc_prot_width_t width) |
Sets the CRC protocol width. More... | |
uint32_t | CRC_HAL_GetCrc32 (CRC_Type *base, uint32_t data, bool newSeed, uint32_t seed) |
CRC_HAL_GetCrc32. More... | |
uint32_t | CRC_HAL_GetCrc16 (CRC_Type *base, uint16_t data, bool newSeed, uint32_t seed) |
CRC_HAL_GetCrc16. More... | |
uint32_t | CRC_HAL_GetCrc8 (CRC_Type *base, uint8_t data, bool newSeed, uint32_t seed) |
CRC_HAL_GetCrc8. More... | |
uint32_t | CRC_HAL_GetCrcResult (CRC_Type *base) |
CRC_HAL_GetCrcResult. More... | |
enum crc_status_t |
enum crc_transpose_t |
enum crc_prot_width_t |
void CRC_HAL_Init | ( | CRC_Type * | base | ) |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | New data for CRC computation. This parameter is a 32-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | New data for CRC computation. This parameter is a 16-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | New data for CRC computation. This parameter is a 16-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | New data for CRC computation. This parameter is a 8-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | New data for CRC computation. This parameter is a 8-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | New data for CRC computation. This parameter is a 8-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | New data for CRC computation. This parameter is a 8-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | Polynomial value. This parameter is a 32-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | Polynomial value. This parameter is a 16-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | Polynomial value. This parameter is a 16-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
value | Control register value. This parameter is a 32-bit value. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
enable | Enable or disable seed mode. -true: use CRC data register for seed values -false: use CRC data register for data values |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
transp | The CRC input transpose type. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
transp | The CRC output transpose type. |
|
inlinestatic |
Some CRC protocols require the final checksum to be XORed with 0xFFFFFFFF or 0xFFFF. XOR mode enables "on the fly" complementing of read data.
base | The CRC peripheral base address. |
|
inlinestatic |
Some CRC protocols require the final checksum to be XORed with 0xFFFFFFFF or 0xFFFF. XOR mode enables "on the fly" complementing of read data.
base | The CRC peripheral base address. |
enable | Enable or disable XOR mode. |
|
inlinestatic |
base | The CRC peripheral base address. |
|
inlinestatic |
base | The CRC peripheral base address. |
width | The CRC protocol width -kCrc16Bits: 16-bit CRC protocol -kCrc32Bits: 32-bit CRC protocol |
uint32_t CRC_HAL_GetCrc32 | ( | CRC_Type * | base, |
uint32_t | data, | ||
bool | newSeed, | ||
uint32_t | seed | ||
) |
This method appends 32-bit data to the current CRC calculation and returns new result. If the newSeed is true, seed set and result are calculated from the seed new value (new CRC calculation).
base | The CRC peripheral base address. |
data | input data for CRC calculation |
newSeed | Sets new CRC calculation.
|
seed | New seed if newSeed is true, else ignored |
uint32_t CRC_HAL_GetCrc16 | ( | CRC_Type * | base, |
uint16_t | data, | ||
bool | newSeed, | ||
uint32_t | seed | ||
) |
This method appends the 16-bit data to the current CRC calculation and returns a new result. If the newSeed is true, seed set and result are calculated from the seed new value (new CRC calculation).
base | The CRC peripheral base address. |
data | input data for CRC calculation |
newSeed | Sets new CRC calculation.
|
seed | New seed if newSeed is true, else ignored |
uint32_t CRC_HAL_GetCrc8 | ( | CRC_Type * | base, |
uint8_t | data, | ||
bool | newSeed, | ||
uint32_t | seed | ||
) |
This method appends the 8-bit data to the current CRC calculation and returns the new result. If the newSeed is true, seed set and result are calculated from the seed new value (new CRC calculation).
base | The CRC peripheral base address. |
data | input data for CRC calculation |
newSeed | Sets new CRC calculation.
|
seed | New seed if newSeed is true, else ignored |
uint32_t CRC_HAL_GetCrcResult | ( | CRC_Type * | base | ) |
This method returns the current result of the CRC calculation. The result is the ReadTranspose dependent.
base | The CRC peripheral base address. |