atsamd11c/sercom0/
usart.rs

1#[repr(C)]
2#[doc = "USART Mode"]
3#[doc(alias = "USART")]
4pub struct Usart {
5    ctrla: Ctrla,
6    ctrlb: Ctrlb,
7    _reserved2: [u8; 0x04],
8    _reserved_2_baud: [u8; 0x02],
9    rxpl: Rxpl,
10    _reserved4: [u8; 0x05],
11    intenclr: Intenclr,
12    _reserved5: [u8; 0x01],
13    intenset: Intenset,
14    _reserved6: [u8; 0x01],
15    intflag: Intflag,
16    _reserved7: [u8; 0x01],
17    status: Status,
18    syncbusy: Syncbusy,
19    _reserved9: [u8; 0x08],
20    data: Data,
21    _reserved10: [u8; 0x06],
22    dbgctrl: Dbgctrl,
23}
24impl Usart {
25    #[doc = "0x00 - USART Control A"]
26    #[inline(always)]
27    pub const fn ctrla(&self) -> &Ctrla {
28        &self.ctrla
29    }
30    #[doc = "0x04 - USART Control B"]
31    #[inline(always)]
32    pub const fn ctrlb(&self) -> &Ctrlb {
33        &self.ctrlb
34    }
35    #[doc = "0x0c - USART Baud Rate"]
36    #[inline(always)]
37    pub const fn baud_usartfp_mode(&self) -> &BaudUsartfpMode {
38        unsafe { &*(self as *const Self).cast::<u8>().add(12).cast() }
39    }
40    #[doc = "0x0c - USART Baud Rate"]
41    #[inline(always)]
42    pub const fn baud_fracfp_mode(&self) -> &BaudFracfpMode {
43        unsafe { &*(self as *const Self).cast::<u8>().add(12).cast() }
44    }
45    #[doc = "0x0c - USART Baud Rate"]
46    #[inline(always)]
47    pub const fn baud_frac_mode(&self) -> &BaudFracMode {
48        unsafe { &*(self as *const Self).cast::<u8>().add(12).cast() }
49    }
50    #[doc = "0x0c - USART Baud Rate"]
51    #[inline(always)]
52    pub const fn baud(&self) -> &Baud {
53        unsafe { &*(self as *const Self).cast::<u8>().add(12).cast() }
54    }
55    #[doc = "0x0e - USART Receive Pulse Length"]
56    #[inline(always)]
57    pub const fn rxpl(&self) -> &Rxpl {
58        &self.rxpl
59    }
60    #[doc = "0x14 - USART Interrupt Enable Clear"]
61    #[inline(always)]
62    pub const fn intenclr(&self) -> &Intenclr {
63        &self.intenclr
64    }
65    #[doc = "0x16 - USART Interrupt Enable Set"]
66    #[inline(always)]
67    pub const fn intenset(&self) -> &Intenset {
68        &self.intenset
69    }
70    #[doc = "0x18 - USART Interrupt Flag Status and Clear"]
71    #[inline(always)]
72    pub const fn intflag(&self) -> &Intflag {
73        &self.intflag
74    }
75    #[doc = "0x1a - USART Status"]
76    #[inline(always)]
77    pub const fn status(&self) -> &Status {
78        &self.status
79    }
80    #[doc = "0x1c - USART Syncbusy"]
81    #[inline(always)]
82    pub const fn syncbusy(&self) -> &Syncbusy {
83        &self.syncbusy
84    }
85    #[doc = "0x28 - USART Data"]
86    #[inline(always)]
87    pub const fn data(&self) -> &Data {
88        &self.data
89    }
90    #[doc = "0x30 - USART Debug Control"]
91    #[inline(always)]
92    pub const fn dbgctrl(&self) -> &Dbgctrl {
93        &self.dbgctrl
94    }
95}
96#[doc = "CTRLA (rw) register accessor: USART Control A\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrla::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrla::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctrla`]
97module"]
98#[doc(alias = "CTRLA")]
99pub type Ctrla = crate::Reg<ctrla::CtrlaSpec>;
100#[doc = "USART Control A"]
101pub mod ctrla;
102#[doc = "CTRLB (rw) register accessor: USART Control B\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrlb::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrlb::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctrlb`]
103module"]
104#[doc(alias = "CTRLB")]
105pub type Ctrlb = crate::Reg<ctrlb::CtrlbSpec>;
106#[doc = "USART Control B"]
107pub mod ctrlb;
108#[doc = "BAUD (rw) register accessor: USART Baud Rate\n\nYou can [`read`](crate::Reg::read) this register and get [`baud::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`baud::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@baud`]
109module"]
110#[doc(alias = "BAUD")]
111pub type Baud = crate::Reg<baud::BaudSpec>;
112#[doc = "USART Baud Rate"]
113pub mod baud;
114#[doc = "BAUD_FRAC_MODE (rw) register accessor: USART Baud Rate\n\nYou can [`read`](crate::Reg::read) this register and get [`baud_frac_mode::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`baud_frac_mode::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@baud_frac_mode`]
115module"]
116#[doc(alias = "BAUD_FRAC_MODE")]
117pub type BaudFracMode = crate::Reg<baud_frac_mode::BaudFracModeSpec>;
118#[doc = "USART Baud Rate"]
119pub mod baud_frac_mode;
120#[doc = "BAUD_FRACFP_MODE (rw) register accessor: USART Baud Rate\n\nYou can [`read`](crate::Reg::read) this register and get [`baud_fracfp_mode::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`baud_fracfp_mode::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@baud_fracfp_mode`]
121module"]
122#[doc(alias = "BAUD_FRACFP_MODE")]
123pub type BaudFracfpMode = crate::Reg<baud_fracfp_mode::BaudFracfpModeSpec>;
124#[doc = "USART Baud Rate"]
125pub mod baud_fracfp_mode;
126#[doc = "BAUD_USARTFP_MODE (rw) register accessor: USART Baud Rate\n\nYou can [`read`](crate::Reg::read) this register and get [`baud_usartfp_mode::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`baud_usartfp_mode::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@baud_usartfp_mode`]
127module"]
128#[doc(alias = "BAUD_USARTFP_MODE")]
129pub type BaudUsartfpMode = crate::Reg<baud_usartfp_mode::BaudUsartfpModeSpec>;
130#[doc = "USART Baud Rate"]
131pub mod baud_usartfp_mode;
132#[doc = "RXPL (rw) register accessor: USART Receive Pulse Length\n\nYou can [`read`](crate::Reg::read) this register and get [`rxpl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rxpl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxpl`]
133module"]
134#[doc(alias = "RXPL")]
135pub type Rxpl = crate::Reg<rxpl::RxplSpec>;
136#[doc = "USART Receive Pulse Length"]
137pub mod rxpl;
138#[doc = "INTENCLR (rw) register accessor: USART Interrupt Enable Clear\n\nYou can [`read`](crate::Reg::read) this register and get [`intenclr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intenclr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@intenclr`]
139module"]
140#[doc(alias = "INTENCLR")]
141pub type Intenclr = crate::Reg<intenclr::IntenclrSpec>;
142#[doc = "USART Interrupt Enable Clear"]
143pub mod intenclr;
144#[doc = "INTENSET (rw) register accessor: USART Interrupt Enable Set\n\nYou can [`read`](crate::Reg::read) this register and get [`intenset::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intenset::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@intenset`]
145module"]
146#[doc(alias = "INTENSET")]
147pub type Intenset = crate::Reg<intenset::IntensetSpec>;
148#[doc = "USART Interrupt Enable Set"]
149pub mod intenset;
150#[doc = "INTFLAG (rw) register accessor: USART Interrupt Flag Status and Clear\n\nYou can [`read`](crate::Reg::read) this register and get [`intflag::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intflag::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@intflag`]
151module"]
152#[doc(alias = "INTFLAG")]
153pub type Intflag = crate::Reg<intflag::IntflagSpec>;
154#[doc = "USART Interrupt Flag Status and Clear"]
155pub mod intflag;
156#[doc = "STATUS (rw) register accessor: USART Status\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`status::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@status`]
157module"]
158#[doc(alias = "STATUS")]
159pub type Status = crate::Reg<status::StatusSpec>;
160#[doc = "USART Status"]
161pub mod status;
162#[doc = "SYNCBUSY (r) register accessor: USART Syncbusy\n\nYou can [`read`](crate::Reg::read) this register and get [`syncbusy::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@syncbusy`]
163module"]
164#[doc(alias = "SYNCBUSY")]
165pub type Syncbusy = crate::Reg<syncbusy::SyncbusySpec>;
166#[doc = "USART Syncbusy"]
167pub mod syncbusy;
168#[doc = "DATA (rw) register accessor: USART Data\n\nYou can [`read`](crate::Reg::read) this register and get [`data::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`data::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@data`]
169module"]
170#[doc(alias = "DATA")]
171pub type Data = crate::Reg<data::DataSpec>;
172#[doc = "USART Data"]
173pub mod data;
174#[doc = "DBGCTRL (rw) register accessor: USART Debug Control\n\nYou can [`read`](crate::Reg::read) this register and get [`dbgctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dbgctrl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dbgctrl`]
175module"]
176#[doc(alias = "DBGCTRL")]
177pub type Dbgctrl = crate::Reg<dbgctrl::DbgctrlSpec>;
178#[doc = "USART Debug Control"]
179pub mod dbgctrl;