bool IspSpi_Tx(unsigned char *buf, int size) { SYS_INT_PROCESSOR_STATUS intStatusSaving; if (size == 0) { return true; } intStatusSaving = SYS_INT_StatusGetAndDisable(); // Disable all interrupts spiBufferHandleTx = DRV_SPI_BufferAddWrite(drvSPIHandle, buf, size, 0, 0); if (spiBufferHandleTx == (DRV_SPI_BUFFER_HANDLE)NULL) { // WDRV_ASSERT(false, "SPI write error"); SYS_INT_StatusRestore(intStatusSaving); // Restore interrupts return false; } while (DRV_SPI_BUFFER_EVENT_COMPLETE != DRV_SPI_BufferStatus(spiBufferHandleTx)) // Check for the successful data transfer { DRV_SPI_Tasks(*p_drvSPIObject); } SYS_INT_StatusRestore(intStatusSaving); // Restore interrupts return true; }
void SPI3_Write(unsigned char value, unsigned char num_of_bytes) { /* Add the buffer to transmit */ display_ctrlData.drvSPIWRBUFHandle = DRV_SPI_BufferAddWrite(display_ctrlData.drvSPIHandle, (SPI_DATA_TYPE *) & value, num_of_bytes, 0, 0); while (!(DRV_SPI_BUFFER_EVENT_COMPLETE & DRV_SPI_BufferStatus(display_ctrlData.drvSPIWRBUFHandle))); }
void SendLEDStrip(LED_DATA_TYPE* strip) { appData.LED.handle = DRV_SPI_BufferAddWrite ( appData.LED.SPIHandle, QueueLEDStrip(strip), RAW_BUFFER_SIZE, &FinishedLEDWriteCB, NULL ); LEDStrip.transmitting=true; }
static bool _Spi_Tx(unsigned char *buf, uint32_t size) { bool ret = true; SPI_DMA_DCACHE_CLEAN(buf, size); s_Spi_Tx_Done = false; s_SpiBufferHandleTx = DRV_SPI_BufferAddWrite(s_SpiHandle, buf, size, SPI_TxComplete, 0); if (s_SpiBufferHandleTx == (DRV_SPI_BUFFER_HANDLE)NULL) ret = false; SPI_WAIT_FOR_TX_COMPLETION(); return ret;; }
bool IspSpi_Tx(unsigned char *buf, int size) { if(size==0) return true; spiBufferHandleTx = DRV_SPI_BufferAddWrite ( drvSPIHandle, buf, size ) ; if( spiBufferHandleTx == NULL ) { //SYS_ASSERT(false, "SPI Write error"); return false; } while(!(DRV_SPI_BUFFER_EVENT_COMPLETE & DRV_SPI_BufferStatus (spiBufferHandleTx) )) //Check for the successful data transfer { DRV_SPI_Tasks (drvSPIObject); } return true; }