atsamd21g/
i2s.rs

1#[repr(C)]
2#[doc = "Register block"]
3pub struct RegisterBlock {
4    ctrla: Ctrla,
5    _reserved1: [u8; 0x03],
6    clkctrl: [Clkctrl; 2],
7    intenclr: Intenclr,
8    _reserved3: [u8; 0x02],
9    intenset: Intenset,
10    _reserved4: [u8; 0x02],
11    intflag: Intflag,
12    _reserved5: [u8; 0x02],
13    syncbusy: Syncbusy,
14    _reserved6: [u8; 0x06],
15    serctrl: [Serctrl; 2],
16    _reserved7: [u8; 0x08],
17    data: [Data; 2],
18}
19impl RegisterBlock {
20    #[doc = "0x00 - Control A"]
21    #[inline(always)]
22    pub const fn ctrla(&self) -> &Ctrla {
23        &self.ctrla
24    }
25    #[doc = "0x04..0x0c - Clock Unit n Control"]
26    #[inline(always)]
27    pub const fn clkctrl(&self, n: usize) -> &Clkctrl {
28        &self.clkctrl[n]
29    }
30    #[doc = "Iterator for array of:"]
31    #[doc = "0x04..0x0c - Clock Unit n Control"]
32    #[inline(always)]
33    pub fn clkctrl_iter(&self) -> impl Iterator<Item = &Clkctrl> {
34        self.clkctrl.iter()
35    }
36    #[doc = "0x0c - Interrupt Enable Clear"]
37    #[inline(always)]
38    pub const fn intenclr(&self) -> &Intenclr {
39        &self.intenclr
40    }
41    #[doc = "0x10 - Interrupt Enable Set"]
42    #[inline(always)]
43    pub const fn intenset(&self) -> &Intenset {
44        &self.intenset
45    }
46    #[doc = "0x14 - Interrupt Flag Status and Clear"]
47    #[inline(always)]
48    pub const fn intflag(&self) -> &Intflag {
49        &self.intflag
50    }
51    #[doc = "0x18 - Synchronization Status"]
52    #[inline(always)]
53    pub const fn syncbusy(&self) -> &Syncbusy {
54        &self.syncbusy
55    }
56    #[doc = "0x20..0x28 - Serializer n Control"]
57    #[inline(always)]
58    pub const fn serctrl(&self, n: usize) -> &Serctrl {
59        &self.serctrl[n]
60    }
61    #[doc = "Iterator for array of:"]
62    #[doc = "0x20..0x28 - Serializer n Control"]
63    #[inline(always)]
64    pub fn serctrl_iter(&self) -> impl Iterator<Item = &Serctrl> {
65        self.serctrl.iter()
66    }
67    #[doc = "0x30..0x38 - Data n"]
68    #[inline(always)]
69    pub const fn data(&self, n: usize) -> &Data {
70        &self.data[n]
71    }
72    #[doc = "Iterator for array of:"]
73    #[doc = "0x30..0x38 - Data n"]
74    #[inline(always)]
75    pub fn data_iter(&self) -> impl Iterator<Item = &Data> {
76        self.data.iter()
77    }
78}
79#[doc = "CTRLA (rw) register accessor: 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`]
80module"]
81#[doc(alias = "CTRLA")]
82pub type Ctrla = crate::Reg<ctrla::CtrlaSpec>;
83#[doc = "Control A"]
84pub mod ctrla;
85#[doc = "CLKCTRL (rw) register accessor: Clock Unit n Control\n\nYou can [`read`](crate::Reg::read) this register and get [`clkctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`clkctrl::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@clkctrl`]
86module"]
87#[doc(alias = "CLKCTRL")]
88pub type Clkctrl = crate::Reg<clkctrl::ClkctrlSpec>;
89#[doc = "Clock Unit n Control"]
90pub mod clkctrl;
91#[doc = "INTENCLR (rw) register accessor: 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`]
92module"]
93#[doc(alias = "INTENCLR")]
94pub type Intenclr = crate::Reg<intenclr::IntenclrSpec>;
95#[doc = "Interrupt Enable Clear"]
96pub mod intenclr;
97#[doc = "INTENSET (rw) register accessor: 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`]
98module"]
99#[doc(alias = "INTENSET")]
100pub type Intenset = crate::Reg<intenset::IntensetSpec>;
101#[doc = "Interrupt Enable Set"]
102pub mod intenset;
103#[doc = "INTFLAG (rw) register accessor: 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`]
104module"]
105#[doc(alias = "INTFLAG")]
106pub type Intflag = crate::Reg<intflag::IntflagSpec>;
107#[doc = "Interrupt Flag Status and Clear"]
108pub mod intflag;
109#[doc = "SYNCBUSY (r) register accessor: Synchronization Status\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`]
110module"]
111#[doc(alias = "SYNCBUSY")]
112pub type Syncbusy = crate::Reg<syncbusy::SyncbusySpec>;
113#[doc = "Synchronization Status"]
114pub mod syncbusy;
115#[doc = "SERCTRL (rw) register accessor: Serializer n Control\n\nYou can [`read`](crate::Reg::read) this register and get [`serctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`serctrl::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@serctrl`]
116module"]
117#[doc(alias = "SERCTRL")]
118pub type Serctrl = crate::Reg<serctrl::SerctrlSpec>;
119#[doc = "Serializer n Control"]
120pub mod serctrl;
121#[doc = "DATA (rw) register accessor: Data n\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`]
122module"]
123#[doc(alias = "DATA")]
124pub type Data = crate::Reg<data::DataSpec>;
125#[doc = "Data n"]
126pub mod data;