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-Examples
How I can add it to Chibios?
Chibios What version do you use?
Should apply a patch?
Thank you!
DAC driver for the STM32
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: DAC driver for the STM32
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
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
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: DAC driver for the STM32
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
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-new
Giovanni, when this is done and tested I can make a patch for inclusion.
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-new
Giovanni, when this is done and tested I can make a patch for inclusion.
Re: DAC driver for the STM32
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.
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.
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: DAC driver for the STM32
Such a function could be easily added to the API but you don't even need a driver for that 
Giovanni
Giovanni
Re: DAC driver for the STM32
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.
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: DAC driver for the STM32
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
About the DAC driver, it is not going to be integrated yet so any of the current features may change.
Giovanni