text:
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"

/** @addtogroup STM32F4xx_HAL_Driver
  * @{
  */

/** @defgroup SPI SPI
  * @brief SPI HAL module driver
  * @{
  */

#ifdef HAL_SPI_MODULE_ENABLED

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define SPI_TIMEOUT_VALUE  10
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/** @addtogroup SPI_Private_Functions
  * @{
  */
static void SPI_TxCloseIRQHandler(SPI_HandleTypeDef *hspi);
static void SPI_TxISR(SPI_HandleTypeDef *hspi);
static void SPI_RxCloseIRQHandler(SPI_HandleTypeDef *hspi);
static void SPI_2LinesRxISR(SPI_HandleTypeDef *hspi);
static void SPI_RxISR(SPI_HandleTypeDef *hspi);
static void SPI_DMAEndTransmitReceive(SPI_HandleTypeDef *hspi);
static void SPI_DMATransmitCplt(DMA_HandleTypeDef *hdma);
static void SPI_DMAReceiveCplt(DMA_HandleTypeDef *hdma);
static void SPI_DMATransmitReceiveCplt(DMA_HandleTypeDef *hdma);
static void SPI_DMAHalfTransmitCplt(DMA_HandleTypeDef *hdma);
static void SPI_DMAHalfReceiveCplt(DMA_HandleTypeDef *hdma);
static void SPI_DMAHalfTransmitReceiveCplt(DMA_HandleTypeDef *hdma);
static void SPI_DMAError(DMA_HandleTypeDef *hdma);
static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, FlagStatus Status, uint32_t Timeout);
/**
  * @}
  */

/* Exported functions --------------------------------------------------------*/
/** @defgroup SPI_Exported_Functions SPI Exported Functions
  * @{
  */

/** @defgroup SPI_Exported_Functions_Group1 Initialization and de-initialization functions
 *  @brief    Initialization and Configuration functions
 *
@verbatim
 ===============================================================================
              ##### Initialization and de-initialization functions #####
 ===============================================================================
    [..]  This subsection provides a set of functions allowing to initialize and
          de-initialize the SPIx peripheral:

      (+) User must implement HAL_SPI_MspInit() function in which he configures
          all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC ).

      (+) Call the function HAL_SPI_Init() to configure the selected device with
          the selected configuration:
        (++) Mode
        (++) Direction
        (++) Data Size
        (++) Clock Polarity and Phase
        (++) NSS Management
        (++) BaudRate Prescaler
        (++) FirstBit
        (++) TIMode
        (++) CRC Calculation
        (++) CRC Polynomial if CRC enabled

      (+) Call the function HAL_SPI_DeInit() to restore the default configuration
          of the selected SPIx peripheral.

@endverbatim
  * @{
  */

/**
  * @brief  Initializes the SPI according to the specified parameters
  *         in the SPI_InitTypeDef and create the associated handle.
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_Init(SPI_HandleTypeDef *hspi)
{
  /* Check the SPI handle allocation */
  if(hspi == NULL)
  {
    return HAL_ERROR;
  }

  /* Check the parameters */
  assert_param(IS_SPI_MODE(hspi->Init.Mode));
  assert_param(IS_SPI_DIRECTION_MODE(hspi->Init.Direction));
  assert_param(IS_SPI_DATASIZE(hspi->Init.DataSize));
  assert_param(IS_SPI_CPOL(hspi->Init.CLKPolarity));
  assert_param(IS_SPI_CPHA(hspi->Init.CLKPhase));
  assert_param(IS_SPI_NSS(hspi->Init.NSS));
  assert_param(IS_SPI_BAUDRATE_PRESCALER(hspi->Init.BaudRatePrescaler));
  assert_param(IS_SPI_FIRST_BIT(hspi->Init.FirstBit));
  assert_param(IS_SPI_TIMODE(hspi->Init.TIMode));
  assert_param(IS_SPI_CRC_CALCULATION(hspi->Init.CRCCalculation));
  assert_param(IS_SPI_CRC_POLYNOMIAL(hspi->Init.CRCPolynomial));

  if(hspi->State == HAL_SPI_STATE_RESET)
  {
    /* Allocate lock resource and initialize it */
    hspi->Lock = HAL_UNLOCKED;
    /* Init the low level hardware : GPIO, CLOCK, NVIC... */
    HAL_SPI_MspInit(hspi);
  }

  hspi->State = HAL_SPI_STATE_BUSY;

  /* Disable the selected SPI peripheral */
  __HAL_SPI_DISABLE(hspi);

  /*----------------------- SPIx CR1 & CR2 Configuration ---------------------*/
  /* Configure : SPI Mode, Communication Mode, Data size, Clock polarity and phase, NSS management,
  Communication speed, First bit and CRC calculation state */
  hspi->Instance->CR1 = (hspi->Init.Mode | hspi->Init.Direction | hspi->Init.DataSize |
                         hspi->Init.CLKPolarity | hspi->Init.CLKPhase | (hspi->Init.NSS & SPI_CR1_SSM) |
                         hspi->Init.BaudRatePrescaler | hspi->Init.FirstBit  | hspi->Init.CRCCalculation);

  /* Configure : NSS management */
  hspi->Instance->CR2 = (((hspi->Init.NSS >> 16) & SPI_CR2_SSOE) | hspi->Init.TIMode);

  /*---------------------------- SPIx CRCPOLY Configuration ------------------*/
  /* Configure : CRC Polynomial */
  hspi->Instance->CRCPR = hspi->Init.CRCPolynomial;

  /* Activate the SPI mode (Make sure that I2SMOD bit in I2SCFGR register is reset) */
  hspi->Instance->I2SCFGR &= (uint32_t)(~SPI_I2SCFGR_I2SMOD);

  hspi->ErrorCode = HAL_SPI_ERROR_NONE;
  hspi->State = HAL_SPI_STATE_READY;

  return HAL_OK;
}

/**
  * @brief  DeInitializes the SPI peripheral
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_DeInit(SPI_HandleTypeDef *hspi)
{
  /* Check the SPI handle allocation */
  if(hspi == NULL)
  {
    return HAL_ERROR;
  }

  /* Disable the SPI Peripheral Clock */
  __HAL_SPI_DISABLE(hspi);

  /* DeInit the low level hardware: GPIO, CLOCK, NVIC... */
  HAL_SPI_MspDeInit(hspi);

  hspi->ErrorCode = HAL_SPI_ERROR_NONE;
  hspi->State = HAL_SPI_STATE_RESET;

  /* Release Lock */
  __HAL_UNLOCK(hspi);

  return HAL_OK;
}

/**
  * @brief SPI MSP Init
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
 __weak void HAL_SPI_MspInit(SPI_HandleTypeDef *hspi)
 {
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
   /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_SPI_MspInit could be implemented in the user file
   */
}

/**
  * @brief SPI MSP DeInit
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
 __weak void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_SPI_MspDeInit could be implemented in the user file
   */
}

/**
  * @}
  */

/** @defgroup SPI_Exported_Functions_Group2 IO operation functions
 *  @brief   Data transfers functions
 *
@verbatim
  ==============================================================================
                      ##### IO operation functions #####
 ===============================================================================
    This subsection provides a set of functions allowing to manage the SPI
    data transfers.

    [..] The SPI supports master and slave mode :

    (#) There are two modes of transfer:
       (++) Blocking mode: The communication is performed in polling mode.
            The HAL status of all data processing is returned by the same function
            after finishing transfer.
       (++) No-Blocking mode: The communication is performed using Interrupts
           or DMA, These APIs return the HAL status.
           The end of the data processing will be indicated through the
           dedicated SPI IRQ when using Interrupt mode or the DMA IRQ when
           using DMA mode.
           The HAL_SPI_TxCpltCallback(), HAL_SPI_RxCpltCallback() and HAL_SPI_TxRxCpltCallback() user callbacks
           will be executed respectively at the end of the transmit or Receive process
           The HAL_SPI_ErrorCallback()user callback will be executed when a communication error is detected

    (#) APIs provided for these 2 transfer modes (Blocking mode or Non blocking mode using either Interrupt or DMA)
        exist for 1Line (simplex) and 2Lines (full duplex) modes.

@endverbatim
  * @{
  */

/**
  * @brief  Transmit an amount of data in blocking mode
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  pData: pointer to data buffer
  * @param  Size: amount of data to be sent
  * @param  Timeout: Timeout duration
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)
{

  if(hspi->State == HAL_SPI_STATE_READY)
  {
    if((pData == NULL ) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Check the parameters */
    assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction));

    /* Process Locked */
    __HAL_LOCK(hspi);

    /* Configure communication */
    hspi->State = HAL_SPI_STATE_BUSY_TX;
    hspi->ErrorCode   = HAL_SPI_ERROR_NONE;

    hspi->pTxBuffPtr = pData;
    hspi->TxXferSize = Size;
    hspi->TxXferCount = Size;

    /*Init field not used in handle to zero */
    hspi->TxISR = 0;
    hspi->RxISR = 0;
    hspi->RxXferSize   = 0;
    hspi->RxXferCount  = 0;

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    if(hspi->Init.Direction == SPI_DIRECTION_1LINE)
    {
      /* Configure communication direction : 1Line */
      SPI_1LINE_TX(hspi);
    }

    /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    /* Transmit data in 8 Bit mode */
    if(hspi->Init.DataSize == SPI_DATASIZE_8BIT)
    {
      if((hspi->Init.Mode == SPI_MODE_SLAVE)|| (hspi->TxXferCount == 0x01))
      {
        hspi->Instance->DR = (*hspi->pTxBuffPtr++);
        hspi->TxXferCount--;
      }
      while(hspi->TxXferCount > 0)
      {
        /* Wait until TXE flag is set to send data */
        if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, Timeout) != HAL_OK)
        {
          return HAL_TIMEOUT;
        }
        hspi->Instance->DR = (*hspi->pTxBuffPtr++);
        hspi->TxXferCount--;
      }
      /* Enable CRC Transmission */
      if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
      {
        hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
      }
    }
    /* Transmit data in 16 Bit mode */
    else
    {
      if((hspi->Init.Mode == SPI_MODE_SLAVE) || (hspi->TxXferCount == 0x01))
      {
        hspi->Instance->DR = *((uint16_t*)hspi->pTxBuffPtr);
        hspi->pTxBuffPtr+=2;
        hspi->TxXferCount--;
      }
      while(hspi->TxXferCount > 0)
      {
        /* Wait until TXE flag is set to send data */
        if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, Timeout) != HAL_OK)
        {
          return HAL_TIMEOUT;
        }
        hspi->Instance->DR = *((uint16_t*)hspi->pTxBuffPtr);
        hspi->pTxBuffPtr+=2;
        hspi->TxXferCount--;
      }
      /* Enable CRC Transmission */
      if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
      {
        hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
      }
    }

    /* Wait until TXE flag is set to send data */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, Timeout) != HAL_OK)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
      return HAL_TIMEOUT;
    }

    /* Wait until Busy flag is reset before disabling SPI */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_BSY, SET, Timeout) != HAL_OK)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
      return HAL_TIMEOUT;
    }

    /* Clear OVERRUN flag in 2 Lines communication mode because received is not read */
    if(hspi->Init.Direction == SPI_DIRECTION_2LINES)
    {
      __HAL_SPI_CLEAR_OVRFLAG(hspi);
    }

    hspi->State = HAL_SPI_STATE_READY;

    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief  Receive an amount of data in blocking mode
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  pData: pointer to data buffer
  * @param  Size: amount of data to be sent
  * @param  Timeout: Timeout duration
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_Receive(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)
{
  __IO uint16_t tmpreg;
  uint32_t tmp = 0;

  if(hspi->State == HAL_SPI_STATE_READY)
  {
    if((pData == NULL ) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Process Locked */
    __HAL_LOCK(hspi);

    /* Configure communication */
    hspi->State       = HAL_SPI_STATE_BUSY_RX;
    hspi->ErrorCode   = HAL_SPI_ERROR_NONE;

    hspi->pRxBuffPtr  = pData;
    hspi->RxXferSize  = Size;
    hspi->RxXferCount = Size;

    /*Init field not used in handle to zero */
    hspi->RxISR = 0;
    hspi->TxISR = 0;
    hspi->TxXferSize   = 0;
    hspi->TxXferCount  = 0;

    /* Configure communication direction : 1Line */
    if(hspi->Init.Direction == SPI_DIRECTION_1LINE)
    {
      SPI_1LINE_RX(hspi);
    }

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    if((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES))
    {
      /* Process Unlocked */
      __HAL_UNLOCK(hspi);

      /* Call transmit-receive function to send Dummy data on Tx line and generate clock on CLK line */
      return HAL_SPI_TransmitReceive(hspi, pData, pData, Size, Timeout);
    }

    /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    /* Receive data in 8 Bit mode */
    if(hspi->Init.DataSize == SPI_DATASIZE_8BIT)
    {
      while(hspi->RxXferCount > 1)
      {
        /* Wait until RXNE flag is set */
        if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
        {
          return HAL_TIMEOUT;
        }

        (*hspi->pRxBuffPtr++) = hspi->Instance->DR;
        hspi->RxXferCount--;
      }
      /* Enable CRC Transmission */
      if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
      {
        hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
      }
    }
    /* Receive data in 16 Bit mode */
    else
    {
      while(hspi->RxXferCount > 1)
      {
        /* Wait until RXNE flag is set to read data */
        if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
        {
          return HAL_TIMEOUT;
        }

        *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR;
        hspi->pRxBuffPtr+=2;
        hspi->RxXferCount--;
      }
      /* Enable CRC Transmission */
      if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
      {
        hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
      }
    }

    /* Wait until RXNE flag is set */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
    {
      return HAL_TIMEOUT;
    }

    /* Receive last data in 8 Bit mode */
    if(hspi->Init.DataSize == SPI_DATASIZE_8BIT)
    {
      (*hspi->pRxBuffPtr++) = hspi->Instance->DR;
    }
    /* Receive last data in 16 Bit mode */
    else
    {
      *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR;
      hspi->pRxBuffPtr+=2;
    }
    hspi->RxXferCount--;

    /* Wait until RXNE flag is set: CRC Received */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
      {
        hspi->ErrorCode |= HAL_SPI_ERROR_CRC;
        return HAL_TIMEOUT;
      }

      /* Read CRC to Flush RXNE flag */
      tmpreg = hspi->Instance->DR;
      UNUSED(tmpreg);
    }

    if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY)))
    {
      /* Disable SPI peripheral */
      __HAL_SPI_DISABLE(hspi);
    }

    hspi->State = HAL_SPI_STATE_READY;

    tmp = __HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR);
    /* Check if CRC error occurred */
    if((hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) && (tmp != RESET))
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_CRC;

      /* Reset CRC Calculation */
      SPI_RESET_CRC(hspi);

      /* Process Unlocked */
      __HAL_UNLOCK(hspi);

      return HAL_ERROR;
    }

    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief  Transmit and Receive an amount of data in blocking mode
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  pTxData: pointer to transmission data buffer
  * @param  pRxData: pointer to reception data buffer to be
  * @param  Size: amount of data to be sent
  * @param  Timeout: Timeout duration
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_TransmitReceive(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
{
  __IO uint16_t tmpreg;
  uint32_t tmpstate = 0, tmp = 0;

  tmpstate = hspi->State;
  if((tmpstate == HAL_SPI_STATE_READY) || (tmpstate == HAL_SPI_STATE_BUSY_RX))
  {
    if((pTxData == NULL ) || (pRxData == NULL ) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Check the parameters */
    assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction));

    /* Process Locked */
    __HAL_LOCK(hspi);

    /* Don't overwrite in case of HAL_SPI_STATE_BUSY_RX */
    if(hspi->State == HAL_SPI_STATE_READY)
    {
      hspi->State = HAL_SPI_STATE_BUSY_TX_RX;
    }

     /* Configure communication */
    hspi->ErrorCode   = HAL_SPI_ERROR_NONE;

    hspi->pRxBuffPtr  = pRxData;
    hspi->RxXferSize  = Size;
    hspi->RxXferCount = Size;

    hspi->pTxBuffPtr  = pTxData;
    hspi->TxXferSize  = Size;
    hspi->TxXferCount = Size;

    /*Init field not used in handle to zero */
    hspi->RxISR = 0;
    hspi->TxISR = 0;

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    /* Transmit and Receive data in 16 Bit mode */
    if(hspi->Init.DataSize == SPI_DATASIZE_16BIT)
    {
      if((hspi->Init.Mode == SPI_MODE_SLAVE) || ((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->TxXferCount == 0x01)))
      {
        hspi->Instance->DR = *((uint16_t*)hspi->pTxBuffPtr);
        hspi->pTxBuffPtr+=2;
        hspi->TxXferCount--;
      }
      if(hspi->TxXferCount == 0)
      {
        /* Enable CRC Transmission */
        if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
        {
          hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
        }

        /* Wait until RXNE flag is set */
        if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
        {
          return HAL_TIMEOUT;
        }

        *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR;
        hspi->pRxBuffPtr+=2;
        hspi->RxXferCount--;
      }
      else
      {
        while(hspi->TxXferCount > 0)
        {
          /* Wait until TXE flag is set to send data */
          if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, Timeout) != HAL_OK)
          {
            return HAL_TIMEOUT;
          }

          hspi->Instance->DR = *((uint16_t*)hspi->pTxBuffPtr);
          hspi->pTxBuffPtr+=2;
          hspi->TxXferCount--;

          /* Enable CRC Transmission */
          if((hspi->TxXferCount == 0) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE))
          {
            hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
          }

          /* Wait until RXNE flag is set */
          if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
          {
            return HAL_TIMEOUT;
          }

          *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR;
          hspi->pRxBuffPtr+=2;
          hspi->RxXferCount--;
        }
        /* Receive the last byte */
        if(hspi->Init.Mode == SPI_MODE_SLAVE)
        {
          /* Wait until RXNE flag is set */
          if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
          {
            return HAL_TIMEOUT;
          }

          *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR;
          hspi->pRxBuffPtr+=2;
          hspi->RxXferCount--;
        }
      }
    }
    /* Transmit and Receive data in 8 Bit mode */
    else
    {
      if((hspi->Init.Mode == SPI_MODE_SLAVE) || ((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->TxXferCount == 0x01)))
      {
        hspi->Instance->DR = (*hspi->pTxBuffPtr++);
        hspi->TxXferCount--;
      }
      if(hspi->TxXferCount == 0)
      {
        /* Enable CRC Transmission */
        if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
        {
          hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
        }

        /* Wait until RXNE flag is set */
        if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
        {
          return HAL_TIMEOUT;
        }

        (*hspi->pRxBuffPtr) = hspi->Instance->DR;
        hspi->RxXferCount--;
      }
      else
      {
        while(hspi->TxXferCount > 0)
        {
          /* Wait until TXE flag is set to send data */
          if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, Timeout) != HAL_OK)
          {
            return HAL_TIMEOUT;
          }

          hspi->Instance->DR = (*hspi->pTxBuffPtr++);
          hspi->TxXferCount--;

          /* Enable CRC Transmission */
          if((hspi->TxXferCount == 0) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE))
          {
            hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
          }

            /* Wait until RXNE flag is set */
            if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
            {
              return HAL_TIMEOUT;
            }

            (*hspi->pRxBuffPtr++) = hspi->Instance->DR;
            hspi->RxXferCount--;
        }
        if(hspi->Init.Mode == SPI_MODE_SLAVE)
        {
          /* Wait until RXNE flag is set */
          if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
          {
            return HAL_TIMEOUT;
          }

          (*hspi->pRxBuffPtr++) = hspi->Instance->DR;
          hspi->RxXferCount--;
        }
      }
    }

    /* Read CRC from DR to close CRC calculation process */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      /* Wait until RXNE flag is set */
      if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, Timeout) != HAL_OK)
      {
        hspi->ErrorCode |= HAL_SPI_ERROR_CRC;
        return HAL_TIMEOUT;
      }
      /* Read CRC */
      tmpreg = hspi->Instance->DR;
      UNUSED(tmpreg);
    }

    /* Wait until Busy flag is reset before disabling SPI */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_BSY, SET, Timeout) != HAL_OK)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
      return HAL_TIMEOUT;
    }

    hspi->State = HAL_SPI_STATE_READY;

    tmp = __HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR);
    /* Check if CRC error occurred */
    if((hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE) && (tmp != RESET))
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_CRC;

      /* Reset CRC Calculation */
      if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
      {
        SPI_RESET_CRC(hspi);
      }

      /* Process Unlocked */
      __HAL_UNLOCK(hspi);

      return HAL_ERROR;
    }

    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief  Transmit an amount of data in no-blocking mode with Interrupt
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  pData: pointer to data buffer
  * @param  Size: amount of data to be sent
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_Transmit_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
{
  if(hspi->State == HAL_SPI_STATE_READY)
  {
    if((pData == NULL) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Check the parameters */
    assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction));

    /* Process Locked */
    __HAL_LOCK(hspi);

    /* Configure communication */
    hspi->State        = HAL_SPI_STATE_BUSY_TX;
    hspi->ErrorCode    = HAL_SPI_ERROR_NONE;

    hspi->TxISR = &SPI_TxISR;
    hspi->pTxBuffPtr   = pData;
    hspi->TxXferSize   = Size;
    hspi->TxXferCount  = Size;

    /*Init field not used in handle to zero */
    hspi->RxISR = 0;
    hspi->RxXferSize   = 0;
    hspi->RxXferCount  = 0;

    /* Configure communication direction : 1Line */
    if(hspi->Init.Direction == SPI_DIRECTION_1LINE)
    {
      SPI_1LINE_TX(hspi);
    }

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    if (hspi->Init.Direction == SPI_DIRECTION_2LINES)
    {
      __HAL_SPI_ENABLE_IT(hspi, (SPI_IT_TXE));
    }else
    {
      /* Enable TXE and ERR interrupt */
      __HAL_SPI_ENABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_ERR));
    }
    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief  Receive an amount of data in no-blocking mode with Interrupt
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  pData: pointer to data buffer
  * @param  Size: amount of data to be sent
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_Receive_IT(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
{
  if(hspi->State == HAL_SPI_STATE_READY)
  {
    if((pData == NULL) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Process Locked */
    __HAL_LOCK(hspi);

    /* Configure communication */
    hspi->State        = HAL_SPI_STATE_BUSY_RX;
    hspi->ErrorCode    = HAL_SPI_ERROR_NONE;

    hspi->RxISR = &SPI_RxISR;
    hspi->pRxBuffPtr   = pData;
    hspi->RxXferSize   = Size;
    hspi->RxXferCount  = Size ;

   /*Init field not used in handle to zero */
    hspi->TxISR = 0;
    hspi->TxXferSize   = 0;
    hspi->TxXferCount  = 0;

    /* Configure communication direction : 1Line */
    if(hspi->Init.Direction == SPI_DIRECTION_1LINE)
    {
       SPI_1LINE_RX(hspi);
    }
    else if((hspi->Init.Direction == SPI_DIRECTION_2LINES) && (hspi->Init.Mode == SPI_MODE_MASTER))
    {
       /* Process Unlocked */
       __HAL_UNLOCK(hspi);

       /* Call transmit-receive function to send Dummy data on Tx line and generate clock on CLK line */
       return HAL_SPI_TransmitReceive_IT(hspi, pData, pData, Size);
    }

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    /* Enable TXE and ERR interrupt */
    __HAL_SPI_ENABLE_IT(hspi, (SPI_IT_RXNE | SPI_IT_ERR));

    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    /* Note : The SPI must be enabled after unlocking current process
              to avoid the risk of SPI interrupt handle execution before current
              process unlock */

        /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief  Transmit and Receive an amount of data in no-blocking mode with Interrupt
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  pTxData: pointer to transmission data buffer
  * @param  pRxData: pointer to reception data buffer to be
  * @param  Size: amount of data to be sent
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
{
 uint32_t tmpstate = 0;

 tmpstate = hspi->State;
  if((tmpstate == HAL_SPI_STATE_READY) || \
     ((hspi->Init.Mode == SPI_MODE_MASTER) && (hspi->Init.Direction == SPI_DIRECTION_2LINES) && (tmpstate == HAL_SPI_STATE_BUSY_RX)))
  {
    if((pTxData == NULL ) || (pRxData == NULL ) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Check the parameters */
    assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction));

    /* Process locked */
    __HAL_LOCK(hspi);

    /* Don't overwrite in case of HAL_SPI_STATE_BUSY_RX */
    if(hspi->State != HAL_SPI_STATE_BUSY_RX)
    {
      hspi->State = HAL_SPI_STATE_BUSY_TX_RX;
    }

    /* Configure communication */
    hspi->ErrorCode    = HAL_SPI_ERROR_NONE;

    hspi->TxISR = &SPI_TxISR;
    hspi->pTxBuffPtr   = pTxData;
    hspi->TxXferSize   = Size;
    hspi->TxXferCount  = Size;

    hspi->RxISR = &SPI_2LinesRxISR;
    hspi->pRxBuffPtr   = pRxData;
    hspi->RxXferSize   = Size;
    hspi->RxXferCount  = Size;

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    /* Enable TXE, RXNE and ERR interrupt */
    __HAL_SPI_ENABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR));

    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief  Transmit an amount of data in no-blocking mode with DMA
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  pData: pointer to data buffer
  * @param  Size: amount of data to be sent
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
{
  if(hspi->State == HAL_SPI_STATE_READY)
  {
    if((pData == NULL) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Check the parameters */
    assert_param(IS_SPI_DIRECTION_2LINES_OR_1LINE(hspi->Init.Direction));

    /* Process Locked */
    __HAL_LOCK(hspi);

    /* Configure communication */
    hspi->State       = HAL_SPI_STATE_BUSY_TX;
    hspi->ErrorCode   = HAL_SPI_ERROR_NONE;

    hspi->pTxBuffPtr  = pData;
    hspi->TxXferSize  = Size;
    hspi->TxXferCount = Size;

    /*Init field not used in handle to zero */
    hspi->TxISR = 0;
    hspi->RxISR = 0;
    hspi->RxXferSize   = 0;
    hspi->RxXferCount  = 0;

    /* Configure communication direction : 1Line */
    if(hspi->Init.Direction == SPI_DIRECTION_1LINE)
    {
      SPI_1LINE_TX(hspi);
    }

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    /* Set the SPI TxDMA Half transfer complete callback */
    hspi->hdmatx->XferHalfCpltCallback = SPI_DMAHalfTransmitCplt;

    /* Set the SPI TxDMA transfer complete callback */
    hspi->hdmatx->XferCpltCallback = SPI_DMATransmitCplt;

    /* Set the DMA error callback */
    hspi->hdmatx->XferErrorCallback = SPI_DMAError;

    /* Enable the Tx DMA Stream */
    HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t)hspi->pTxBuffPtr, (uint32_t)&hspi->Instance->DR, hspi->TxXferCount);

    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    /* Enable Tx DMA Request */
    hspi->Instance->CR2 |= SPI_CR2_TXDMAEN;

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief  Receive an amount of data in no-blocking mode with DMA
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *         the configuration information for SPI module.
  * @param  pData: pointer to data buffer
  * @note  When the CRC feature is enabled the pData Length must be Size + 1.
  * @param  Size: amount of data to be sent
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
{
  if(hspi->State == HAL_SPI_STATE_READY)
  {
    if((pData == NULL) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Process Locked */
    __HAL_LOCK(hspi);

    /* Configure communication */
    hspi->State       = HAL_SPI_STATE_BUSY_RX;
    hspi->ErrorCode   = HAL_SPI_ERROR_NONE;

    hspi->pRxBuffPtr  = pData;
    hspi->RxXferSize  = Size;
    hspi->RxXferCount = Size;

    /*Init field not used in handle to zero */
    hspi->RxISR = 0;
    hspi->TxISR = 0;
    hspi->TxXferSize   = 0;
    hspi->TxXferCount  = 0;

    /* Configure communication direction : 1Line */
    if(hspi->Init.Direction == SPI_DIRECTION_1LINE)
    {
       SPI_1LINE_RX(hspi);
    }
    else if((hspi->Init.Direction == SPI_DIRECTION_2LINES)&&(hspi->Init.Mode == SPI_MODE_MASTER))
    {
       /* Process Unlocked */
       __HAL_UNLOCK(hspi);

       /* Call transmit-receive function to send Dummy data on Tx line and generate clock on CLK line */
       return HAL_SPI_TransmitReceive_DMA(hspi, pData, pData, Size);
    }

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    /* Set the SPI RxDMA Half transfer complete callback */
    hspi->hdmarx->XferHalfCpltCallback = SPI_DMAHalfReceiveCplt;

    /* Set the SPI Rx DMA transfer complete callback */
    hspi->hdmarx->XferCpltCallback = SPI_DMAReceiveCplt;

    /* Set the DMA error callback */
    hspi->hdmarx->XferErrorCallback = SPI_DMAError;

    /* Enable the Rx DMA Stream */
    HAL_DMA_Start_IT(hspi->hdmarx, (uint32_t)&hspi->Instance->DR, (uint32_t)hspi->pRxBuffPtr, hspi->RxXferCount);

    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    /* Enable Rx DMA Request */
    hspi->Instance->CR2 |= SPI_CR2_RXDMAEN;

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief  Transmit and Receive an amount of data in no-blocking mode with DMA
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  pTxData: pointer to transmission data buffer
  * @param  pRxData: pointer to reception data buffer
  * @note  When the CRC feature is enabled the pRxData Length must be Size + 1
  * @param  Size: amount of data to be sent
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
{
  uint32_t tmpstate = 0;
  tmpstate = hspi->State;
  if((tmpstate == HAL_SPI_STATE_READY) || ((hspi->Init.Mode == SPI_MODE_MASTER) && \
     (hspi->Init.Direction == SPI_DIRECTION_2LINES) && (tmpstate == HAL_SPI_STATE_BUSY_RX)))
  {
    if((pTxData == NULL ) || (pRxData == NULL ) || (Size == 0))
    {
      return  HAL_ERROR;
    }

    /* Check the parameters */
    assert_param(IS_SPI_DIRECTION_2LINES(hspi->Init.Direction));

    /* Process locked */
    __HAL_LOCK(hspi);

    /* Don't overwrite in case of HAL_SPI_STATE_BUSY_RX */
    if(hspi->State != HAL_SPI_STATE_BUSY_RX)
    {
      hspi->State = HAL_SPI_STATE_BUSY_TX_RX;
    }

    /* Configure communication */
    hspi->ErrorCode   = HAL_SPI_ERROR_NONE;

    hspi->pTxBuffPtr  = (uint8_t*)pTxData;
    hspi->TxXferSize  = Size;
    hspi->TxXferCount = Size;

    hspi->pRxBuffPtr  = (uint8_t*)pRxData;
    hspi->RxXferSize  = Size;
    hspi->RxXferCount = Size;

    /*Init field not used in handle to zero */
    hspi->RxISR = 0;
    hspi->TxISR = 0;

    /* Reset CRC Calculation */
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      SPI_RESET_CRC(hspi);
    }

    /* Check if we are in Rx only or in Rx/Tx Mode and configure the DMA transfer complete callback */
    if(hspi->State == HAL_SPI_STATE_BUSY_RX)
    {
      /* Set the SPI Rx DMA Half transfer complete callback */
      hspi->hdmarx->XferHalfCpltCallback = SPI_DMAHalfReceiveCplt;

      hspi->hdmarx->XferCpltCallback = SPI_DMAReceiveCplt;
    }
    else
    {
      /* Set the SPI Tx/Rx DMA Half transfer complete callback */
      hspi->hdmarx->XferHalfCpltCallback = SPI_DMAHalfTransmitReceiveCplt;

      hspi->hdmarx->XferCpltCallback = SPI_DMATransmitReceiveCplt;
    }

    /* Set the DMA error callback */
    hspi->hdmarx->XferErrorCallback = SPI_DMAError;

    /* Enable the Rx DMA Stream */
    HAL_DMA_Start_IT(hspi->hdmarx, (uint32_t)&hspi->Instance->DR, (uint32_t)hspi->pRxBuffPtr, hspi->RxXferCount);

    /* Enable Rx DMA Request */
    hspi->Instance->CR2 |= SPI_CR2_RXDMAEN;

    /* Set the SPI Tx DMA transfer complete callback as NULL because the communication closing
    is performed in DMA reception complete callback  */
    hspi->hdmatx->XferCpltCallback = NULL;

    if(hspi->State == HAL_SPI_STATE_BUSY_TX_RX)
    {
      /* Set the DMA error callback */
      hspi->hdmatx->XferErrorCallback = SPI_DMAError;
    }
    else
    {
      hspi->hdmatx->XferErrorCallback = NULL;
    }

    /* Enable the Tx DMA Stream */
    HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t)hspi->pTxBuffPtr, (uint32_t)&hspi->Instance->DR, hspi->TxXferCount);

    /* Process Unlocked */
    __HAL_UNLOCK(hspi);

    /* Check if the SPI is already enabled */
    if((hspi->Instance->CR1 &SPI_CR1_SPE) != SPI_CR1_SPE)
    {
      /* Enable SPI peripheral */
      __HAL_SPI_ENABLE(hspi);
    }

    /* Enable Tx DMA Request */
    hspi->Instance->CR2 |= SPI_CR2_TXDMAEN;

    return HAL_OK;
  }
  else
  {
    return HAL_BUSY;
  }
}

/**
  * @brief Pauses the DMA Transfer.
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for the specified SPI module.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_DMAPause(SPI_HandleTypeDef *hspi)
{
  /* Process Locked */
  __HAL_LOCK(hspi);

  /* Disable the SPI DMA Tx & Rx requests */
  hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN);
  hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN);

  /* Process Unlocked */
  __HAL_UNLOCK(hspi);

  return HAL_OK;
}

/**
  * @brief Resumes the DMA Transfer.
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for the specified SPI module.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_DMAResume(SPI_HandleTypeDef *hspi)
{
  /* Process Locked */
  __HAL_LOCK(hspi);

  /* Enable the SPI DMA Tx & Rx requests */
  hspi->Instance->CR2 |= SPI_CR2_TXDMAEN;
  hspi->Instance->CR2 |= SPI_CR2_RXDMAEN;

  /* Process Unlocked */
  __HAL_UNLOCK(hspi);

  return HAL_OK;
}

/**
  * @brief Stops the DMA Transfer.
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for the specified SPI module.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_SPI_DMAStop(SPI_HandleTypeDef *hspi)
{
  /* The Lock is not implemented on this API to allow the user application
     to call the HAL SPI API under callbacks HAL_SPI_TxCpltCallback() or HAL_SPI_RxCpltCallback() or HAL_SPI_TxRxCpltCallback():
     when calling HAL_DMA_Abort() API the DMA TX/RX Transfer complete interrupt is generated
     and the correspond call back is executed HAL_SPI_TxCpltCallback() or HAL_SPI_RxCpltCallback() or HAL_SPI_TxRxCpltCallback()
     */

  /* Abort the SPI DMA tx Stream */
  if(hspi->hdmatx != NULL)
  {
    HAL_DMA_Abort(hspi->hdmatx);
  }
  /* Abort the SPI DMA rx Stream */
  if(hspi->hdmarx != NULL)
  {
    HAL_DMA_Abort(hspi->hdmarx);
  }

  /* Disable the SPI DMA Tx & Rx requests */
  hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN);
  hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN);

  hspi->State = HAL_SPI_STATE_READY;

  return HAL_OK;
}

/**
  * @brief  This function handles SPI interrupt request.
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval HAL status
  */
void HAL_SPI_IRQHandler(SPI_HandleTypeDef *hspi)
{
  uint32_t tmp1 = 0, tmp2 = 0, tmp3 = 0;

  tmp1 = __HAL_SPI_GET_FLAG(hspi, SPI_FLAG_RXNE);
  tmp2 = __HAL_SPI_GET_IT_SOURCE(hspi, SPI_IT_RXNE);
  tmp3 = __HAL_SPI_GET_FLAG(hspi, SPI_FLAG_OVR);
  /* SPI in mode Receiver and Overrun not occurred ---------------------------*/
  if((tmp1 != RESET) && (tmp2 != RESET) && (tmp3 == RESET))
  {
    hspi->RxISR(hspi);
    return;
  }

  tmp1 = __HAL_SPI_GET_FLAG(hspi, SPI_FLAG_TXE);
  tmp2 = __HAL_SPI_GET_IT_SOURCE(hspi, SPI_IT_TXE);
  /* SPI in mode Transmitter ---------------------------------------------------*/
  if((tmp1 != RESET) && (tmp2 != RESET))
  {
    hspi->TxISR(hspi);
    return;
  }

  if(__HAL_SPI_GET_IT_SOURCE(hspi, SPI_IT_ERR) != RESET)
  {
    /* SPI CRC error interrupt occurred ---------------------------------------*/
    if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_CRC;
      __HAL_SPI_CLEAR_CRCERRFLAG(hspi);
    }
    /* SPI Mode Fault error interrupt occurred --------------------------------*/
    if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_MODF) != RESET)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_MODF;
      __HAL_SPI_CLEAR_MODFFLAG(hspi);
    }

    /* SPI Overrun error interrupt occurred -----------------------------------*/
    if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_OVR) != RESET)
    {
      if(hspi->State != HAL_SPI_STATE_BUSY_TX)
      {
        hspi->ErrorCode |= HAL_SPI_ERROR_OVR;
        __HAL_SPI_CLEAR_OVRFLAG(hspi);
      }
    }

    /* SPI Frame error interrupt occurred -------------------------------------*/
    if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_FRE) != RESET)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FRE;
      __HAL_SPI_CLEAR_FREFLAG(hspi);
    }

    /* Call the Error call Back in case of Errors */
    if(hspi->ErrorCode!=HAL_SPI_ERROR_NONE)
    {
      hspi->State = HAL_SPI_STATE_READY;
      HAL_SPI_ErrorCallback(hspi);
    }
  }
}

/**
  * @brief Tx Transfer completed callbacks
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
__weak void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_SPI_TxCpltCallback could be implemented in the user file
   */
}

/**
  * @brief Rx Transfer completed callbacks
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
__weak void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_SPI_RxCpltCallback() could be implemented in the user file
   */
}

/**
  * @brief Tx and Rx Transfer completed callbacks
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
__weak void HAL_SPI_TxRxCpltCallback(SPI_HandleTypeDef *hspi)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_SPI_TxRxCpltCallback() could be implemented in the user file
   */
}

/**
  * @brief Tx Half Transfer completed callbacks
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
__weak void HAL_SPI_TxHalfCpltCallback(SPI_HandleTypeDef *hspi)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_SPI_TxHalfCpltCallback could be implemented in the user file
   */
}

/**
  * @brief Rx Half Transfer completed callbacks
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
__weak void HAL_SPI_RxHalfCpltCallback(SPI_HandleTypeDef *hspi)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_SPI_RxHalfCpltCallback() could be implemented in the user file
   */
}

/**
  * @brief Tx and Rx Transfer completed callbacks
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
__weak void HAL_SPI_TxRxHalfCpltCallback(SPI_HandleTypeDef *hspi)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_SPI_TxRxHalfCpltCallback() could be implemented in the user file
   */
}

/**
  * @brief SPI error callbacks
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
 __weak void HAL_SPI_ErrorCallback(SPI_HandleTypeDef *hspi)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hspi);
  /* NOTE : - This function Should not be modified, when the callback is needed,
            the HAL_SPI_ErrorCallback() could be implemented in the user file.
            - The ErrorCode parameter in the hspi handle is updated by the SPI processes
            and user can use HAL_SPI_GetError() API to check the latest error occurred.
   */
}

/**
  * @}
  */

/** @defgroup SPI_Exported_Functions_Group3 Peripheral State and Errors functions
  *  @brief   SPI control functions
  *
@verbatim
 ===============================================================================
                      ##### Peripheral State and Errors functions #####
 ===============================================================================
    [..]
    This subsection provides a set of functions allowing to control the SPI.
     (+) HAL_SPI_GetState() API can be helpful to check in run-time the state of the SPI peripheral
     (+) HAL_SPI_GetError() check in run-time Errors occurring during communication
@endverbatim
  * @{
  */

/**
  * @brief  Return the SPI state
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval HAL state
  */
HAL_SPI_StateTypeDef HAL_SPI_GetState(SPI_HandleTypeDef *hspi)
{
  return hspi->State;
}

/**
  * @brief  Return the SPI error code
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval SPI Error Code
  */
uint32_t HAL_SPI_GetError(SPI_HandleTypeDef *hspi)
{
  return hspi->ErrorCode;
}

/**
  * @}
  */

  /**
  * @brief  Interrupt Handler to close Tx transfer
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval void
  */
static void SPI_TxCloseIRQHandler(SPI_HandleTypeDef *hspi)
{
  /* Wait until TXE flag is set to send data */
  if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK)
  {
    hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
  }

  /* Disable TXE interrupt */
  __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE ));

  /* Disable ERR interrupt if Receive process is finished */
  if(__HAL_SPI_GET_IT_SOURCE(hspi, SPI_IT_RXNE) == RESET)
  {
    __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_ERR));

    /* Wait until Busy flag is reset before disabling SPI */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_BSY, SET, SPI_TIMEOUT_VALUE) != HAL_OK)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
    }

    /* Clear OVERRUN flag in 2 Lines communication mode because received is not read */
    if(hspi->Init.Direction == SPI_DIRECTION_2LINES)
    {
      __HAL_SPI_CLEAR_OVRFLAG(hspi);
    }

    /* Check if Errors has been detected during transfer */
    if(hspi->ErrorCode ==  HAL_SPI_ERROR_NONE)
    {
      /* Check if we are in Tx or in Rx/Tx Mode */
      if(hspi->State == HAL_SPI_STATE_BUSY_TX_RX)
      {
        /* Set state to READY before run the Callback Complete */
        hspi->State = HAL_SPI_STATE_READY;
        HAL_SPI_TxRxCpltCallback(hspi);
      }
      else
      {
        /* Set state to READY before run the Callback Complete */
        hspi->State = HAL_SPI_STATE_READY;
        HAL_SPI_TxCpltCallback(hspi);
      }
    }
    else
    {
      /* Set state to READY before run the Callback Complete */
      hspi->State = HAL_SPI_STATE_READY;
      /* Call Error call back in case of Error */
      HAL_SPI_ErrorCallback(hspi);
    }
  }
}

/**
  * @brief  Interrupt Handler to transmit amount of data in no-blocking mode
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval void
  */
static void SPI_TxISR(SPI_HandleTypeDef *hspi)
{
  /* Transmit data in 8 Bit mode */
  if(hspi->Init.DataSize == SPI_DATASIZE_8BIT)
  {
    hspi->Instance->DR = (*hspi->pTxBuffPtr++);
  }
  /* Transmit data in 16 Bit mode */
  else
  {
    hspi->Instance->DR = *((uint16_t*)hspi->pTxBuffPtr);
    hspi->pTxBuffPtr+=2;
  }
  hspi->TxXferCount--;

  if(hspi->TxXferCount == 0)
  {
    if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
    {
      /* calculate and transfer CRC on Tx line */
      hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
    }
    SPI_TxCloseIRQHandler(hspi);
  }
}

/**
  * @brief  Interrupt Handler to close Rx transfer
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval void
  */
static void SPI_RxCloseIRQHandler(SPI_HandleTypeDef *hspi)
{
  __IO uint16_t tmpreg;

  if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
  {
    /* Wait until RXNE flag is set to send data */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
    }

    /* Read CRC to reset RXNE flag */
    tmpreg = hspi->Instance->DR;
    UNUSED(tmpreg);

    /* Wait until RXNE flag is set to send data */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) != HAL_OK)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
    }

    /* Check if CRC error occurred */
    if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_CRC;

      /* Reset CRC Calculation */
      SPI_RESET_CRC(hspi);
    }
  }

  /* Disable RXNE and ERR interrupt */
  __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_RXNE));

  /* if Transmit process is finished */
  if(__HAL_SPI_GET_IT_SOURCE(hspi, SPI_IT_TXE) == RESET)
  {
    /* Disable ERR interrupt */
    __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_ERR));

    if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY)))
    {
      /* Disable SPI peripheral */
      __HAL_SPI_DISABLE(hspi);
    }

    /* Check if Errors has been detected during transfer */
    if(hspi->ErrorCode ==  HAL_SPI_ERROR_NONE)
    {
      /* Check if we are in Rx or in Rx/Tx Mode */
      if(hspi->State == HAL_SPI_STATE_BUSY_TX_RX)
      {
        /* Set state to READY before run the Callback Complete */
        hspi->State = HAL_SPI_STATE_READY;
        HAL_SPI_TxRxCpltCallback(hspi);
      }
      else
      {
        /* Set state to READY before run the Callback Complete */
        hspi->State = HAL_SPI_STATE_READY;
        HAL_SPI_RxCpltCallback(hspi);
      }
    }
    else
    {
      /* Set state to READY before run the Callback Complete */
      hspi->State = HAL_SPI_STATE_READY;
      /* Call Error call back in case of Error */
      HAL_SPI_ErrorCallback(hspi);
    }
  }
}

/**
  * @brief  Interrupt Handler to receive amount of data in 2Lines mode
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval void
  */
static void SPI_2LinesRxISR(SPI_HandleTypeDef *hspi)
{
  /* Receive data in 8 Bit mode */
  if(hspi->Init.DataSize == SPI_DATASIZE_8BIT)
  {
    (*hspi->pRxBuffPtr++) = hspi->Instance->DR;
  }
  /* Receive data in 16 Bit mode */
  else
  {
    *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR;
    hspi->pRxBuffPtr+=2;
  }
  hspi->RxXferCount--;

  if(hspi->RxXferCount==0)
  {
    SPI_RxCloseIRQHandler(hspi);
  }
}

/**
  * @brief  Interrupt Handler to receive amount of data in no-blocking mode
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval void
  */
static void SPI_RxISR(SPI_HandleTypeDef *hspi)
{
  /* Receive data in 8 Bit mode */
  if(hspi->Init.DataSize == SPI_DATASIZE_8BIT)
  {
    (*hspi->pRxBuffPtr++) = hspi->Instance->DR;
  }
  /* Receive data in 16 Bit mode */
  else
  {
    *((uint16_t*)hspi->pRxBuffPtr) = hspi->Instance->DR;
    hspi->pRxBuffPtr+=2;
  }
    hspi->RxXferCount--;

  /* Enable CRC Transmission */
  if((hspi->RxXferCount == 1) && (hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE))
  {
    /* Set CRC Next to calculate CRC on Rx side */
    hspi->Instance->CR1 |= SPI_CR1_CRCNEXT;
  }

  if(hspi->RxXferCount == 0)
  {
    SPI_RxCloseIRQHandler(hspi);
  }
}

/**
  * @brief DMA SPI transmit process complete callback
  * @param  hdma: pointer to a DMA_HandleTypeDef structure that contains
  *                the configuration information for the specified DMA module.
  * @retval None
  */
static void SPI_DMATransmitCplt(DMA_HandleTypeDef *hdma)
{
  SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;

  /* DMA Normal Mode */
  if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0)
  {
    /* Wait until TXE flag is set to send data */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
    }
    /* Disable Tx DMA Request */
    hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN);

    /* Wait until Busy flag is reset before disabling SPI */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_BSY, SET, SPI_TIMEOUT_VALUE) != HAL_OK)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
    }

    hspi->TxXferCount = 0;

    hspi->State = HAL_SPI_STATE_READY;
  }

  /* Clear OVERRUN flag in 2 Lines communication mode because received is not read */
  if(hspi->Init.Direction == SPI_DIRECTION_2LINES)
  {
   __HAL_SPI_CLEAR_OVRFLAG(hspi);
  }

  /* Check if Errors has been detected during transfer */
  if(hspi->ErrorCode != HAL_SPI_ERROR_NONE)
  {
    HAL_SPI_ErrorCallback(hspi);
  }
  else
  {
    HAL_SPI_TxCpltCallback(hspi);
  }
}

/**
  * @brief DMA SPI receive process complete callback
  * @param  hdma: pointer to a DMA_HandleTypeDef structure that contains
  *                the configuration information for the specified DMA module.
  * @retval None
  */
static void SPI_DMAReceiveCplt(DMA_HandleTypeDef *hdma)
{
  __IO uint16_t tmpreg;

  SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;
  /* DMA Normal mode */
  if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0)
  {
    if((hspi->Init.Direction == SPI_DIRECTION_2LINES)&&(hspi->Init.Mode == SPI_MODE_MASTER))
    {
       SPI_DMAEndTransmitReceive(hspi);
    }
    /* SPI_DIRECTION_1LINE or SPI_DIRECTION_2LINES_RXONLY */
    else
    {
      if((hspi->Init.Mode == SPI_MODE_MASTER)&&((hspi->Init.Direction == SPI_DIRECTION_1LINE)||(hspi->Init.Direction == SPI_DIRECTION_2LINES_RXONLY)))
      {
        /* Disable SPI peripheral */
        __HAL_SPI_DISABLE(hspi);
      }

      /* Disable Rx DMA Request */
      hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN);

      hspi->RxXferCount = 0;

      /* Reset CRC Calculation */
      if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
      {
        /* Wait until RXNE flag is set to send data */
        if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK)
        {
          hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
        }

        /* Read CRC */
        tmpreg = hspi->Instance->DR;
        UNUSED(tmpreg);

        /* Wait until RXNE flag is set */
        if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) != HAL_OK)
        {
          hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
        }

        /* Check if CRC error occurred */
        if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET)
        {
          hspi->ErrorCode |= HAL_SPI_ERROR_CRC;
          __HAL_SPI_CLEAR_CRCERRFLAG(hspi);
        }
      }
    }

    hspi->State = HAL_SPI_STATE_READY;

    /* Check if Errors has been detected during transfer */
    if(hspi->ErrorCode != HAL_SPI_ERROR_NONE)
    {
      HAL_SPI_ErrorCallback(hspi);
    }
    else
    {
      HAL_SPI_RxCpltCallback(hspi);
    }
  }
  else
  {
    HAL_SPI_RxCpltCallback(hspi);
  }
}

/**
  * @brief End DMA SPI transmit receive process
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @retval None
  */
static void SPI_DMAEndTransmitReceive(SPI_HandleTypeDef *hspi)
{
  __IO uint16_t tmpreg;

  /* Reset CRC Calculation */
  if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
  {
    /* Check if CRC is done on going (RXNE flag set) */
    if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, SET, SPI_TIMEOUT_VALUE) == HAL_OK)
    {
      /* Wait until RXNE flag is set to send data */
      if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_RXNE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK)
      {
        hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
      }
    }
    /* Read CRC */
    tmpreg = hspi->Instance->DR;
    UNUSED(tmpreg);

    /* Check if CRC error occurred */
    if(__HAL_SPI_GET_FLAG(hspi, SPI_FLAG_CRCERR) != RESET)
    {
      hspi->ErrorCode |= HAL_SPI_ERROR_CRC;
      __HAL_SPI_CLEAR_CRCERRFLAG(hspi);
    }
  }

  /* Wait until TXE flag is set to send data */
  if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_TXE, RESET, SPI_TIMEOUT_VALUE) != HAL_OK)
  {
    hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
  }
  /* Disable Tx DMA Request */
  hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_TXDMAEN);

  /* Wait until Busy flag is reset before disabling SPI */
  if(SPI_WaitOnFlagUntilTimeout(hspi, SPI_FLAG_BSY, SET, SPI_TIMEOUT_VALUE) != HAL_OK)
  {
    hspi->ErrorCode |= HAL_SPI_ERROR_FLAG;
  }

  /* Disable Rx DMA Request */
  hspi->Instance->CR2 &= (uint32_t)(~SPI_CR2_RXDMAEN);

  hspi->TxXferCount = 0;
  hspi->RxXferCount = 0;
}

/**
  * @brief DMA SPI transmit receive process complete callback
  * @param  hdma: pointer to a DMA_HandleTypeDef structure that contains
  *                the configuration information for the specified DMA module.
  * @retval None
  */
static void SPI_DMATransmitReceiveCplt(DMA_HandleTypeDef *hdma)
{
  SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;
  if((hdma->Instance->CR & DMA_SxCR_CIRC) == 0)
  { /**/
    SPI_DMAEndTransmitReceive(hspi);

    hspi->State = HAL_SPI_STATE_READY;

    /* Check if Errors has been detected during transfer */
    if(hspi->ErrorCode != HAL_SPI_ERROR_NONE)
    {
      HAL_SPI_ErrorCallback(hspi);
    }
    else
    {
      HAL_SPI_TxRxCpltCallback(hspi);
    }
  }
  else
  {
    HAL_SPI_TxRxCpltCallback(hspi);
  }
}

/**
  * @brief DMA SPI half transmit process complete callback
  * @param  hdma: pointer to a DMA_HandleTypeDef structure that contains
  *                the configuration information for the specified DMA module.
  * @retval None
  */
static void SPI_DMAHalfTransmitCplt(DMA_HandleTypeDef *hdma)
{
  SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;

  HAL_SPI_TxHalfCpltCallback(hspi);
}

/**
  * @brief DMA SPI half receive process complete callback
  * @param  hdma: pointer to a DMA_HandleTypeDef structure that contains
  *                the configuration information for the specified DMA module.
  * @retval None
  */
static void SPI_DMAHalfReceiveCplt(DMA_HandleTypeDef *hdma)
{
  SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;

  HAL_SPI_RxHalfCpltCallback(hspi);
}

/**
  * @brief DMA SPI Half transmit receive process complete callback
  * @param  hdma: pointer to a DMA_HandleTypeDef structure that contains
  *                the configuration information for the specified DMA module.
  * @retval None
  */
static void SPI_DMAHalfTransmitReceiveCplt(DMA_HandleTypeDef *hdma)
{
  SPI_HandleTypeDef* hspi = ( SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;

  HAL_SPI_TxRxHalfCpltCallback(hspi);
}

/**
  * @brief DMA SPI communication error callback
  * @param  hdma: pointer to a DMA_HandleTypeDef structure that contains
  *                the configuration information for the specified DMA module.
  * @retval None
  */
static void SPI_DMAError(DMA_HandleTypeDef *hdma)
{
  SPI_HandleTypeDef* hspi = (SPI_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent;
  hspi->TxXferCount = 0;
  hspi->RxXferCount = 0;
  hspi->State= HAL_SPI_STATE_READY;
  hspi->ErrorCode |= HAL_SPI_ERROR_DMA;
  HAL_SPI_ErrorCallback(hspi);
}

/**
  * @brief This function handles SPI Communication Timeout.
  * @param  hspi: pointer to a SPI_HandleTypeDef structure that contains
  *                the configuration information for SPI module.
  * @param  Flag: SPI flag to check
  * @param  Status: Flag status to check: RESET or set
  * @param  Timeout: Timeout duration
  * @retval HAL status
  */
static HAL_StatusTypeDef SPI_WaitOnFlagUntilTimeout(SPI_HandleTypeDef *hspi, uint32_t Flag, FlagStatus Status, uint32_t Timeout)
{
  uint32_t tickstart = 0;

  /* Get tick */
  tickstart = HAL_GetTick();

  /* Wait until flag is set */
  if(Status == RESET)
  {
    while(__HAL_SPI_GET_FLAG(hspi, Flag) == RESET)
    {
      if(Timeout != HAL_MAX_DELAY)
      {
        if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
        {
          /* Disable the SPI and reset the CRC: the CRC value should be cleared
             on both master and slave sides in order to resynchronize the master
             and slave for their respective CRC calculation */

          /* Disable TXE, RXNE and ERR interrupts for the interrupt process */
          __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR));

          /* Disable SPI peripheral */
          __HAL_SPI_DISABLE(hspi);

          /* Reset CRC Calculation */
          if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
          {
            SPI_RESET_CRC(hspi);
          }

          hspi->State= HAL_SPI_STATE_READY;

          /* Process Unlocked */
          __HAL_UNLOCK(hspi);

          return HAL_TIMEOUT;
        }
      }
    }
  }
  else
  {
    while(__HAL_SPI_GET_FLAG(hspi, Flag) != RESET)
    {
      if(Timeout != HAL_MAX_DELAY)
      {
        if((Timeout == 0)||((HAL_GetTick() - tickstart ) > Timeout))
        {
          /* Disable the SPI and reset the CRC: the CRC value should be cleared
             on both master and slave sides in order to resynchronize the master
             and slave for their respective CRC calculation */

          /* Disable TXE, RXNE and ERR interrupts for the interrupt process */
          __HAL_SPI_DISABLE_IT(hspi, (SPI_IT_TXE | SPI_IT_RXNE | SPI_IT_ERR));

          /* Disable SPI peripheral */
          __HAL_SPI_DISABLE(hspi);

          /* Reset CRC Calculation */
          if(hspi->Init.CRCCalculation == SPI_CRCCALCULATION_ENABLE)
          {
            SPI_RESET_CRC(hspi);
          }

          hspi->State= HAL_SPI_STATE_READY;

          /* Process Unlocked */
          __HAL_UNLOCK(hspi);

          return HAL_TIMEOUT;
        }
      }
    }
  }
  return HAL_OK;
}

/**
  * @}
  */

#endif /* HAL_SPI_MODULE_ENABLED */
/**
  * @}
  */

/**
  * @}
  */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

redpajama_set_name: RedPajamaGithub


Vast areas of arable land in Akhaura area of Brahmanbaria district are under threat due to dumping of untreated poisonous waste from India's Agartala. Expressing deep concern, Bangladesh has raised the issue before the Joint Rivers Commission (JRC) and drawn the attention of the Indian authorities.
The untreated industrial, household and medical waste is being dumped into the Akhaura canal that enters Bangladesh through the Agartala-Akhaura border.
The stinky waste spreads in the Akahura area and finally reaches the Titas River through the Kalondi, Kalikapur and Sonarbadi canals.
The Department of Environment (DoE) has conducted a test of the canal water and found the presence of heavy metals like lead, chromium and iron.
During a recent visit, this correspondent found stinky jet black water, along with plastic bottles and polythene, entering Bangladesh through the Akhaura border.
Some Border Guard Bangladesh (BGB) personnel, on condition of anonymity, told this correspondent that the canal water stinks.
"Sometimes it becomes unbearable for us to perform our duty. At times, the canal overflows. We have informed the higher authorities, but no remedy as yet," one of them said.
Many farmers have to use the canal water for irrigation purposes to minimise their production cost, he said in reply to a query.
"We have tested the canal water at various points. The presence of dissolved oxygen (DO) is very low. The DO level is only 0.24-0.36 mg/L, against the standard 5mg/L in canal water. Besides, the presence of heavy metals, like lead, chromium and iron was found," Mosabber Hossain Muhammad Rajib, assistant director of the DoE in Brahmanbaria district told The Independent last week.
The issue was discussed during a technical level JRC meeting between the two countries. Bangladesh's concern was conveyed to India, JRC member Md Mofazzal Hossain told this correspondent.
"The Indian authorities have assured us several times that it would construct an effluent treatment plant (ETP) to treat the waste before releasing it in the water. We are yet to confirm whether this has been done," the JRC member said in reply to a query.
Trans-boundary water pollution is taking place in downstream rivers in Bangladesh, as most of them originate in the upstream, Abdus Sobhan, former additional director general of the DoE, told this correspondent.
Considering the serious consequences of the discharged poisonous water, the government should take up the issue with India and urge it to manage the canal water properly before discharging it into Bangladesh through the canal, he added.
Moharana Choudhury of the Department of Environmental Science, Tezpur University, and McDonald Choudhury of Hindustan Paper Corporation Limited in India have jointly written an article on "Trends of Urban Solid Waste Management in Agartala City". It was published in the Universal Journal of Environmental Research and Technology in 2014 (Volume 4, Issue 4). Environmental-friendly disposal of municipal waste is not often practised in developing nations like India. With the rapid growth of population, along with the expansion of residential areas and infrastructure development, the inhabiting environment is getting affected. Poor management and lack of scientific approach in the dumping process are the major hindrances on the way of the MSW process.
However, unsuitable placement of dumping yards in inappropriate areas is another obstacle found in the case of Agartala city, as it is growing very fast. As per the 2011 census, population of the city was 3,99,688, with a density of 6,251/Sq km.
Around 260 MT (metric tonnes) of urban solid waste is generated every day from more than 90,000 households, including household (10%) commercial, including industrial (12%) construction debris, including thrown sweeping (50%), electronic waste (2%), respectively "As Agartala city does not have an underground sewage collection and sewage treatment system, the untreated sewage directly mixes into several drainage channels of the city and finally goes to the "Haora River", "Khatakhal River" and the "Akhaura" channel.
This results in severe degradation of the water quality, which is also reported by monitoring the physic-chemical and bacteriological parameters of the river water upstream and downstream of the city of Agartala," Subhro Sarkar and Umesh Mishra said in their article (2014).
They also said that the Central Pollution Control Board (Report 2010) identified the river side, along with the city of Agartala, for the "Haora River" to be one of the polluted minor river basins in India and suggested that measures should be taken immediately.
An open dumping ground is also creating problems from an environmental point of view. Contamination of ground water, as well as surface water, is taking place, as was reported from the "Hapania area". (Debasree Purkayastha and Sumanta Chakrabarti. 2014). This area had been used as a solid waste dumping ground for the last 40 years. It is now used as a biomedical waste disposal site.
The problem of waste management is becoming more complicated due to the improper and unscientific disposal of solid waste, mostly in open dumping site (Rajkumar, et al, 2010), which may result in contamination of ground water (Kamboj. N, & Choudhury. M, 2013). Open dumping sites generally attract birds, rodents and fleas, and accordingly, result in unhygienic condition of the surrounding area of the dumping site (Suchitra, 2007).
The estimated amount of waste generation in Agartala city was approximately 200 tonnes per day. It has been noticed that the urban population of India has increased from 26% in 2001 to 32% in 2011 (Census of India, 2011)—this has resulted in the rapid increase of waste generation.
Owing to the negligence of the municipalities towards the solid waste management process, it has become a serious environmental issue for collection, transportation and disposal. In India, the Solid Waste Management Rule 2013 presents an improved solid waste management process as per international standards.


DistrictBug offers details on school districts and ISDs. This record is for BRIDGEPORT-SPAULDING COMMUNITY S school district in BRIDGEPORT, MI. ISD and school district data is deemed reliable, but not guaranteed. More info at SchoolBug.


You are getting a 200+ page PDF book with over 270 references, 17 Chapters, and both peer reviewed and anecdotal experience on the topics on metabolic behavior. It features a foreword by one of my great mentors, Tom Venuto, a nationally published author of The Body Fat Solution.
What roles are my hormones playing during (and after) fat loss?
What is starvation mode? Does it really exist?
Is a metabolism damaged forever?
Do I have to gain weight if I increase calories?
Which macronutrient speeds up my metabolism the most, really?
What role does water play in my weight?
What can I ask my dietitian or doctors to get the best help?
Do I need supplements or drugs to have a healthy metabolism?
How I can I weed out bad research?
How long does it take to get a revving metabolism?
What is refeeding? How do I know if I need it?
Have I plateaued in my fat loss?
If I increase calories fast, will I gain fat?
How do I keep a fast metabolism at any age?


text:
Home » Browse » Academic journals » Sociology and Anthropology Journals » Human Organization » Article details, "A Tale of Three Parks: Tlingit Conservation,..."
Academic journal article Human Organization
A Tale of Three Parks: Tlingit Conservation, Representation, and Repatriation in Southeast Alaska's National Parks
By Thornton, Thomas F.
Why have Southeast Alaska Natives enjoyed success in gaining governing authority over cultural resource economies but limited success in gaining co-management over natural resource economies in the region's national parks? This paper hypothesizes that the most successful co-management regimes in the natural resource economy will be those that are constructed according to an emerging cultural resource paradigm, which emphasizes the circulation and return of "inalienable possessions" by the federal government, rather than the extension of limited harvest rights under the current "subsistence" regime. Further, it suggests the logic of "repatriation," well used in the cultural resources realm, might be constructively applied to the natural resource realm to restore Alaska Native relations to critical fish, wildlife, and other resources in national parks and protected areas.
Key words: Tlingit, repatriation, inalienable possessions, conservation, resource management, parks and protected areas
Why have Southeast Alaska Natives enjoyed success in gaining governing authority over cultural resource economies but limited success in gaining co-management over natural resource economies in the national park system? Much of the answer to this question lies in how national parks evolved within a particular historical, legal, and cultural context in the United States, where the environment became increasingly constructed according to a nature/ culture dichotomy in which supposedly "uninhabited" wilderness landscapes were constructed, framed, and preserved, fortress-like, as museums of nature and historical landscapes (see Keller and Turek 1998; Schemas 2001; Spence 1999; West, Igoe, and Brockington 2006). As many have pointed out, including Theodore Cattai (1997:217) in Alaska, this "romantic impulse to preserve America's past. . .as remnants of a once-continental wilderness" or "vignettes of primitive America," has become increasingly untenable. Wilderness and primitiveness may themselves become fetishes in support of a certain dominant nationalist identity, topophilia (love of place; see Tuan 1974), and historia (atlas of eternity; see Wallace 2005) to the exclusion of others, especially those of indigenous peoples. Even in countries with legal recognition of multiculturalism, as in Australia and Canada, the state typically requires Indigenous people to authenticate their aboriginality and "connectedness" to land in logics defined by Western law and heritage, thereby strengthening the latter at the expense of the indigenous logics (Povinelli 2002).
Indigenous peoples, including the Tlingit, never accepted the assumptions that underlie the dominant nature/culture paradigm in United States national parks and have actively resisted their removal, regulation, and representation by the Park Service through articulations of their own identities, topophilia, and historia. Recently, Tlingits have begun to enjoy some success in promoting these visions within Southeast Alaskan parks. But access to natural resources, such as fish and wildlife, remains stubbornly limited, in part due to conflicting visions of what these resources represent and how and for whom they should be conserved. This paper argues that conflicts over natural resources between park managers and Natives could be reduced if certain natural resources of critical cultural significance were reconceptualized as "inalienable possessions" of cultural patrimony, rather than mere "resources" to be developed or preserved. In this way, the logic of "repatriation," increasingly utilized in the cultural resources realm under such laws as the Native American Graves Protection and Repatriation Act (NAGPRA), could be applied to the natural resource realm to restore Alaska Native relations to critical fish, wildlife, and other features of the land and sea, in national parks and protected areas. Such a paradigm shift would have the advantage of conserving critical Tlingit cultural landscapes and livelihoods in Southeast parks, where subsistence and other relations have been severely circumscribed by the establishment of parks and protected areas. …
Publication: Human Organization
Publication date: Summer 2010
Thornton, Thomas F.
Parks & recreation areas
Dispossessing the Wilderness: Indian Removal and the Making of the National Parks By Mark David Spence Oxford University Press, 2000
The Capacity for Wonder: Preserving National Parks By William R. Lowry Brookings Institution, 1994
Uncertain Path: A Search for the Future of National Parks By William C. Tweed University of California Press, 2010
Healthy Children, Healthy Communities: Schools, Parks, Recreation, and Sustainable Regional Planning By Garcia, Robert Flores, Erica S. Chang, Sophia Mei-ling Fordham Urban Law Journal, Vol. 31, No. 5, October 2004
Understanding the Perceived Effectiveness of Applying the Visitor Experience and Resource Protection (VERP) Framework for Recreation Planning: A Multi-Case Study in U.S. National Parks By Fefer, Jessica Urioste-Stone, Sandra M. De Daigle, John Silka, Linda The Qualitative Report, Vol. 23, No. 7, July 2018
Understanding the Perceived Effectiveness of Applying the Visitor Experience and Resource Protection (VERP) Framework for Recreation Planning: A Multi-Case Study in U.S. National Parks By Fefer, Jessica De Urioste-Stone, Sandra M. Daigle, John Silka, Linda The Qualitative Report, Vol. 23, No. 7, July 2018
The Public Mandate for Conservation: The Future of Parks and Recreation Depends on Our Response By Dolesh, Richard J. Parks & Recreation, Vol. 47, No. 1, January 2012
2004 Presidential Candidates Talk Parks: George W. Bush and John Kerry Answer Tough Questions about What They'll Do for Parks and Recreation By Parks & Recreation, Vol. 39, No. 10, October 2004
Parks in Peril: Across the Country, Recreation Areas Are Being Hit Hard by State Budget Cuts By Shinkle, Douglas State Legislatures, Vol. 38, No. 1, January 2012
Conservation Will Trump Access at the National Parks ; Settling a Long Debate, the President Puts Nature's Needs Ahead of Those of Park Visitors By Brad Knickerbocker writer of The Christian Science Monitor The Christian Science Monitor, June 22, 2006
Legislator Proposes Moving Parks to Wildlife Department By Record, Journal THE JOURNAL RECORD, January 22, 2016
Oak Brook Park District Wins National Gold Medal Award in Parks and Recreation By Cannaday, Jessica Daily Herald (Arlington Heights, IL), September 16, 2015
FREE! wildlife, conservation of The Columbia Encyclopedia, 6th ed., 2018
FREE! conservation of wildlife The Columbia Encyclopedia, 6th ed., 2018
FREE! national parks and monuments The Columbia Encyclopedia, 6th ed., 2018

redpajama_set_name: RedPajamaCommonCrawl


The handfeeling is very soft, and suitable for high quality soft fabric.
Adopting imported PA powder & double dot coating, they have better performance after washing and dry cleaning.
The strentch interlining can be fused at low temperature (90℃), suitable for heat sennsitive fabric (fur, leather,silk or other memory fabric).


Obama's comments come just one day after Hendrik told a news conference that the Baltic state would welcome NATO bases on its territory.
"We should not have NATO with two-tier countries: with NATO permanent bases and without. This is a wrong signal to send to the potential aggressor," the Estonian president said.
The United States and Estonia, which has a complicated history of relations with Russia, are two of four NATO members that contribute 2 percent of their GDP to defense spending.
Obama's visit to Estonia precedes a NATO summit in Cardiff, Wales on Thursday where the 28-member military bloc will discuss the crisis in Ukraine that has embroiled the Western security organization in a standoff with Russia, which the United States has accused of interfering in the Ukrainian conflict.
Moscow has vehemently rejected such claims.
On August 28, NATO provided satellite images that allegedly showed Russian military units moving in a convoy formation with self-propelled artillery in the area of Krasnodon, Ukraine.
Russia's Defense Ministry spokesman Major-General Igor Konashenkov ridiculed the alleged NATO evidence.
The General also criticized Western media outlets for accepting such images at face value.
Meanwhile, an alliance of seven former US intelligence officers is asking NATO members to recall the 2003 invasion of Iraq before authorizing any military action.
"We saw no credible evidence of weapons of mass destruction in Iraq then; we see no credible evidence of a Russian invasion now," reads an excerpt from the memo signed by the VIPS steering group — a coalition that counts among its members former National Security Agency analyst William Binney, retired CIA analyst Ray McGovern, retired US Army Colonel Ann Wright and others.
The statement was published online over the weekend and addressed to German Chancellor Angela Merkel.
Shortly after Obama arrived in Tallinn, Russian President Vladimir Putin and Ukrainian President Petro Poroshenko discussed the steps that could lead to a ceasefire between the warring sides in Ukraine.
"In the course of today's phone call between Putin and Poroshenko there was indeed an exchange of views that went a long way toward an agreement on steps to be taken for a swift end to the clashes taking place between the Ukrainian military and southeastern uprising," Putin's spokesperson Dmitry Peskov said.
Meanwhile, NATO is reportedly working towards organizing an expeditionary force composed of 10,000 troops from seven different member states as a result of escalating tensions with Russia over the conflict in Ukraine.
Last week, NATO Secretary-General Anders Fogh Rasmussen said they would attempt to agree on "a more visible NATO presence in the East" despite internal opposition.
Asked in an interview with a handful of European newspapers on August 27 whether NATO would permanently deploy forces under its flag in Eastern Europe, Rasmussen was quoted as saying: "The brief answer is yes. To prevent misunderstanding I use the phrase 'for as long as necessary. Our eastern allies will be satisfied when they see what is actually in the readiness action plan."
However, several NATO members have expressed reservations over the enlargement plans, saying they do not see the point in aggravating tensions with Moscow. Heavyweight NATO members, including France, Spain and Italy, have voiced objections to the plans. Meanwhile, Germany, NATO's second strongest member, remains uncommitted to the expansion plans.
This places Barack Obama in a rather difficult position. His popularity has dramatically tumbled among America's traditional European allies over the Snowden revelations, which showed the National Security Agency conducting a massive surveillance operation against enemies and allies alike.
Estonian Prime Minister Taavi Roivas on Tuesday attempted to tamp down fears among Estonians that the country would soon be overrun by NATO forces.
The Estonian leader then employed a weather metaphor, perhaps in an attempt to suggest that a new Cold War is once again threatening Europe.
"All of Europe has realized that the security situation has changed. This is not a just temporary change in the security situation," Roivas added. "It's not just bad weather, it's comparable to climate change."
On average, military spending among European NATO members was 1.6 percent of GDP last year, below the 2 percent goal.
Later Wednesday, Obama and Ilves were to hold broader security talks to include the leaders of Latvia and Lithuania. Then Obama departed for Wales, where a two-day NATO summit will begin on Thursday.


Coventry City midfielder Ivor Lawton has joined Nuneaton Town on a one-month youth loan deal.
The 19-year old midfielder will link up with the National League North side today ahead of their game against Lowestoft Town.
Lawton will pick up vital first-team experience with Kevin Wilson's side after he extended his deal with the Sky Blues in the summer.


We loved taking pictures in Game Stavanger (Old Stavanger) before we left Norway and knew we wanted to do something similar in the Old City of Baku. Thankfully I have an amazing photographer friend Alisha who was available one of the days Jason was in town in June after having to re-schedule our first session due to extreme winds and rain.
The evening we took them was still a little breezy, but not too bad and the sun was lovely. We walked around the city and had lots of laughs and joy taking these pictures. We have some beautiful girls and Alisha captured them perfectly.
Similar to last year's jungle party, we opted to do another joint birthday party for the girls before we left Baku. We had the party at our house again and I had a ball designing the invitations and making a more simple cake than last year (read - no fondant animals - ha!).
Thankfully we had help with the setup and some of the decor and food preparation otherwise I would not have pulled everything off! It was a beautiful afternoon and the girls had an amazing time. It was also our last chance to see quite a few families before our move and that made it very bittersweet, but wonderful to have so many gathered together celebrating our girls.
My mom bought these adorable Moana outfits, but unfortunately they were a bit too big. I knew the girls wouldn't be able to keep them on long so we snapped an outfit picture and let them change into their birthday shirts before our guests arrived.
I know you may not believe me, but I did go simpler this year. Or it felt like it at least (maybe because I wasn't spending hours making fondant animals, which surprisingly survived the move to Doha in one piece, hahaha). My friend Alisha gifted us picture-taking at the birthday and I am so thankful she captured these memories since it allowed us to relax and just enjoy the party.
We had face painting and bubbles for entertainment and lots of laughter and fun both inside and outside the house.
It was a perfect birthday and I am thankful these sisters love each other and let me do another combined party for them - hahaha. Happy 3rd and 5th birthday to our amazing girls!


MacVCD X 4.7.3 Video Players software developed by Mireth Technology Corp. The license of this video players software is shareware$, the price is 19.95, you can free download and get a free trial before you buy a registration or license. Do not use illegal warez version, crack, serial numbers, registration codes, pirate key for this video players software MacVCD X. If you want to get a full and unlimited version of MacVCD X, you should buy from original publisher Mireth Technology Corp.


With the m-ticket, an electronic ticket, Be-Mobile wants to make cash-free purchases of public transport tickets easier. This is a first for the Belgian public transport sector.
With the app, Be-Mobile, who is specialized in Mobility-as-a-Service applications, enables people to pay for different means of transport without any worries. Besides bus or tram journeys, you can also pay for a parking space and for charging an electric car. In the long run the app will also become an attractive proposition for companies wanting to offer their employees a mobility budget instead of a company car.
Users of the 4411 app can pay via their telecom bill, by credit card or bank transfer. The 4411 app generates only for parking one million SMS and parking tickets per month.
The 4411 m-ticket is protected against fraud in various ways. Since the m-ticket's colors change continuously during its validity period, it is impossible to use a screenshot as a ticket.
The success of De Lijn's SMS ticket is due to its ease of use and lower price compared with tickets purchased from the driver. Since the introduction of the SMS ticket, sales of individual tickets sold by bus drivers has more than halved. This has a positive impact on punctuality.
We develop and sell technological solutions to fight traffic jams, by using the power of connected vehicles and travelers to measure and manage the traffic flows.
On top we offer advanced solutions for parking guidance, electronic toll collection, multimodal route planning and electronic fare collection.
By controlling mobility we are giving travelers, cities, road authorities, parking operators and logistics companies control over their mobility processes.


The EM4058 earth tester is a digital, microprocessor controlled instrument that allows to measure the earth resistance and ground resistivity (using Wenner´s method), as well as to detect parasitic voltages present in the ground. This instrument is suitable to measure earth systems in power substations, industries, distribution networks, etc., according to IEC 61557-5.
It is also suitable for soil resistivity measurements, in order to optimize the earth systems project. It is a fully automatic and easy-to-operate equipment. Before starting each measurement, the equipment will check that conditions are within appropriate limits and will notify the operator in case any abnormality turns up (too high interference voltage, too much resistance in test spikes, very low test current, etc). Then, it will look for the most suitable range and show measurement results in an alphanumeric display.
The EM4058 has a Frequency Scan feature that performs an earth resistance measure with all vailable frequencies automatically and calculates, displays and prints the average result besides the individual result of each frequency. Those results are saved on the internal memory.
The instrument has four ranges that are automatically selected, covering measurements from 0.01 Ω up to 20 kΩ, which allows to obtain very accurate measurements for any kind of soils. During ground resistivity measurement, the operator may indicate the distance between spikes in order for the equipment to apply Wenner's formula and to show the resistivity value directly.


The Bark River Special Hunting Knife Hidden Tang is one of the most practical field knives Bark River has released for 2015. Bark River has taken the blade from the original Will & Fink late 1800s Hunting Knife and married it to the handle of the early 1900s Wade & Butcher Sheffield Boone. This combination was actually suggested to Bark River by their customers and was such a great idea that Bark River made a production run of them. The Special Hunting knife blade - with it's high grind - gives fantastic cutting geometry and the hidden tang handle of the Boone is not only very comfortable but very traditional this is a knife that is very practical and a real joy to use in the field.


Every Monday night, the Internet searches go out: "Who Left Dancing with the Stars Tonight?" Fans who miss a results show want to know quickly which of their favorite celebrities was axed from the popular dance competition. If you're dying to know which way-less-than-A-list-celeb is on his way home, skip the search engine and get right to the facts!
Go to the ABC network's website (see Resources, below, for a link). There, you can actually watch the whole episode to find out what happened. If you want the news more quickly, scroll down to the bottom of the page to see whose bio is not lit up anymore. The ABC website is quick and efficient.
Find a recap on the website of your favorite newspaper or celebrity website. "Dancing With the Stars" is very popular and the show's results are quickly posted in the entertainment sections of websites such as USA Today, Entertainment Tonight and your local television news station.
If you don't want to watch the episode, go on the official website or look through a recap, your final option is to wait until the next episode. Or, of course, call an addicted friend.


text:
Bond Yields Approaching Record Lows
Google Faces Lawsuit from New Mexico Attorney General
Coronavirus Update February 27: New California Case Shows First Possible Community Spread in U.S.
© Corey Agopian/ Unsplash
Rachel Hemple 27.02.2020
The White House on Thursday has directed government health officials and scientists to clear all coronavirus statements with Vice President Mike Pence. President Donald Trump had selected his second in command for the job in an effort to stop the spread of false information and coordinate the U.S.'s response to the virus. Pence has appointed Dr. Deborah L. Birx to serve at Coronavirus Response Coordinator for the White House.
Facebook (FB ) has cancelled its annual F8 software developer conference in order to help slow the spread of the virus. In a blog post, Facebook Director of Platform Partnerships Konstantinos Papamiltiadis wrote: "This was a tough call to make--F8 is an incredibly important event for Facebook and it's one of our favorite ways to celebrate all of you from around the world--but we need to prioritize the health and safety of our developer partners, employees and everyone who helps put F8 on."
Total Confirmed: More than 82,500
Total Deaths: Over 2,800
What Experts are Saying:
The World Health Organization stated on Thursday that member nations need to prepare for COVID-19's arrival. "Every country must be ready for its first case," said Tedros Adhanom Ghebreyesus, director-general of WHO. "No country should assume it wont get cases. That could be a fatal mistake. This virus does not respect borders."
The International Monetary Fund stated that it will likely downgrade its global economic growth forecast because of the rapid spread affecting businesses. IMF spokesperson Gerry Rice said in regard to the outbreak: "Clearly the virus is going to have an impact on growth," without going into detail about how large the impact will be. "A lot just depends on the speed of recovery in China and other countries, the spillover effect, the effects on supply chains, and the extent to which other countries may be significantly affected."
U.S. Health and Human Services Secretary Alex Azar stated on Thursday that at least 40 public health labs have been able to test samples of COVID-19, and that number is due to double as soon as Friday. These labs will be testing to see how exactly the virus spreads and will be working towards an eventual vaccine.
China's central bank is concerned about the virus's impact on the global economy. Vice governor of the People's Bank of China stated on Thursday: "International organizations are worried about the negative impact of the [virus] to the global economy. I'm also worried, and this worry has become a reality."
Tracking the Spread:
South Korea has now confirmed over 500 new cases, bringing the nation's total to 1,766. This new spike in cases now exceeds China, who reported about 430 new cases on Thursday. The Japanese government has asked all school to close from March 2 to April. Singapore has also reported 3 new cases.
Iran has confirmed over 100 new cases on Thursday, bringing the nation's total to 245. Iran's death toll has continued to rise, now at 26. Health authorities from Afghanistan, Bahrain, Iraq, Kuwait, Oman, and the United Arab Emirates have all reported cases that can be traced back to recent travel to Iran. Saudi Arabia has temporarily suspends the entry of foreigners to help prevent the spread.
Italy has added 180 new cases and 5 deaths. Ireland has confirmed its first case of the coronavirus on Thursday. This case is in addition to the 15 cases that have been confirmed within the U.K. The Netherlands, Denmark, and Estonia have all also had their first confirmed cases. Spain has confirmed 12 new cases, including a critical case in Madrid. Norway, Austria, France, Sweden, Germany, Switzerland, and Greece have confirmed at least one new case on Thursday.
United States health officials late on Wednesday have confirmed that the first possible community transmission of the coronavirus in the U.S., which is a bad sign that the virus could already be spreading in local cities and towns. The infected individual in California has no trace to other outbreaks and the Centers for Disease Control and Prevention does not know how they contracted the virus. California is also monitoring potentially 8,400 people that were at risk of exposure to the virus.
Note: This article only tracts daily coronavirus spread and commentary. For stock market update's, see today's Market Update.


VIII International Course "Detectors and Electronics for High Energy Physics, Astrophysics, Space Applications and Medical Physics"
No fee is required for the course.
The costs of travel, food and lodging are in charge to the participant.
The maximum number of participants is 90.
- Italian and European irradiation facilities for interdisciplinary applications.
Course organization: the lessons are from 9 a.m. to 6 p.m.
1st day Monday. Visit of the INFN National Laboratories of Legnaro. The measurements and the fundamental physical quantities of radiation. Radiation environments in High Energy Physics, Space and Medical Physics. Introduction to semiconductor detectors from the device point of view.
2nd day Tuesday. Semiconductor detectors: damage from a microscopic and macroscopic point of view, the techniques to improve the radiation hardness. State of the art for 4D detectors for space and time tracking and for 2-level avalanche detectors.
3rd day Wednesday. Front-end electronics for High Energy Physics experiments. Radiation effects on electronics: total dose damage, single event effects: destructive and non-destructive. New developments in microelectronics and silicon sensors. Poster session for the participants to the course (click here for more details).
4th day Thursday. Radiation effects and mitigation techniques on electronics for Space and fusion reactors. Radiation effects in non-volatile memories, CMOS imagers, power devices. The nanosatellites. FPGAs for HEP.
Everyone will receive the attendance certificate.
is scheduled on Friday afternoon.


text:
Гумка — шматочок гуми, призначений для стирання написаного
 Жувальна гумка — присмачений чим-небудь шматочок гуми, що використовується для жування
 Гумка для волосся (резинка для волосся) — тонке еластичне кільце для скріплення зачіски
 Резинка або гумка — тасьма або шнур з гумових та простих ниток, які розтягуються в довжину.
 Білизняна гумка або білизняна резинка — пристосування з гумової тасьми для підтримування панчіх, шкарпеток на нозі.
 Канцелярська гумка або аптечна гумка (резинка) — тонке еластичне кільце для скріплення предметів.
 Гумка або резинка — рибальська снасть.

Див. також
 Гумомотор

Джерела

redpajama_set_name: RedPajamaWikipedia