AnsweredAssumed Answered

KSDK-1.1 SPI include file

Question asked by Ole Asbjorn Fadum on Jan 14, 2015
Latest reply on Jan 15, 2015 by Ole Asbjorn Fadum

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?

Outcomes