KSDK-1.1 SPI include file

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

KSDK-1.1 SPI include file

ソリューションへジャンプ
893件の閲覧回数
oaf
Contributor IV

I'm using KDS-2.0.0 and KSDK-1.1.0.

In my project I use a SPI device, but the PEx generated .h file doesn't contain a full definition of what is needed

 

This is how I do it:

 

#include "spiCom0.h"

 

static int HW_SPI0TxHelper(uint8_t *txBuff, size_t length)

{

    spi_status_t stat = kStatus_SPI_Busy;

    int err = 1;

 

 

    if(SPI_DRV_MasterTransfer(FSL_SPICOM0, NULL, txBuff, NULL, length) == kStatus_Success)

    {

        uint32_t txCnt = 0;

 

        while(stat != kStatus_Success)

        {

            stat = SPI_DRV_MasterGetTransferStatus(FSL_SPICOM0, &txCnt);

        }

 

        if(stat == kStatus_Success)

            err = 0;

    }

 

 

    return err;

}

 

When compiling this sw I got the following error messages:

 

..\..\Project\Infrastructure\HW.c:99:2: error: unknown type name 'spi_status_t'

  spi_status_t stat = kStatus_SPI_Busy;

  ^

..\..\Project\Infrastructure\HW.c:99:22: error: 'kStatus_SPI_Busy' undeclared (first use in this function)

  spi_status_t stat = kStatus_SPI_Busy;

                      ^

 

I thought that the SPI .h file should contain the definition for all that is needed to use the SPI interface?

What is the intended use here (from the design point of view)?

Is this an error, or have I complete misunderstood?

ラベル(1)
タグ(3)
0 件の賞賛
返信
1 解決策
663件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Ole,

You can find the SPI interface function under the SPI component , and in the file of "fsl_dspi_master_driver.h" / "fsl_dspi_slave_driver.h" and so on .

Please see the screenshot below :

pastedImage_0.png

Hope it helps

Alice

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
664件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Ole,

You can find the SPI interface function under the SPI component , and in the file of "fsl_dspi_master_driver.h" / "fsl_dspi_slave_driver.h" and so on .

Please see the screenshot below :

pastedImage_0.png

Hope it helps

Alice

0 件の賞賛
返信
663件の閲覧回数
oaf
Contributor IV

Well you put me on the track, there is a very significant 'd' which does all the difference.

I have included the fsl_spi_master_driver.h where the correct is fsl_dspi_master_driver.h(!)

If I may suggest a change it will be that the API documentation tells which file to include...

0 件の賞賛
返信