Skip to content

[stm32] Adapt enum.zig#945

Open
JAicewizard wants to merge 11 commits intoZigEmbeddedGroup:mainfrom
JAicewizard:adapt_common
Open

[stm32] Adapt enum.zig#945
JAicewizard wants to merge 11 commits intoZigEmbeddedGroup:mainfrom
JAicewizard:adapt_common

Conversation

@JAicewizard
Copy link
Copy Markdown

This is currently a bit messy as it includes the changes in #939, this will be fixed once that is merged.

[The commits intended to be in] this PR remove remove the constant strings for which peripherals should be included, and change how base_perihperal_index works. This last change could technically breaking, but it was extremely unreliable as it depended on the order the peripherals were specified by embassy. I do not believe any correct usage is affected.

JAicewizard and others added 11 commits April 27, 2026 16:32
They were tightly coupled together, but had different types for the same
concept. This introduced unneeded enum casts from and to int, and added
complexity.
Previously pins_v2 was only available on the F303 and L47x, and only
implemented for 7 GPIO ports on the later.

This makes the pins api available to any number of pins (soft limited to
11 due to comptime LUT size). Importer can provide the available number
of ports.

This also makes the api available for stm32f429
This makes it so that all peripherals always get added, so this should
be good for almost any chip. Only thing that needs to be done is
potentially add more indexed peripherals.

This commit also fixes the peripheral index to work on chips where the
peripherals are not coincidentally in order.
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

Successfully merging this pull request may close these issues.

1 participant