亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stm32l1xx_spi.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 3 頁
字號:
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_DIRECTION(SPI_Direction));
  if (SPI_Direction == SPI_Direction_Tx)
  {
    /* Set the Tx only mode */
    SPIx->CR1 |= SPI_Direction_Tx;
  }
  else
  {
    /* Set the Rx only mode */
    SPIx->CR1 &= SPI_Direction_Rx;
  }
}

/**
  * @brief  Configures internally by software the NSS pin for the selected SPI.
  * @param  SPIx: where x can be 1 or 2 to select the SPI peripheral.
  * @param  SPI_NSSInternalSoft: specifies the SPI NSS internal state.
  *   This parameter can be one of the following values:
  *     @arg SPI_NSSInternalSoft_Set: Set NSS pin internally
  *     @arg SPI_NSSInternalSoft_Reset: Reset NSS pin internally
  * @retval None
  */
void SPI_NSSInternalSoftwareConfig(SPI_TypeDef* SPIx, uint16_t SPI_NSSInternalSoft)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_NSS_INTERNAL(SPI_NSSInternalSoft));
  if (SPI_NSSInternalSoft != SPI_NSSInternalSoft_Reset)
  {
    /* Set NSS pin internally by software */
    SPIx->CR1 |= SPI_NSSInternalSoft_Set;
  }
  else
  {
    /* Reset NSS pin internally by software */
    SPIx->CR1 &= SPI_NSSInternalSoft_Reset;
  }
}

/**
  * @brief  Enables or disables the SS output for the selected SPI.
  * @param  SPIx: where x can be 1 or 2 to select the SPI peripheral.
  * @param  NewState: new state of the SPIx SS output. 
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void SPI_SSOutputCmd(SPI_TypeDef* SPIx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  if (NewState != DISABLE)
  {
    /* Enable the selected SPI SS output */
    SPIx->CR2 |= (uint16_t)SPI_CR2_SSOE;
  }
  else
  {
    /* Disable the selected SPI SS output */
    SPIx->CR2 &= (uint16_t)~((uint16_t)SPI_CR2_SSOE);
  }
}

/**
  * @}
  */

/** @defgroup SPI_Group2 Data transfers functions
 *  @brief   Data transfers functions
 *
@verbatim   
 ===============================================================================
                         Data transfers functions
 ===============================================================================  

  This section provides a set of functions allowing to manage the SPI data transfers
  
  In reception, data are received and then stored into an internal Rx buffer while 
  In transmission, data are first stored into an internal Tx buffer before being 
  transmitted.

  The read access of the SPI_DR register can be done using the SPI_I2S_ReceiveData()
  function and returns the Rx buffered value. Whereas a write access to the SPI_DR 
  can be done using SPI_I2S_SendData() function and stores the written data into 
  Tx buffer.

@endverbatim
  * @{
  */

/**
  * @brief  Returns the most recent received data by the SPIx peripheral. 
  * @param  SPIx: where x can be 1 or 2 in SPI mode.
  * @retval The value of the received data.
  */
uint16_t SPI_I2S_ReceiveData(SPI_TypeDef* SPIx)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  
  /* Return the data in the DR register */
  return SPIx->DR;
}

/**
  * @brief  Transmits a Data through the SPIx peripheral.
  * @param  SPIx: where x can be 1 or 2 in SPI mode. 
  * @param  Data: Data to be transmitted.
  * @retval None
  */
void SPI_I2S_SendData(SPI_TypeDef* SPIx, uint16_t Data)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  
  /* Write in the DR register the data to be sent */
  SPIx->DR = Data;
}

/**
  * @}
  */

/** @defgroup SPI_Group3 Hardware CRC Calculation functions
 *  @brief   Hardware CRC Calculation functions
 *
@verbatim   
 ===============================================================================
                         Hardware CRC Calculation functions
 ===============================================================================  

  This section provides a set of functions allowing to manage the SPI CRC hardware 
  calculation

  SPI communication using CRC is possible through the following procedure:
     1. Program the Data direction, Polarity, Phase, First Data, Baud Rate Prescaler, 
        Slave Management, Peripheral Mode and CRC Polynomial values using the SPI_Init()
        function.
     2. Enable the CRC calculation using the SPI_CalculateCRC() function.
     3. Enable the SPI using the SPI_Cmd() function
     4. Before writing the last data to the TX buffer, set the CRCNext bit using the 
      SPI_TransmitCRC() function to indicate that after transmission of the last 
      data, the CRC should be transmitted.
     5. After transmitting the last data, the SPI transmits the CRC. The SPI_CR1_CRCNEXT
        bit is reset. The CRC is also received and compared against the SPI_RXCRCR 
        value. 
        If the value does not match, the SPI_FLAG_CRCERR flag is set and an interrupt
        can be generated when the SPI_I2S_IT_ERR interrupt is enabled.

Note: 
-----
    - It is advised to don't read the calculate CRC values during the communication.

    - When the SPI is in slave mode, be careful to enable CRC calculation only 
      when the clock is stable, that is, when the clock is in the steady state. 
      If not, a wrong CRC calculation may be done. In fact, the CRC is sensitive 
      to the SCK slave input clock as soon as CRCEN is set, and this, whatever 
      the value of the SPE bit.

    - With high bitrate frequencies, be careful when transmitting the CRC.
      As the number of used CPU cycles has to be as low as possible in the CRC 
      transfer phase, it is forbidden to call software functions in the CRC 
      transmission sequence to avoid errors in the last data and CRC reception. 
      In fact, CRCNEXT bit has to be written before the end of the transmission/reception 
      of the last data.

    - For high bit rate frequencies, it is advised to use the DMA mode to avoid the
      degradation of the SPI speed performance due to CPU accesses impacting the 
      SPI bandwidth.

    - When the STM32L15xxx are configured as slaves and the NSS hardware mode is 
      used, the NSS pin needs to be kept low between the data phase and the CRC 
      phase.

    - When the SPI is configured in slave mode with the CRC feature enabled, CRC
      calculation takes place even if a high level is applied on the NSS pin. 
      This may happen for example in case of a multislave environment where the 
      communication master addresses slaves alternately.

    - Between a slave deselection (high level on NSS) and a new slave selection 
      (low level on NSS), 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.

    To clear the CRC, follow the procedure below:
      1. Disable SPI using the SPI_Cmd() function
      2. Disable the CRC calculation using the SPI_CalculateCRC() function.
      3. Enable the CRC calculation using the SPI_CalculateCRC() function.
      4. Enable SPI using the SPI_Cmd() function.

@endverbatim
  * @{
  */

/**
  * @brief  Enables or disables the CRC value calculation of the transferred bytes.
  * @param  SPIx: where x can be 1 or 2  to select the SPI peripheral.
  * @param  NewState: new state of the SPIx CRC value calculation.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void SPI_CalculateCRC(SPI_TypeDef* SPIx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  if (NewState != DISABLE)
  {
    /* Enable the selected SPI CRC calculation */
    SPIx->CR1 |= SPI_CR1_CRCEN;
  }
  else
  {
    /* Disable the selected SPI CRC calculation */
    SPIx->CR1 &= (uint16_t)~((uint16_t)SPI_CR1_CRCEN);
  }
}

/**
  * @brief  Transmit the SPIx CRC value.
  * @param  SPIx: where x can be 1 or 2  to select the SPI peripheral.
  * @retval None
  */
void SPI_TransmitCRC(SPI_TypeDef* SPIx)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  
  /* Enable the selected SPI CRC transmission */
  SPIx->CR1 |= SPI_CR1_CRCNEXT;
}

/**
  * @brief  Returns the transmit or the receive CRC register value for the specified SPI.
  * @param  SPIx: where x can be 1 or 2  to select the SPI peripheral.
  * @param  SPI_CRC: specifies the CRC register to be read.
  *   This parameter can be one of the following values:
  *     @arg SPI_CRC_Tx: Selects Tx CRC register
  *     @arg SPI_CRC_Rx: Selects Rx CRC register
  * @retval The selected CRC register value..
  */
uint16_t SPI_GetCRC(SPI_TypeDef* SPIx, uint8_t SPI_CRC)
{
  uint16_t crcreg = 0;
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_CRC(SPI_CRC));
  if (SPI_CRC != SPI_CRC_Rx)
  {
    /* Get the Tx CRC register */
    crcreg = SPIx->TXCRCR;
  }
  else
  {
    /* Get the Rx CRC register */
    crcreg = SPIx->RXCRCR;
  }
  /* Return the selected CRC register */
  return crcreg;
}

/**
  * @brief  Returns the CRC Polynomial register value for the specified SPI.
  * @param  SPIx: where x can be 1 or 2  to select the SPI peripheral.
  * @retval The CRC Polynomial register value.
  */
uint16_t SPI_GetCRCPolynomial(SPI_TypeDef* SPIx)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  
  /* Return the CRC polynomial register */
  return SPIx->CRCPR;
}

/**
  * @}
  */

/** @defgroup SPI_Group4 DMA transfers management functions
 *  @brief   DMA transfers management functions
  *
@verbatim   
 ===============================================================================
                         DMA transfers management functions
 ===============================================================================  

@endverbatim
  * @{
  */

/**
  * @brief  Enables or disables the SPIx DMA interface.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人高清在线视频| 91精品国产综合久久久久久久久久| 91同城在线观看| 欧美性做爰猛烈叫床潮| 2欧美一区二区三区在线观看视频| 国产精品毛片大码女人| 麻豆精品精品国产自在97香蕉| 成人性生交大片免费看中文| 777奇米四色成人影色区| 国产精品久久久久久久裸模| 日本vs亚洲vs韩国一区三区二区| 99久久综合国产精品| 精品久久久久一区| 日韩成人精品视频| 欧美精品一区二区在线播放| 亚洲欧美另类图片小说| 国产一区二区网址| 日韩三级伦理片妻子的秘密按摩| 亚洲精品乱码久久久久久久久| 国产精品一区二区果冻传媒| 911精品产国品一二三产区 | 成人美女视频在线看| 欧美美女bb生活片| 夜夜揉揉日日人人青青一国产精品| 国产在线看一区| 日韩一区二区免费在线电影| 午夜精品久久久久久久 | 91影院在线观看| 26uuu亚洲综合色| 美洲天堂一区二卡三卡四卡视频| 在线视频欧美区| 亚洲女女做受ⅹxx高潮| 99国内精品久久| 国产精品你懂的在线欣赏| 国产成人综合亚洲网站| 久久五月婷婷丁香社区| 韩日av一区二区| 欧美va亚洲va| 久久国产精品72免费观看| 日韩三级精品电影久久久| 久久精品免费看| 日韩亚洲欧美高清| 久久电影网电视剧免费观看| 欧美mv和日韩mv国产网站| 久久99最新地址| 久久久久国产精品麻豆 | 日韩激情中文字幕| 欧美精品 日韩| 首页国产欧美久久| 欧美成人三级在线| 国产精品自在欧美一区| 国产精品网友自拍| 日本乱人伦aⅴ精品| 亚洲成人自拍偷拍| 欧美一级日韩不卡播放免费| 经典三级视频一区| 国产精品麻豆久久久| 91免费观看国产| 午夜精品久久久久久久99水蜜桃| 欧美va亚洲va| 99久久99久久综合| 亚洲午夜在线电影| 欧美不卡视频一区| av在线播放一区二区三区| 亚洲精品视频免费观看| 在线成人av影院| 国产乱人伦精品一区二区在线观看| 久久精品免视看| 91一区二区在线| 男女性色大片免费观看一区二区| 久久久久国产精品麻豆ai换脸| 91麻豆6部合集magnet| 日日夜夜免费精品视频| 国产午夜精品在线观看| 91免费观看视频| 国产综合久久久久久久久久久久| 国产精品情趣视频| 88在线观看91蜜桃国自产| av一区二区三区四区| 日韩电影免费在线| 亚洲欧美中日韩| 日韩欧美电影一区| 色综合一个色综合| 国产一区二区女| 性感美女极品91精品| 中文一区在线播放| 91精品福利在线一区二区三区| jlzzjlzz欧美大全| 麻豆91在线看| 亚洲国产中文字幕在线视频综合| 国产偷国产偷亚洲高清人白洁| 欧美日韩精品一区二区天天拍小说| 国产麻豆成人精品| 美女一区二区视频| 亚洲国产欧美在线人成| 国产精品久久久久久久久搜平片 | 色综合一个色综合| 国产精品一级片在线观看| 午夜av一区二区| 中文字幕一区二区三区色视频| 欧美videofree性高清杂交| 欧美视频一二三区| 91一区一区三区| 国产精品一区免费视频| 美女在线观看视频一区二区| 五月综合激情日本mⅴ| 日韩毛片精品高清免费| 国产欧美日韩在线视频| 日韩欧美的一区二区| 91精品国产91久久久久久一区二区 | 狠狠色综合日日| 免费日韩伦理电影| 丝袜美腿亚洲一区| 日本三级亚洲精品| 视频一区中文字幕国产| 亚洲国产精品一区二区www在线| 亚洲欧美色一区| 亚洲精品久久嫩草网站秘色| 1024成人网| 亚洲欧美偷拍三级| 亚洲综合色区另类av| 一区二区三区久久| 亚洲亚洲人成综合网络| 视频在线观看一区二区三区| 日本成人在线看| 精品一区二区日韩| 国产馆精品极品| 粉嫩一区二区三区性色av| 国产成人高清在线| 99re这里只有精品6| 色婷婷精品大在线视频| 欧洲生活片亚洲生活在线观看| 91久久国产最好的精华液| 欧美主播一区二区三区美女| 欧美三级中文字| 日韩视频在线观看一区二区| 久久综合九色综合欧美98| 久久久久久久久久久久久女国产乱| 久久久三级国产网站| 国产精品久久一卡二卡| 洋洋av久久久久久久一区| 丝袜亚洲另类欧美综合| 精品一区二区久久久| 国产成人小视频| 色偷偷88欧美精品久久久| 欧美日韩高清在线| 久久亚洲一区二区三区明星换脸| 国产欧美视频一区二区三区| 亚洲免费观看高清完整| 日韩精品福利网| 成人亚洲精品久久久久软件| 精品视频在线免费| 久久久噜噜噜久噜久久综合| 亚洲同性gay激情无套| 日本午夜精品一区二区三区电影| 国产丶欧美丶日本不卡视频| 在线欧美日韩国产| 久久综合色8888| 亚洲一区二区在线观看视频 | 国产日产精品一区| 亚洲一区二区三区视频在线播放 | 亚洲国产精品久久久久秋霞影院| 美国欧美日韩国产在线播放| 暴力调教一区二区三区| 91精品国产色综合久久久蜜香臀| 欧美激情在线看| 日韩—二三区免费观看av| 97久久超碰国产精品| 日韩午夜精品视频| 亚洲伦理在线免费看| 国产综合一区二区| 欧美偷拍一区二区| 国产精品成人在线观看| 久久se精品一区精品二区| 91久久免费观看| 国产精品国产自产拍高清av| 免费亚洲电影在线| 欧美日韩成人在线一区| 国产精品久久久久久久久果冻传媒 | 99久久精品免费| 日韩一本二本av| 亚洲韩国一区二区三区| zzijzzij亚洲日本少妇熟睡| 欧美变态口味重另类| 午夜电影网亚洲视频| 91丝袜呻吟高潮美腿白嫩在线观看| 精品第一国产综合精品aⅴ| 日韩高清在线电影| 在线免费观看成人短视频| 国产精品国产三级国产有无不卡| 国产在线精品国自产拍免费| 日韩一区二区三区在线观看| 亚洲成人激情自拍| 欧美三级中文字| 一区二区三区电影在线播| 99久久综合狠狠综合久久| 日本一区二区高清| 国产99久久久国产精品| 久久久不卡网国产精品一区| 久久99久久99小草精品免视看|