Commit Graph

9 Commits (804d050a18e80da5036f7554b256e119e55946ae)

Author SHA1 Message Date
Steven Cartmell 5e98eea1a0 HAL CRC: Add additional thread safety notes to the API 2018-05-24 17:51:49 +01:00
Steven Cartmell eb202a29c1 HAL CRC: Update function documentation with new config parameter 2018-05-24 17:51:49 +01:00
Steven Cartmell 1da75e5e85 HAL CRC: Fix code to match coding conventions 2018-05-24 17:51:49 +01:00
Steven Cartmell 8e14b5977b HAL CRC: Add bit width parameter to crc_config_t 2018-05-24 17:51:49 +01:00
Steven Cartmell e1ca2b32fc Add CRC configuration options to HAL API 2018-05-24 17:51:49 +01:00
Steven Cartmell 167d3f9a1e HAL CRC: Return early when calling compute with null or 0 size buffer 2018-05-24 17:51:48 +01:00
Steven Cartmell df93c0151c Remove support for 7/8 bit CRC polynomials for K64F 2018-05-24 17:51:48 +01:00
Steven Cartmell e0d98bfe2c Adapt MbedCRC class to support Hardware CRC
- Move CRC polynomial enum into HAL layer, so it's accessible from platform
  implementations

- Add enum to CRC class to indicate which mode the CRC class should use:
  HARDWARE, TABLE, or BITWISE

- Add calls to HAL Hardware CRC API to each of the compute functions when the
  class is in HARDWARE mode.

- Add missing constructor call to template constructor, and remove const from
  delegating constructor.
2018-05-24 17:50:12 +01:00
Steven Cartmell bad3aa0b6b Add Hardware CRC HAL API specification headers
Define the HAL API header for the Hardware CRC module. This set of functions
allows hardware acceleration of a subset of CRC algorithms for supported
platforms by providing access to the hardware CRC module of certain platforms.

The API is defined as four separate functions:

  - hal_crc_is_supported(polynomial)

    Indicates to the caller if the specific CRC polynomial is supported.

  - hal_crc_compute_partial_start(const uint32_t polynomial)

    Initializes the hardware CRC module with the given polynomial.

  - hal_crc_compute_partial(*data, size)

    Writes an array of bytes to the CRC module to be appended to the calculation

  - hal_crc_get_result()

    Applies the final transformations to the data and returns the result to the
    caller.
2018-05-24 17:50:12 +01:00