Tool/software: TI-RTOS
Hi All,
How to configure EUSCI B3 for spi in ti rtos. I am very difficult dma channel trigger and index from pdf file of data sheet. anyone knows how to configure it for spi in ti rtos?
SPIEUSCIBDMA_Object spiEUSCIBDMAObjects[MSP_EXP430FR5994_SPICOUNT];
uint8_t spiEUSCIBDMAscratchBuf[MSP_EXP430FR5994_SPICOUNT];
const SPIEUSCIBDMA_HWAttrs spiEUSCIBDMAHWAttrs[MSP_EXP430FR5994_SPICOUNT] = {
{
.baseAddr = EUSCI_B3_BASE,
.clockSource = EUSCI_B_SPI_CLOCKSOURCE_SMCLK,
.bitOrder = EUSCI_B_SPI_MSB_FIRST,
.scratchBufPtr = &spiEUSCIBDMAscratchBuf[0],
.defaultTxBufValue = 0,
/* DMA */
.dmaBaseAddr = DMA_BASE,
/* Rx Channel */
.rxDMAChannelIndex = DMA_CHANNEL_5,
.rxDMASourceTrigger = DMA_TRIGGERSOURCE_18,//DMA_TRIGGERSOURCE_17
/* Tx Channel */
.txDMAChannelIndex = DMA_CHANNEL_4,
.txDMASourceTrigger = DMA_TRIGGERSOURCE_19 //DMA_TRIGGERSOURCE_16
}
};
const SPI_Config SPI_config[] = {
{
.fxnTablePtr = &SPIEUSCIBDMA_fxnTable,
.object = &spiEUSCIBDMAObjects[0],
.hwAttrs = &spiEUSCIBDMAHWAttrs[0]
},
{NULL, NULL, NULL},
};
/*
* ======== MSP_EXP430FR5994_initSPI ========
*/
void MSP_EXP430FR5994_initSPI(void)
{
/* EUSCIA3 */
/* SIMO/MOSI */
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P6, GPIO_PIN4, GPIO_PRIMARY_MODULE_FUNCTION);
/* SOMI/MISO */
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P6, GPIO_PIN5, GPIO_PRIMARY_MODULE_FUNCTION);
/* CLK */
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P6, GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);
SPI_init();
}
Best Regards