Examples/Crusher/Linux/stm32/firmware/lib/src/peripherals/stm32f4xx_spi.c
/**
  * @brief  Enables or disables the SPIx/I2Sx DMA interface.
  * @param  SPIx: To select the SPIx/I2Sx peripheral, where x can be: 1, 2 or 3 
  *         in SPI mode or 2 or 3 in I2S mode or I2Sxext for I2S full duplex mode. 
  * @param  SPI_I2S_DMAReq: specifies the SPI DMA transfer request to be enabled or disabled. 
  *          This parameter can be any combination of the following values:
  *            @arg SPI_I2S_DMAReq_Tx: Tx buffer DMA transfer request
  *            @arg SPI_I2S_DMAReq_Rx: Rx buffer DMA transfer request
  * @param  NewState: new state of the selected SPI DMA transfer request.
  *          This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
@brief  Enables or disables the SPIx/I2Sx DMA interface.
@param  SPIx: To select the SPIx/I2Sx peripheral, where x can be: 1, 2 or 3
in SPI mode or 2 or 3 in I2S mode or I2Sxext for I2S full duplex mode.
@param  SPI_I2S_DMAReq: specifies the SPI DMA transfer request to be enabled or disabled.
This parameter can be any combination of the following values:
@arg SPI_I2S_DMAReq_Tx: Tx buffer DMA transfer request
@arg SPI_I2S_DMAReq_Rx: Rx buffer DMA transfer request
@param  NewState: new state of the selected SPI DMA transfer request.
This parameter can be: ENABLE or DISABLE.
@retval None
@brief Enables or disables the SPIx / I2Sx DMA interface . @param SPIx : To select the SPIx / I2Sx peripheral where x can be : 1 2 or 3 in SPI mode or 2 or 3 in I2S mode or I2Sxext for I2S full duplex mode . @param SPI_I2S_DMAReq : specifies the SPI DMA transfer request to be enabled or disabled . This parameter can be any combination of the following values : @arg SPI_I2S_DMAReq_Tx : Tx buffer DMA transfer request @arg SPI_I2S_DMAReq_Rx : Rx buffer DMA transfer request @param NewState : new state of the selected SPI DMA transfer request . This parameter can be : ENABLE or DISABLE . @retval None
void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq, FunctionalState NewState)
{
  assert_param(IS_SPI_ALL_PERIPH_EXT(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  assert_param(IS_SPI_I2S_DMAREQ(SPI_I2S_DMAReq));
  if (NewState != DISABLE)
  {
    SPIx->CR2 |= SPI_I2S_DMAReq;
  }
  else
  {
    SPIx->CR2 &= (uint16_t)~SPI_I2S_DMAReq;
  }
}
void SPI_I2S_DMACmd ( SPI_TypeDef * SPIx , uint16_t SPI_I2S_DMAReq , FunctionalState NewState ) { assert_param ( IS_SPI_ALL_PERIPH_EXT ( SPIx ) ) ; assert_param ( IS_FUNCTIONAL_STATE ( NewState ) ) ; assert_param ( IS_SPI_I2S_DMAREQ ( SPI_I2S_DMAReq ) ) ; if ( NewState != DISABLE ) { SPIx -> CR2 |= SPI_I2S_DMAReq ; } else { SPIx -> CR2 &= ( uint16_t ) ~ SPI_I2S_DMAReq ; } }
@brief  Enables or disables the SPIx/I2Sx DMA interface.
@brief Enables or disables the SPIx / I2Sx DMA interface .
/* Check the parameters */ /* Enable the selected SPI DMA requests */ /* Disable the selected SPI DMA requests */