Skip to content

Commit fbe7ea2

Browse files
author
Amanda Butler
authored
Copy edit crc.md
Copy edit file for consistent tense across docs, formatting and U.S. spelling.
1 parent 6a737ab commit fbe7ea2

File tree

1 file changed

+18
-50
lines changed
  • docs/reference/contributing/target

1 file changed

+18
-50
lines changed

docs/reference/contributing/target/crc.md

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,41 @@
1-
## Hardware CRC - Porting Guide
1+
## Hardware CRC
22

3-
The Hardware CRC HAL API provides a low-level interface to the Hardware CRC
4-
module of a target platform. Implementing the Hardware CRC API will allow you
5-
to gain the performance benefits of using hardware acceleration for CRC
6-
calculations. For platforms without hardware CRC capabilities the API will
7-
fallback to using the table and bitwise CRC implementations.
3+
The hardware CRC HAL API provides a low-level interface to the hardware CRC module of a target platform. Implementing the hardware CRC API allows you to gain the performance benefits of using hardware acceleration for CRC calculations. For platforms without hardware CRC capabilities, the API falls back to using the table and bitwise CRC implementations.
84

95
#### Assumptions
106

11-
##### Defined Behaviour
7+
##### Defined behavior
128

13-
* Calling hal_crc_compute_partial_start() multiple times will override the
14-
current CRC configuration and calculation.
9+
- Calling `hal_crc_compute_partial_start()` multiple times overrides the current CRC configuration and calculation.
10+
- The current intermediate calculation is lost if the module is reconfigured with `hal_crc_compute_partial_start()`.
11+
- `hal_crc_compute_partial()` does nothing if either the buffer is undefined or the size is equal to 0.
12+
- `hal_crc_compute_partial()` is safe to call multiple times. The new data is appended to the current calculation.
13+
- `hal_crc_is_supported` must return false if the the platform cannot support the initial or final values or data reflection in or out that the input polynomial requires.
1514

16-
* The current intermediate calculation is lost if the module is reconfigured
17-
with hal_crc_compute_partial_start().
15+
##### Undefined behavior
1816

19-
* hal_crc_compute_partial() does nothing if either the buffer is undefined or
20-
the size is equal to 0.
17+
- Calling the `hal_crc_get_result()` function multiple times is undefined. The contents of the result register after it has been read is platform-specific. The HAL API makes no assumptions about what the register contains, so it is not safe to call this multiple times.
18+
- Calling the `hal_crc_partial_start()` function with a polynomial unsupported by the current platform is undefined. Polynomial support should be checked before this function is called.
19+
- Calling the `hal_crc_get_result()` function before calling `hal_crc_partial_start()` is undefined. The module must be initialized before the get result function can return meaningful values.
20+
- Calling the `hal_crc_compute_partial()` function before calling `hal_crc_partial_start()` is undefined. The hardware CRC module must be configured correctly using the start function before writing data to it.
2121

22-
* hal_crc_compute_partial() is safe to call multiple times. The new data is
23-
appended to the current calculation.
22+
#### Dependency
2423

25-
* hal_crc_is_supported must return false if the the platform cannot support the
26-
initial/final values or data reflection in/out that is required by the input
27-
polynomial.
28-
29-
##### Undefined Behaviour
30-
31-
* Calling the hal_crc_get_result() function multiple times is undefined. The
32-
contents of the result register after it has been read is platform-specific.
33-
The HAL API makes no assumptions what the register contains so it is not safe
34-
to call this multiple times.
35-
36-
* Calling the hal_crc_partial_start() function with a polynomial unsupported by
37-
the current platform is undefined. Polynomial support should be checked before
38-
this function is called.
39-
40-
* Calling the hal_crc_get_result() function before calling
41-
hal_crc_partial_start() is undefined. The module must be initialized before
42-
the get result function can return meaningful values.
43-
44-
* Calling the hal_crc_compute_partial() function before calling
45-
hal_crc_partial_start() is undefined. The Hardware CRC module must be
46-
configured correctly using the start function before writing data to it.
47-
48-
#### Dependencies
49-
50-
Hardware CRC module in MCU that supports at least one of the following defined
51-
polynomials: `POLY_8BIT_CCITT, POLY_7BIT_SD, POLY_16BIT_CCITT, POLY_16BIT_IBM,
52-
POLY_32BIT_ANSI `
24+
The hardware CRC module in the MCU that supports at least one of the following defined polynomials: `POLY_8BIT_CCITT, POLY_7BIT_SD, POLY_16BIT_CCITT, POLY_16BIT_IBM, POLY_32BIT_ANSI `
5325

5426
#### Implementing the CRC API
5527

56-
You can find the API and specification for the Hardware CRC API in the following
57-
header file:
28+
You can find the API and specification for the hardware CRC API in the following header file:
5829

5930
```
6031
Fix link after code is merged.
6132
```
6233

63-
To enable Hardware CRC support in Mbed OS, add the `CRC` label in the
64-
`device_has` option of the target's section in the `targets.json` file.
34+
To enable hardware CRC support in Mbed OS, add the `CRC` label in the `device_has` option of the target's section in the `targets.json` file.
6535

6636
#### Testing
6737

68-
The Mbed OS HAL API provides a set of conformance tests for Hardware CRC. You
69-
can use these tests to validate the correctness of your implementation. To run
70-
the Hardware CRC HAL tests use the following command:
38+
The Mbed OS HAL API provides a set of conformance tests for Hardware CRC. You can use these tests to validate the correctness of your implementation. To run the hardware CRC HAL tests, use the following command:
7139

7240
```
7341
mbed test -t <toolchain> -m <target> -n "tests-mbed_hal-crc*"

0 commit comments

Comments
 (0)