Atmel Software Framework

classb_crc_hw.c File Reference

Driver for 16- and 32-bit CRC using CRC hardware module.

Application note:
AVR1610: Guide to IEC60730 Class B compliance with XMEGA

Copyright (C) 2011-2015 Atmel Corporation. All rights reserved.

#include "classb_crc_hw.h"
#include <nvm.h>
uint32_t crc_initial_value = 0
 Initial CRC value to use on next CRC calculation. More...
 
static bool crc_is_busy (void)
 Check if the CRC module is busy. More...
 
void crc_io_checksum_byte_add (uint8_t data)
 Add one byte of data to CRC performed on I/O interface. More...
 
static void crc_reset (void)
 Reset CRC module and set CHECKSUM to initial value. More...
 
static uint16_t crc16_checksum_read (void)
 Read CRC-16 checksum. More...
 
static uint32_t crc32_checksum_read (void)
 Read CRC-32 checksum. More...
 
static uint32_t crc_checksum_read (void)
 Read checksum. More...
 
static void crc_set_source (CRC_SOURCE_t source)
 Set data source for the CRC module after reset. More...
 
static void crc_disable (void)
 Disable the CRC module. More...
 
static uint32_t crc_checksum_complete (void)
 Complete CRC calculation by reading checksum and disabling module. More...
 
void crc_set_initial_value (uint32_t value)
 Set initial CRC value for next CRC calculation. More...
 
uint32_t crc_io_checksum (void *data, uint16_t len, enum crc_16_32_t crc_16_32)
 Calculate the CRC checksum for data in a buffer. More...
 
static void crc_32_enable (void)
 Enable CRC-32. More...
 
void crc_io_checksum_byte_start (enum crc_16_32_t crc_16_32)
 Reset CRC module and set source to I/O interface. More...
 
uint32_t crc_io_checksum_byte_stop (void)
 Disable CRC module and return checksum. More...
 
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. More...
 
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. More...
 
void crc16_append_value (uint16_t value, void *ptr)
 Appends a CRC value to the given pointer. More...
 
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. More...
 
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. More...
 
void crc32_append_value (uint32_t value, void *ptr)
 Get and append data to generate checksum zero with CRC32. More...
 
uint32_t crc_flash_checksum (NVM_CMD_t crc_type, flash_addr_t flash_addr, uint32_t length)
 Perform a CRC-32 calculation on part of or entire flash. More...