/* Start an SPI master blocking single item (frame) transfer.  */
Ecode_t SPIDRV_MTransferSingleItemB(SPIDRV_Handle_t handle, uint32_t txValue, void *rxValue)
/* Start an SPI master blocking single item (frame) transfer.  */
Ecode_t SPIDRV_MTransferSingleItemB(SPIDRV_Handle_t handle, uint32_t txValue, void *rxValue)
{
  void *pRx;
  CORE_DECLARE_IRQ_STATE;
  uint32_t rxBuffer;
  if ( handle == NULL ) {
    return ECODE_EMDRV_SPIDRV_ILLEGAL_HANDLE;
  }
  if ( handle->initData.type == spidrvSlave ) {
    return ECODE_EMDRV_SPIDRV_MODE_ERROR;
  }
  CORE_ENTER_ATOMIC();
  if ( handle->state != spidrvStateIdle ) {
    CORE_EXIT_ATOMIC();
    return ECODE_EMDRV_SPIDRV_BUSY;
  }
  handle->state = spidrvStateTransferring;
  CORE_EXIT_ATOMIC();
  if ( (pRx = rxValue) == NULL ) {
    pRx = &rxBuffer;
  }
  StartTransferDMA(handle, &txValue, pRx, 1, BlockingComplete);
  WaitForTransferCompletion(handle);
  return handle->transferStatus;
}