1.6.6.16 DMAC_CRCCalculate Function

C

void DMAC_CRCCalculate(void *buffer, uint32_t length, DMAC_CRC_SETUP CRCSetup)

Summary

Function to calculate CRC using I/O Interface

Description

It Sets the CRC Engine in IO mode to get the data using the CPU which will be written in CRCDATAIN register. It internally calculates the Beat Size to be used based on the buffer length.

This function returns the final CRC value once the computation is done

DMAC_CRCRead() function can also be used to read the Generated CRC value.

Parameters

Param Description
buffer Buffer on which the CRC has to be computed
length Size of the buffer in bytes.
DMAC_CRC_SETUP crcSetup parameter holding the crc setup information

Returns

- crc - Generated crc value

Example

#define DMAC_TRANSFER_SIZE 9

const uint8_t srcBuffer[DMAC_TRANSFER_SIZE] = {'1', '2', '3', '4', '5', '6', '7', '8', '9'};
uint8_t CACHE_ALIGN dstBuffer[DMAC_TRANSFER_SIZE] = {0};
    
    uint32_t io_crc_32 = 0;
DMAC_CRC_SETUP crcSetup = {0};
    
    crcSetup.polynomial_type = DMAC_CRC_TYPE_32;
    crcSetup.seed = 0xFFFFFFFF;
    
    io_crc_32 = DMAC_CRCCalculate((void *)srcBuffer, DMAC_TRANSFER_SIZE, CRCSetup);
    

Remarks

None