esp32h2/mcpwm0/
ch.rs

1#[repr(C)]
2#[cfg_attr(feature = "impl-register-debug", derive(Debug))]
3#[doc = "Cluster CH%s, containing GEN?_STMP_CFG, GEN?_TSTMP_A, GEN?_TSTMP_B, GEN?_CFG0, GEN?_FORCE, GEN?_A, GEN?_B, DT?_CFG, DT?_FED_CFG, DT?_RED_CFG, CARRIER?_CFG, FH?_CFG0, FH?_CFG1, FH?_STATUS"]
4pub struct CH {
5    gen_stmp_cfg: GEN_STMP_CFG,
6    gen_tstmp_a: GEN_TSTMP_A,
7    gen_tstmp_b: GEN_TSTMP_B,
8    gen_cfg0: GEN_CFG0,
9    gen_force: GEN_FORCE,
10    gen: [GEN; 2],
11    dt_cfg: DT_CFG,
12    dt_fed_cfg: DT_FED_CFG,
13    dt_red_cfg: DT_RED_CFG,
14    carrier_cfg: CARRIER_CFG,
15    fh_cfg0: FH_CFG0,
16    fh_cfg1: FH_CFG1,
17    fh_status: FH_STATUS,
18}
19impl CH {
20    #[doc = "0x00 - Transfer status and update method for time stamp registers A and B"]
21    #[inline(always)]
22    pub const fn gen_stmp_cfg(&self) -> &GEN_STMP_CFG {
23        &self.gen_stmp_cfg
24    }
25    #[doc = "0x04 - Shadow register for register A."]
26    #[inline(always)]
27    pub const fn gen_tstmp_a(&self) -> &GEN_TSTMP_A {
28        &self.gen_tstmp_a
29    }
30    #[doc = "0x08 - Shadow register for register B."]
31    #[inline(always)]
32    pub const fn gen_tstmp_b(&self) -> &GEN_TSTMP_B {
33        &self.gen_tstmp_b
34    }
35    #[doc = "0x0c - Fault event T0 and T1 handling"]
36    #[inline(always)]
37    pub const fn gen_cfg0(&self) -> &GEN_CFG0 {
38        &self.gen_cfg0
39    }
40    #[doc = "0x10 - Permissives to force PWMxA and PWMxB outputs by software"]
41    #[inline(always)]
42    pub const fn gen_force(&self) -> &GEN_FORCE {
43        &self.gen_force
44    }
45    #[doc = "0x14..0x1c - Actions triggered by events on PWMx%s"]
46    #[doc = ""]
47    #[doc = "<div class=\"warning\">`n` is the index of register in the array. `n == 0` corresponds to `GENA` register.</div>"]
48    #[inline(always)]
49    pub const fn gen(&self, n: usize) -> &GEN {
50        &self.gen[n]
51    }
52    #[doc = "Iterator for array of:"]
53    #[doc = "0x14..0x1c - Actions triggered by events on PWMx%s"]
54    #[inline(always)]
55    pub fn gen_iter(&self) -> impl Iterator<Item = &GEN> {
56        self.gen.iter()
57    }
58    #[doc = "0x14 - Actions triggered by events on PWMxA"]
59    #[inline(always)]
60    pub const fn gena(&self) -> &GEN {
61        self.gen(0)
62    }
63    #[doc = "0x18 - Actions triggered by events on PWMxB"]
64    #[inline(always)]
65    pub const fn genb(&self) -> &GEN {
66        self.gen(1)
67    }
68    #[doc = "0x1c - Dead time type selection and configuration"]
69    #[inline(always)]
70    pub const fn dt_cfg(&self) -> &DT_CFG {
71        &self.dt_cfg
72    }
73    #[doc = "0x20 - Shadow register for falling edge delay (FED)."]
74    #[inline(always)]
75    pub const fn dt_fed_cfg(&self) -> &DT_FED_CFG {
76        &self.dt_fed_cfg
77    }
78    #[doc = "0x24 - Shadow register for rising edge delay (RED)."]
79    #[inline(always)]
80    pub const fn dt_red_cfg(&self) -> &DT_RED_CFG {
81        &self.dt_red_cfg
82    }
83    #[doc = "0x28 - Carrier enable and configuratoin"]
84    #[inline(always)]
85    pub const fn carrier_cfg(&self) -> &CARRIER_CFG {
86        &self.carrier_cfg
87    }
88    #[doc = "0x2c - Actions on PWM0A and PWM0B trip events"]
89    #[inline(always)]
90    pub const fn fh_cfg0(&self) -> &FH_CFG0 {
91        &self.fh_cfg0
92    }
93    #[doc = "0x30 - Software triggers for fault handler actions"]
94    #[inline(always)]
95    pub const fn fh_cfg1(&self) -> &FH_CFG1 {
96        &self.fh_cfg1
97    }
98    #[doc = "0x34 - Status of fault events."]
99    #[inline(always)]
100    pub const fn fh_status(&self) -> &FH_STATUS {
101        &self.fh_status
102    }
103}
104#[doc = "GEN_STMP_CFG (rw) register accessor: Transfer status and update method for time stamp registers A and B\n\nYou can [`read`](crate::Reg::read) this register and get [`gen_stmp_cfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gen_stmp_cfg::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@gen_stmp_cfg`] module"]
105pub type GEN_STMP_CFG = crate::Reg<gen_stmp_cfg::GEN_STMP_CFG_SPEC>;
106#[doc = "Transfer status and update method for time stamp registers A and B"]
107pub mod gen_stmp_cfg;
108#[doc = "GEN_TSTMP_A (rw) register accessor: Shadow register for register A.\n\nYou can [`read`](crate::Reg::read) this register and get [`gen_tstmp_a::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gen_tstmp_a::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@gen_tstmp_a`] module"]
109pub type GEN_TSTMP_A = crate::Reg<gen_tstmp_a::GEN_TSTMP_A_SPEC>;
110#[doc = "Shadow register for register A."]
111pub mod gen_tstmp_a;
112#[doc = "GEN_TSTMP_B (rw) register accessor: Shadow register for register B.\n\nYou can [`read`](crate::Reg::read) this register and get [`gen_tstmp_b::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gen_tstmp_b::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@gen_tstmp_b`] module"]
113pub type GEN_TSTMP_B = crate::Reg<gen_tstmp_b::GEN_TSTMP_B_SPEC>;
114#[doc = "Shadow register for register B."]
115pub mod gen_tstmp_b;
116#[doc = "GEN_CFG0 (rw) register accessor: Fault event T0 and T1 handling\n\nYou can [`read`](crate::Reg::read) this register and get [`gen_cfg0::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gen_cfg0::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@gen_cfg0`] module"]
117pub type GEN_CFG0 = crate::Reg<gen_cfg0::GEN_CFG0_SPEC>;
118#[doc = "Fault event T0 and T1 handling"]
119pub mod gen_cfg0;
120#[doc = "GEN_FORCE (rw) register accessor: Permissives to force PWMxA and PWMxB outputs by software\n\nYou can [`read`](crate::Reg::read) this register and get [`gen_force::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gen_force::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@gen_force`] module"]
121pub type GEN_FORCE = crate::Reg<gen_force::GEN_FORCE_SPEC>;
122#[doc = "Permissives to force PWMxA and PWMxB outputs by software"]
123pub mod gen_force;
124#[doc = "GEN (rw) register accessor: Actions triggered by events on PWMx%s\n\nYou can [`read`](crate::Reg::read) this register and get [`gen::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gen::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@gen`] module"]
125pub type GEN = crate::Reg<gen::GEN_SPEC>;
126#[doc = "Actions triggered by events on PWMx%s"]
127pub mod gen;
128#[doc = "DT_CFG (rw) register accessor: Dead time type selection and configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`dt_cfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dt_cfg::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@dt_cfg`] module"]
129pub type DT_CFG = crate::Reg<dt_cfg::DT_CFG_SPEC>;
130#[doc = "Dead time type selection and configuration"]
131pub mod dt_cfg;
132#[doc = "DT_FED_CFG (rw) register accessor: Shadow register for falling edge delay (FED).\n\nYou can [`read`](crate::Reg::read) this register and get [`dt_fed_cfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dt_fed_cfg::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@dt_fed_cfg`] module"]
133pub type DT_FED_CFG = crate::Reg<dt_fed_cfg::DT_FED_CFG_SPEC>;
134#[doc = "Shadow register for falling edge delay (FED)."]
135pub mod dt_fed_cfg;
136#[doc = "DT_RED_CFG (rw) register accessor: Shadow register for rising edge delay (RED).\n\nYou can [`read`](crate::Reg::read) this register and get [`dt_red_cfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dt_red_cfg::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@dt_red_cfg`] module"]
137pub type DT_RED_CFG = crate::Reg<dt_red_cfg::DT_RED_CFG_SPEC>;
138#[doc = "Shadow register for rising edge delay (RED)."]
139pub mod dt_red_cfg;
140#[doc = "CARRIER_CFG (rw) register accessor: Carrier enable and configuratoin\n\nYou can [`read`](crate::Reg::read) this register and get [`carrier_cfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`carrier_cfg::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@carrier_cfg`] module"]
141pub type CARRIER_CFG = crate::Reg<carrier_cfg::CARRIER_CFG_SPEC>;
142#[doc = "Carrier enable and configuratoin"]
143pub mod carrier_cfg;
144#[doc = "FH_CFG0 (rw) register accessor: Actions on PWM0A and PWM0B trip events\n\nYou can [`read`](crate::Reg::read) this register and get [`fh_cfg0::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fh_cfg0::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@fh_cfg0`] module"]
145pub type FH_CFG0 = crate::Reg<fh_cfg0::FH_CFG0_SPEC>;
146#[doc = "Actions on PWM0A and PWM0B trip events"]
147pub mod fh_cfg0;
148#[doc = "FH_CFG1 (rw) register accessor: Software triggers for fault handler actions\n\nYou can [`read`](crate::Reg::read) this register and get [`fh_cfg1::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fh_cfg1::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@fh_cfg1`] module"]
149pub type FH_CFG1 = crate::Reg<fh_cfg1::FH_CFG1_SPEC>;
150#[doc = "Software triggers for fault handler actions"]
151pub mod fh_cfg1;
152#[doc = "FH_STATUS (r) register accessor: Status of fault events.\n\nYou can [`read`](crate::Reg::read) this register and get [`fh_status::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fh_status`] module"]
153pub type FH_STATUS = crate::Reg<fh_status::FH_STATUS_SPEC>;
154#[doc = "Status of fault events."]
155pub mod fh_status;