atsam4ls2a_pac/
usart0.rs

1#[doc = r"Register block"]
2#[repr(C)]
3pub struct RegisterBlock {
4    _reserved_0_lin_mode_cr_lin: [u8; 0x04],
5    _reserved_1_usart_mode_mr: [u8; 0x04],
6    _reserved_2_lin_mode_ier_lin: [u8; 0x04],
7    _reserved_3_lin_mode_idr_lin: [u8; 0x04],
8    _reserved_4_lin_mode_imr_lin: [u8; 0x04],
9    _reserved_5_lin_mode_csr_lin: [u8; 0x04],
10    #[doc = "0x18 - Receiver Holding Register"]
11    pub rhr: RHR,
12    #[doc = "0x1c - Transmitter Holding Register"]
13    pub thr: THR,
14    #[doc = "0x20 - Baud Rate Generator Register"]
15    pub brgr: BRGR,
16    #[doc = "0x24 - Receiver Time-out Register"]
17    pub rtor: RTOR,
18    #[doc = "0x28 - Transmitter Timeguard Register"]
19    pub ttgr: TTGR,
20    _reserved11: [u8; 0x14],
21    #[doc = "0x40 - FI DI Ratio Register"]
22    pub fidi: FIDI,
23    #[doc = "0x44 - Number of Errors Register"]
24    pub ner: NER,
25    _reserved13: [u8; 0x04],
26    #[doc = "0x4c - IrDA Filter Register"]
27    pub ifr: IFR,
28    #[doc = "0x50 - Manchester Configuration Register"]
29    pub man: MAN,
30    #[doc = "0x54 - LIN Mode Register"]
31    pub linmr: LINMR,
32    #[doc = "0x58 - LIN Identifier Register"]
33    pub linir: LINIR,
34    #[doc = "0x5c - LIN Baud Rate Register"]
35    pub linbrr: LINBRR,
36    _reserved18: [u8; 0x84],
37    #[doc = "0xe4 - Write Protect Mode Register"]
38    pub wpmr: WPMR,
39    #[doc = "0xe8 - Write Protect Status Register"]
40    pub wpsr: WPSR,
41    _reserved20: [u8; 0x10],
42    #[doc = "0xfc - Version Register"]
43    pub version: VERSION,
44}
45impl RegisterBlock {
46    #[doc = "0x00 - Control Register"]
47    #[inline(always)]
48    pub const fn usart_mode_cr_usart(&self) -> &USART_MODE_CR_USART {
49        unsafe { &*(self as *const Self).cast::<u8>().add(0usize).cast() }
50    }
51    #[doc = "0x00 - Control Register"]
52    #[inline(always)]
53    pub const fn spi_master_mode_cr_spi(&self) -> &SPI_MASTER_MODE_CR_SPI {
54        unsafe { &*(self as *const Self).cast::<u8>().add(0usize).cast() }
55    }
56    #[doc = "0x00 - Control Register"]
57    #[inline(always)]
58    pub const fn lin_mode_cr_lin(&self) -> &LIN_MODE_CR_LIN {
59        unsafe { &*(self as *const Self).cast::<u8>().add(0usize).cast() }
60    }
61    #[doc = "0x04 - Mode Register"]
62    #[inline(always)]
63    pub const fn usart_mode_mr(&self) -> &USART_MODE_MR {
64        unsafe { &*(self as *const Self).cast::<u8>().add(4usize).cast() }
65    }
66    #[doc = "0x04 - Mode Register"]
67    #[inline(always)]
68    pub const fn spi_mode_mr_spi(&self) -> &SPI_MODE_MR_SPI {
69        unsafe { &*(self as *const Self).cast::<u8>().add(4usize).cast() }
70    }
71    #[doc = "0x08 - Interrupt Enable Register"]
72    #[inline(always)]
73    pub const fn usart_mode_ier_usart(&self) -> &USART_MODE_IER_USART {
74        unsafe { &*(self as *const Self).cast::<u8>().add(8usize).cast() }
75    }
76    #[doc = "0x08 - Interrupt Enable Register"]
77    #[inline(always)]
78    pub const fn spi_slave_mode_ier_spi(&self) -> &SPI_SLAVE_MODE_IER_SPI {
79        unsafe { &*(self as *const Self).cast::<u8>().add(8usize).cast() }
80    }
81    #[doc = "0x08 - Interrupt Enable Register"]
82    #[inline(always)]
83    pub const fn lin_mode_ier_lin(&self) -> &LIN_MODE_IER_LIN {
84        unsafe { &*(self as *const Self).cast::<u8>().add(8usize).cast() }
85    }
86    #[doc = "0x0c - Interrupt Disable Register"]
87    #[inline(always)]
88    pub const fn usart_mode_idr_usart(&self) -> &USART_MODE_IDR_USART {
89        unsafe { &*(self as *const Self).cast::<u8>().add(12usize).cast() }
90    }
91    #[doc = "0x0c - Interrupt Disable Register"]
92    #[inline(always)]
93    pub const fn spi_slave_mode_idr_spi(&self) -> &SPI_SLAVE_MODE_IDR_SPI {
94        unsafe { &*(self as *const Self).cast::<u8>().add(12usize).cast() }
95    }
96    #[doc = "0x0c - Interrupt Disable Register"]
97    #[inline(always)]
98    pub const fn lin_mode_idr_lin(&self) -> &LIN_MODE_IDR_LIN {
99        unsafe { &*(self as *const Self).cast::<u8>().add(12usize).cast() }
100    }
101    #[doc = "0x10 - Interrupt Mask Register"]
102    #[inline(always)]
103    pub const fn usart_mode_imr_usart(&self) -> &USART_MODE_IMR_USART {
104        unsafe { &*(self as *const Self).cast::<u8>().add(16usize).cast() }
105    }
106    #[doc = "0x10 - Interrupt Mask Register"]
107    #[inline(always)]
108    pub const fn spi_slave_mode_mr_usart(&self) -> &SPI_SLAVE_MODE_MR_USART {
109        unsafe { &*(self as *const Self).cast::<u8>().add(16usize).cast() }
110    }
111    #[doc = "0x10 - Interrupt Mask Register"]
112    #[inline(always)]
113    pub const fn lin_mode_imr_lin(&self) -> &LIN_MODE_IMR_LIN {
114        unsafe { &*(self as *const Self).cast::<u8>().add(16usize).cast() }
115    }
116    #[doc = "0x14 - Channel Status Register"]
117    #[inline(always)]
118    pub const fn usart_mode_csr_usart(&self) -> &USART_MODE_CSR_USART {
119        unsafe { &*(self as *const Self).cast::<u8>().add(20usize).cast() }
120    }
121    #[doc = "0x14 - Channel Status Register"]
122    #[inline(always)]
123    pub const fn spi_slave_mode_csr_spi(&self) -> &SPI_SLAVE_MODE_CSR_SPI {
124        unsafe { &*(self as *const Self).cast::<u8>().add(20usize).cast() }
125    }
126    #[doc = "0x14 - Channel Status Register"]
127    #[inline(always)]
128    pub const fn lin_mode_csr_lin(&self) -> &LIN_MODE_CSR_LIN {
129        unsafe { &*(self as *const Self).cast::<u8>().add(20usize).cast() }
130    }
131}
132#[doc = "BRGR (rw) register accessor: an alias for `Reg<BRGR_SPEC>`"]
133pub type BRGR = crate::Reg<brgr::BRGR_SPEC>;
134#[doc = "Baud Rate Generator Register"]
135pub mod brgr;
136#[doc = "LIN_MODE_CR_LIN (w) register accessor: an alias for `Reg<LIN_MODE_CR_LIN_SPEC>`"]
137pub type LIN_MODE_CR_LIN = crate::Reg<lin_mode_cr_lin::LIN_MODE_CR_LIN_SPEC>;
138#[doc = "Control Register"]
139pub mod lin_mode_cr_lin;
140#[doc = "SPI_MASTER_MODE_CR_SPI (w) register accessor: an alias for `Reg<SPI_MASTER_MODE_CR_SPI_SPEC>`"]
141pub type SPI_MASTER_MODE_CR_SPI = crate::Reg<spi_master_mode_cr_spi::SPI_MASTER_MODE_CR_SPI_SPEC>;
142#[doc = "Control Register"]
143pub mod spi_master_mode_cr_spi;
144#[doc = "USART_MODE_CR_USART (w) register accessor: an alias for `Reg<USART_MODE_CR_USART_SPEC>`"]
145pub type USART_MODE_CR_USART = crate::Reg<usart_mode_cr_usart::USART_MODE_CR_USART_SPEC>;
146#[doc = "Control Register"]
147pub mod usart_mode_cr_usart;
148#[doc = "LIN_MODE_CSR_LIN (r) register accessor: an alias for `Reg<LIN_MODE_CSR_LIN_SPEC>`"]
149pub type LIN_MODE_CSR_LIN = crate::Reg<lin_mode_csr_lin::LIN_MODE_CSR_LIN_SPEC>;
150#[doc = "Channel Status Register"]
151pub mod lin_mode_csr_lin;
152#[doc = "SPI_SLAVE_MODE_CSR_SPI (r) register accessor: an alias for `Reg<SPI_SLAVE_MODE_CSR_SPI_SPEC>`"]
153pub type SPI_SLAVE_MODE_CSR_SPI = crate::Reg<spi_slave_mode_csr_spi::SPI_SLAVE_MODE_CSR_SPI_SPEC>;
154#[doc = "Channel Status Register"]
155pub mod spi_slave_mode_csr_spi;
156#[doc = "USART_MODE_CSR_USART (r) register accessor: an alias for `Reg<USART_MODE_CSR_USART_SPEC>`"]
157pub type USART_MODE_CSR_USART = crate::Reg<usart_mode_csr_usart::USART_MODE_CSR_USART_SPEC>;
158#[doc = "Channel Status Register"]
159pub mod usart_mode_csr_usart;
160#[doc = "FIDI (rw) register accessor: an alias for `Reg<FIDI_SPEC>`"]
161pub type FIDI = crate::Reg<fidi::FIDI_SPEC>;
162#[doc = "FI DI Ratio Register"]
163pub mod fidi;
164#[doc = "LIN_MODE_IDR_LIN (w) register accessor: an alias for `Reg<LIN_MODE_IDR_LIN_SPEC>`"]
165pub type LIN_MODE_IDR_LIN = crate::Reg<lin_mode_idr_lin::LIN_MODE_IDR_LIN_SPEC>;
166#[doc = "Interrupt Disable Register"]
167pub mod lin_mode_idr_lin;
168#[doc = "SPI_SLAVE_MODE_IDR_SPI (w) register accessor: an alias for `Reg<SPI_SLAVE_MODE_IDR_SPI_SPEC>`"]
169pub type SPI_SLAVE_MODE_IDR_SPI = crate::Reg<spi_slave_mode_idr_spi::SPI_SLAVE_MODE_IDR_SPI_SPEC>;
170#[doc = "Interrupt Disable Register"]
171pub mod spi_slave_mode_idr_spi;
172#[doc = "USART_MODE_IDR_USART (w) register accessor: an alias for `Reg<USART_MODE_IDR_USART_SPEC>`"]
173pub type USART_MODE_IDR_USART = crate::Reg<usart_mode_idr_usart::USART_MODE_IDR_USART_SPEC>;
174#[doc = "Interrupt Disable Register"]
175pub mod usart_mode_idr_usart;
176#[doc = "LIN_MODE_IER_LIN (w) register accessor: an alias for `Reg<LIN_MODE_IER_LIN_SPEC>`"]
177pub type LIN_MODE_IER_LIN = crate::Reg<lin_mode_ier_lin::LIN_MODE_IER_LIN_SPEC>;
178#[doc = "Interrupt Enable Register"]
179pub mod lin_mode_ier_lin;
180#[doc = "SPI_SLAVE_MODE_IER_SPI (w) register accessor: an alias for `Reg<SPI_SLAVE_MODE_IER_SPI_SPEC>`"]
181pub type SPI_SLAVE_MODE_IER_SPI = crate::Reg<spi_slave_mode_ier_spi::SPI_SLAVE_MODE_IER_SPI_SPEC>;
182#[doc = "Interrupt Enable Register"]
183pub mod spi_slave_mode_ier_spi;
184#[doc = "USART_MODE_IER_USART (w) register accessor: an alias for `Reg<USART_MODE_IER_USART_SPEC>`"]
185pub type USART_MODE_IER_USART = crate::Reg<usart_mode_ier_usart::USART_MODE_IER_USART_SPEC>;
186#[doc = "Interrupt Enable Register"]
187pub mod usart_mode_ier_usart;
188#[doc = "IFR (rw) register accessor: an alias for `Reg<IFR_SPEC>`"]
189pub type IFR = crate::Reg<ifr::IFR_SPEC>;
190#[doc = "IrDA Filter Register"]
191pub mod ifr;
192#[doc = "LIN_MODE_IMR_LIN (r) register accessor: an alias for `Reg<LIN_MODE_IMR_LIN_SPEC>`"]
193pub type LIN_MODE_IMR_LIN = crate::Reg<lin_mode_imr_lin::LIN_MODE_IMR_LIN_SPEC>;
194#[doc = "Interrupt Mask Register"]
195pub mod lin_mode_imr_lin;
196#[doc = "SPI_SLAVE_MODE_MR_USART (r) register accessor: an alias for `Reg<SPI_SLAVE_MODE_MR_USART_SPEC>`"]
197pub type SPI_SLAVE_MODE_MR_USART =
198    crate::Reg<spi_slave_mode_mr_usart::SPI_SLAVE_MODE_MR_USART_SPEC>;
199#[doc = "Interrupt Mask Register"]
200pub mod spi_slave_mode_mr_usart;
201#[doc = "USART_MODE_IMR_USART (r) register accessor: an alias for `Reg<USART_MODE_IMR_USART_SPEC>`"]
202pub type USART_MODE_IMR_USART = crate::Reg<usart_mode_imr_usart::USART_MODE_IMR_USART_SPEC>;
203#[doc = "Interrupt Mask Register"]
204pub mod usart_mode_imr_usart;
205#[doc = "LINBRR (r) register accessor: an alias for `Reg<LINBRR_SPEC>`"]
206pub type LINBRR = crate::Reg<linbrr::LINBRR_SPEC>;
207#[doc = "LIN Baud Rate Register"]
208pub mod linbrr;
209#[doc = "LINIR (rw) register accessor: an alias for `Reg<LINIR_SPEC>`"]
210pub type LINIR = crate::Reg<linir::LINIR_SPEC>;
211#[doc = "LIN Identifier Register"]
212pub mod linir;
213#[doc = "LINMR (rw) register accessor: an alias for `Reg<LINMR_SPEC>`"]
214pub type LINMR = crate::Reg<linmr::LINMR_SPEC>;
215#[doc = "LIN Mode Register"]
216pub mod linmr;
217#[doc = "MAN (rw) register accessor: an alias for `Reg<MAN_SPEC>`"]
218pub type MAN = crate::Reg<man::MAN_SPEC>;
219#[doc = "Manchester Configuration Register"]
220pub mod man;
221#[doc = "SPI_MODE_MR_SPI (rw) register accessor: an alias for `Reg<SPI_MODE_MR_SPI_SPEC>`"]
222pub type SPI_MODE_MR_SPI = crate::Reg<spi_mode_mr_spi::SPI_MODE_MR_SPI_SPEC>;
223#[doc = "Mode Register"]
224pub mod spi_mode_mr_spi;
225#[doc = "USART_MODE_MR (rw) register accessor: an alias for `Reg<USART_MODE_MR_SPEC>`"]
226pub type USART_MODE_MR = crate::Reg<usart_mode_mr::USART_MODE_MR_SPEC>;
227#[doc = "Mode Register"]
228pub mod usart_mode_mr;
229#[doc = "NER (r) register accessor: an alias for `Reg<NER_SPEC>`"]
230pub type NER = crate::Reg<ner::NER_SPEC>;
231#[doc = "Number of Errors Register"]
232pub mod ner;
233#[doc = "RHR (r) register accessor: an alias for `Reg<RHR_SPEC>`"]
234pub type RHR = crate::Reg<rhr::RHR_SPEC>;
235#[doc = "Receiver Holding Register"]
236pub mod rhr;
237#[doc = "RTOR (rw) register accessor: an alias for `Reg<RTOR_SPEC>`"]
238pub type RTOR = crate::Reg<rtor::RTOR_SPEC>;
239#[doc = "Receiver Time-out Register"]
240pub mod rtor;
241#[doc = "THR (w) register accessor: an alias for `Reg<THR_SPEC>`"]
242pub type THR = crate::Reg<thr::THR_SPEC>;
243#[doc = "Transmitter Holding Register"]
244pub mod thr;
245#[doc = "TTGR (rw) register accessor: an alias for `Reg<TTGR_SPEC>`"]
246pub type TTGR = crate::Reg<ttgr::TTGR_SPEC>;
247#[doc = "Transmitter Timeguard Register"]
248pub mod ttgr;
249#[doc = "VERSION (r) register accessor: an alias for `Reg<VERSION_SPEC>`"]
250pub type VERSION = crate::Reg<version::VERSION_SPEC>;
251#[doc = "Version Register"]
252pub mod version;
253#[doc = "WPMR (rw) register accessor: an alias for `Reg<WPMR_SPEC>`"]
254pub type WPMR = crate::Reg<wpmr::WPMR_SPEC>;
255#[doc = "Write Protect Mode Register"]
256pub mod wpmr;
257#[doc = "WPSR (r) register accessor: an alias for `Reg<WPSR_SPEC>`"]
258pub type WPSR = crate::Reg<wpsr::WPSR_SPEC>;
259#[doc = "Write Protect Status Register"]
260pub mod wpsr;