76 g_dmaCTRL dma_controlPacketSpiTx = {
86 .PORTASGN = (uint32_t)PORTA_READ_PORTB_WRITE,
87 .RDSIZE = (uint32_t)ACCESS_16_BIT,
88 .WRSIZE = (uint32_t)ACCESS_16_BIT,
89 .TTYPE = (uint32_t)FRAME_TRANSFER,
90 .ADDMODERD = (uint32_t)ADDR_INC1,
91 .ADDMODEWR = (uint32_t)ADDR_FIXED,
92 .AUTOINIT = (uint32_t)AUTOINIT_OFF
95 g_dmaCTRL dma_controlPacketSpiRx = {
105 .PORTASGN = (uint32_t)PORTB_READ_PORTA_WRITE,
106 .RDSIZE = ACCESS_16_BIT,
107 .WRSIZE = ACCESS_16_BIT,
108 .TTYPE = FRAME_TRANSFER,
109 .ADDMODERD = ADDR_FIXED,
110 .ADDMODEWR = ADDR_INC1,
111 .AUTOINIT = AUTOINIT_OFF
115 g_dmaCTRL dma_controlPacketI2cTx = {
125 .PORTASGN = (uint32_t)PORTA_READ_PORTB_WRITE,
126 .RDSIZE = (uint32_t)ACCESS_8_BIT,
127 .WRSIZE = (uint32_t)ACCESS_8_BIT,
128 .TTYPE = (uint32_t)FRAME_TRANSFER,
129 .ADDMODERD = (uint32_t)ADDR_INC1,
130 .ADDMODEWR = (uint32_t)ADDR_FIXED,
131 .AUTOINIT = (uint32_t)AUTOINIT_OFF
134 g_dmaCTRL dma_controlPacketI2cRx = {
144 .PORTASGN = (uint32_t)PORTB_READ_PORTA_WRITE,
145 .RDSIZE = (uint32_t)ACCESS_8_BIT,
146 .WRSIZE = (uint32_t)ACCESS_8_BIT,
147 .TTYPE = (uint32_t)FRAME_TRANSFER,
148 .ADDMODERD = (uint32_t)ADDR_FIXED,
149 .ADDMODEWR = (uint32_t)ADDR_INC1,
150 .AUTOINIT = (uint32_t)AUTOINIT_OFF
174 (dmaIntGroup_t)DMA_INTA);
178 (dmaChannel_t)(dmaChannel_t)
dma_spiDmaChannels[i].rxChannel, (dmaInterrupt_t)BTC, (dmaIntGroup_t)DMA_INTA);
184 dmaSetCtrlPacket((dmaChannel_t)
dma_spiDmaChannels[i].txChannel, dma_controlPacketSpiTx);
187 dmaSetCtrlPacket((dmaChannel_t)
dma_spiDmaChannels[i].rxChannel, dma_controlPacketSpiRx);
190 dmaSetChEnable((dmaChannel_t)
dma_spiDmaChannels[i].txChannel, (dmaTriggerType_t)DMA_HW);
191 dmaSetChEnable((dmaChannel_t)
dma_spiDmaChannels[i].rxChannel, (dmaTriggerType_t)DMA_HW);
204 dmaEnableInterrupt((dmaChannel_t)(dmaChannel_t)
DMA_CHANNEL_I2C_TX, (dmaInterrupt_t)BTC, (dmaIntGroup_t)DMA_INTA);
205 dmaEnableInterrupt((dmaChannel_t)(dmaChannel_t)
DMA_CHANNEL_I2C_RX, (dmaInterrupt_t)BTC, (dmaIntGroup_t)DMA_INTA);
227 if (inttype == (dmaInterrupt_t)BTC) {
228 uint16_t timeoutIterations = 0u;
229 uint8_t spiIndex = 0u;
251 (timeoutIterations > 0u)) {
293 i2cREG1->DMACR &= ~(uint32)0x2u;
296 while ((i2cIsStopDetected(i2cREG1) == 0u) && (timeoutIterations > 0u)) {
300 i2cClearSCD(i2cREG1);
303 i2cREG1->DMACR &= ~(uint32)0x1u;
306 while ((i2cIsStopDetected(i2cREG1) == 0u) && (timeoutIterations > 0u)) {
310 i2cClearSCD(i2cREG1);
Headers for the driver for the general DMA module of monitoring ICs.
void AFE_DmaCallback(uint8_t spiIndex)
Function called by DMA block transfer callback.
void DMA_Initialize(void)
Enables the DMA module.
void UNIT_TEST_WEAK_IMPL dmaGroupANotification(dmaInterrupt_t inttype, uint32 channel)
Headers for the driver for the DMA module.
DMA_REQUEST_CONFIG_s dma_spiDmaRequests[DMA_NUMBER_SPI_INTERFACES]
spiBASE_t * dma_spiInterfaces[DMA_NUMBER_SPI_INTERFACES]
DMA_CHANNEL_CONFIG_s dma_spiDmaChannels[DMA_NUMBER_SPI_INTERFACES]
#define DMA_CHANNEL_SPI1_RX
#define DMA_CHANNEL_SPI5_RX
#define DMA_BIG_ENDIAN_ADDRESS_16BIT
#define DMA_CHANNEL_SPI4_TX
#define DMA_BIG_ENDIAN_ADDRESS_8BIT
#define DMA_NUMBER_SPI_INTERFACES
#define DMA_CHANNEL_SPI3_RX
#define DMA_CHANNEL_SPI5_TX
#define DMA_CHANNEL_SPI1_TX
#define DMA_CHANNEL_I2C_TX
#define DMA_CHANNEL_SPI4_RX
#define DMA_REQ_LINE_I2C_TX
#define DMA_REQ_LINE_I2C_RX
#define DMA_CHANNEL_SPI3_TX
#define DMA_CHANNEL_SPI2_TX
#define DMA_CHANNEL_I2C_RX
#define DMA_CHANNEL_SPI2_RX
#define UNIT_TEST_WEAK_IMPL
Header for the driver for the I2C module.
#define I2C_TIMEOUT_ITERATIONS
void SPI_DmaSendLastByte(uint8_t spiIndex)
Used to send last byte per SPI.
uint8_t SPI_GetSpiIndex(spiBASE_t *pNode)
Returns index of SPI node.
Headers for the driver for the SPI module.
SPI_BUSY_STATE_e spi_busyFlags[]
#define SPI_TX_EMPTY_TIMEOUT_ITERATIONS
#define SPI_TX_BUFFER_EMPTY_FLAG_POSITION
#define SPI_PC0_CLEAR_HW_CS_MASK