Page 4 of 5
Re: DAC driver for the STM32
Posted: Tue Oct 08, 2013 3:24 pm
by chelox
hello!
Very good job!
I wanted to use the driver for the DAC.
I was watching the example of STM32F4-LCD-DSP is in
https://github.com/mobyfab/ChibiOS-ExamplesHow I can add it to Chibios?
Chibios What version do you use?
Should apply a patch?
Thank you!
Re: DAC driver for the STM32
Posted: Tue Oct 08, 2013 3:49 pm
by Giovanni
Hi,
I plan to integrate the driver in the 3.0 branch first, please continue working with it, when the time will come I will post here. Integration in 2.6 should be possible too.
Giovanni
Re: DAC driver for the STM32
Posted: Thu Oct 10, 2013 9:17 am
by sebx86
Can we assume DAC output buffer will always be circular ?
Re: DAC driver for the STM32
Posted: Thu Oct 10, 2013 12:30 pm
by Giovanni
sebx86 wrote:Can we assume DAC output buffer will always be circular ?
The driver specifies both a linear and circular buffer mode, implementations are expected to support both.
Giovanni
Re: DAC driver for the STM32
Posted: Thu Oct 10, 2013 12:42 pm
by sebx86
OK, I'll do this

Re: DAC driver for the STM32
Posted: Fri Nov 15, 2013 10:45 pm
by mobyfab
I updated the dac-new branch, it is now based on the current master.
It complies with your dac files definitions.
There are testhal examples for F0 and L1. I'll redo the others later.
I compiles and runs but is untested as I don't have a scope right now.
https://github.com/mobyfab/ChibiOS/tree/dac-newGiovanni, when this is done and tested I can make a patch for inclusion.
Re: DAC driver for the STM32
Posted: Sat Nov 16, 2013 5:32 am
by beaming
Great job Mobyfab!
I just compiled and ran testhal/STM32L1xx/DAC. According to digital multimeter it works, I will check it with a scope on Monday.
Giovanni, is it along ChibiOS lines to have a code which just sets a DAC output to a particular value, i.e. not a waveform? This is often handy in a slow loop applications.
Re: DAC driver for the STM32
Posted: Sat Nov 16, 2013 1:14 pm
by Giovanni
Such a function could be easily added to the API but you don't even need a driver for that

Giovanni
Re: DAC driver for the STM32
Posted: Sat Nov 16, 2013 4:22 pm
by beaming
Well, it is as trivial as to send a word to a register at least in some cases, though care should be taken to stop relevant DMA and probably free timers if they used before. But it is hardware dependent, which ruins the idea of a general API. If you specify how function call should look like, I will try to forge the function body at least for one architecture. Since, I am likely to use it for my projects, I am volunteering.
Re: DAC driver for the STM32
Posted: Sat Nov 16, 2013 4:42 pm
by Giovanni
There is no need to stop anything, design the function to be called only when a streaming operation is not in progress, see the driver state machine. You may also create a low-level only function and don't case about portability.
About the DAC driver, it is not going to be integrated yet so any of the current features may change.
Giovanni