Mistake on this page?
Report an issue in GitHub or email us
Functions
crc hal tests

The crc HAL tests ensure driver conformance to defined behaviour. More...

Functions

void crc_is_supported_test ()
 Test that hal_crc_is_supported() function returns true if given polynomial/width is supported, false otherwise (at least one predefined polynomial/width must be supported). More...
 
void crc_calc_single_test ()
 Test that CRC module can be successfully configured, fed with data and the result can be successfully obtained. More...
 
void crc_calc_multi_test ()
 Test that hal_crc_compute_partial() function can be call multiple times in succession in order to provide additional data to CRC module. More...
 
void crc_reconfigure_test ()
 Test that calling hal_crc_compute_partial_start() without finalising the CRC calculation overrides the current configuration and partial result. More...
 
void crc_compute_partial_invalid_param_test ()
 Test that hal_crc_compute_partial() does nothing if pointer to buffer is undefined or data length is equal to 0. More...
 
void crc_is_supported_invalid_param_test ()
 Test that hal_crc_is_supported() returns false if pointer to the config structure is undefined. More...
 

Detailed Description

The crc HAL tests ensure driver conformance to defined behaviour.

To run the crc hal tests use the command:

mbed test -t <toolchain> -m <target> -n tests-mbed_hal-crc*

Function Documentation

void crc_calc_multi_test ( )

Test that hal_crc_compute_partial() function can be call multiple times in succession in order to provide additional data to CRC module.

Given is platform with hardware CRC support and CRC module is configured. When hal_crc_compute_partial() function is called multiple times. Then each call provides additional data to CRC module.

void crc_calc_single_test ( )

Test that CRC module can be successfully configured, fed with data and the result can be successfully obtained.

Given is platform with hardware CRC support.

When hal_crc_compute_partial_start() function is called. Then it configures CRC module with the given polynomial.

When hal_crc_compute_partial() function is called with valid buffer and data length. Then it feeds CRC module with data.

When hal_crc_get_result() function is called. Then CRC value for the given data is returned.

void crc_compute_partial_invalid_param_test ( )

Test that hal_crc_compute_partial() does nothing if pointer to buffer is undefined or data length is equal to 0.

Given is platform with hardware CRC support. When hal_crc_compute_partial() is called with invalid parameters. Then no data is provided to CRC module and no exception is generated.

void crc_is_supported_invalid_param_test ( )

Test that hal_crc_is_supported() returns false if pointer to the config structure is undefined.

Given is platform with hardware CRC support. When hal_crc_is_supported() is called with invalid parameter. Then function returns false.

void crc_is_supported_test ( )

Test that hal_crc_is_supported() function returns true if given polynomial/width is supported, false otherwise (at least one predefined polynomial/width must be supported).

Given is platform with hardware CRC support.

When given polynomial/width is supported. Then hal_crc_is_supported() function returns true.

When given polynomial/width is not supported. Then hal_crc_is_supported() function returns false.

Note: At least one predefined polynomial/width config must be supported.

void crc_reconfigure_test ( )

Test that calling hal_crc_compute_partial_start() without finalising the CRC calculation overrides the current configuration and partial result.

Given is platform with hardware CRC support. When CRC module has been configured and fed with data and reconfigured (without reading the result). Then the configuration has been overwritten and the new data can be successfully processed.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.