![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
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... | |
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
base | CAAM peripheral base address | |
handle | Handle used for this request. | |
[out] | ctx | Output crc context |
algo | Underlaying algorithm to use for CRC computation | |
polynomial | CRC polynomial (NULL if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI) | |
polynomialSize | Size of polynomial in bytes (0u if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI) | |
mode | Specify how CRC engine manipulates its input and output data |
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.
[in,out] | ctx | CRC context |
input | Input data | |
inputSize | Size of input data in bytes |
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.
[in,out] | ctx | Input crc context |
[out] | output | Output crc data |
[out] | outputSize | Output parameter storing the size of the output crc in bytes |
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.
base | CAAM peripheral base address | |
handle | Handle used for this request. | |
algo | Underlaying algorithm to use for crc computation. | |
mode | Specify how CRC engine manipulates its input and output data. | |
input | Input data | |
inputSize | Size of input data in bytes | |
polynomial | CRC polynomial (NULL if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI) | |
polynomialSize | Size of input polynomial in bytes (0U if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI) | |
[out] | output | Output crc data |
[out] | outputSize | Output parameter storing the size of the output crc in bytes |
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.
base | CAAM peripheral base address | |
handle | Handle used for this request. | |
[out] | descriptor | Memory for the CAAM descriptor. |
algo | Underlaying algorithm to use for crc computation. | |
mode | Specify how CRC engine manipulates its input and output data. | |
input | Input data | |
inputSize | Size of input data in bytes | |
polynomial | CRC polynomial (NULL if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI) | |
polynomialSize | Size of input polynomial in bytes (0U if underlaying algorithm is kCAAM_CrcIEEE or kCAAM_CrciSCSI) | |
[out] | output | Output crc data |
[out] | outputSize | Output parameter storing the size of the output crc in bytes |