Commit Graph

5 Commits

Author SHA1 Message Date
Nico Tonnhofer 9033d86877 fast integer: uint_fast8_t and uint_fast16_t for some vars.
This will decrease the flash size and should increase performance.
In some cases this will increase the used ram slightly.

In total this path costs 28 bytes RAM and saves 88 bytes of Flash on a STM32.
AVRs are not affected by this commit.
2017-03-05 15:00:13 +01:00
Nico Tonnhofer dea9cec217 STM32F411: uff... ADC works. Really? Really!
Was a little bit tricky. When using ADC with DMA and infitiy readings, everthing is ok. But we don't need so much readings.
To read only one shot after starting the ADC, we need something more.
Disabling continuous conversion and unset the DMA bit. So conversion is stopped. Else the next conversion could start at any ADC.
For a restart just enable again the DMA bit, the continuous conversion and start the ADC.
2017-03-03 18:54:57 +01:00
Nico Tonnhofer 767c4a6911 STM32F411: simplify analog readings
We don't need an interrupt for the DMA.
Simply clear and set the DMA-bit for the ADC is sufficient.
2017-03-03 18:54:57 +01:00
Nico Tonnhofer efd8279c1a STM32F411: implement DMA for ADC
Eureka!!!
The STM32 has only one data register for all channels. So I want to use the ADC over DMA.
Issues are: It is not possible to stop the DMA or the ADC without uninit and init the hole parts.
We have more or less one option. Manually start the ADC.
So what we have now. We start the ADC after reading the values from DMA buffer. The ADC now make a conversion of all channels.
We can read also the values because it uses a double buffer mode. With that mode we can read the unused buffer.
2017-03-03 18:54:57 +01:00
Nico Tonnhofer 4cb6f85e3c STM32F411: implement analog-stm32.c
It's not that easy like LPC. We need later an DMA to control all ADCs, because there is only one register to read the ADC.
2017-03-03 18:54:57 +01:00