MKMxxZxxACxx5 Bare Metal Software Drivers  R4.1.6
Reference Manual
CRC API Specification

Overview

This section describes functions and macros of the driver's API.

Macros

#define CRC_Read()
 Reads and returns calculated CRC code. More...
 
#define CRC_Calc8(ptr, len)
 Calculates CRC of the data array of bytes (8-bits) and returns calculated CRC code. More...
 
#define CRC_Calc16(ptr, len)
 Calculates CRC of the data array of half-words (16-bits) and returns calculated CRC code. More...
 
#define CRC_Calc32(ptr, len)
 Calculates CRC of the data array of words (32-bits) and returns calculated CRC code. More...
 
#define CRC_Init(crc)
 Initializes CRC calculation. More...
 

Macro Definition Documentation

#define CRC_Read ( )

This macro reads and returns calculated CRC code.

Returns
uint32 CRC number.
Note
Implemented as a function call.
#define CRC_Calc8 (   ptr,
  len 
)

This function calculates CRC of the data array of bytes (8-bits) and returns calculated CRC code. The algorithm for CRC calculation has been defined by the preceding CRC_Init function.

Parameters
ptrPointer to data array of bytes (8-bits).
lenNumber of data bytes
Returns
uint32 CRC number.
Note
Implemented as a function call.
#define CRC_Calc16 (   ptr,
  len 
)

This function calculates CRC of the data array of half-words (16-bits) and returns calculated CRC code. The algorithm for CRC calculation has been defined by the preceding CRC_Init function.

Parameters
ptrPointer to data array of half-words (16-bits).
lenNumber of data half-words.
Returns
uint32 CRC number.
Note
Implemented as a function call.
#define CRC_Calc32 (   ptr,
  len 
)

This function calculates CRC of the data array of words (32-bits) and returns calculated CRC code. The algorithm for CRC calculation has been defined by the preceding CRC_Init function.

Parameters
ptrPointer to data array of words (32-bits).
lenNumber of data words.
Returns
uint32 CRC number.
Note
Implemented as a function call.
#define CRC_Init (   crc)

This function initializes CRC calculation and allows user to select preferred calculation algorithm.

Parameters
crcSelect one of the CRC Configuration Structures.
Returns
void* pointer to CRC_DATA register.
Note
Implemented as a function call. Information about various CRC specs available from http://en.wikipedia.org/wiki/Cyclic_redundancy_check