I'm using KDS-2.0.0 and KSDK-1.1.0.
When adding a spi (fsl_dspi) device to my project I could set IRQ priorities and vector, but how do I enable DMA?
I see there is two different initialization functions:
1. DSPI_DRV_MasterInit
2. DSPI_DRV_EdmaMasterInit
I have not found out how to make PEx to use the DMA type. In Cpu.c the DSPI_DRV_MasterInit() is called.
Should I in my own code:
1. DSPI_DRV_MasterDeinit()
DSPI_DRV_EdmaMasterInit()
2. Just call DSPI_DRV_EdmaMasterInit()
Ok, and then I suppose I should ask the bean to NOT initialize the device?
Hi Ole,
There are two ways.
1) select "Auto initialization" , then writhe the initialize function of EDMA_SPI to the main function.
2) Do not initialization the device , you can checked the " Components_Init()" function like this :
So , you need write initialize code refer to your need to the main function.
In a word, check the driver function "Description", then select you need .
Hope it helps
Alice
Hi Ole,
You can configuration the spi_dma on here:
and the related spi_dma function are these :
Hope it helps
Alice
Well maybe I was a bit unclear, the PEx setup is OK but
When using IRQ:
DSPI_DRV_MasterInit() should be used
When using DMA:
DSPI_DRV_Edma_MasterInit() should be used
When I open the generated source file Cpu.c it calls the DSPI_DRV_MasterInit(),
so my question is how should I make Cpu.c to call DSPI_DRV_Edma_MasterInit()?
Hello Ole,
In generate code , the function "DSPI_DRV_EdmaMasterInit" can not auto show on cpu.c file.
You can directly drag it to the place you want , like this :
Hope it helps
Alice