AdaCore / Ada_Drivers_Library

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.
BSD 3-Clause "New" or "Revised" License
240 stars 141 forks source link

STM32 dma services #203

Closed Fabien-Chouteau closed 7 years ago

Fabien-Chouteau commented 7 years ago

In this PR, I provide a common scheme for DMA support in the STM32 communication drivers.

First, STM32.DMA.Interrupts factorizes the handling of interrupts for DMA transfer. It's a simple protected object, the configuration of DMA streams is the same.

I then use this in the STM32.SPI.DMA driver in a proof of concept that can be applied to I2C, UART, etc. The idea is that the configuration code is shared, only the transfers primitives differ which makes for a simple and clear implementation.

These new packages are used in OpenMV.Sensor for the DCMI transfer and OpenMV.LCD with SPI port.