Hi @VaneB
This is the Lpspi_Ip_UpdateTransferMode() function in my code
Lpspi_Ip_StatusType Lpspi_Ip_UpdateTransferMode(uint8 Instance, Lpspi_Ip_ModeType Mode)
{
Lpspi_Ip_StateStructureType* State;
Lpspi_Ip_StatusType Status = LPSPI_IP_STATUS_SUCCESS;
#if (LPSPI_IP_DMA_USED == STD_ON)
Dma_Ip_LogicChannelTransferListType DmaTcdList[1u];
#endif
#if (LPSPI_IP_DEV_ERROR_DETECT == STD_ON)
DevAssert(Instance < LPSPI_INSTANCE_COUNT);
#endif
State = Lpspi_Ip_apxStateStructureArray[Instance];
#if (LPSPI_IP_DEV_ERROR_DETECT == STD_ON)
DevAssert(NULL_PTR != State);
#endif
/* Transfer mode can be changed when no transfers are in progress. */
if (State->Status != LPSPI_IP_BUSY)
{
State->TransferMode = Mode;
#if (LPSPI_IP_DMA_USED == STD_ON)
if (TRUE == State->PhyUnitConfig->DmaUsed)
{
/* Activate TX DMA and RX DMA interrupt in interrupt mode or disable then in polling mode. */
DmaTcdList[0u].Param = DMA_IP_CH_SET_CONTROL_EN_MAJOR_INTERRUPT;
switch (State->TransferMode)
{
case LPSPI_IP_POLLING:
/* Disable DMA major interrupt. */
DmaTcdList[0u].Value = 0u;
break;
case LPSPI_IP_INTERRUPT:
/* Enable DMA major interrupt. */
DmaTcdList[0u].Value = 1u;
break;
default:
/* Nothing to do */
break;
}
(void)Dma_Ip_SetLogicChannelTransferList(State->PhyUnitConfig->TxDmaChannel, DmaTcdList, 1u);
(void)Dma_Ip_SetLogicChannelTransferList(State->PhyUnitConfig->RxDmaChannel, DmaTcdList, 1u);
}
#endif
}
else
{
Status = LPSPI_IP_STATUS_FAIL;
}
return Status;
}
The below mentioned are the SPI configurations,
SpiDriver


SpiGeneral
