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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? stm32l1xx_spi.c

?? VS1003_MP3_SPI_SDHC_FAT32
?? C
?? 第 1 頁 / 共 3 頁
字號:
  SPI_InitStruct->SPI_NSS = SPI_NSS_Hard;
  /* Initialize the SPI_BaudRatePrescaler member */
  SPI_InitStruct->SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2;
  /* Initialize the SPI_FirstBit member */
  SPI_InitStruct->SPI_FirstBit = SPI_FirstBit_MSB;
  /* Initialize the SPI_CRCPolynomial member */
  SPI_InitStruct->SPI_CRCPolynomial = 7;
}

/**
  * @brief  Fills each I2S_InitStruct member with its default value.
  * @param  I2S_InitStruct: pointer to a I2S_InitTypeDef structure which will be initialized.
  * @retval None
  */
void I2S_StructInit(I2S_InitTypeDef* I2S_InitStruct)
{
/*--------------- Reset I2S init structure parameters values -----------------*/
  /* Initialize the I2S_Mode member */
  I2S_InitStruct->I2S_Mode = I2S_Mode_SlaveTx;
  
  /* Initialize the I2S_Standard member */
  I2S_InitStruct->I2S_Standard = I2S_Standard_Phillips;
  
  /* Initialize the I2S_DataFormat member */
  I2S_InitStruct->I2S_DataFormat = I2S_DataFormat_16b;
  
  /* Initialize the I2S_MCLKOutput member */
  I2S_InitStruct->I2S_MCLKOutput = I2S_MCLKOutput_Disable;
  
  /* Initialize the I2S_AudioFreq member */
  I2S_InitStruct->I2S_AudioFreq = I2S_AudioFreq_Default;
  
  /* Initialize the I2S_CPOL member */
  I2S_InitStruct->I2S_CPOL = I2S_CPOL_Low;
}

/**
  * @brief  Enables or disables the specified SPI peripheral.
  * @param  SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
  * @param  NewState: new state of the SPIx peripheral. 
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void SPI_Cmd(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 peripheral */
    SPIx->CR1 |= SPI_CR1_SPE;
  }
  else
  {
    /* Disable the selected SPI peripheral */
    SPIx->CR1 &= (uint16_t)~((uint16_t)SPI_CR1_SPE);
  }
}

/**
  * @brief  Enables or disables the specified SPI peripheral (in I2S mode).
  * @param  SPIx: where x can be 2 or 3 to select the SPI peripheral.
  * @param  NewState: new state of the SPIx peripheral. 
  *         This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void I2S_Cmd(SPI_TypeDef* SPIx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_SPI_23_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    /* Enable the selected SPI peripheral (in I2S mode) */
    SPIx->I2SCFGR |= SPI_I2SCFGR_I2SE;
  }
  else
  {
    /* Disable the selected SPI peripheral in I2S mode */
    SPIx->I2SCFGR &= (uint16_t)~((uint16_t)SPI_I2SCFGR_I2SE);
  }
}

/**
  * @brief  Configures the data size for the selected SPI.
  * @param  SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
  * @param  SPI_DataSize: specifies the SPI data size.
  *   This parameter can be one of the following values:
  *     @arg SPI_DataSize_16b: Set data frame format to 16bit.
  *     @arg SPI_DataSize_8b: Set data frame format to 8bit.
  * @retval None.
  */
void SPI_DataSizeConfig(SPI_TypeDef* SPIx, uint16_t SPI_DataSize)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_DATASIZE(SPI_DataSize));
  /* Clear DFF bit */
  SPIx->CR1 &= (uint16_t)~SPI_DataSize_16b;
  /* Set new DFF bit value */
  SPIx->CR1 |= SPI_DataSize;
}

/**
  * @brief  Selects the data transfer direction in bidirectional mode for the specified SPI.
  * @param  SPIx: where x can be 1, 2 or 3 to select the SPI peripheral.
  * @param  SPI_Direction: specifies the data transfer direction in bidirectional mode. 
  *   This parameter can be one of the following values:
  *     @arg SPI_Direction_Tx: Selects Tx transmission direction.
  *     @arg SPI_Direction_Rx: Selects Rx receive direction.
  * @retval None
  */
void SPI_BiDirectionalLineConfig(SPI_TypeDef* SPIx, uint16_t SPI_Direction)
{
  /* 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, 2 or 3 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, 2 or 3 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/I2Sx peripheral. 
  * @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.
  * @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/I2Sx peripheral.
  * @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.
  * @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:
         (#) Program the Data direction, Polarity, Phase, First Data, Baud Rate 
             Prescaler, Slave Management, Peripheral Mode and CRC Polynomial 
             values using the SPI_Init() function.
         (#) Enable the CRC calculation using the SPI_CalculateCRC() function.
         (#) Enable the SPI using the SPI_Cmd() function.
         (#) 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.
         (#) 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.
    -@-
       (+@) 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:
       (#@) Disable SPI using the SPI_Cmd() function
       (#@) Disable the CRC calculation using the SPI_CalculateCRC() function.
       (#@) Enable the CRC calculation using the SPI_CalculateCRC() function.
       (#@) 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, 2 or 3 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, 2 or 3 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, 2 or 3 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;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色中色一区二区| 精品国产露脸精彩对白| 日韩视频一区二区| 亚洲精品一二三四区| 成人av在线网| 国产欧美日韩视频一区二区| 九色porny丨国产精品| 91精品国产综合久久精品图片 | 日韩精品乱码av一区二区| 色婷婷激情一区二区三区| 国产在线视频一区二区| 国产欧美综合在线观看第十页 | 国产精品嫩草影院av蜜臀| 高清久久久久久| 亚洲丝袜美腿综合| 色综合天天综合色综合av| 一区二区三区在线免费播放| 欧美日韩精品二区第二页| 免费高清在线一区| 国产婷婷色一区二区三区四区| 白白色亚洲国产精品| 亚洲第一二三四区| 日韩欧美久久一区| 成人av网站免费| 国产精品乡下勾搭老头1| 综合久久给合久久狠狠狠97色| 久久蜜臀精品av| 一本大道av一区二区在线播放| 成人精品一区二区三区四区| 午夜电影久久久| 国产网红主播福利一区二区| 2023国产精华国产精品| 在线免费不卡视频| 男女激情视频一区| 美腿丝袜亚洲一区| 亚洲欧美成人一区二区三区| 国产精品中文字幕一区二区三区| 99久久久久久| 亚洲一级电影视频| 日韩午夜精品电影| 日韩一区二区麻豆国产| 日韩一区二区免费在线电影| 日韩亚洲欧美中文三级| 精品乱人伦一区二区三区| 成人免费三级在线| 成人中文字幕合集| 91色综合久久久久婷婷| 麻豆精品新av中文字幕| 麻豆精品新av中文字幕| 激情国产一区二区| 成人免费视频视频| 色悠悠亚洲一区二区| 在线一区二区视频| 成人亚洲一区二区一| 99久久婷婷国产精品综合| 一本色道**综合亚洲精品蜜桃冫| 在线观看91视频| 欧美一区二区精美| 欧美日韩卡一卡二| 欧美成人精品1314www| 久久久99精品免费观看| 亚洲三级电影网站| 五月天网站亚洲| 久久精品国产亚洲高清剧情介绍 | www国产精品av| 中文字幕va一区二区三区| 日韩欧美国产成人一区二区| 久久综合资源网| 亚洲视频在线一区观看| 五月综合激情网| 国产揄拍国内精品对白| 免费观看日韩电影| 国产suv精品一区二区883| 在线免费观看日本一区| 2023国产精品自拍| 洋洋成人永久网站入口| 韩日av一区二区| 91免费国产在线观看| 欧美一区二区视频在线观看2020 | 欧美人动与zoxxxx乱| 久久亚洲捆绑美女| 亚洲国产色一区| 亚洲免费大片在线观看| 欧美aaa在线| 91啪亚洲精品| 精品美女被调教视频大全网站| 亚洲日本在线天堂| 国产精品一线二线三线精华| 欧美亚州韩日在线看免费版国语版| 欧美性xxxxxxxx| 久久精品在线免费观看| 亚洲不卡av一区二区三区| 国产乱人伦偷精品视频不卡| 欧美中文字幕一区二区三区| 久久精品视频网| 蜜臀av性久久久久蜜臀aⅴ流畅| 成人精品在线视频观看| 日韩三区在线观看| 亚洲国产精品一区二区www在线| 国产精品18久久久久久久网站| 欧美视频一区二区三区四区 | 日韩欧美黄色影院| 一区二区三区小说| 国产91在线观看| 日韩免费观看高清完整版在线观看| 亚洲精品中文字幕乱码三区 | 欧美日韩高清一区二区三区| 国产精品日日摸夜夜摸av| 麻豆久久久久久| 欧美影院精品一区| 这里只有精品电影| 亚洲成人av资源| 欧美亚洲国产怡红院影院| 国产精品福利影院| 亚洲一区二区综合| 99精品视频一区二区三区| 国产亚洲一区二区三区四区| 六月婷婷色综合| 91精品国产综合久久福利软件| 亚洲综合免费观看高清完整版 | 欧美一个色资源| 日日夜夜精品视频天天综合网| 色综合久久九月婷婷色综合| 中文字幕亚洲区| 男人操女人的视频在线观看欧美| 精品视频一区二区不卡| 久久午夜电影网| 激情综合色播五月| 日韩你懂的在线播放| 免费av成人在线| 精品视频一区 二区 三区| 亚洲一区二区免费视频| 91国模大尺度私拍在线视频| 亚洲欧美国产77777| 91网站视频在线观看| 亚洲欧美日韩精品久久久久| jvid福利写真一区二区三区| 国产精品久久精品日日| 99综合影院在线| 亚洲精品成人精品456| 在线视频国产一区| 亚洲一区二区综合| 91精品国产欧美一区二区18| 青青草97国产精品免费观看| 91精品蜜臀在线一区尤物| 免费观看日韩电影| 久久精品一区二区三区av| 粉嫩aⅴ一区二区三区四区五区| 国产婷婷一区二区| 91片黄在线观看| 亚洲成人动漫av| 精品国产乱码久久久久久闺蜜| 国产风韵犹存在线视精品| 欧美一卡二卡在线观看| 美腿丝袜在线亚洲一区| 国产欧美va欧美不卡在线| 成人99免费视频| 天堂影院一区二区| 久久久久久亚洲综合| 91玉足脚交白嫩脚丫在线播放| 亚洲成av人在线观看| 精品日本一线二线三线不卡| 不卡视频一二三四| 亚洲在线中文字幕| 欧美不卡在线视频| 99精品国产热久久91蜜凸| 午夜精品免费在线观看| 久久久久久麻豆| 欧美三级视频在线| 韩国成人精品a∨在线观看| 综合在线观看色| 欧美精品第一页| 午夜精品久久久久久久久久久 | 99re在线精品| 水蜜桃久久夜色精品一区的特点| 日韩精品一区在线观看| 99re这里只有精品首页| 麻豆一区二区99久久久久| 日韩毛片高清在线播放| 欧美一区午夜精品| 91美女视频网站| 久久精品国产99国产精品| 亚洲色图.com| 国产亚洲精品超碰| 制服.丝袜.亚洲.中文.综合 | 欧美电视剧免费全集观看| 972aa.com艺术欧美| 蜜桃精品视频在线观看| 亚洲日本丝袜连裤袜办公室| 欧美不卡视频一区| 欧美这里有精品| 大桥未久av一区二区三区中文| 日本大胆欧美人术艺术动态 | 亚洲黄色性网站| 久久久久久毛片| 91精品啪在线观看国产60岁| 色婷婷激情综合| 成人一级片网址| 国产一区二区三区四区五区入口| 丝袜亚洲精品中文字幕一区|