RA4M1 , SPI with DMA

Hi,

I search a small example for SPI Master and DMA transfer.

So that I can receive e.g. 15 bytes with DMA and get a transfer end interrupt/callback when it is finished.

Thanks in advanced !

Parents Reply
  • Now I use the 4.0 and there is DMAC supported. But I don't get a SPI DMA transmission to work. here my HAL_ENTRY :

    void hal_entry(void)
    {

    unsigned char txByte[] = {0,1,2,3,4,5,6,7,8,9};
    unsigned char rxByte[] = {0,1,2,3,4,5,6,7,8,9};

    /* Initialize SPI driver */
    g_spi_master.p_api->open (&g_spi_master_ctrl, &g_spi_master_cfg);
    /* Initialize SPI TX DMAC driver */
    g_transferSPI0_tx_cfg.p_info->p_dest = (void*)&R_SPI0->SPDR ;
    g_transferSPI0_tx_cfg.p_info->p_src = (void*)&txByte ;
    g_transferSPI0_tx_cfg.p_info->length = 10;
    /* Initialize SPI RX DMAC driver */
    g_transferSPI0_rx_cfg.p_info->p_dest = (void*)&rxByte ;
    g_transferSPI0_rx_cfg.p_info->p_src = (void*)&R_SPI0->SPDR ;

    g_transferSPI0_tx.p_api->open(&g_transferSPI0_tx_ctrl , &g_transferSPI0_tx_cfg);
    g_transferSPI0_rx.p_api->open(&g_transferSPI0_rx_ctrl , &g_transferSPI0_rx_cfg);

    g_transferSPI0_tx.p_api->enable(&g_transferSPI0_tx_ctrl);
    g_transferSPI0_tx.p_api->softwareStart(&g_transferSPI0_tx_ctrl,TRANSFER_START_MODE_SINGLE);

    while(1) {

    }

    }

    and here my settings :

    I can't see a SPI transfer on the Pins on my board. How I start the transmission with DMAC for e.g. 10 bytes ?

    What is wrong or missing ?

    Thanks in advanced

Children
No Data