Hi there,
i have the CC2650 Launchpad and i was able to get the HeartRate Project to work on ccs.
I am able too see with my iphone the simulated date from the Launchpad to the Sensortag App.
So i have this project running fine.
Now i want to enable SPI to communicate with another IC. The problem is that i couldnt fine any example on Resource Explorer for it.
I have linked the spi driverlib into a folder and i have two files: SPICC26XXDMA.h and SPICC26XXDMA.c
I tryied to run this example code given in the header and i made a new C and H file in the Application folder and added it there. I did also include the header files for the driver
// The SPI header file should be included in an application as follows:
#include <ti/drivers/SPI.h>
#include <ti/drivers/spi/SPICC2650DMA.h>
#include <ti/drivers/dma/UDMACC26XX.h>
// From board.c
PIN_Config BoardGpioInitTable[] = {
Board_CSN_0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, // Ensure SPI slave 0 is not selected
Board_CSN_1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL // Ensure SPI slave 1 is not selected
}
const SPICC2650_HWAttrs SPICC2650DMAHWAttrs[CC2650_SPICOUNT] = {
{ // Use SPI0 module with default chip select on Board_CSN_0
.baseAddr = SSI0_BASE,
.intNum = INT_SSI0,
.defaultTxBufValue = 0,
.powerMngrId = PERIPH_SSI0,
.rxChannelIndex = UDMA_CHAN_SSI0_RX,
.txChannelIndex = UDMA_CHAN_SSI0_TX,
.mosiPin = Board_SPI0_MOSI,
.misoPin = Board_SPI0_MISO,
.clkPin = Board_SPI0_CLK,
.csnPin = Board_CSN_0
}
// From your_application.c
static void taskFxn(UArg a0, UArg a1)
{
SPI_Handle handle;
SPI_Params params;
SPI_Transaction transaction;
PIN_Id csnPin1 = PIN_ID(Board_CSN_1);
uint8_t txBuf[] = "Hello World"; // Transmit buffer
// Init SPI and specify non-default parameters
SPI_Params_init(¶ms);
params.bitRate = 1000000;
params.frameFormat = SPI_POL1_PHA1;
params.mode = SPI_MASTER;
// Configure the transaction
transaction.count = sizeof(txBuf);
transaction.txBuf = txBuf;
transaction.rxBuf = NULL;
// Open the SPI and perform transfer to the first slave
handle = SPI_open(Board_SPI, ¶ms);
SPI_transfer(handle, &transaction);
// Then switch chip select pin and perform transfer to the second slave
SPI_control(handle, SPICC2650DMA_SET_CSN_PIN, &csnPin1);
SPI_transfer(handle, &transaction);
}
Now when i compile it, CCS is given me errors:
SPI_Params_init()
SPI_open()
SPI_transfer()
Saying that those functions are unresolved symbols and first referenced in <whole-program>
Any idea? Is there a easy way to implement SPI with DMA on this?