Struct stm32h7xx_hal::crc::Config [−][src]
CRC unit configuration.
Implementations
impl Config
[src]
pub const fn new() -> Self
[src]
Creates the Config struct with the default configuration of the STM32H7 CRC unit:
0x04C1_1DB7
polynomial0xFFFF_FFFF
initial value- Bits not reflected
0
output XOR
This configuration is the MPEG-2 CRC.
pub const fn polynomial(self, poly: Polynomial) -> Self
[src]
Set the polynomial.
pub const fn initial_value(self, initial: u32) -> Self
[src]
Set the initial value of the CRC. The CRC unit will only use the needed
bits to match the polynomial; the default initial value 0xFFFF_FFFF
will actually write 0x7F
in the case of a 7-bit CRC, for example.
pub const fn reverse_input(self, reverse: Option<BitReversal>) -> Self
[src]
Set how to reverse the bits of the input. None
means no reversal.
pub const fn reverse_output(self, reverse: bool) -> Self
[src]
Set whether to reverse the bits of the output.
pub fn reflect(self, reflect: bool) -> Self
[src]
Set whether to reflect the CRC. When enabled, reflection is
BitReversal::Byte
and output reversal enabled. This is simply
a convenience function as many CRC algorithms call for this.
pub const fn output_xor(self, output_xor: u32) -> Self
[src]
Set the value to XOR the output with. Automatically masked to the proper size.
Trait Implementations
impl Clone for Config
[src]
fn clone(&self) -> Config
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Config
[src]
impl Default for Config
[src]
fn default() -> Self
[src]
Calls Config::new
.
impl PartialEq<Config> for Config
[src]
impl StructuralPartialEq for Config
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,