aboutsummaryrefslogtreecommitdiff
path: root/stmhal/dma.c
AgeCommit message (Collapse)Author
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-03stmhal: Clean up some header includes.Damien George
2017-03-30stmhal/dma: Don't include SDMMC2 struct if SDMMC2 is not available.Damien George
Not all F7 MCUs have SDMMC2.
2017-03-30stmhal/sdcard: Add support for SDMMC2 on F7 MCUs.Damien George
By default the SDIO (F4) or SDMMC1 (L4, F7) is used as the SD card peripheral, but if a board config defines MICROPY_HW_SDMMC2_CK and other pins then the SD card driver will use SDMMC2.
2017-03-28stmhal/dma: Fix reinitialisation of DMA on F7 MCUs, following F4.Damien George
2016-11-25stmhal/i2c: Add support for I2C4 hardware block on F7 MCUs.Damien George
2016-11-16stmhal/dma: mark DMA sate as READY even if HAL_DMA_Init is skippedKrzysztof Blazewicz
Current version of HAL drivers checks if `hdma->State == HAL_DMA_STATE_READY` before executing some functions.
2016-11-16stmhal/dma: precalculate register base and bitshift on handle initKrzysztof Blazewicz
Current version of HAL drivers optimize IRQ handler by using precalculated DMA register address and stream bitshift instead of calculating it on every interrupt. Since we skip call to `HAL_DMA_Init` on reused DMA, fields StreamBaseAddress and StreamIndex of DMA handle are not initialized and thus leads to SegFault in `DMA_IRQHandler`. HAL_DMA_Init is a big routine and we do not need to call it on each use of DMA (ex.: series of I2C operations) and DMA_CalcBaseAndBitshift is really small and releasing it increases code size by only 8 bytes.
2016-11-11stmhal/dma: De-init the DMA peripheral properly before initialising.Damien George
The DMA state is always HAL_DMA_STATE_RESET because of the memset clearing all the data, so prior to this patch HAL_DMA_DeInit was never called. Now it is always called to make sure the DMA is properly reset.
2016-06-29stmhal: Correct DMA to allow SD card on L4 MCUs.dpslwk
2016-05-06stmhal/dma: Fix builds for boards with an F4 or F7 but no DAC.Dave Hylands
2016-05-05stmhal/dma: Make DAC DMA descriptors conditional on having a DAC.Damien George
2016-05-05stmhal: L4: Adapt DMA to be able to support STM32L4 MCU series.Tobias Badertscher
The main thing is to change the DMA code in a way that the structure DMA_Stream_TypeDef (which is similar to DMA_Channel_TypeDef on stm32l4) is no longer used outside of dma.c, as this structure only exists for the F4 series. Therefore I introduced a new structure (dma_descr_t) which handles all DMA specific stuff for configuration. Further the periphery (spi, i2c, sdcard, dac) does not need to know the internals of the dma.
2015-12-22stmhal: Add pyb.irq_stats() to get statistics about IRQ calls.Damien George
Adds a lot of code, makes IRQs a bit less efficient, but is very useful for debugging. Usage: pyb.irq_stats() returns a memory view that can be read and written, eg: list(pyb.irq_stats()) pyb.irq_stats()[0] pyb.irq_stats()[0] = 0 The patch provides general IRQ_ENTER() and IRQ_EXIT() macros that can be modified to provide further IRQ statistics if desired.
2015-11-24stmhal: On SysTick IRQ, only process one DMA channel at a time.Damien George
This can be generalised if/when more processing is needed by SysTick. Thanks to @chuckbook for the idea.
2015-11-24stmhal: Small simplification of code to tickle DMA idle counter.Damien George
2015-11-24stmhal: Turn off DMA clocks when idle for 100 msecDave Hylands
Turning on each DMA block increases the current consumption by about 8 mA. This code adds an idle timer for each DMA block and turns off the clocks when no streams are in use for 128 msec. Having a small timeout allows for improved performance when back-to-back transfers are being performed. The 128 msec is basically a guess.
2015-11-01stmhal: Add symbolic #defines for interrupt levels in irq.h.Dave Curtis
2015-07-30stmhal: Replace #include "stm32f4xx_hal.h" with #include STM32_HAL_H.Dave Hylands
2015-06-24stmhal/dma.c: Modify dma_init() to accept init struct as an argumentblmorris
This removes hard-coded DMA init params from dma_init(), instead defining these parameters in a DMA_InitTypeDef struct that gets passed as an argument to dma_init() This makes dma_init more generic so it can be used for I2S and SD Card, which require different initialization parameters.
2015-06-10stmhal: Factor out DMA initialisation code from spi.c.Damien George
This is so that the DMA can be shared by multiple peripherals.