-
Notifications
You must be signed in to change notification settings - Fork 143
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
DAC API #113
Comments
Ever make any progress on this? I'm about to start implementing it if not. |
Ping @chris-durand 😉 |
Well starting now. I'm going to at least do the stm32. |
Hi, I'm a new modm user and I would like to try it on a project using a DAC I see some Code for the mcp4922 in the repository but no way to use it currently @W-M-D is that what you're working on? |
This issue is about the STM32 integrated DAC unfortunately. The MCP4922 was part of xpcc.io but I didn't port it to modm, due to running out of motivation and not having the hardware to test it. |
Oh, I'm sorry anyway thank you for the fast answer! I will look into it and share it if I come up with something :) |
I wrote a simple synchronous driver for the STM32 DAC. I'm using it on the STM32F413, but I haven't done any looking into how similar/dissimilar the DAC is on other parts/families. It's here: develop...mcbridejc:stm32-dac |
Great! Do you want to merge it regardless? lbuild lets you enable the driver only for the F413, so that you don't need to deepdive into other devices. But this way your work won't be lost, and other's can expand it at a later time. |
I'd be happy to! Then I can get my project off of my fork and back on the main modm repo. I'll take a pass at getting the doc comments up to par. Let me know if you have any issues with the API as is. At what point do you recommend enabling for other parts? I suspect it will work on many or even all F4s; perhaps other families. I can look over some datasheets to see if I can find any differences, but I'm not about to do an exhaustive search of all parts. Do you prefer to enable drivers only for parts that are tested to work, or if its "expected" to work everywhere do you enable for everything and risk possible exceptions being found later? The ST HAL drivers don't have any variations at least, so I expect the DAC is the same for all F4 parts anyway: https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c#L223 |
We usually enable a driver for an entire family, since they only very rarely differ. The CI may complain about missing defines sometimes, if it does not, the risk is very small.
Yeah, me too. You may also additionally check this comparison tool, which shows it's the same DAC across the entire F4: https://agg.io/u/stm32/stm32f/stm32f4/DAC_0x40007400.html |
It looks like F0, F1 (partially), F2, F3 (partially), F4, F7 share this DAC implementation. You can simply opportunistically enable it for all and then check the CI what families "survive" without any changes. Then you can decide whether to fix it, or simply disable that family, perhaps with a comment for someone else to fix later. There's nothing bad about delegating this, that was a large motivation for lbuild. |
Clean and simple, I like it! |
Maybe someone also missing that and implemented it?
@chris-durand ;-)
The text was updated successfully, but these errors were encountered: