Low-level driver implementation for the AVR XMEGA AU CRC module.
The CRC computation is done by the hardware CRC module. Even if this hardware module computes the checksum, the CPU can still be required to read the data. In the case of 32-bit CRC computation for flash memory, the whole process can be run without support from the CPU. However, for the 16-bit computation the CPU would have to read from Flash memory and transfer data to the CRC module. For CRC computations of data in SRAM, EEPROM or peripherals, the CPU will have to transfer data to the CRC module unless a DMA transaction is setup. The CRC-CCITT polynomial is 0x1021 and the IEEE 802.3 polynomial is 0x04C11DB7. More details on the CRC implementation can be found in the XMEGA AU manual.
NVM Commands | |
NVMcommands related to 32-bit CRC for flash memory. This is only used by CLASSB_CRC32_Flash_HW. | |
| #define | CRC_FLASH_RANGE NVM_CMD_FLASH_RANGE_CRC_gc |
| Compute a CRC checksum on an address range. | |
| #define | CRC_BOOT NVM_CMD_BOOT_CRC_gc |
| Compute a CRC checksum on the application section. | |
| #define | CRC_APP NVM_CMD_APP_CRC_gc |
| Compute a CRC checksum on the boot section. | |
CRC tests | |
Invariant memory tests based on CRC that are compliant with IEC60730 Class B. | |
| uint16_t | CLASSB_CRC16_EEPROM_HW (eepromptr_t dataptr, const crcbytenum_t numBytes, eeprom_uint16ptr_t pchecksum) |
| Compute 16-bit CRC for EEPROM address range using hardware CRC module. | |
| uint16_t | CLASSB_CRC16_Flash_HW (flashptr_t dataptr, const crcbytenum_t numBytes, eeprom_uint16ptr_t pchecksum) |
| Compute 16-bit CRC for Flash address range using hardware CRC module. | |
| uint32_t | CLASSB_CRC32_EEPROM_HW (eepromptr_t dataptr, const crcbytenum_t numBytes, eeprom_uint32ptr_t pchecksum) |
| Compute 32-bit CRC for EEPROM address range using hardware CRC module. | |
| uint32_t | CLASSB_CRC32_Flash_HW (NVM_CMD_t crc_type, flashptr_t dataptr, const crcbytenum_t numBytes, eeprom_uint32ptr_t pchecksum) |
| Compute 32-bit CRC for Flash address range using hardware CRC module. | |
| uint16_t CLASSB_CRC16_EEPROM_HW | ( | eepromptr_t | origDataptr, |
| crcbytenum_t | numBytes, | ||
| eeprom_uint16ptr_t | pchecksum | ||
| ) |
Compute 16-bit CRC for EEPROM address range using hardware CRC module.
This function returns the 16-bit CRC of the specified EEPROM address range.
| origDataptr | Address of EEPROM location to start CRC computation at. |
| numBytes | Number of bytes of the data. |
| pchecksum | Pointer to the checksum stored in EEPROM. |
Definition at line 394 of file classb_crc_hw.c.
References CLASSB_EEMAP_BEGIN, CLASSB_EEMAP_END, and CLASSB_ERROR_HANDLER_CRC.
Referenced by ISR().
Here is the caller graph for this function:| uint16_t CLASSB_CRC16_Flash_HW | ( | flashptr_t | origDataptr, |
| crcbytenum_t | numBytes, | ||
| eeprom_uint16ptr_t | pchecksum | ||
| ) |
Compute 16-bit CRC for Flash address range using hardware CRC module.
This function returns the 16-bit CRC of the specified Flash address range.
| origDataptr | Address of Flash location to start CRC computation at. |
| numBytes | Number of bytes of the data. |
| pchecksum | Pointer to the checksum stored in EEPROM. |
Definition at line 439 of file classb_crc_hw.c.
References CLASSB_EEMAP_BEGIN, CLASSB_EEMAP_END, and CLASSB_ERROR_HANDLER_CRC.
| uint32_t CLASSB_CRC32_EEPROM_HW | ( | eepromptr_t | origDataptr, |
| crcbytenum_t | numBytes, | ||
| eeprom_uint32ptr_t | pchecksum | ||
| ) |
Compute 32-bit CRC for EEPROM address range using hardware CRC module.
This function returns the 32-bit CRC of the specified EEPROM address range.
| origDataptr | Address of EEPROM location to start CRC computation at. |
| numBytes | Number of bytes of the data. |
| pchecksum | Pointer to the checksum stored in EEPROM. |
Definition at line 518 of file classb_crc_hw.c.
References CLASSB_EEMAP_BEGIN, CLASSB_EEMAP_END, and CLASSB_ERROR_HANDLER_CRC.
| uint32_t CLASSB_CRC32_Flash_HW | ( | NVM_CMD_t | crc_type, |
| flashptr_t | origDataptr, | ||
| crcbytenum_t | numBytes, | ||
| eeprom_uint32ptr_t | pchecksum | ||
| ) |
Compute 32-bit CRC for Flash address range using hardware CRC module.
This function returns the 32-bit CRC of the specified Flash address range.
| crc_type | Type of CRC computation: CRC_FLASH_RANGE, CRC_BOOT or CRC_APP. |
| origDataptr | Address of Flash location to start CRC computation at. |
| numBytes | Number of bytes of the data. |
| pchecksum | Pointer to the checksum stored in EEPROM. |
Definition at line 560 of file classb_crc_hw.c.
References CLASSB_EEMAP_BEGIN, CLASSB_EEMAP_END, and CLASSB_ERROR_HANDLER_CRC.
Referenced by ISR().
Here is the caller graph for this function: