Commit Graph

15 Commits (64575fe5860b9def0a08751ded4fb228e9b86703)

Author SHA1 Message Date
Alastair D'Silva 2617c5d55b Don't use define checks on DEVICE_FOO macros (mbed code)
The DEVICE_FOO macros are always defined (either 0 or 1).

This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2018-12-20 10:16:42 +11:00
Martin Kojtal 406f9508d3 hal: add spdx license 2018-11-28 10:39:51 +00:00
Deepika 4d7fdfc2a9 Use MbedCRC for LittleFS (0xEDB88320)
CRC used in LittleFS is Reversed ANSI, hence new polynomial added.
Reversed polynomials perform shift in reverse direction of standard
polynomial, and we do not have option to notify reverse shift to hardware.
Hence this option is available in software only.
2018-09-02 15:25:40 -05:00
Martin Kojtal 483427a285 hal: astyle update 2018-06-29 10:36:36 +01:00
Przemyslaw Stekiel 307021ec23 Add testing requirements to HAL CRC header file. 2018-06-07 10:17:21 +02:00
Amanda Butler 824466d18c Copy edit crc_api.h
Copy edit file, mostly for American spelling and consistent tense across files.
2018-05-24 17:53:36 +01:00
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