75 g_dmaCTRL dma_controlPacketSpiTx = {
85 .PORTASGN = (uint32_t)PORTA_READ_PORTB_WRITE,
86 .RDSIZE = (uint32_t)ACCESS_16_BIT,
87 .WRSIZE = (uint32_t)ACCESS_16_BIT,
88 .TTYPE = (uint32_t)FRAME_TRANSFER,
89 .ADDMODERD = (uint32_t)ADDR_INC1,
90 .ADDMODEWR = (uint32_t)ADDR_FIXED,
91 .AUTOINIT = (uint32_t)AUTOINIT_OFF
94 g_dmaCTRL dma_controlPacketSpiRx = {
104 .PORTASGN = (uint32_t)PORTB_READ_PORTA_WRITE,
105 .RDSIZE = ACCESS_16_BIT,
106 .WRSIZE = ACCESS_16_BIT,
107 .TTYPE = FRAME_TRANSFER,
108 .ADDMODERD = ADDR_FIXED,
109 .ADDMODEWR = ADDR_INC1,
110 .AUTOINIT = AUTOINIT_OFF
114 g_dmaCTRL dma_controlPacketI2cTx = {
124 .PORTASGN = (uint32_t)PORTA_READ_PORTB_WRITE,
125 .RDSIZE = (uint32_t)ACCESS_8_BIT,
126 .WRSIZE = (uint32_t)ACCESS_8_BIT,
127 .TTYPE = (uint32_t)FRAME_TRANSFER,
128 .ADDMODERD = (uint32_t)ADDR_INC1,
129 .ADDMODEWR = (uint32_t)ADDR_FIXED,
130 .AUTOINIT = (uint32_t)AUTOINIT_OFF
133 g_dmaCTRL dma_controlPacketI2cRx = {
143 .PORTASGN = (uint32_t)PORTB_READ_PORTA_WRITE,
144 .RDSIZE = (uint32_t)ACCESS_8_BIT,
145 .WRSIZE = (uint32_t)ACCESS_8_BIT,
146 .TTYPE = (uint32_t)FRAME_TRANSFER,
147 .ADDMODERD = (uint32_t)ADDR_FIXED,
148 .ADDMODEWR = (uint32_t)ADDR_INC1,
149 .AUTOINIT = (uint32_t)AUTOINIT_OFF
173 (dmaIntGroup_t)DMA_INTA);
177 (dmaChannel_t)(dmaChannel_t)
dma_spiDmaChannels[i].rxChannel, (dmaInterrupt_t)BTC, (dmaIntGroup_t)DMA_INTA);
183 dmaSetCtrlPacket((dmaChannel_t)
dma_spiDmaChannels[i].txChannel, dma_controlPacketSpiTx);
186 dmaSetCtrlPacket((dmaChannel_t)
dma_spiDmaChannels[i].rxChannel, dma_controlPacketSpiRx);
189 dmaSetChEnable((dmaChannel_t)
dma_spiDmaChannels[i].txChannel, (dmaTriggerType_t)DMA_HW);
190 dmaSetChEnable((dmaChannel_t)
dma_spiDmaChannels[i].rxChannel, (dmaTriggerType_t)DMA_HW);
203 dmaEnableInterrupt((dmaChannel_t)(dmaChannel_t)
DMA_CHANNEL_I2C_TX, (dmaInterrupt_t)BTC, (dmaIntGroup_t)DMA_INTA);
204 dmaEnableInterrupt((dmaChannel_t)(dmaChannel_t)
DMA_CHANNEL_I2C_RX, (dmaInterrupt_t)BTC, (dmaIntGroup_t)DMA_INTA);
223 if (inttype == (dmaInterrupt_t)BTC) {
224 uint16_t timeoutIterations = 0u;
225 uint8_t spiIndex = 0u;
247 (timeoutIterations > 0u)) {
289 i2cREG1->DMACR &= ~(uint32)0x2u;
292 while ((i2cIsStopDetected(i2cREG1) == 0u) && (timeoutIterations > 0u)) {
296 i2cClearSCD(i2cREG1);
299 i2cREG1->DMACR &= ~(uint32)0x1u;
302 while ((i2cIsStopDetected(i2cREG1) == 0u) && (timeoutIterations > 0u)) {
306 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