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

Handling multiple simultaneous revisions of peripheral (ADC on U5) #522

Open
klownfish opened this issue Sep 17, 2024 · 2 comments
Open

Comments

@klownfish
Copy link
Contributor

I’m having trouble implementing the ADCs for the U5 series due to it having multiple simultaneous ADC revisions. Some chips have up to three ADC instances: ADC1, ADC2, and ADC4. While ADC1 and ADC2 are identical, ADC4 is a completely different revision. I haven't seen a setup like this before so I'm unsure on how to best handle it.

The most straightforward solution in my opinion is to treat them as separate peripherals (e.g. adc12_u5.yaml and adc4_u5.yaml), but this breaks the pattern of having a generic "adc" peripheral across all chips.

An alternative would be to use a single file with separate blocks, similar to how timers are handled. However due to overlapping fields and enums everything related to ADC4 would need to be prefixed (e.g. ADC4_xxxx)

Are there any existing examples of this kind of situation, or is there a better way to approach it? Any guidance or feedback would be greatly appreciated!

Thanks!

@taylorh140
Copy link
Contributor

taylorh140 commented Sep 25, 2024

I think I'm running into this same problem trying to include the FMPI2c peripherals on the stm32f446 and a few others:

  • the other I2C's on the device are "I2c_v1" type
  • But the FMPI2C is "I2c_v2" type

and i get a fun error:

image

Let me know though and ill start a separate issue.

@klownfish
Copy link
Contributor Author

Yeah this seems to be the same core problem that I ran into. There's also this issue that's similar I realized just now
#509

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

2 participants