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

[beken-72xx] Improve ddev ADC support #220

Merged
merged 2 commits into from
Jan 6, 2024

Conversation

szupi-ipuzs
Copy link
Contributor

One of the users reported issue esphome/issues#5201 with ADC on BK7231N, so I took a look at the code and found something that could be related. I don't own any N device with ADC, so cannot really test this. But I have checked my T devices with this fix and the ADC still works there.

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 8, 2023

The whole "ddev" layer adds so much boilerplate and lowers performance... too bad most functions handling the "requests" are static. I wish we could just #define static ; or something haha

@kuba2k2 kuba2k2 added bug Something isn't working BK7231 Beken BK72xx family labels Dec 8, 2023
@szupi-ipuzs
Copy link
Contributor Author

I wish we could just #define static ; or something haha

That would be really confusing :)
But I don't understand the problem - why can't we ditch these functions and create a nice wrapper that would operate on registers directly? Is it simply too much work or is there something missing?

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 8, 2023

Of course we can. This is just too much work for a single person :)

Ultimately (in distant future) I would like to have LibreTiny C APIs (not Arduino APIs) around all peripherals that are now Arduino-only, such as GPIO, ADC, PWM, I2C, SPI, Wi-Fi.

The existing Arduino implementations would then be moved to "components" (similar to those in esp-idf, structured like the lt_*.c files now) in the C API. The Arduino APIs would only be a thin wrapper around the C API.

Those "components" would then use plain register access, slowly getting rid of parts of the vendor SDKs. But those are dreams only 😄

@szupi-ipuzs
Copy link
Contributor Author

Too much work for a single person who does it in their free time and not for money. That's true.
But it's good you have dreams, because it means the software you create is (or will be) well-thought and structured, unlike some others I have seen.
Let's just hope tuya doesn't soon switch their products to yet another chip family - with yet uglier sdks :)

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 8, 2023

Too much work for a single person who does it in their free time and not for money.

Yup, that's me 😄

We still have a few more chip families to add...

@kuba2k2 kuba2k2 changed the title Various fixes for ADC [beken-72xx] Improve ddev ADC support Jan 3, 2024
@kuba2k2 kuba2k2 merged commit 1e3a82f into libretiny-eu:master Jan 6, 2024
2 checks passed
@szupi-ipuzs szupi-ipuzs deleted the adc_fix branch January 6, 2024 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BK7231 Beken BK72xx family bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants