first 2016/02 SDFileSystemDMA inherited from Official SDFileSystem.

Dependents:   SDFileSystemDMA-test DmdFullRGB_0_1

Fork of SDFileSystemDMA by mi mi

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers spi_dma.h Source File

spi_dma.h

00001 /*
00002 
00003 This file is licensed under Apache 2.0 license.
00004 (C) 2016 dinau
00005 
00006 */
00007 #ifndef SPI_DMA_H_INCLUDED
00008 #define SPI_DMA_H_INCLUDED
00009 
00010 #ifdef __cplusplus
00011  extern "C" {
00012 #endif
00013 
00014 #include "mbed_assert.h"
00015 #include "spi_api.h"
00016 
00017 #define DMA_SPI_READ                0
00018 #define DMA_SPI_WRITE               1
00019 void __spi_dma_read_write( SPI_TypeDef *spi, uint8_t *txbuff, uint8_t *rxbuff, uint16_t count, uint8_t mode);
00020 #define spi_dma_read(pspi,txbuff,rxbuff,count )\
00021       __spi_dma_read_write( pspi,txbuff,rxbuff,count,DMA_SPI_READ)
00022 #define spi_dma_write(pspi,txbuff,rxbuff,count )\
00023       __spi_dma_read_write( pspi,txbuff,rxbuff,count,DMA_SPI_WRITE)
00024 
00025 
00026 
00027 
00028 
00029 extern DMA_HandleTypeDef hdma_spi_tx;
00030 extern DMA_HandleTypeDef hdma_spi_rx;
00031 extern DMA_HandleTypeDef hdma_spi3_tx;
00032 extern DMA_HandleTypeDef hdma_spi3_rx;
00033 extern SPI_HandleTypeDef SpiHandle;
00034 extern SPI_HandleTypeDef Spi3Handle;
00035 
00036 
00037 void spi_dma_init( SPI_TypeDef *spi );
00038 void spi_dma_irq_setup( SPI_TypeDef *spi);
00039 void spi_dma_get_info(  SPI_TypeDef *spi );
00040 void spi_dma_handle_setup( SPI_TypeDef *spi, uint8_t mode );
00041 SPI_TypeDef *spi_get_id(PinName mosi, PinName miso, PinName sclk, PinName ssel);
00042 
00043 
00044 #ifdef __cplusplus
00045 }
00046 #endif
00047 
00048 #endif   /* SPI_DMA_H_INCLUDED */
00049