/* ===================================================================*/ LDD_TError SMasterLdd3_SendBlock(LDD_TDeviceData *DeviceDataPtr, LDD_TData *BufferPtr, uint16_t Size) { /* Clock configuration test - this test can be disabled by setting the "Ignore clock configuration test" property to the "yes" value in the "Configuration inspector" */ if (!((SMasterLdd3_TDeviceDataPtr)DeviceDataPtr)->EnMode) { /* Is the device disabled in the actual speed CPU mode? */ return ERR_SPEED; /* If yes then error */ } /* Device state test - this test can be disabled by setting the "Ignore enable test" property to the "yes" value in the "Configuration inspector" */ if (!((SMasterLdd3_TDeviceDataPtr)DeviceDataPtr)->EnUser) { /* Is the device disabled by user? */ return ERR_DISABLED; /* If yes then error */ } if (((SMasterLdd3_TDeviceDataPtr)DeviceDataPtr)->OutDataNumReq != 0x00U) { /* Is the previous transmit operation pending? */ return ERR_BUSY; /* If yes then error */ } /* {Default RTOS Adapter} Critical section begin, general PE function is used */ EnterCritical(); ((SMasterLdd3_TDeviceDataPtr)DeviceDataPtr)->OutDataPtr = (uint8_t*)BufferPtr; /* Set a pointer to the output data. */ ((SMasterLdd3_TDeviceDataPtr)DeviceDataPtr)->OutDataNumReq = Size; /* Set the counter of characters to be sent. */ ((SMasterLdd3_TDeviceDataPtr)DeviceDataPtr)->OutSentDataNum = 0x00U; /* Clear the counter of sent characters. */ SPI_PDD_EnableDmasInterrupts(SPI2_BASE_PTR, SPI_PDD_TX_FIFO_FILL_INT_DMA); /* Enable TX interrupt */ /* {Default RTOS Adapter} Critical section end, general PE function is used */ ExitCritical(); return ERR_OK; /* OK */ }
/* ===================================================================*/ LDD_TError SMasterLdd1_SendBlock(LDD_TDeviceData *DeviceDataPtr, LDD_TData *BufferPtr, uint16_t Size) { if (((SMasterLdd1_TDeviceDataPtr)DeviceDataPtr)->OutDataNumReq != 0x00U) { /* Is the previous transmit operation pending? */ return ERR_BUSY; /* If yes then error */ } /* {Default RTOS Adapter} Critical section begin, general PE function is used */ EnterCritical(); ((SMasterLdd1_TDeviceDataPtr)DeviceDataPtr)->OutDataPtr = (uint8_t*)BufferPtr; /* Set a pointer to the output data. */ ((SMasterLdd1_TDeviceDataPtr)DeviceDataPtr)->OutDataNumReq = Size; /* Set the counter of characters to be sent. */ ((SMasterLdd1_TDeviceDataPtr)DeviceDataPtr)->OutSentDataNum = 0x00U; /* Clear the counter of sent characters. */ SPI_PDD_EnableDmasInterrupts(SPI0_BASE_PTR, SPI_PDD_TX_FIFO_FILL_INT_DMA); /* Enable TX interrupt */ /* {Default RTOS Adapter} Critical section end, general PE function is used */ ExitCritical(); return ERR_OK; /* OK */ }
/* ===================================================================*/ LDD_TError SMasterLdd1_SendBlock(LDD_TDeviceData *DeviceDataPtr, LDD_TData *BufferPtr, uint16_t Size) { if (((SMasterLdd1_TDeviceDataPtr)DeviceDataPtr)->OutDataNumReq != 0x00U) { /* Is the previous transmit operation pending? */ return ERR_BUSY; /* If yes then error */ } /* {FreeRTOS RTOS Adapter} Critical section begin (RTOS function call is defined by FreeRTOS RTOS Adapter property) */ taskENTER_CRITICAL(); ((SMasterLdd1_TDeviceDataPtr)DeviceDataPtr)->OutDataPtr = (uint8_t*)BufferPtr; /* Set a pointer to the output data. */ ((SMasterLdd1_TDeviceDataPtr)DeviceDataPtr)->OutDataNumReq = Size; /* Set the counter of characters to be sent. */ ((SMasterLdd1_TDeviceDataPtr)DeviceDataPtr)->OutSentDataNum = 0x00U; /* Clear the counter of sent characters. */ SPI_PDD_EnableDmasInterrupts(SPI0_BASE_PTR, SPI_PDD_TX_FIFO_FILL_INT_DMA); /* Enable TX interrupt */ /* {FreeRTOS RTOS Adapter} Critical section ends (RTOS function call is defined by FreeRTOS RTOS Adapter property) */ taskEXIT_CRITICAL(); return ERR_OK; /* OK */ }