MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

This functions is used to initialize the context for CAAM_CRC API.

Functions

status_t CAAM_CRC_Init (CAAM_Type *base, caam_handle_t *handle, caam_crc_ctx_t *ctx, caam_crc_algo_t algo, const uint8_t *polynomial, size_t polynomialSize, caam_aai_crc_alg_t mode)
 Initialize CRC context. More...
 
status_t CAAM_CRC_Update (caam_crc_ctx_t *ctx, const uint8_t *input, size_t inputSize)
 Add data to current CRC. More...
 
status_t CAAM_CRC_Finish (caam_crc_ctx_t *ctx, uint8_t *output, size_t *outputSize)
 Finalize CRC. More...
 
status_t CAAM_CRC (CAAM_Type *base, caam_handle_t *handle, caam_crc_algo_t algo, caam_aai_crc_alg_t mode, const uint8_t *input, size_t inputSize, const uint8_t *polynomial, size_t polynomialSize, uint8_t *output, size_t *outputSize)
 Create CRC on given data. More...
 
status_t CAAM_CRC_NonBlocking (CAAM_Type *base, caam_handle_t *handle, caam_desc_hash_t descriptor, caam_crc_algo_t algo, caam_aai_crc_alg_t mode, const uint8_t *input, size_t inputSize, const uint8_t *polynomial, size_t polynomialSize, uint8_t *output, size_t *outputSize)
 Create CRC on given data. More...
 

Function Documentation

status_t CAAM_CRC_Init ( CAAM_Type *  base,
caam_handle_t handle,
caam_crc_ctx_t *  ctx,
caam_crc_algo_t  algo,
const uint8_t *  polynomial,
size_t  polynomialSize,
caam_aai_crc_alg_t  mode 
)

This function initializes the CRC context. polynomial shall be supplied if the underlaying algoritm is kCAAM_CrcCUSTPOLY. polynomial shall be NULL if the underlaying algoritm is kCAAM_CrcIEEE or kCAAM_CrciSCSI.

This functions is used to initialize the context for CAAM_CRC API

Parameters
baseCAAM peripheral base address
handleHandle used for this request.
[out]ctxOutput crc context
algoUnderlaying algorithm to use for CRC computation
polynomialCRC polynomial (NULL if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI)
polynomialSizeSize of polynomial in bytes (0u if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI)
modeSpecify how CRC engine manipulates its input and output data
Returns
Status of initialization
status_t CAAM_CRC_Update ( caam_crc_ctx_t *  ctx,
const uint8_t *  input,
size_t  inputSize 
)

Add data to current CRC. This can be called repeatedly. The functions blocks. If it returns kStatus_Success, the running CRC has been updated (CAAM has processed the input data), so the memory at input pointer can be released back to system. The context is updated with the running CRC and with all necessary information to support possible context switch.

Parameters
[in,out]ctxCRC context
inputInput data
inputSizeSize of input data in bytes
Returns
Status of the crc update operation
status_t CAAM_CRC_Finish ( caam_crc_ctx_t *  ctx,
uint8_t *  output,
size_t *  outputSize 
)

Outputs the final CRC (computed by CAAM_CRC_Update()) and erases the context.

Parameters
[in,out]ctxInput crc context
[out]outputOutput crc data
[out]outputSizeOutput parameter storing the size of the output crc in bytes
Returns
Status of the crc finish operation
status_t CAAM_CRC ( CAAM_Type *  base,
caam_handle_t handle,
caam_crc_algo_t  algo,
caam_aai_crc_alg_t  mode,
const uint8_t *  input,
size_t  inputSize,
const uint8_t *  polynomial,
size_t  polynomialSize,
uint8_t *  output,
size_t *  outputSize 
)

Perform CRC in one function call.

Polynomial shall be supplied if underlaying algorithm is kCAAM_CrcCUSTPOLY. Polynomial shall be NULL if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI.

The function is blocking.

Parameters
baseCAAM peripheral base address
handleHandle used for this request.
algoUnderlaying algorithm to use for crc computation.
modeSpecify how CRC engine manipulates its input and output data.
inputInput data
inputSizeSize of input data in bytes
polynomialCRC polynomial (NULL if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI)
polynomialSizeSize of input polynomial in bytes (0U if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI)
[out]outputOutput crc data
[out]outputSizeOutput parameter storing the size of the output crc in bytes
Returns
Status of the one call crc operation.
status_t CAAM_CRC_NonBlocking ( CAAM_Type *  base,
caam_handle_t handle,
caam_desc_hash_t  descriptor,
caam_crc_algo_t  algo,
caam_aai_crc_alg_t  mode,
const uint8_t *  input,
size_t  inputSize,
const uint8_t *  polynomial,
size_t  polynomialSize,
uint8_t *  output,
size_t *  outputSize 
)

Perform CRC in one function call.

Polynomial shall be supplied if underlaying algorithm is kCAAM_CrcCUSTPOLY. Polynomial shall be NULL if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI.

The function is non-blocking. The request is scheduled at CAAM.

Parameters
baseCAAM peripheral base address
handleHandle used for this request.
[out]descriptorMemory for the CAAM descriptor.
algoUnderlaying algorithm to use for crc computation.
modeSpecify how CRC engine manipulates its input and output data.
inputInput data
inputSizeSize of input data in bytes
polynomialCRC polynomial (NULL if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI)
polynomialSizeSize of input polynomial in bytes (0U if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI)
[out]outputOutput crc data
[out]outputSizeOutput parameter storing the size of the output crc in bytes
Returns
Status of the one call crc operation.