Other Parts Discussed in Thread: CC2640
I am trying to add the SPI driver to SimpleBLEPeripheral.c. I am using this driver in callback mode.
I have followed all the steps outlined in the SPICC26XXDMA.h file and in the RTOS 2.12 guide.
(TI RTOS 2.13.00.06, BLE Stack 2.1.1.44627).
I am calling the SPI init function from SimpleBLEPeripheral_init.
I am unable to see the SPI CLK on the scope. The only thing I am doing differently is selecting the
slave though an IOC function call. What might be going wrong here? The SPITransferOK variable
is taking on a value of 1 as I debug.
Thanks,
Priya
static void SPI_Callback (SPI_Handle spi, SPI_Transaction *spiTransaction)
{
// SPI_enqueueMsg();
}
static void SPI_ACAM_initialize(void)
{
IOCPortConfigureSet(Board_ACSN ,IOC_PORT_MCU_SSI0_FSS,IOC_IOMODE_NORMAL);
UInt peripheralNum = 1;
SPI_Params spiParams;
SPI_Params_init(&spiParams);
spiParams.bitRate = 1000000;
spiParams.dataSize = 8;
spiParams.frameFormat = SPI_POL0_PHA1;
spiParams.mode = SPI_MASTER;
spiParams.transferMode = SPI_MODE_CALLBACK;
spiParams.transferCallbackFxn = SPI_Callback;
spi = SPI_open(peripheralNum, &spiParams);
if (spi == NULL){
System_abort("Error opening SPI");
}
spiTransaction.count = 4;
spiTransaction.rxBuf = NULL;
spiTransaction.txBuf = spi_tx_buf;
SPITransferOK = SPI_transfer(spi, &spiTransaction);
if (!SPITransferOK){
System_abort("Error in SPI transfer or transfer is already in progress");
}
}
