Skip to main content

mik32_pac/
timer32_2.rs

1#[repr(C)]
2#[doc = "Register block"]
3pub struct RegisterBlock {
4    value: Value,
5    top: Top,
6    prescale: Prescale,
7    control: Control,
8    enable: Enable,
9    int_mask: IntMask,
10    int_clear: IntClear,
11    int_flag: IntFlag,
12    _reserved8: [u8; 0x60],
13    ch1_cntr: Ch1Cntr,
14    ch1_ocr: Ch1Ocr,
15    ch1_icr: Ch1Icr,
16    _reserved11: [u8; 0x04],
17    _reserved_11_ch2_cntr: [u8; 0x04],
18    ch2_ocr: Ch2Ocr,
19    ch2_icr: Ch2Icr,
20    _reserved14: [u8; 0x08],
21    ch3_ocr: Ch3Ocr,
22    ch3_icr: Ch3Icr,
23    _reserved16: [u8; 0x04],
24    ch4_cntr: Ch4Cntr,
25    ch4_ocr: Ch4Ocr,
26    ch4_icr: Ch4Icr,
27}
28impl RegisterBlock {
29    #[doc = "0x00 - "]
30    #[inline(always)]
31    pub const fn value(&self) -> &Value {
32        &self.value
33    }
34    #[doc = "0x04 - максимальное значение счетной последовательности"]
35    #[inline(always)]
36    pub const fn top(&self) -> &Top {
37        &self.top
38    }
39    #[doc = "0x08 - значение делителя"]
40    #[inline(always)]
41    pub const fn prescale(&self) -> &Prescale {
42        &self.prescale
43    }
44    #[doc = "0x0c - Конфигурационный регистр основного таймера"]
45    #[inline(always)]
46    pub const fn control(&self) -> &Control {
47        &self.control
48    }
49    #[doc = "0x10 - Регистр включения таймера"]
50    #[inline(always)]
51    pub const fn enable(&self) -> &Enable {
52        &self.enable
53    }
54    #[doc = "0x14 - Регистр маски прерываний"]
55    #[inline(always)]
56    pub const fn int_mask(&self) -> &IntMask {
57        &self.int_mask
58    }
59    #[doc = "0x18 - Регистр сброса флагов прерываний"]
60    #[inline(always)]
61    pub const fn int_clear(&self) -> &IntClear {
62        &self.int_clear
63    }
64    #[doc = "0x1c - Регистр флагов прерываний"]
65    #[inline(always)]
66    pub const fn int_flag(&self) -> &IntFlag {
67        &self.int_flag
68    }
69    #[doc = "0x80 - Конфигурационный регистр 1 канала"]
70    #[inline(always)]
71    pub const fn ch1_cntr(&self) -> &Ch1Cntr {
72        &self.ch1_cntr
73    }
74    #[doc = "0x84 - Значение сравнения 1 канала"]
75    #[inline(always)]
76    pub const fn ch1_ocr(&self) -> &Ch1Ocr {
77        &self.ch1_ocr
78    }
79    #[doc = "0x88 - Значение захвата 1 канала"]
80    #[inline(always)]
81    pub const fn ch1_icr(&self) -> &Ch1Icr {
82        &self.ch1_icr
83    }
84    #[doc = "0x90 - Конфигурационный регистр 3 канала"]
85    #[inline(always)]
86    pub const fn ch3_cntr(&self) -> &Ch3Cntr {
87        unsafe { &*core::ptr::from_ref(self).cast::<u8>().add(144).cast() }
88    }
89    #[doc = "0x90 - Конфигурационный регистр 2 канала"]
90    #[inline(always)]
91    pub const fn ch2_cntr(&self) -> &Ch2Cntr {
92        unsafe { &*core::ptr::from_ref(self).cast::<u8>().add(144).cast() }
93    }
94    #[doc = "0x94 - Значение сравнения 2 канала"]
95    #[inline(always)]
96    pub const fn ch2_ocr(&self) -> &Ch2Ocr {
97        &self.ch2_ocr
98    }
99    #[doc = "0x98 - Значение захвата 2 канала"]
100    #[inline(always)]
101    pub const fn ch2_icr(&self) -> &Ch2Icr {
102        &self.ch2_icr
103    }
104    #[doc = "0xa4 - Значение сравнения 3 канала"]
105    #[inline(always)]
106    pub const fn ch3_ocr(&self) -> &Ch3Ocr {
107        &self.ch3_ocr
108    }
109    #[doc = "0xa8 - Значение захвата 3 канала"]
110    #[inline(always)]
111    pub const fn ch3_icr(&self) -> &Ch3Icr {
112        &self.ch3_icr
113    }
114    #[doc = "0xb0 - Конфигурационный регистр 4 канала"]
115    #[inline(always)]
116    pub const fn ch4_cntr(&self) -> &Ch4Cntr {
117        &self.ch4_cntr
118    }
119    #[doc = "0xb4 - Значение сравнения 4 канала"]
120    #[inline(always)]
121    pub const fn ch4_ocr(&self) -> &Ch4Ocr {
122        &self.ch4_ocr
123    }
124    #[doc = "0xb8 - Значение захвата 4 канала"]
125    #[inline(always)]
126    pub const fn ch4_icr(&self) -> &Ch4Icr {
127        &self.ch4_icr
128    }
129}
130#[doc = "VALUE (rw) register accessor: \n\nYou can [`read`](crate::Reg::read) this register and get [`value::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`value::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@value`] module"]
131#[doc(alias = "VALUE")]
132pub type Value = crate::Reg<value::ValueSpec>;
133#[doc = ""]
134pub mod value;
135#[doc = "TOP (rw) register accessor: максимальное значение счетной последовательности\n\nYou can [`read`](crate::Reg::read) this register and get [`top::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`top::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@top`] module"]
136#[doc(alias = "TOP")]
137pub type Top = crate::Reg<top::TopSpec>;
138#[doc = "максимальное значение счетной последовательности"]
139pub mod top;
140#[doc = "PRESCALE (rw) register accessor: значение делителя\n\nYou can [`read`](crate::Reg::read) this register and get [`prescale::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`prescale::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@prescale`] module"]
141#[doc(alias = "PRESCALE")]
142pub type Prescale = crate::Reg<prescale::PrescaleSpec>;
143#[doc = "значение делителя"]
144pub mod prescale;
145#[doc = "CONTROL (rw) register accessor: Конфигурационный регистр основного таймера\n\nYou can [`read`](crate::Reg::read) this register and get [`control::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`control::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@control`] module"]
146#[doc(alias = "CONTROL")]
147pub type Control = crate::Reg<control::ControlSpec>;
148#[doc = "Конфигурационный регистр основного таймера"]
149pub mod control;
150#[doc = "ENABLE (rw) register accessor: Регистр включения таймера\n\nYou can [`read`](crate::Reg::read) this register and get [`enable::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`enable::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@enable`] module"]
151#[doc(alias = "ENABLE")]
152pub type Enable = crate::Reg<enable::EnableSpec>;
153#[doc = "Регистр включения таймера"]
154pub mod enable;
155#[doc = "INT_MASK (rw) register accessor: Регистр маски прерываний\n\nYou can [`read`](crate::Reg::read) this register and get [`int_mask::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`int_mask::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@int_mask`] module"]
156#[doc(alias = "INT_MASK")]
157pub type IntMask = crate::Reg<int_mask::IntMaskSpec>;
158#[doc = "Регистр маски прерываний"]
159pub mod int_mask;
160#[doc = "INT_CLEAR (rw) register accessor: Регистр сброса флагов прерываний\n\nYou can [`read`](crate::Reg::read) this register and get [`int_clear::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`int_clear::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@int_clear`] module"]
161#[doc(alias = "INT_CLEAR")]
162pub type IntClear = crate::Reg<int_clear::IntClearSpec>;
163#[doc = "Регистр сброса флагов прерываний"]
164pub mod int_clear;
165#[doc = "INT_FLAG (rw) register accessor: Регистр флагов прерываний\n\nYou can [`read`](crate::Reg::read) this register and get [`int_flag::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`int_flag::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@int_flag`] module"]
166#[doc(alias = "INT_FLAG")]
167pub type IntFlag = crate::Reg<int_flag::IntFlagSpec>;
168#[doc = "Регистр флагов прерываний"]
169pub mod int_flag;
170#[doc = "CH1_CNTR (rw) register accessor: Конфигурационный регистр 1 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch1_cntr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch1_cntr::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@ch1_cntr`] module"]
171#[doc(alias = "CH1_CNTR")]
172pub type Ch1Cntr = crate::Reg<ch1_cntr::Ch1CntrSpec>;
173#[doc = "Конфигурационный регистр 1 канала"]
174pub mod ch1_cntr;
175#[doc = "CH1_OCR (rw) register accessor: Значение сравнения 1 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch1_ocr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch1_ocr::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@ch1_ocr`] module"]
176#[doc(alias = "CH1_OCR")]
177pub type Ch1Ocr = crate::Reg<ch1_ocr::Ch1OcrSpec>;
178#[doc = "Значение сравнения 1 канала"]
179pub mod ch1_ocr;
180#[doc = "CH1_ICR (rw) register accessor: Значение захвата 1 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch1_icr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch1_icr::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@ch1_icr`] module"]
181#[doc(alias = "CH1_ICR")]
182pub type Ch1Icr = crate::Reg<ch1_icr::Ch1IcrSpec>;
183#[doc = "Значение захвата 1 канала"]
184pub mod ch1_icr;
185#[doc = "CH2_CNTR (rw) register accessor: Конфигурационный регистр 2 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch2_cntr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch2_cntr::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@ch2_cntr`] module"]
186#[doc(alias = "CH2_CNTR")]
187pub type Ch2Cntr = crate::Reg<ch2_cntr::Ch2CntrSpec>;
188#[doc = "Конфигурационный регистр 2 канала"]
189pub mod ch2_cntr;
190#[doc = "CH2_OCR (rw) register accessor: Значение сравнения 2 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch2_ocr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch2_ocr::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@ch2_ocr`] module"]
191#[doc(alias = "CH2_OCR")]
192pub type Ch2Ocr = crate::Reg<ch2_ocr::Ch2OcrSpec>;
193#[doc = "Значение сравнения 2 канала"]
194pub mod ch2_ocr;
195#[doc = "CH2_ICR (rw) register accessor: Значение захвата 2 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch2_icr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch2_icr::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@ch2_icr`] module"]
196#[doc(alias = "CH2_ICR")]
197pub type Ch2Icr = crate::Reg<ch2_icr::Ch2IcrSpec>;
198#[doc = "Значение захвата 2 канала"]
199pub mod ch2_icr;
200#[doc = "CH3_CNTR (rw) register accessor: Конфигурационный регистр 3 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch3_cntr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch3_cntr::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@ch3_cntr`] module"]
201#[doc(alias = "CH3_CNTR")]
202pub type Ch3Cntr = crate::Reg<ch3_cntr::Ch3CntrSpec>;
203#[doc = "Конфигурационный регистр 3 канала"]
204pub mod ch3_cntr;
205#[doc = "CH3_OCR (rw) register accessor: Значение сравнения 3 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch3_ocr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch3_ocr::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@ch3_ocr`] module"]
206#[doc(alias = "CH3_OCR")]
207pub type Ch3Ocr = crate::Reg<ch3_ocr::Ch3OcrSpec>;
208#[doc = "Значение сравнения 3 канала"]
209pub mod ch3_ocr;
210#[doc = "CH3_ICR (rw) register accessor: Значение захвата 3 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch3_icr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch3_icr::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@ch3_icr`] module"]
211#[doc(alias = "CH3_ICR")]
212pub type Ch3Icr = crate::Reg<ch3_icr::Ch3IcrSpec>;
213#[doc = "Значение захвата 3 канала"]
214pub mod ch3_icr;
215#[doc = "CH4_CNTR (rw) register accessor: Конфигурационный регистр 4 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch4_cntr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch4_cntr::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@ch4_cntr`] module"]
216#[doc(alias = "CH4_CNTR")]
217pub type Ch4Cntr = crate::Reg<ch4_cntr::Ch4CntrSpec>;
218#[doc = "Конфигурационный регистр 4 канала"]
219pub mod ch4_cntr;
220#[doc = "CH4_OCR (rw) register accessor: Значение сравнения 4 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch4_ocr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch4_ocr::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@ch4_ocr`] module"]
221#[doc(alias = "CH4_OCR")]
222pub type Ch4Ocr = crate::Reg<ch4_ocr::Ch4OcrSpec>;
223#[doc = "Значение сравнения 4 канала"]
224pub mod ch4_ocr;
225#[doc = "CH4_ICR (rw) register accessor: Значение захвата 4 канала\n\nYou can [`read`](crate::Reg::read) this register and get [`ch4_icr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ch4_icr::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@ch4_icr`] module"]
226#[doc(alias = "CH4_ICR")]
227pub type Ch4Icr = crate::Reg<ch4_icr::Ch4IcrSpec>;
228#[doc = "Значение захвата 4 канала"]
229pub mod ch4_icr;