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

Why SWCLK and SWD register of pads_bank0 is not modeled in hardware structure? #1897

Open
oldoldman opened this issue Sep 2, 2024 · 1 comment
Assignees
Milestone

Comments

@oldoldman
Copy link

oldoldman commented Sep 2, 2024

Hi guys,
From the rp2040 datasheet(page 300), there are 2 registers named SWCLK and SWD at the offset of PADS_BANK0_BASE+0x7C and PADS_BANK0_BASE+0x80, right after the register for GPIO29. But there is no place for SWCLK and SWD in pads_bank0_hw_t. In my understanding, either the sizeof pads_bank0_hw_t.io should be 32 or there should be 2 additional fields, for example,

typedef struct {
io_rw_32 voltage_select
io_rw_32 io[30];
io_rw_32 swclk;    // 
io_rw_32 swd;      //
} pads_bank0_hw_t;

How does this happen? Many thanks!

@lurch
Copy link
Contributor

lurch commented Sep 2, 2024

Those hardware_structs are autogenerated, so pinging @matiasilva

Interestingly, the "lower level" rp2040/hardware_regs/include/hardware/regs/pads_bank0.h (which is also autogenerated) does provide definitions for SWCLK and SWD.

@kilograham kilograham added this to the 2.0.1 milestone Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants