Skip to content

Commit

Permalink
LP_APM
Browse files Browse the repository at this point in the history
  • Loading branch information
burrbull authored and JurajSadel committed Apr 30, 2024
1 parent a8d8acb commit 7005a41
Show file tree
Hide file tree
Showing 118 changed files with 2,793 additions and 6,313 deletions.
1 change: 1 addition & 0 deletions common_patches/hp_apm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _cluster:
R?_PMS_W: {}
R?_PMS_R: {}
M%s:
dimIncrement: 16
M?_STATUS:
name: STATUS
_strip: M0_
Expand Down
222 changes: 28 additions & 194 deletions esp32c6-lp/src/lp_apm.rs

Large diffs are not rendered by default.

53 changes: 37 additions & 16 deletions esp32c6-lp/src/lp_apm/func_ctrl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,35 @@
pub type R = crate::R<FUNC_CTRL_SPEC>;
#[doc = "Register `FUNC_CTRL` writer"]
pub type W = crate::W<FUNC_CTRL_SPEC>;
#[doc = "Field `M0_PMS_FUNC_EN` reader - PMS M0 function enable"]
pub type M0_PMS_FUNC_EN_R = crate::BitReader;
#[doc = "Field `M0_PMS_FUNC_EN` writer - PMS M0 function enable"]
pub type M0_PMS_FUNC_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `M1_PMS_FUNC_EN` reader - PMS M1 function enable"]
pub type M1_PMS_FUNC_EN_R = crate::BitReader;
#[doc = "Field `M1_PMS_FUNC_EN` writer - PMS M1 function enable"]
pub type M1_PMS_FUNC_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `M_PMS_FUNC_EN(0-1)` reader - PMS M%s function enable"]
pub type M_PMS_FUNC_EN_R = crate::BitReader;
#[doc = "Field `M_PMS_FUNC_EN(0-1)` writer - PMS M%s function enable"]
pub type M_PMS_FUNC_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[doc = "PMS M(0-1) function enable"]
#[doc = ""]
#[doc = "NOTE: `n` is number of field in register. `n == 0` corresponds to `M0_PMS_FUNC_EN` field"]
#[inline(always)]
pub fn m_pms_func_en(&self, n: u8) -> M_PMS_FUNC_EN_R {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
M_PMS_FUNC_EN_R::new(((self.bits >> n) & 1) != 0)
}
#[doc = "Iterator for array of:"]
#[doc = "PMS M(0-1) function enable"]
#[inline(always)]
pub fn m_pms_func_en_iter(&self) -> impl Iterator<Item = M_PMS_FUNC_EN_R> + '_ {
(0..2).map(move |n| M_PMS_FUNC_EN_R::new(((self.bits >> n) & 1) != 0))
}
#[doc = "Bit 0 - PMS M0 function enable"]
#[inline(always)]
pub fn m0_pms_func_en(&self) -> M0_PMS_FUNC_EN_R {
M0_PMS_FUNC_EN_R::new((self.bits & 1) != 0)
pub fn m0_pms_func_en(&self) -> M_PMS_FUNC_EN_R {
M_PMS_FUNC_EN_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - PMS M1 function enable"]
#[inline(always)]
pub fn m1_pms_func_en(&self) -> M1_PMS_FUNC_EN_R {
M1_PMS_FUNC_EN_R::new(((self.bits >> 1) & 1) != 0)
pub fn m1_pms_func_en(&self) -> M_PMS_FUNC_EN_R {
M_PMS_FUNC_EN_R::new(((self.bits >> 1) & 1) != 0)
}
}
#[cfg(feature = "impl-register-debug")]
Expand All @@ -44,17 +55,27 @@ impl core::fmt::Debug for crate::generic::Reg<FUNC_CTRL_SPEC> {
}
}
impl W {
#[doc = "PMS M(0-1) function enable"]
#[doc = ""]
#[doc = "NOTE: `n` is number of field in register. `n == 0` corresponds to `M0_PMS_FUNC_EN` field"]
#[inline(always)]
#[must_use]
pub fn m_pms_func_en(&mut self, n: u8) -> M_PMS_FUNC_EN_W<FUNC_CTRL_SPEC> {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
M_PMS_FUNC_EN_W::new(self, n)
}
#[doc = "Bit 0 - PMS M0 function enable"]
#[inline(always)]
#[must_use]
pub fn m0_pms_func_en(&mut self) -> M0_PMS_FUNC_EN_W<FUNC_CTRL_SPEC> {
M0_PMS_FUNC_EN_W::new(self, 0)
pub fn m0_pms_func_en(&mut self) -> M_PMS_FUNC_EN_W<FUNC_CTRL_SPEC> {
M_PMS_FUNC_EN_W::new(self, 0)
}
#[doc = "Bit 1 - PMS M1 function enable"]
#[inline(always)]
#[must_use]
pub fn m1_pms_func_en(&mut self) -> M1_PMS_FUNC_EN_W<FUNC_CTRL_SPEC> {
M1_PMS_FUNC_EN_W::new(self, 1)
pub fn m1_pms_func_en(&mut self) -> M_PMS_FUNC_EN_W<FUNC_CTRL_SPEC> {
M_PMS_FUNC_EN_W::new(self, 1)
}
}
#[doc = "PMS function control register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`func_ctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`func_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
Expand Down
63 changes: 39 additions & 24 deletions esp32c6-lp/src/lp_apm/int_en.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,43 @@
pub type R = crate::R<INT_EN_SPEC>;
#[doc = "Register `INT_EN` writer"]
pub type W = crate::W<INT_EN_SPEC>;
#[doc = "Field `M0_APM_INT_EN` reader - APM M0 interrupt enable"]
pub type M0_APM_INT_EN_R = crate::BitReader;
#[doc = "Field `M0_APM_INT_EN` writer - APM M0 interrupt enable"]
pub type M0_APM_INT_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `M1_APM_INT_EN` reader - APM M1 interrupt enable"]
pub type M1_APM_INT_EN_R = crate::BitReader;
#[doc = "Field `M1_APM_INT_EN` writer - APM M1 interrupt enable"]
pub type M1_APM_INT_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `M_APM(0-1)` reader - APM M%s interrupt enable"]
pub type M_APM_R = crate::BitReader;
#[doc = "Field `M_APM(0-1)` writer - APM M%s interrupt enable"]
pub type M_APM_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[doc = "APM M(0-1) interrupt enable"]
#[doc = ""]
#[doc = "NOTE: `n` is number of field in register. `n == 0` corresponds to `M0_APM` field"]
#[inline(always)]
pub fn m_apm(&self, n: u8) -> M_APM_R {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
M_APM_R::new(((self.bits >> n) & 1) != 0)
}
#[doc = "Iterator for array of:"]
#[doc = "APM M(0-1) interrupt enable"]
#[inline(always)]
pub fn m_apm_iter(&self) -> impl Iterator<Item = M_APM_R> + '_ {
(0..2).map(move |n| M_APM_R::new(((self.bits >> n) & 1) != 0))
}
#[doc = "Bit 0 - APM M0 interrupt enable"]
#[inline(always)]
pub fn m0_apm_int_en(&self) -> M0_APM_INT_EN_R {
M0_APM_INT_EN_R::new((self.bits & 1) != 0)
pub fn m0_apm(&self) -> M_APM_R {
M_APM_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - APM M1 interrupt enable"]
#[inline(always)]
pub fn m1_apm_int_en(&self) -> M1_APM_INT_EN_R {
M1_APM_INT_EN_R::new(((self.bits >> 1) & 1) != 0)
pub fn m1_apm(&self) -> M_APM_R {
M_APM_R::new(((self.bits >> 1) & 1) != 0)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("INT_EN")
.field(
"m0_apm_int_en",
&format_args!("{}", self.m0_apm_int_en().bit()),
)
.field(
"m1_apm_int_en",
&format_args!("{}", self.m1_apm_int_en().bit()),
)
.field("m0_apm", &format_args!("{}", self.m0_apm().bit()))
.field("m1_apm", &format_args!("{}", self.m1_apm().bit()))
.finish()
}
}
Expand All @@ -44,17 +49,27 @@ impl core::fmt::Debug for crate::generic::Reg<INT_EN_SPEC> {
}
}
impl W {
#[doc = "APM M(0-1) interrupt enable"]
#[doc = ""]
#[doc = "NOTE: `n` is number of field in register. `n == 0` corresponds to `M0_APM` field"]
#[inline(always)]
#[must_use]
pub fn m_apm(&mut self, n: u8) -> M_APM_W<INT_EN_SPEC> {
#[allow(clippy::no_effect)]
[(); 2][n as usize];
M_APM_W::new(self, n)
}
#[doc = "Bit 0 - APM M0 interrupt enable"]
#[inline(always)]
#[must_use]
pub fn m0_apm_int_en(&mut self) -> M0_APM_INT_EN_W<INT_EN_SPEC> {
M0_APM_INT_EN_W::new(self, 0)
pub fn m0_apm(&mut self) -> M_APM_W<INT_EN_SPEC> {
M_APM_W::new(self, 0)
}
#[doc = "Bit 1 - APM M1 interrupt enable"]
#[inline(always)]
#[must_use]
pub fn m1_apm_int_en(&mut self) -> M1_APM_INT_EN_W<INT_EN_SPEC> {
M1_APM_INT_EN_W::new(self, 1)
pub fn m1_apm(&mut self) -> M_APM_W<INT_EN_SPEC> {
M_APM_W::new(self, 1)
}
}
#[doc = "APM interrupt enable register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`int_en::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`int_en::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
Expand Down
47 changes: 47 additions & 0 deletions esp32c6-lp/src/lp_apm/m.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#[repr(C)]
#[cfg_attr(feature = "impl-register-debug", derive(Debug))]
#[doc = "Cluster M%s, containing M?_STATUS, M?_STATUS_CLR, M?_EXCEPTION_INFO0, M?_EXCEPTION_INFO1"]
pub struct M {
status: STATUS,
status_clr: STATUS_CLR,
exception_info0: EXCEPTION_INFO0,
exception_info1: EXCEPTION_INFO1,
}
impl M {
#[doc = "0x00 - M0 status register"]
#[inline(always)]
pub const fn status(&self) -> &STATUS {
&self.status
}
#[doc = "0x04 - M0 status clear register"]
#[inline(always)]
pub const fn status_clr(&self) -> &STATUS_CLR {
&self.status_clr
}
#[doc = "0x08 - M0 exception_info0 register"]
#[inline(always)]
pub const fn exception_info0(&self) -> &EXCEPTION_INFO0 {
&self.exception_info0
}
#[doc = "0x0c - M0 exception_info1 register"]
#[inline(always)]
pub const fn exception_info1(&self) -> &EXCEPTION_INFO1 {
&self.exception_info1
}
}
#[doc = "STATUS (r) register accessor: M0 status register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`status::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@status`] module"]
pub type STATUS = crate::Reg<status::STATUS_SPEC>;
#[doc = "M0 status register"]
pub mod status;
#[doc = "STATUS_CLR (w) register accessor: M0 status clear register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`status_clr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@status_clr`] module"]
pub type STATUS_CLR = crate::Reg<status_clr::STATUS_CLR_SPEC>;
#[doc = "M0 status clear register"]
pub mod status_clr;
#[doc = "EXCEPTION_INFO0 (r) register accessor: M0 exception_info0 register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exception_info0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@exception_info0`] module"]
pub type EXCEPTION_INFO0 = crate::Reg<exception_info0::EXCEPTION_INFO0_SPEC>;
#[doc = "M0 exception_info0 register"]
pub mod exception_info0;
#[doc = "EXCEPTION_INFO1 (r) register accessor: M0 exception_info1 register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exception_info1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@exception_info1`] module"]
pub type EXCEPTION_INFO1 = crate::Reg<exception_info1::EXCEPTION_INFO1_SPEC>;
#[doc = "M0 exception_info1 register"]
pub mod exception_info1;
61 changes: 61 additions & 0 deletions esp32c6-lp/src/lp_apm/m/exception_info0.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#[doc = "Register `EXCEPTION_INFO0` reader"]
pub type R = crate::R<EXCEPTION_INFO0_SPEC>;
#[doc = "Field `EXCEPTION_REGION` reader - Exception region"]
pub type EXCEPTION_REGION_R = crate::FieldReader;
#[doc = "Field `EXCEPTION_MODE` reader - Exception mode"]
pub type EXCEPTION_MODE_R = crate::FieldReader;
#[doc = "Field `EXCEPTION_ID` reader - Exception id information"]
pub type EXCEPTION_ID_R = crate::FieldReader;
impl R {
#[doc = "Bits 0:3 - Exception region"]
#[inline(always)]
pub fn exception_region(&self) -> EXCEPTION_REGION_R {
EXCEPTION_REGION_R::new((self.bits & 0x0f) as u8)
}
#[doc = "Bits 16:17 - Exception mode"]
#[inline(always)]
pub fn exception_mode(&self) -> EXCEPTION_MODE_R {
EXCEPTION_MODE_R::new(((self.bits >> 16) & 3) as u8)
}
#[doc = "Bits 18:22 - Exception id information"]
#[inline(always)]
pub fn exception_id(&self) -> EXCEPTION_ID_R {
EXCEPTION_ID_R::new(((self.bits >> 18) & 0x1f) as u8)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EXCEPTION_INFO0")
.field(
"exception_region",
&format_args!("{}", self.exception_region().bits()),
)
.field(
"exception_mode",
&format_args!("{}", self.exception_mode().bits()),
)
.field(
"exception_id",
&format_args!("{}", self.exception_id().bits()),
)
.finish()
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for crate::generic::Reg<EXCEPTION_INFO0_SPEC> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(&self.read(), f)
}
}
#[doc = "M0 exception_info0 register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exception_info0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct EXCEPTION_INFO0_SPEC;
impl crate::RegisterSpec for EXCEPTION_INFO0_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [`exception_info0::R`](R) reader structure"]
impl crate::Readable for EXCEPTION_INFO0_SPEC {}
#[doc = "`reset()` method sets EXCEPTION_INFO0 to value 0"]
impl crate::Resettable for EXCEPTION_INFO0_SPEC {
const RESET_VALUE: u32 = 0;
}
39 changes: 39 additions & 0 deletions esp32c6-lp/src/lp_apm/m/exception_info1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#[doc = "Register `EXCEPTION_INFO1` reader"]
pub type R = crate::R<EXCEPTION_INFO1_SPEC>;
#[doc = "Field `EXCEPTION_ADDR` reader - Exception addr"]
pub type EXCEPTION_ADDR_R = crate::FieldReader<u32>;
impl R {
#[doc = "Bits 0:31 - Exception addr"]
#[inline(always)]
pub fn exception_addr(&self) -> EXCEPTION_ADDR_R {
EXCEPTION_ADDR_R::new(self.bits)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EXCEPTION_INFO1")
.field(
"exception_addr",
&format_args!("{}", self.exception_addr().bits()),
)
.finish()
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for crate::generic::Reg<EXCEPTION_INFO1_SPEC> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(&self.read(), f)
}
}
#[doc = "M0 exception_info1 register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exception_info1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct EXCEPTION_INFO1_SPEC;
impl crate::RegisterSpec for EXCEPTION_INFO1_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [`exception_info1::R`](R) reader structure"]
impl crate::Readable for EXCEPTION_INFO1_SPEC {}
#[doc = "`reset()` method sets EXCEPTION_INFO1 to value 0"]
impl crate::Resettable for EXCEPTION_INFO1_SPEC {
const RESET_VALUE: u32 = 0;
}
39 changes: 39 additions & 0 deletions esp32c6-lp/src/lp_apm/m/status.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#[doc = "Register `STATUS` reader"]
pub type R = crate::R<STATUS_SPEC>;
#[doc = "Field `EXCEPTION_STATUS` reader - Exception status"]
pub type EXCEPTION_STATUS_R = crate::FieldReader;
impl R {
#[doc = "Bits 0:1 - Exception status"]
#[inline(always)]
pub fn exception_status(&self) -> EXCEPTION_STATUS_R {
EXCEPTION_STATUS_R::new((self.bits & 3) as u8)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("STATUS")
.field(
"exception_status",
&format_args!("{}", self.exception_status().bits()),
)
.finish()
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for crate::generic::Reg<STATUS_SPEC> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
core::fmt::Debug::fmt(&self.read(), f)
}
}
#[doc = "M0 status register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct STATUS_SPEC;
impl crate::RegisterSpec for STATUS_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [`status::R`](R) reader structure"]
impl crate::Readable for STATUS_SPEC {}
#[doc = "`reset()` method sets STATUS to value 0"]
impl crate::Resettable for STATUS_SPEC {
const RESET_VALUE: u32 = 0;
}
Loading

0 comments on commit 7005a41

Please sign in to comment.