Hi,
I'm using BIOS 5.41, CCS 3.3 with c6747 on a custom board.
I'm using GIO_Handle to implement data transfer on SPI1:
bios.UDEV.create("ADISIMUSpi1"); The initialisation is as follow: void ADISIMUGIOSpiInit() spiParamsADISIMU.hwiNumber = 8; spiParamsADISIMU.outputClkFreq = 1000000;
bios.UDEV.instance("ADISIMUSpi1").fxnTableType = "IOM_Fxns";
bios.UDEV.instance("ADISIMUSpi1").initFxn = prog.extern("ADISIMUGIOSpiInit");
bios.UDEV.instance("ADISIMUSpi1").params = prog.extern("spiParamsADISIMU");
bios.UDEV.instance("ADISIMUSpi1").fxnTable = prog.extern("Spi_IOMFXNS");
bios.UDEV.instance("ADISIMUSpi1").deviceId = 1;
{
LOG_printf(&trace, "ADISIMUGIOSpiInit() starts.");
spiParamsADISIMU = Spi_PARAMS;
spiParamsADISIMU.spiHWCfgData.intrLevel = FALSE;
spiParamsADISIMU.opMode = Spi_OpMode_INTERRUPT;
spiParamsADISIMU.loopbackEnabled = FALSE;
spiParamsADISIMU.edmaHandle = NULL;
spiParamsADISIMU.spiHWCfgData.waitDelay = FALSE;//FALSE
spiParamsADISIMU.spiHWCfgData.configDatafmt[0].charLength = 8;
spiParamsADISIMU.spiHWCfgData.configDatafmt[0].clkHigh = TRUE ;
spiParamsADISIMU.spiHWCfgData.configDatafmt[0].lsbFirst = FALSE;
spiParamsADISIMU.spiHWCfgData.configDatafmt[0].oddParity = FALSE;
spiParamsADISIMU.spiHWCfgData.configDatafmt[0].parityEnable = FALSE ;
spiParamsADISIMU.spiHWCfgData.configDatafmt[0].phaseIn = FALSE;;
spiParamsADISIMU.spiHWCfgData.configDatafmt[0].waitEnable = FALSE;
spiParamsADISIMU.spiHWCfgData.configDatafmt[0].wDelay = 0x3F;
// Power on the spi device in the Power sleep controller
Psc_ModuleClkCtrl(Psc_DevId_1, CSL_PSC_SPI1, TRUE);
Spi_init();
LOG_printf(&trace, "ADISIMUGIOSpiInit() completed.");
}
However, I have more than one device using SPI1. What do I need to do for one GIO_Handle to be able to transmit data to difference devices using different data format? (e.g. one is IsbFirst = FALSE, another is Isb = TRUE)
Besides this I also encounter the following issue:
When spiHWCfgData.configDatafmt[0].charLength is set to 8, the transmission works find. But when it is set to 16, data started transmitting around 8 clock cycle late. Is there other setting I need to do for spiHWCfgData.configDatafmt[0].charLength = 16?