Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defined reserved RMT_SYS_CONF_REG register bits of ESP32-H2 #278

Closed
Tnze opened this issue Sep 9, 2024 · 0 comments · Fixed by #285
Closed

Defined reserved RMT_SYS_CONF_REG register bits of ESP32-H2 #278

Tnze opened this issue Sep 9, 2024 · 0 comments · Fixed by #285
Assignees
Labels
fields Something is wrong with one or more fields

Comments

@Tnze
Copy link

Tnze commented Sep 9, 2024

According to the TRM:

Only 5 bits of RMT_SYS_CONF_REG defined.

  • RMT_APB_FIFO_MASK
  • RMT_MEM_CLK_FORCE_ON
  • RMT_MEM_FORCE_PD
  • RMT_MEM_FORCE_PU
  • RMT_CLK_EN

image

But lots of reserved bits in the pacs:

impl W {
#[doc = "Bit 0 - 1'h1: access memory directly. 1'h0: access memory by FIFO."]
#[inline(always)]
#[must_use]
pub fn apb_fifo_mask(&mut self) -> APB_FIFO_MASK_W<SYS_CONF_SPEC> {
APB_FIFO_MASK_W::new(self, 0)
}
#[doc = "Bit 1 - Set this bit to enable the clock for RMT memory."]
#[inline(always)]
#[must_use]
pub fn mem_clk_force_on(&mut self) -> MEM_CLK_FORCE_ON_W<SYS_CONF_SPEC> {
MEM_CLK_FORCE_ON_W::new(self, 1)
}
#[doc = "Bit 2 - Set this bit to power down RMT memory."]
#[inline(always)]
#[must_use]
pub fn mem_force_pd(&mut self) -> MEM_FORCE_PD_W<SYS_CONF_SPEC> {
MEM_FORCE_PD_W::new(self, 2)
}
#[doc = "Bit 3 - 1: Disable RMT memory light sleep power down function. 0: Power down RMT memory when RMT is in light sleep mode."]
#[inline(always)]
#[must_use]
pub fn mem_force_pu(&mut self) -> MEM_FORCE_PU_W<SYS_CONF_SPEC> {
MEM_FORCE_PU_W::new(self, 3)
}
#[doc = "Bits 4:11 - the integral part of the fractional divisor"]
#[inline(always)]
#[must_use]
pub fn sclk_div_num(&mut self) -> SCLK_DIV_NUM_W<SYS_CONF_SPEC> {
SCLK_DIV_NUM_W::new(self, 4)
}
#[doc = "Bits 12:17 - the numerator of the fractional part of the fractional divisor"]
#[inline(always)]
#[must_use]
pub fn sclk_div_a(&mut self) -> SCLK_DIV_A_W<SYS_CONF_SPEC> {
SCLK_DIV_A_W::new(self, 12)
}
#[doc = "Bits 18:23 - the denominator of the fractional part of the fractional divisor"]
#[inline(always)]
#[must_use]
pub fn sclk_div_b(&mut self) -> SCLK_DIV_B_W<SYS_CONF_SPEC> {
SCLK_DIV_B_W::new(self, 18)
}
#[doc = "Bits 24:25 - choose the clock source of rmt_sclk. 1:CLK_80Mhz,2:CLK_FOSC, 3:XTAL"]
#[inline(always)]
#[must_use]
pub fn sclk_sel(&mut self) -> SCLK_SEL_W<SYS_CONF_SPEC> {
SCLK_SEL_W::new(self, 24)
}
#[doc = "Bit 26 - rmt_sclk switch"]
#[inline(always)]
#[must_use]
pub fn sclk_active(&mut self) -> SCLK_ACTIVE_W<SYS_CONF_SPEC> {
SCLK_ACTIVE_W::new(self, 26)
}
#[doc = "Bit 31 - RMT register clock gate enable signal. 1: Power up the drive clock of registers. 0: Power down the drive clock of registers"]
#[inline(always)]
#[must_use]
pub fn clk_en(&mut self) -> CLK_EN_W<SYS_CONF_SPEC> {
CLK_EN_W::new(self, 31)
}
}

Which cause the esp-hal incorrectly writes them but not discovered at compile-time.

@github-project-automation github-project-automation bot moved this to Todo in esp-rs Sep 9, 2024
@Tnze Tnze changed the title Defined reserved RMT_SYS_CONF_REG register bits of ESP32-H2 Defined reserved RMT_SYS_CONF_REG register bits of ESP32-H2 Sep 9, 2024
@jessebraham jessebraham added the fields Something is wrong with one or more fields label Sep 9, 2024
@jessebraham jessebraham self-assigned this Sep 10, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fields Something is wrong with one or more fields
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants