# Error Correction Code

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasECC\_Init(const char \*licenseKey)

    - Initialize ECC. **WARNING:** Must be called once before other FastADAS functions except [FadasVersion()](https://docs.qualcomm.com/doc/80-63309-1/topic/misc.html#group__misc_1ga55cbdff48d751f2a0227ae4ac106d746).

- Parameters:

    - **licenseKey** – Pointer to the license key string.

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasECC\_DeInit(void)

    - Deinitialize ECC. **WARNING:** Must be called once after all other FastADAS functions.

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasECC\_CRC32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_e_c_c_8h_1a03c4d1702dc1f140e3536ab3c3f78392.html#_CPPv416FadasECC_CRC32_t) \*FadasECC\_CRC32\_Create(uint32\_t poly)

    - Create a CRC32 object.

- Parameters:

    - **poly** – Polynomial used to divide the data

- Returns:

    - Pointer to object.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasECC\_CRC32\_Destroy([FadasECC\_CRC32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_e_c_c_8h_1a03c4d1702dc1f140e3536ab3c3f78392.html#_CPPv416FadasECC_CRC32_t) \*hCRC)

    - Destroy CRC object.

- Parameters:

    - **hCRC** – Pointer to the CRC object returned by FadasCRC\_Create().

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasECC\_CRC32\_Run([FadasECC\_CRC32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_e_c_c_8h_1a03c4d1702dc1f140e3536ab3c3f78392.html#_CPPv416FadasECC_CRC32_t) \*hCRC, const uint8\_t \*\_\_restrict data, uint32\_t dataLen, uint32\_t \*checksum)

    - Calculates the CRC32 checksum value.

- Parameters:

    - - **hCRC** – Pointer to the CRC32 object
- **data** – Pointer to the data for which CRC to be calculated.
- **dataLen** – Length of the data
- **checksum** – CRC32 value for data

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasECC\_CRC32\_RunMT(void \*wrkrs, [FadasECC\_CRC32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_e_c_c_8h_1a03c4d1702dc1f140e3536ab3c3f78392.html#_CPPv416FadasECC_CRC32_t) \*hCRC, const uint8\_t \*\_\_restrict data, uint32\_t dataLen, uint32\_t \*checksum)

    - Calculates the CRC32 checksum value.

- Parameters:

    - - **wrkrs** – Pointer to the worker pool created by [FadasECC\_CreateWorkers()](https://docs.qualcomm.com/doc/80-63309-1/topic/error-correction-code.html#group___e_c_c_1ga10c1bfdb0c3af66a4a49cbdebab56b98).
- **hCRC** – Pointer to the CRC32 object returned by [FadasECC\_CRC32\_Create()](https://docs.qualcomm.com/doc/80-63309-1/topic/error-correction-code.html#group___e_c_c_1ga1fd95d1faaa200e97700675b467bc90f).
- **data** – Pointer to the data for which CRC to be found.
- **dataLen** – Length of the data
- **checksum** – CRC32 value for data

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- void \*FadasECC\_CreateWorkers(uint32\_t nThreads, int32\_t pThreadsAffinity[])

    - Creates a multithreaded worker pool specifically for the ECC features.

- Parameters:

    - - **nThreads** – Requested number of threads. Can be limited to the maximum number of threads if requesting more than that the limit. The maximum is the maximum number of physical or logical cores. If requesting 0 threads, use the maximum number.
- **pThreadsAffinity** – Array for setting threads affinity

- Returns:

    - Worker pool pointer.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasECC\_DestroyWorkers(void \*wrkrs)

    - Destroys ECC worker pool.

- Parameters:

    - **wrkrs** – Pointer to the worker pool created by [FadasECC\_CreateWorkers()](https://docs.qualcomm.com/doc/80-63309-1/topic/error-correction-code.html#group___e_c_c_1ga10c1bfdb0c3af66a4a49cbdebab56b98).

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

Last Published: Sep 30, 2024

[Previous Topic
Image Conversion Functions](https://docs.qualcomm.com/bundle/publicresource/80-63309-1/topics/image-conversion-functions.md) [Next Topic
Fast Fourier Transform](https://docs.qualcomm.com/bundle/publicresource/80-63309-1/topics/fast-fourier-transform.md)