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?
Solved! Go to Solution.
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 :
Hope it helps
Alice
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 :
Hope it helps
Alice
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...