Ignore:
Timestamp:
Dec 5, 2013, 4:40:04 PM (10 years ago)
Author:
bouyer
Message:

Use the SPI controller's DMA if the defs_platform.h defines
IOC_USE_DMA.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/include/spi.h

    r398 r590  
    3636     */
    3737    unsigned int ss;
     38    unsigned int dma_base;
     39    unsigned int dma_baseh;
     40    unsigned int dma_count;
    3841};
    3942
     
    130133#define SPI_CTRL_RXN_EN        ( 1 << 9  ) /**< MISO is latched on neg edge   */
    131134#define SPI_CTRL_GO_BSY        ( 1 << 8  ) /**< Start the transfer            */
     135#define SPI_CTRL_DMA_BSY        (1 << 16)  /***   DMA in progress             */
    132136#define SPI_CTRL_CHAR_LEN_MASK (  0xFF   ) /**< Bits transmited in 1 transfer */
    133137#define SPI_RXTX_MASK          (  0xFF   ) /**< Mask for the an RX/TX value   */
     138
     139#define SPI_DMA_COUNT_READ      (1 << 0) /* operation is a read (else write) */
    134140
    135141/**
     
    140146 * \brief  Check the GO_BUSY bit of the SPI Controller
    141147 */
    142 #define SPI_IS_BUSY(x)         ((ioread32(&x->ctrl) & SPI_CTRL_GO_BSY) != 0) ? 1 : 0
     148#define SPI_IS_BUSY(x)         ((ioread32(&x->ctrl) & (SPI_CTRL_GO_BSY|SPI_CTRL_DMA_BSY)) != 0) ? 1 : 0
    143149
    144150#endif
Note: See TracChangeset for help on using the changeset viewer.