stm32g4/stm32g431/comp.rs
1#[repr(C)]
2#[derive(Debug)]
3///Register block
4pub struct RegisterBlock {
5 ccsr: [CCSR; 7],
6}
7impl RegisterBlock {
8 ///0x00..0x1c - Comparator control/status register
9 ///
10 ///<div class="warning">`n` is the index of register in the array. `n == 0` corresponds to `C1CSR` register.</div>
11 #[inline(always)]
12 pub const fn ccsr(&self, n: usize) -> &CCSR {
13 &self.ccsr[n]
14 }
15 ///Iterator for array of:
16 ///0x00..0x1c - Comparator control/status register
17 #[inline(always)]
18 pub fn ccsr_iter(&self) -> impl Iterator<Item = &CCSR> {
19 self.ccsr.iter()
20 }
21 ///0x00 - Comparator control/status register
22 #[inline(always)]
23 pub const fn c1csr(&self) -> &CCSR {
24 self.ccsr(0)
25 }
26 ///0x04 - Comparator control/status register
27 #[inline(always)]
28 pub const fn c2csr(&self) -> &CCSR {
29 self.ccsr(1)
30 }
31 ///0x08 - Comparator control/status register
32 #[inline(always)]
33 pub const fn c3csr(&self) -> &CCSR {
34 self.ccsr(2)
35 }
36 ///0x0c - Comparator control/status register
37 #[inline(always)]
38 pub const fn c4csr(&self) -> &CCSR {
39 self.ccsr(3)
40 }
41 ///0x10 - Comparator control/status register
42 #[inline(always)]
43 pub const fn c5csr(&self) -> &CCSR {
44 self.ccsr(4)
45 }
46 ///0x14 - Comparator control/status register
47 #[inline(always)]
48 pub const fn c6csr(&self) -> &CCSR {
49 self.ccsr(5)
50 }
51 ///0x18 - Comparator control/status register
52 #[inline(always)]
53 pub const fn c7csr(&self) -> &CCSR {
54 self.ccsr(6)
55 }
56}
57/**CCSR (rw) register accessor: Comparator control/status register
58
59You can [`read`](crate::Reg::read) this register and get [`ccsr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ccsr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
60
61See register [structure](https://stm32-rs.github.io/stm32-rs/STM32G431.html#COMP:C[1]CSR)
62
63For information about available fields see [`mod@ccsr`] module*/
64pub type CCSR = crate::Reg<ccsr::CCSRrs>;
65///Comparator control/status register
66pub mod ccsr;