stm32c0/stm32c071/crc.rs
1#[repr(C)]
2#[derive(Debug)]
3///Register block
4pub struct RegisterBlock {
5 _reserved_0_dr: [u8; 0x04],
6 idr: IDR,
7 cr: CR,
8 _reserved3: [u8; 0x04],
9 init: INIT,
10 pol: POL,
11}
12impl RegisterBlock {
13 ///0x00 - Data register - half-word sized
14 #[inline(always)]
15 pub const fn dr16(&self) -> &DR16 {
16 unsafe { &*core::ptr::from_ref(self).cast::<u8>().cast() }
17 }
18 ///0x00 - Data register - byte sized
19 #[inline(always)]
20 pub const fn dr8(&self) -> &DR8 {
21 unsafe { &*core::ptr::from_ref(self).cast::<u8>().cast() }
22 }
23 ///0x00 - CRC data register
24 #[inline(always)]
25 pub const fn dr(&self) -> &DR {
26 unsafe { &*core::ptr::from_ref(self).cast::<u8>().cast() }
27 }
28 ///0x04 - CRC independent data register
29 #[inline(always)]
30 pub const fn idr(&self) -> &IDR {
31 &self.idr
32 }
33 ///0x08 - CRC control register
34 #[inline(always)]
35 pub const fn cr(&self) -> &CR {
36 &self.cr
37 }
38 ///0x10 - CRC initial value
39 #[inline(always)]
40 pub const fn init(&self) -> &INIT {
41 &self.init
42 }
43 ///0x14 - CRC polynomial
44 #[inline(always)]
45 pub const fn pol(&self) -> &POL {
46 &self.pol
47 }
48}
49/**DR (rw) register accessor: CRC data register
50
51You can [`read`](crate::Reg::read) this register and get [`dr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
52
53See register [structure](https://stm32-rs.github.io/stm32-rs/STM32C071.html#CRC:DR)
54
55For information about available fields see [`mod@dr`] module*/
56pub type DR = crate::Reg<dr::DRrs>;
57///CRC data register
58pub mod dr;
59/**DR8 (rw) register accessor: Data register - byte sized
60
61You can [`read`](crate::Reg::read) this register and get [`dr8::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dr8::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
62
63See register [structure](https://stm32-rs.github.io/stm32-rs/STM32C071.html#CRC:DR8)
64
65For information about available fields see [`mod@dr8`] module*/
66pub type DR8 = crate::Reg<dr8::DR8rs>;
67///Data register - byte sized
68pub mod dr8;
69/**DR16 (rw) register accessor: Data register - half-word sized
70
71You can [`read`](crate::Reg::read) this register and get [`dr16::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dr16::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
72
73See register [structure](https://stm32-rs.github.io/stm32-rs/STM32C071.html#CRC:DR16)
74
75For information about available fields see [`mod@dr16`] module*/
76pub type DR16 = crate::Reg<dr16::DR16rs>;
77///Data register - half-word sized
78pub mod dr16;
79/**IDR (rw) register accessor: CRC independent data register
80
81You can [`read`](crate::Reg::read) this register and get [`idr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`idr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
82
83See register [structure](https://stm32-rs.github.io/stm32-rs/STM32C071.html#CRC:IDR)
84
85For information about available fields see [`mod@idr`] module*/
86pub type IDR = crate::Reg<idr::IDRrs>;
87///CRC independent data register
88pub mod idr;
89/**CR (rw) register accessor: CRC control register
90
91You can [`read`](crate::Reg::read) this register and get [`cr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
92
93See register [structure](https://stm32-rs.github.io/stm32-rs/STM32C071.html#CRC:CR)
94
95For information about available fields see [`mod@cr`] module*/
96pub type CR = crate::Reg<cr::CRrs>;
97///CRC control register
98pub mod cr;
99/**INIT (rw) register accessor: CRC initial value
100
101You can [`read`](crate::Reg::read) this register and get [`init::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`init::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
102
103See register [structure](https://stm32-rs.github.io/stm32-rs/STM32C071.html#CRC:INIT)
104
105For information about available fields see [`mod@init`] module*/
106pub type INIT = crate::Reg<init::INITrs>;
107///CRC initial value
108pub mod init;
109/**POL (rw) register accessor: CRC polynomial
110
111You can [`read`](crate::Reg::read) this register and get [`pol::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pol::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
112
113See register [structure](https://stm32-rs.github.io/stm32-rs/STM32C071.html#CRC:POL)
114
115For information about available fields see [`mod@pol`] module*/
116pub type POL = crate::Reg<pol::POLrs>;
117///CRC polynomial
118pub mod pol;