KSDK-1.1 SPI include file

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

KSDK-1.1 SPI include file

跳至解决方案
1,102 次查看
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 解答
872 次查看
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 回复数
873 次查看
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 项奖励
回复
872 次查看
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 项奖励
回复