Other Parts Discussed in Thread: ADS1291
Hi Team,
Recently, I used SPI to read ADS1291 data, and I felt that the frequency of data reading was not very stable. Would it be better to use dma?
Then I looked at the spi program and felt that the spi had been configured with DMA, so I want to make sure if this is true or not?
const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[BOARD_SPICOUNT] = {
{
.baseAddr = SSI0_BASE,
.intNum = INT_SSI0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI0,
.defaultTxBufValue = 0,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
.mosiPin = BOARD_SPI0_MOSI,
.misoPin = BOARD_SPI0_MISO,
.clkPin = BOARD_SPI0_SCK,
.csnPin =BOARD_SPI0_CSN
}
};
//spi_config includes configuration for dma?
const SPI_Config SPI_config[BOARD_SPICOUNT] = {
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[BOARD_SPI0],
.hwAttrs = &spiCC26XXDMAHWAttrs[BOARD_SPI0]
}
};
/* SPI function table for SPICC26XXDMA implementation */
const SPI_FxnTable SPICC26XXDMA_fxnTable = {
SPICC26XXDMA_close,
SPICC26XXDMA_control,
SPICC26XXDMA_init,
SPICC26XXDMA_open,
SPICC26XXDMA_transfer,
SPICC26XXDMA_transferCancel
};
SPI_Handle SPI_open(uint_least8_t index, SPI_Params *params)
{
SPI_Handle handle = NULL;
if (isInitialized && (index < SPI_count)) {
/* If params are NULL use defaults */
if (params == NULL) {
params = (SPI_Params *) &SPI_defaultParams;
}
/* Get handle for this driver instance */
handle = (SPI_Handle)&(SPI_config[index]);
handle = handle->fxnTablePtr->openFxn(handle, params);
}
return (handle);
}
SPIHandle = SPI_open(BOARD_SPI0, &SPIparams);
Should I use SPICC26XXDMA_transfer instead of SPI_transfer(); when transmitting?
Kind regards,
Katherine