KSDK-1.1 SPI DMA

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

KSDK-1.1 SPI DMA

1,292件の閲覧回数
oaf
Contributor IV

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()

ラベル(1)
タグ(3)
0 件の賞賛
返信
5 返答(返信)

947件の閲覧回数
oaf
Contributor IV

Ok, and then I suppose I should ask the bean to NOT initialize the device?

0 件の賞賛
返信

947件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

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 :

pastedImage_1.png

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 .

pastedImage_3.png

Hope it helps

Alice

0 件の賞賛
返信

947件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Ole,

You can configuration the spi_dma  on here:

pastedImage_0.png

and the related  spi_dma function are  these :

Hope it helps

Alice

0 件の賞賛
返信

947件の閲覧回数
oaf
Contributor IV

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()?

0 件の賞賛
返信

947件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

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 :

pastedImage_0.png

Hope it helps

Alice

0 件の賞賛
返信