diag_eeprom_crc16_lookup.c File Reference

This file contains APIs to test EEPROM using CRC16 CCITT Look-up Table algorithm.

Includes

  1. 1.diag_eeprom_crc16.h
  2. 2.diag_crc16_lookup_table.h
  3. 3.string.h

Functions

Table 1. voidDIAG_EEPROM_CalculateCRC16 (uint16_t startAddress, uint16_t length, uint16_t *crcSeed).
Parameters

[in] startAddress

uint16_t

- starting address of EEPROM memory region to be considered for CRC

[in] length

uint16_t

- number of bytes from startAddress to be considered for CRC

[in, out] crcSeed

uint16_t *

- pointer to initial and final CRC

Returns
void None
Table 2. diag_crc_status_tDIAG_EEPROM_CalculateStoreCRC16 (uint16_t startAddress, uint16_t length, uint16_t storeAddress).
Parameters

[in] startAddress

uint16_t

- starting address of EEPROM memory region to be considered for CRC

[in] length

uint16_t

- number of bytes from startAddress to be considered for CRC

[in] storeAddress

uint16_t

- the EEPROM address where calculated CRC will be stored

Returns
diag_crc_status_t CRC_OK, CRC_ERROR, CRC_INVALID_ADDRESS, CRC_INVALID_LENGTH
Table 3. diag_crc_status_tDIAG_EEPROM_ValidateCRC16 (uint16_t startAddress, uint16_t length, uint16_t refAddress).
Parameters

[in] startAddress

uint16_t

- starting address of EEPROM memory region to be considered for CRC

[in] length

uint16_t

- number of bytes from startAddress to be considered for CRC

[in] refAddress

uint16_t

- the EEPROM address where reference CRC is available

Returns
diag_crc_status_t CRC_OK, CRC_ERROR, CRC_INVALID_ADDRESS, CRC_INVALID_LENGTH