pub struct Crc32 { /* private fields */ }
Expand description

A handle to a HAL CRC32 peripheral

Implementations

Create a new Crc32 HAL peripheral

Reset the internal CRC32 state to the default value (0xFFFF_FFFF)

Feed words into the CRC engine.

The resulting calculated CRC (including this and prior data since the last call to init() is returned.

Feed bytes into the CRC engine.

The resulting calculated CRC (including this and prior data since the last call to init() is returned.

NOTE: Each four-byte chunk will be copied into a scratch buffer. This is done to ensure alignment of the data (the CRC engine only processes full words at a time). If the number of bytes passed in are not a multiple of four, the MOST significant bytes of the remaining word will be zeroes.

This should be taken into consideration if attempting to feed bytes across multiple parts (that spurious zeroes will be inserted)! To avoid this, only feed multiples of 4 bytes in before the “final” part of the message.

Example: Given the following 7 bytes:

[0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77]

The following two words will be fed into the CRC engine:

  1. 0x4433_2211
  2. 0x0077_6655

Consume the HAL peripheral, returning the PAC peripheral

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.