Module sam4l::crccu [] [src]

Implementation of the SAM4L CRCCU.

See datasheet section "41. Cyclic Redundancy Check Calculation Unit (CRCCU)".

The SAM4L can compute CRCs using three different polynomials:

(The integers above give each polynomial from most-significant to least-significant bit, except that the most significant bit is omitted because it is always 1.)

In all cases, the unit consumes each input byte from LSB to MSB.

Note that the chip's behavior differs from some "standard" CRC algorithms, which may do some of these things:

Notes

This calculator may be used to generate CRC values. To match the output of the SAM4L, the parameters must be set as follows:

For one example, the SAM4L calculates 0x1541 for "ABCDEFG" when using polynomial 0x1021.

Reexports

use core::cell::Cell;
use kernel::ReturnCode;
use kernel::hil::crc;
use kernel::hil::crc::CrcAlg;
use pm::disable_clock;
use pm::enable_clock;
use pm::Clock;
use pm::HSBClock;
use pm::PBBClock;

Structs

Crccu

State for managing the CRCCU

Descriptor
Mode
Reg
TCR

Enums

Polynomial
State
TrWidth

Transfer width for DMA

Constants

CR
CRCCU_BASE
DMADIS
DMAEN
DMAIDR
DMAIER
DMAIMR
DMAISR
DMASR
DSCR
DSCR_RESERVE
IDR
IER
IMR
ISR
MR
SR
VERSION

Statics

CRCCU

Static state to manage the CRCCU

Functions

poly_for_alg
post_process
reverse_and_invert