I am trying to use the PSP SPI driver in an OMAP-L138 ARM application.
The SPI interface is an SPI slave, so I want to open the channel and then wait for single bytes to be received in inetrrupt mode.
My problem is that the channel opens successfully, however the SPIFLG.TXINTFLG bit gets set, the TX interrupt continously fires and my thread blocks.
This is the initialisation code:
{
/* Initialise interface to TI PSP SPI driver */
Stream_Params streamPrms;
Spi_ChanParams chanParams;
Error_Block eb;
/* initialize the stream attributes */
Stream_Params_init(&streamPrms);
chanParams.hGpio = gpio0;
streamPrms.chanParams = (UArg) &chanParams;
/* Initialize the error block */
Error_init(&eb);
/* create SPI channel for receive */
spiHandle = Stream_create("/spi0", DriverTypes_INOUT, &streamPrms, &eb);
if (spiHandle != NULL) {
System_printf("BIOS SPI:Stream channel created\n");
}
else {
System_printf("SPI Driver Handle creation Failed\n");
}
}
I then call Stream_write with a NULL outBuffer, but the transmit interupt then constantly fires.
Any suggestions how to stop the transmit interrupt firing whilst waiting for data?