@@ -62,9 +62,64 @@ extern "C" {
62
62
* The Hardware CRC HAL API provides a low-level interface to the Hardware CRC
63
63
* module of a target platform.
64
64
*
65
+ * # Defined behaviour
66
+ *
67
+ * * Function hal_crc_is_supported() returns true if platform supports hardware
68
+ * CRC for the given polynomial/width - verified by test ::crc_is_supported_test.
69
+ * * Function hal_crc_is_supported() returns false if platform does not support hardware
70
+ * CRC for the given polynomial/width - verified by test ::crc_is_supported_test.
71
+ * * Function hal_crc_is_supported() returns false if given pointer to configuration
72
+ * structure is undefined (NULL) - verified by test ::crc_is_supported_invalid_param_test.
73
+ * * If CRC module does not support one of the following settings: initial_xor, final_xor
74
+ * reflect_in, reflect_out, then these operations should be handled by the driver
75
+ * - Verified by test ::crc_calc_single_test.
76
+ * * Platform which supports hardware CRC must be able to handle at least one of the predefined
77
+ * polynomial/width configurations that can be constructed in the MbedCRC class: POLY_8BIT_CCITT,
78
+ * POLY_7BIT_SD, POLY_16BIT_CCITT, POLY_16BIT_IBM, POLY_32BIT_ANSI
79
+ * - verified by test ::crc_is_supported_test, ::crc_calc_single_test.
80
+ * * Function hal_crc_compute_partial_start() configures CRC module with the given configuration
81
+ * - Verified by test ::crc_calc_single_test.
82
+ * * Calling hal_crc_compute_partial_start() without finalising the
83
+ * CRC calculation overrides the current configuration - Verified by test ::crc_reconfigure_test.
84
+ * * Function hal_crc_compute_partial() writes data to the CRC module - verified by test ::crc_calc_single_test.
85
+ * * Function hal_crc_compute_partial() can be call multiple times in succession in order to
86
+ * provide additional data to CRC module - verified by test ::crc_calc_multi_test.
87
+ * * Function hal_crc_compute_partial() does nothing if pointer to buffer is undefined or
88
+ * data length is equal to 0 - verified by test ::crc_compute_partial_invalid_param_test.
89
+ * * Function hal_crc_get_result() returns the checksum result from the CRC module
90
+ * - verified by tests ::crc_calc_single_test, ::crc_calc_multi_test, ::crc_reconfigure_test.
91
+ *
92
+ * # Undefined behaviour
93
+ *
94
+ * * Calling hal_crc_compute_partial_start() function with invalid (unsupported) polynomial.
95
+ * * Calling hal_crc_compute_partial() or hal_crc_get_result() functions before hal_crc_compute_partial_start().
96
+ * * Calling hal_crc_get_result() function multiple times.
97
+ *
98
+ * # Non-functional requirements
99
+ *
100
+ * * CRC configuration provides the following settings:
101
+ * * polynomial - CRC Polynomial,
102
+ * * width - CRC bit width,
103
+ * * initial_xor - seed value for the computation,
104
+ * * final_xor - final xor value for the computation,
105
+ * * reflect_in - reflect bits on input,
106
+ * * reflect_out - reflect bits in final result before returning.
107
+ *
108
+ * # Potential bugs
109
+ *
65
110
* @{
66
111
*/
67
112
113
+ /**
114
+ * \defgroup hal_crc_tests crc hal tests
115
+ * The crc HAL tests ensure driver conformance to defined behaviour.
116
+ *
117
+ * To run the crc hal tests use the command:
118
+ *
119
+ * mbed test -t <toolchain> -m <target> -n tests-mbed_hal-crc*
120
+ *
121
+ */
122
+
68
123
/** Determine if the current platform supports hardware CRC for given polynomial
69
124
*
70
125
* The purpose of this function is to inform the CRC Platform API whether the
0 commit comments