Other Parts Discussed in Thread: CC2640R2F
Tool/software: TI-RTOS
Hi, I am using TDC7200EVM with CC2640R2F (not MSP430Fxx). I also was not able to install GUI on Windows 10 it has KernelBase.dll and NationalInstrumentsLabView errors.
I read every post about this error. I do not understand what could be wrong?
#include <ti/drivers/SPI.h> #include <xdc/runtime/System.h> #include <ti/drivers/GPIO.h> #include <ti/sysbios/knl/Task.h> #include "Board.h" uint8_t regComm[2] = { 0x40, 0x08 }; uint8_t regRead[2] = { NULL }; void spiCallback(SPI_Handle handle, SPI_Transaction *transaction){ System_printf("%u\n", *((uint8_t *)transaction->rxBuf)); System_printf("%u\n", *(((uint8_t *)transaction->rxBuf) + 1)); } void *mainThread(void *arg0) { GPIO_init(); SPI_init(); GPIO_write(23, 0); Task_sleep(1e1); GPIO_write(23, 1); Task_sleep(1e1); GPIO_write(11, 1); Task_sleep(1e1); GPIO_write(11, 0); SPI_Handle handle; SPI_Params params; SPI_Transaction transaction; SPI_Params_init(¶ms); params.mode = SPI_MASTER; params.dataSize = 8; params.transferMode = SPI_MODE_CALLBACK; params.transferCallbackFxn = spiCallback; handle = SPI_open(Board_SPI0, ¶ms); if(handle == NULL){ System_printf("Error.\n"); } transaction.count = 2; transaction.txBuf = regComm; transaction.rxBuf = regRead; while(1){ bool transferOK = SPI_transfer(handle, &transaction); if(!transferOK){ System_printf("Error.\n"); } Task_sleep(1e5); } }
Thanks for your help.