RL78 Family VDE Certified IEC60730/60335 Self Test Library
R01AN0749EG0201 Rev.2.01 Page 15 of 50
Mar 04, 2014
Syntax
uint16_t stl_RL78_peripheral_crc(uint16_t gcrc, CHECKSUM_CRC_TEST_AREA *p)
Description
This function calculates a CRC value over the address range supplied using the hardware CRC peripheral. The start
address and calculation range (Length) are passed by the calling function via the structure detailed in the table below.
The calculated result is returned. This can be either a partial result of full result depending upon the parameters
provided.
The function “indicate_test_result.c” will be called by the test harness control files (main.c) to process the test result
Note Function “indicate_test_result.c “is located in the module stl_main_example_support function.c
Input Parameters
uint16_t gcrc
Value for starting the CRC calculation
CHECKSUM_CRC_TEST_AREA *p
Pointer to the structure where the start address and calculation range is
located
Output Parameters
NONE
N/A
Return Values
uint16_t
16 bit calculated CRC value (Full or partial result) is returned in
CPU Register AX
Source files: Hardware CRC Parameter Structure
Syntax
static CHECKSUM_CRC_TEST_AREA checksum_crc;
Description
Structure declaration and instance providing the parameters to be passed to the hardware CRC module
(stl_RL78_peripheral_crc.asm) by the calling function in main.c.
Note: This is the same structure as used by the software CRC function.
Input Parameters
uint32_t length;
Range (length = number of bytes + 1) of memory to be tested.
uint32_t start_address
Start address for CRC calculation
Output Parameters
NONE
N/A
Return Values
N/A