Part Number: LAUNCHXL-CC2640R2
Tool/software: Code Composer Studio
Hello Gang,
I have this project where I want to read ADC-Values from an ADC-Chip's SPI-Interface. So I connected my device to DIO8...DIO11 (MISO, MOSI, CLK, CS).
This is what the relevant(?) code looks like.
It will be trapped inside the while loop and not print the log to uart(why?)
...
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
...
#include <ti/drivers/SPI.h>
...
//spi innit
SPI_Handle mmasterSpi_handle;
SPI_Params mspiParams;
SPI_Transaction mspitransaction;
uint32_t spi_i;
bool spi_transferOK;
int32_t spi_status;
SPI_Params_init(&mspiParams); // Open SPI as master (default)
mspiParams.frameFormat = SPI_POL0_PHA1;
mspiParams.bitRate = 4000000;
mmasterSpi_handle = SPI_open(Board_SPI_MASTER, &mspiParams);
if (mmasterSpi_handle == NULL) {
Log_error0("Error initializing master SPI\n");
while (1);
}
else {
Log_info0("Master SPI initialized\n");
}