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

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

?? stm32l1xx_spi.c

?? VS1003_MP3_SPI_SDHC_FAT32
?? C
?? 第 1 頁 / 共 3 頁
字號:
  }
  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, 2 or 3 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/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.
  * @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)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  assert_param(IS_SPI_I2S_DMAREQ(SPI_I2S_DMAReq));

  if (NewState != DISABLE)
  {
    /* Enable the selected SPI DMA requests */
    SPIx->CR2 |= SPI_I2S_DMAReq;
  }
  else
  {
    /* Disable the selected SPI DMA requests */
    SPIx->CR2 &= (uint16_t)~SPI_I2S_DMAReq;
  }
}

/**
  * @}
  */

/** @defgroup SPI_Group5 Interrupts and flags management functions
 *  @brief   Interrupts and flags management functions
  *
@verbatim
 ===============================================================================
             ##### Interrupts and flags management functions #####
 ===============================================================================
    [..] This section provides a set of functions allowing to configure the SPI 
         Interrupts sources and check or clear the flags or pending bits status.
         The user should identify which mode will be used in his application to 
         manage the communication: Polling mode, Interrupt mode or DMA mode.
  *** Polling Mode ***
  ====================
    [..] In Polling Mode, the SPI/I2S communication can be managed by 9 flags:
        (#) SPI_I2S_FLAG_TXE : to indicate the status of the transmit buffer 
             register.
        (#) SPI_I2S_FLAG_RXNE : to indicate the status of the receive buffer 
             register.
        (#) SPI_I2S_FLAG_BSY : to indicate the state of the communication layer 
             of the SPI.
        (#) SPI_FLAG_CRCERR : to indicate if a CRC Calculation error occur.
        (#) SPI_FLAG_MODF : to indicate if a Mode Fault error occur.
        (#) SPI_I2S_FLAG_OVR : to indicate if an Overrun error occur.
        (#) SPI_I2S_FLAG_FRE: to indicate a Frame Format error occurs.
        (#) I2S_FLAG_UDR: to indicate an Underrun error occurs.
        (#) I2S_FLAG_CHSIDE: to indicate Channel Side.
    -@- Do not use the BSY flag to handle each data transmission or reception.
        It is better to use the TXE and RXNE flags instead.
    [..] In this Mode it is advised to use the following functions:
         (+) FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG).
         (+) void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG).

  *** Interrupt Mode ***
  ======================
    [..] In Interrupt Mode, the SPI communication can be managed by 3 interrupt 
         sources and 7 pending bits: 
    [..] Pending Bits:
        (#) SPI_I2S_IT_TXE : to indicate the status of the transmit buffer register.
        (#) SPI_I2S_IT_RXNE : to indicate the status of the receive buffer register.
        (#) SPI_IT_CRCERR : to indicate if a CRC Calculation error occur.
        (#) SPI_IT_MODF : to indicate if a Mode Fault error occur.
        (#) SPI_I2S_IT_OVR : to indicate if an Overrun error occur.
        (#) I2S_IT_UDR : to indicate an Underrun Error occurs.
        (#) SPI_I2S_FLAG_FRE : to indicate a Frame Format error occurs.
    [..] Interrupt Source:
        (#) SPI_I2S_IT_TXE: specifies the interrupt source for the Tx buffer empty 
            interrupt.
        (#) SPI_I2S_IT_RXNE : specifies the interrupt source for the Rx buffer not 
            empty interrupt.
        (#) SPI_I2S_IT_ERR : specifies the interrupt source for the errors interrupt.
    [..] In this Mode it is advised to use the following functions:
         (+) void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT,
             FunctionalState NewState).
         (+) ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT).
         (+) void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT).

  *** DMA Mode ***
  ================
    [..] In DMA Mode, the SPI communication can be managed by 2 DMA Channel 
         requests:
        (#) SPI_I2S_DMAReq_Tx: specifies the Tx buffer DMA transfer request.
        (#) SPI_I2S_DMAReq_Rx: specifies the Rx buffer DMA transfer request.

    [..] In this Mode it is advised to use the following function:
         (+) void SPI_I2S_DMACmd(SPI_TypeDef* SPIx, uint16_t SPI_I2S_DMAReq,
             FunctionalState NewState).

@endverbatim
  * @{
  */

/**
  * @brief  Enables or disables the specified SPI/I2S interrupts.
  * @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  SPI_I2S_IT: specifies the SPI interrupt source to be enabled or disabled. 
  *   This parameter can be one of the following values:
  *     @arg SPI_I2S_IT_TXE: Tx buffer empty interrupt mask.
  *     @arg SPI_I2S_IT_RXNE: Rx buffer not empty interrupt mask.
  *     @arg SPI_I2S_IT_ERR: Error interrupt mask.
  * @param  NewState: new state of the specified SPI interrupt.
  *   This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void SPI_I2S_ITConfig(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT, FunctionalState NewState)
{
  uint16_t itpos = 0, itmask = 0 ;
  
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  assert_param(IS_SPI_I2S_CONFIG_IT(SPI_I2S_IT));

  /* Get the SPI IT index */
  itpos = SPI_I2S_IT >> 4;

  /* Set the IT mask */
  itmask = (uint16_t)1 << (uint16_t)itpos;

  if (NewState != DISABLE)
  {
    /* Enable the selected SPI interrupt */
    SPIx->CR2 |= itmask;
  }
  else
  {
    /* Disable the selected SPI interrupt */
    SPIx->CR2 &= (uint16_t)~itmask;
  }
}

/**
  * @brief  Checks whether the specified SPIx/I2Sx flag is set or not.
  * @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  SPI_I2S_FLAG: specifies the SPI flag to check. 
  *   This parameter can be one of the following values:
  *     @arg SPI_I2S_FLAG_TXE: Transmit buffer empty flag.
  *     @arg SPI_I2S_FLAG_RXNE: Receive buffer not empty flag.
  *     @arg SPI_I2S_FLAG_BSY: Busy flag.
  *     @arg SPI_I2S_FLAG_OVR: Overrun flag.
  *     @arg SPI_FLAG_MODF: Mode Fault flag.
  *     @arg SPI_FLAG_CRCERR: CRC Error flag.
  *     @arg SPI_I2S_FLAG_FRE: Format Error.
  *     @arg I2S_FLAG_UDR: Underrun Error flag.
  *     @arg I2S_FLAG_CHSIDE: Channel Side flag.
  * @retval The new state of SPI_I2S_FLAG (SET or RESET).
  */
FlagStatus SPI_I2S_GetFlagStatus(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG)
{
  FlagStatus bitstatus = RESET;
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_I2S_GET_FLAG(SPI_I2S_FLAG));
  
  /* Check the status of the specified SPI flag */
  if ((SPIx->SR & SPI_I2S_FLAG) != (uint16_t)RESET)
  {
    /* SPI_I2S_FLAG is set */
    bitstatus = SET;
  }
  else
  {
    /* SPI_I2S_FLAG is reset */
    bitstatus = RESET;
  }
  /* Return the SPI_I2S_FLAG status */
  return  bitstatus;
}

/**
  * @brief  Clears the SPIx CRC Error (CRCERR) flag.
  * @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  SPI_I2S_FLAG: specifies the SPI flag to clear. 
  *   This function clears only CRCERR flag.

  * @note OVR (OverRun error) flag is cleared by software sequence: a read 
  *     operation to SPI_DR register (SPI_I2S_ReceiveData()) followed by a read 
  *     operation to SPI_SR register (SPI_I2S_GetFlagStatus()).
  * @note UDR (UnderRun error) flag is cleared by a read operation to 
  *     SPI_SR register (SPI_I2S_GetFlagStatus()).   
  * @note MODF (Mode Fault) flag is cleared by software sequence: a read/write 
  *     operation to SPI_SR register (SPI_I2S_GetFlagStatus()) followed by a 
  *     write operation to SPI_CR1 register (SPI_Cmd() to enable the SPI).
  * @retval None
  */
void SPI_I2S_ClearFlag(SPI_TypeDef* SPIx, uint16_t SPI_I2S_FLAG)
{
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_I2S_CLEAR_FLAG(SPI_I2S_FLAG));
    
  /* Clear the selected SPI CRC Error (CRCERR) flag */
  SPIx->SR = (uint16_t)~SPI_I2S_FLAG;
}

/**
  * @brief  Checks whether the specified SPIx/I2Sx interrupt has occurred or not.
  * @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  SPI_I2S_IT: specifies the SPI interrupt source to check. 
  *   This parameter can be one of the following values:
  *     @arg SPI_I2S_IT_TXE: Transmit buffer empty interrupt.
  *     @arg SPI_I2S_IT_RXNE: Receive buffer not empty interrupt.
  *     @arg SPI_I2S_IT_OVR: Overrun interrupt.
  *     @arg SPI_IT_MODF: Mode Fault interrupt.
  *     @arg SPI_IT_CRCERR: CRC Error interrupt.
  *     @arg I2S_IT_UDR: Underrun interrupt.  
  *     @arg SPI_I2S_IT_FRE: Format Error interrupt.  
  * @retval The new state of SPI_I2S_IT (SET or RESET).
  */
ITStatus SPI_I2S_GetITStatus(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT)
{
  ITStatus bitstatus = RESET;
  uint16_t itpos = 0, itmask = 0, enablestatus = 0;

  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_I2S_GET_IT(SPI_I2S_IT));

  /* Get the SPI_I2S_IT index */
  itpos = 0x01 << (SPI_I2S_IT & 0x0F);

  /* Get the SPI_I2S_IT IT mask */
  itmask = SPI_I2S_IT >> 4;

  /* Set the IT mask */
  itmask = 0x01 << itmask;

  /* Get the SPI_I2S_IT enable bit status */
  enablestatus = (SPIx->CR2 & itmask) ;

  /* Check the status of the specified SPI interrupt */
  if (((SPIx->SR & itpos) != (uint16_t)RESET) && enablestatus)
  {
    /* SPI_I2S_IT is set */
    bitstatus = SET;
  }
  else
  {
    /* SPI_I2S_IT is reset */
    bitstatus = RESET;
  }
  /* Return the SPI_I2S_IT status */
  return bitstatus;
}

/**
  * @brief  Clears the SPIx CRC Error (CRCERR) interrupt pending bit.
  * @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  SPI_I2S_IT: specifies the SPI interrupt pending bit to clear.
  *   This function clears only CRCERR interrupt pending bit.   

  *     OVR (OverRun Error) interrupt pending bit is cleared by software 
  *     sequence: a read operation to SPI_DR register (SPI_I2S_ReceiveData()) 
  *     followed by a read operation to SPI_SR register (SPI_I2S_GetITStatus()).
  * @note UDR (UnderRun Error) interrupt pending bit is cleared by a read 
  *     operation to SPI_SR register (SPI_I2S_GetITStatus()).   
  * @note MODF (Mode Fault) interrupt pending bit is cleared by software sequence:
  *     a read/write operation to SPI_SR register (SPI_I2S_GetITStatus()) 
  *     followed by a write operation to SPI_CR1 register (SPI_Cmd() to enable 
  *     the SPI).
  * @retval None
  */
void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT)
{
  uint16_t itpos = 0;
  /* Check the parameters */
  assert_param(IS_SPI_ALL_PERIPH(SPIx));
  assert_param(IS_SPI_I2S_CLEAR_IT(SPI_I2S_IT));

  /* Get the SPI_I2S IT index */
  itpos = 0x01 << (SPI_I2S_IT & 0x0F);

  /* Clear the selected SPI CRC Error (CRCERR) interrupt pending bit */
  SPIx->SR = (uint16_t)~itpos;
}

/**
  * @}
  */

/**
  * @}
  */ 

/**
  * @}
  */ 

/**
  * @}
  */ 

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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美蜜桃一区二区三区| 夜夜嗨av一区二区三区网页| 日韩免费高清视频| 91精品在线免费| 欧美一卡在线观看| 欧美一二三在线| 日韩精品一区二区三区中文精品 | 国产精品美女久久久久av爽李琼| 久久精品综合网| 国产亚洲va综合人人澡精品| 国产欧美一区二区精品忘忧草 | 亚洲六月丁香色婷婷综合久久| 国产精品成人在线观看| 亚洲色图制服诱惑 | 国产高清精品网站| 国产大陆a不卡| 99综合电影在线视频| 色香色香欲天天天影视综合网| 91免费版pro下载短视频| 在线观看免费一区| 欧美日韩精品一区二区三区四区 | 国产精品一色哟哟哟| 福利一区二区在线观看| 成人免费视频播放| 欧美午夜片在线看| 日韩欧美综合一区| 国产亚洲1区2区3区| 亚洲欧美在线aaa| 亚洲一区二区视频在线观看| 蜜臀av一级做a爰片久久| 国产一区二区影院| 91浏览器在线视频| 欧美久久久久久久久久| 久久先锋资源网| 亚洲另类色综合网站| 婷婷开心久久网| 国产高清久久久| 在线观看亚洲精品视频| 欧美成人艳星乳罩| 18欧美乱大交hd1984| 婷婷综合在线观看| 国产ts人妖一区二区| 在线亚洲免费视频| 久久蜜桃一区二区| 亚洲精品精品亚洲| 国内一区二区在线| 在线视频欧美区| 久久久美女毛片| 一区二区三区免费| 国产美女精品在线| 欧美性感一类影片在线播放| 精品国产乱码久久久久久夜甘婷婷| 18涩涩午夜精品.www| 免费不卡在线观看| 91亚洲资源网| 欧美精品一区二区三区视频| 一区二区激情小说| 国产乱子轮精品视频| 欧美丝袜丝nylons| 国产欧美视频一区二区| 日韩黄色片在线观看| 99视频超级精品| 精品久久一二三区| 亚洲福利电影网| av资源网一区| 精品国产乱码久久久久久闺蜜 | 国产a久久麻豆| 777午夜精品免费视频| 亚洲欧美色一区| 国产不卡视频在线播放| 91精品国产综合久久小美女| 综合精品久久久| 国产不卡高清在线观看视频| 日韩免费看的电影| 午夜精品久久久久久久蜜桃app| 成人午夜视频福利| 精品国产免费一区二区三区四区| 亚洲国产综合在线| 91毛片在线观看| 国产区在线观看成人精品| 美女诱惑一区二区| 91精选在线观看| 亚洲国产精品久久久久秋霞影院 | 国产精品亚洲一区二区三区在线 | 日韩高清不卡一区二区| 日韩精彩视频在线观看| 日本韩国一区二区三区视频| 国产欧美日韩久久| 久草精品在线观看| 欧美电视剧免费全集观看| 亚洲福利视频一区| 欧美三区在线观看| 亚洲精品综合在线| 成人av电影免费观看| 国产亚洲精品中文字幕| 国产美女主播视频一区| 久久久噜噜噜久久中文字幕色伊伊 | 欧美精品视频www在线观看| 一区二区欧美视频| 91精品91久久久中77777| 亚洲人成网站影音先锋播放| av在线播放一区二区三区| 国产精品久久久久久久第一福利| 国产91精品露脸国语对白| 国产欧美一区二区精品仙草咪| 国产成人高清在线| 国产精品免费久久久久| 99国产精品国产精品毛片| 国产精品久久久久久久久图文区| 成人免费高清视频在线观看| 国产精品色哟哟网站| 99re热这里只有精品视频| 亚洲欧美二区三区| 在线亚洲高清视频| 肉色丝袜一区二区| 欧美成人伊人久久综合网| 国产一区不卡视频| 最近日韩中文字幕| 欧美三级三级三级| 久久精品久久精品| 日本一二三不卡| 色综合一区二区| 水野朝阳av一区二区三区| 欧美大胆一级视频| 国产成人精品影视| 一区二区三区四区中文字幕| 欧美精品色一区二区三区| 久久精品国产久精国产爱| 欧美国产97人人爽人人喊| 在线免费观看日韩欧美| 日本最新不卡在线| 国产欧美一区二区精品婷婷 | 国产欧美精品一区| 色婷婷综合久久久久中文| 日韩激情视频网站| 国产色一区二区| 91浏览器在线视频| 麻豆国产精品777777在线| 日本一区二区免费在线| 色香蕉久久蜜桃| 久久爱另类一区二区小说| 国产精品欧美一级免费| 欧美无乱码久久久免费午夜一区| 美女视频一区二区三区| 国产精品天美传媒沈樵| 欧美日本在线看| 国产999精品久久久久久绿帽| 亚洲精品亚洲人成人网| 日韩视频永久免费| 99久精品国产| 免费精品视频最新在线| 亚洲欧洲综合另类在线| 日韩久久久精品| 色婷婷久久久久swag精品| 精品一区二区三区免费| 一区二区三区高清在线| 国产亚洲一区二区三区| 欧美日韩国产成人在线91| 国产aⅴ综合色| 天使萌一区二区三区免费观看| 中文一区二区在线观看| 337p亚洲精品色噜噜| 色伊人久久综合中文字幕| 韩国女主播成人在线观看| 亚洲地区一二三色| 国产精品青草综合久久久久99| 欧美一区二区视频网站| 94-欧美-setu| 国产成人午夜视频| 免费久久99精品国产| 一区二区成人在线| 欧美国产97人人爽人人喊| 日韩欧美国产麻豆| 欧美视频在线观看一区二区| voyeur盗摄精品| 国精品**一区二区三区在线蜜桃| 亚洲成人综合在线| 亚洲欧美另类久久久精品 | 日韩av一二三| 一区二区三区日韩欧美精品| 国产精品天天看| 久久精品一区蜜桃臀影院| 日韩午夜激情av| 欧美日韩国产大片| 欧美亚洲一区二区在线| 91亚洲国产成人精品一区二三 | 国产亲近乱来精品视频| 欧美r级在线观看| 91精品欧美一区二区三区综合在| 色先锋资源久久综合| 91丨九色丨蝌蚪富婆spa| av一区二区三区| 成人免费视频播放| 国产99一区视频免费| 国产一区二区三区久久悠悠色av| 另类的小说在线视频另类成人小视频在线| 亚洲在线一区二区三区| 亚洲夂夂婷婷色拍ww47| 亚洲精品欧美激情| 亚洲精品日产精品乱码不卡|