52 #include <adi_processor.h> 60 #include <drivers/dma/adi_dma.h> 63 #include <adi_crc_config.h> 71 #if (ADI_CRC_CFG_ENABLE_DMA_SUPPORT == 0) 79 #if defined(__ICCARM__) 84 #define ADI_CRC_MEMORY_SIZE (32u) 92 #define ADI_CRC_MEMORY_SIZE (32u) 104 #if defined(__ICCARM__) 109 #define ADI_CRC_MEMORY_SIZE (32u) 117 #define ADI_CRC_MEMORY_SIZE (32u) 121 #define ADI_CRC_VALID_DMA_CHANNEL(DMA_CHANNEL_ID) ((SIP0_CHANn<=(DMA_CHANNEL_ID)) && ((DMA_CHANNEL_ID)<=SIP7_CHANn)) 128 typedef enum __ADI_CRC_EVENT
171 ADI_CRC_HANDLE *phDevice);
175 ADI_CRC_HANDLE
const hDevice);
179 ADI_CRC_HANDLE
const hDevice,
180 ADI_CALLBACK pfCallback,
181 void *
const pCBParam);
185 ADI_CRC_HANDLE
const hDevice,
186 uint32_t PolynomialVal);
190 ADI_CRC_HANDLE
const hDevice,
197 ADI_CRC_HANDLE
const hDevice,
198 bool *pbCrcInProgress);
202 ADI_CRC_HANDLE
const hDevice,
203 uint32_t *pFinalCrcVal);
207 ADI_CRC_HANDLE
const hDevice,
208 uint32_t *pCurrentCrcVal);
211 ADI_CRC_HANDLE
const hDevice,
215 ADI_CRC_HANDLE
const hDevice,
219 ADI_CRC_HANDLE
const hDevice,
223 ADI_CRC_HANDLE
const hDevice,
224 uint32_t CrcSeedVal);
227 ADI_CRC_HANDLE
const hDevice,
struct __ADI_CRC_DEVICE * ADI_CRC_HANDLE
ADI_CRC_RESULT adi_crc_GetCurrentCrcVal(ADI_CRC_HANDLE const hDevice, uint32_t *pCurrentCrcVal)
Gets the current/intermediate CRC result computed for a data stream.
ADI_CRC_RESULT adi_crc_RegisterCallback(ADI_CRC_HANDLE const hDevice, ADI_CALLBACK pfCallback, void *const pCBParam)
Registers or unregisters a callback with the CRC device.
ADI_CRC_RESULT adi_crc_SetByteMirroring(ADI_CRC_HANDLE const hDevice, const bool bEnable)
Set the byte mirroring. This function should be called only when device is disabled.
ADI_CRC_RESULT adi_crc_SetPolynomialVal(ADI_CRC_HANDLE const hDevice, uint32_t PolynomialVal)
Sets the 32-bit polynomial for CRC operations.
ADI_CRC_RESULT adi_crc_SetLSBFirst(ADI_CRC_HANDLE const hDevice, const bool bEnable)
Enable the LSB first.
ADI_CRC_RESULT adi_crc_Open(uint32_t DeviceNum, void *pMemory, uint32_t MemorySize, ADI_CRC_HANDLE *phDevice)
Opens a CRC device instance.
ADI_CRC_RESULT adi_crc_IsCrcInProgress(ADI_CRC_HANDLE const hDevice, bool *pbCrcInProgress)
Gets the current CRC peripheral status.
ADI_CRC_RESULT adi_crc_Close(ADI_CRC_HANDLE const hDevice)
Closes CRC device instance opened for use.
ADI_CRC_RESULT adi_crc_GetFinalCrcVal(ADI_CRC_HANDLE const hDevice, uint32_t *pFinalCrcVal)
Gets the final CRC result computed for a data stream.
ADI_CRC_RESULT adi_crc_EnableWordSwap(ADI_CRC_HANDLE const hDevice, const bool bEnable)
To enable/disable the word Swap. This function should be called only when device is disabled...
ADI_CRC_RESULT adi_crc_SetCrcSeedVal(ADI_CRC_HANDLE const hDevice, uint32_t CrcSeedVal)
Sets the initial seed value for the CRC operation that is about to take place.
ADI_CRC_RESULT adi_crc_Compute(ADI_CRC_HANDLE const hDevice, void *pCrcBuf, uint32_t NumBytes, uint32_t NumBits)
Submits data buffer for CRC computation.
ADI_CRC_RESULT adi_crc_SetBitMirroring(ADI_CRC_HANDLE const hDevice, const bool bEnable)
Set the bit mirroring. This function should be called only when device is idle, i.e. when no data are being processd by the CRC.