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

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

?? stm32f10x_usart.c

?? 基于STM32的數碼相冊.rar
?? C
?? 第 1 頁 / 共 3 頁
字號:
* Return         : None
*******************************************************************************/
void USART_SmartCardCmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_123_PERIPH(USARTx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the SC mode by setting the SCEN bit in the CR3 register */
    USARTx->CR3 |= CR3_SCEN_Set;
  }
  else
  {
    /* Disable the SC mode by clearing the SCEN bit in the CR3 register */
    USARTx->CR3 &= CR3_SCEN_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_SmartCardNACKCmd
* Description    : Enables or disables NACK transmission.
* Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
*                    peripheral. 
*                    Note: The Smart Card mode is not available for UART4 and UART5.
*                  - NewState: new state of the NACK transmission.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_SmartCardNACKCmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_123_PERIPH(USARTx));  
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  if (NewState != DISABLE)
  {
    /* Enable the NACK transmission by setting the NACK bit in the CR3 register */
    USARTx->CR3 |= CR3_NACK_Set;
  }
  else
  {
    /* Disable the NACK transmission by clearing the NACK bit in the CR3 register */
    USARTx->CR3 &= CR3_NACK_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_HalfDuplexCmd
* Description    : Enables or disables the USART抯 Half Duplex communication.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - NewState: new state of the USART Communication.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  if (NewState != DISABLE)
  {
    /* Enable the Half-Duplex mode by setting the HDSEL bit in the CR3 register */
    USARTx->CR3 |= CR3_HDSEL_Set;
  }
  else
  {
    /* Disable the Half-Duplex mode by clearing the HDSEL bit in the CR3 register */
    USARTx->CR3 &= CR3_HDSEL_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_IrDAConfig
* Description    : Configures the USART抯 IrDA interface.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_IrDAMode: specifies the IrDA mode.
*                    This parameter can be one of the following values:
*                       - USART_IrDAMode_LowPower
*                       - USART_IrDAMode_Normal
* Output         : None
* Return         : None
*******************************************************************************/
void USART_IrDAConfig(USART_TypeDef* USARTx, u16 USART_IrDAMode)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_IRDA_MODE(USART_IrDAMode));
    
  USARTx->CR3 &= CR3_IRLP_Mask;
  USARTx->CR3 |= USART_IrDAMode;
}

/*******************************************************************************
* Function Name  : USART_IrDACmd
* Description    : Enables or disables the USART抯 IrDA interface.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - NewState: new state of the IrDA mode.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_IrDACmd(USART_TypeDef* USARTx, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_FUNCTIONAL_STATE(NewState));
    
  if (NewState != DISABLE)
  {
    /* Enable the IrDA mode by setting the IREN bit in the CR3 register */
    USARTx->CR3 |= CR3_IREN_Set;
  }
  else
  {
    /* Disable the IrDA mode by clearing the IREN bit in the CR3 register */
    USARTx->CR3 &= CR3_IREN_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_GetFlagStatus
* Description    : Checks whether the specified USART flag is set or not.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_FLAG: specifies the flag to check.
*                    This parameter can be one of the following values:
*                       - USART_FLAG_CTS:  CTS Change flag (not available for 
*                                          UART4 and UART5)
*                       - USART_FLAG_LBD:  LIN Break detection flag
*                       - USART_FLAG_TXE:  Transmit data register empty flag
*                       - USART_FLAG_TC:   Transmission Complete flag
*                       - USART_FLAG_RXNE: Receive data register not empty flag
*                       - USART_FLAG_IDLE: Idle Line detection flag
*                       - USART_FLAG_ORE:  OverRun Error flag
*                       - USART_FLAG_NE:   Noise Error flag
*                       - USART_FLAG_FE:   Framing Error flag
*                       - USART_FLAG_PE:   Parity Error flag
* Output         : None
* Return         : The new state of USART_FLAG (SET or RESET).
*******************************************************************************/
FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, u16 USART_FLAG)
{
  FlagStatus bitstatus = RESET;

  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_FLAG(USART_FLAG));
  assert_param(IS_USART_PERIPH_FLAG(USARTx, USART_FLAG)); /* The CTS flag is not available for UART4 and UART5 */   

  if ((USARTx->SR & USART_FLAG) != (u16)RESET)
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  return bitstatus;
}

/*******************************************************************************
* Function Name  : USART_ClearFlag
* Description    : Clears the USARTx's pending flags.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_FLAG: specifies the flag to clear.
*                    This parameter can be any combination of the following values:
*                       - USART_FLAG_CTS:  CTS Change flag (not available for
*                                          UART4 and UART5).
*                       - USART_FLAG_LBD:  LIN Break detection flag.
*                       - USART_FLAG_TC:   Transmission Complete flag.
*                       - USART_FLAG_RXNE: Receive data register not empty flag.
*
*                  Notes:
*                        - PE (Parity error), FE (Framing error), NE (Noise error),
*                          ORE (OverRun error) and IDLE (Idle line detected) 
*                          flags are cleared by software sequence: a read 
*                          operation to USART_SR register (USART_GetFlagStatus()) 
*                          followed by a read operation to USART_DR register 
*                          (USART_ReceiveData()).
*                        - RXNE flag can be also cleared by a read to the 
*                          USART_DR register (USART_ReceiveData()).
*                        - TC flag can be also cleared by software sequence: a 
*                          read operation to USART_SR register 
*                          (USART_GetFlagStatus()) followed by a write operation
*                          to USART_DR register (USART_SendData()).                                                      
*                        - TXE flag is cleared only by a write to the USART_DR 
*                          register (USART_SendData()).                        
* Output         : None
* Return         : None
*******************************************************************************/
void USART_ClearFlag(USART_TypeDef* USARTx, u16 USART_FLAG)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_CLEAR_FLAG(USART_FLAG));
  assert_param(IS_USART_PERIPH_FLAG(USARTx, USART_FLAG)); /* The CTS flag is not available for UART4 and UART5 */   
   
  USARTx->SR = (u16)~USART_FLAG;
}

/*******************************************************************************
* Function Name  : USART_GetITStatus
* Description    : Checks whether the specified USART interrupt has occurred or not.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_IT: specifies the USART interrupt source to check.
*                    This parameter can be one of the following values:
*                       - USART_IT_CTS:  CTS change interrupt (not available for 
*                                        UART4 and UART5)
*                       - USART_IT_LBD:  LIN Break detection interrupt
*                       - USART_IT_TXE:  Tansmit Data Register empty interrupt
*                       - USART_IT_TC:   Transmission complete interrupt
*                       - USART_IT_RXNE: Receive Data register not empty 
*                                        interrupt
*                       - USART_IT_IDLE: Idle line detection interrupt
*                       - USART_IT_ORE:  OverRun Error interrupt
*                       - USART_IT_NE:   Noise Error interrupt
*                       - USART_IT_FE:   Framing Error interrupt
*                       - USART_IT_PE:   Parity Error interrupt
* Output         : None
* Return         : The new state of USART_IT (SET or RESET).
*******************************************************************************/
ITStatus USART_GetITStatus(USART_TypeDef* USARTx, u16 USART_IT)
{
  u32 bitpos = 0x00, itmask = 0x00, usartreg = 0x00;
  ITStatus bitstatus = RESET;

  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_GET_IT(USART_IT));
  assert_param(IS_USART_PERIPH_IT(USARTx, USART_IT)); /* The CTS interrupt is not available for UART4 and UART5 */  
  
  /* Get the USART register index */
  usartreg = (((u8)USART_IT) >> 0x05);

  /* Get the interrupt position */
  itmask = USART_IT & IT_Mask;

  itmask = (u32)0x01 << itmask;
  
  if (usartreg == 0x01) /* The IT  is in CR1 register */
  {
    itmask &= USARTx->CR1;
  }
  else if (usartreg == 0x02) /* The IT  is in CR2 register */
  {
    itmask &= USARTx->CR2;
  }
  else /* The IT  is in CR3 register */
  {
    itmask &= USARTx->CR3;
  }
  
  bitpos = USART_IT >> 0x08;

  bitpos = (u32)0x01 << bitpos;
  bitpos &= USARTx->SR;

  if ((itmask != (u16)RESET)&&(bitpos != (u16)RESET))
  {
    bitstatus = SET;
  }
  else
  {
    bitstatus = RESET;
  }
  
  return bitstatus;  
}

/*******************************************************************************
* Function Name  : USART_ClearITPendingBit
* Description    : Clears the USARTx抯 interrupt pending bits.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - USART_IT: specifies the interrupt pending bit to clear.
*                    This parameter can be one of the following values:
*                       - USART_IT_CTS:  CTS change interrupt (not available for 
*                                        UART4 and UART5)
*                       - USART_IT_LBD:  LIN Break detection interrupt
*                       - USART_IT_TC:   Transmission complete interrupt. 
*                       - USART_IT_RXNE: Receive Data register not empty interrupt.
*                    
*                  Notes:
*                        - PE (Parity error), FE (Framing error), NE (Noise error),
*                          ORE (OverRun error) and IDLE (Idle line detected) 
*                          pending bits are cleared by software sequence: a read 
*                          operation to USART_SR register (USART_GetITStatus()) 
*                          followed by a read operation to USART_DR register 
*                          (USART_ReceiveData()).
*                        - RXNE pending bit can be also cleared by a read to the 
*                          USART_DR register (USART_ReceiveData()).
*                        - TC pending bit can be also cleared by software 
*                          sequence: a read operation to USART_SR register 
*                          (USART_GetITStatus()) followed by a write operation
*                          to USART_DR register (USART_SendData()).                                                      
*                        - TXE pending bit is cleared only by a write to the 
*                          USART_DR register (USART_SendData()).  
* Output         : None
* Return         : None
*******************************************************************************/
void USART_ClearITPendingBit(USART_TypeDef* USARTx, u16 USART_IT)
{
  u16 bitpos = 0x00, itmask = 0x00;

  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_CLEAR_IT(USART_IT));
  assert_param(IS_USART_PERIPH_IT(USARTx, USART_IT)); /* The CTS interrupt is not available for UART4 and UART5 */
  
  bitpos = USART_IT >> 0x08;

  itmask = (u16)((u16)0x01 << bitpos);
  USARTx->SR = (u16)~itmask;
}

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费视频最近日韩| 国产精品视频一二| 91日韩在线专区| 不卡av在线免费观看| 成人午夜精品一区二区三区| 国产精品一区二区久久精品爱涩| 韩国女主播成人在线观看| 黄网站免费久久| 国产福利91精品| 99在线精品观看| 欧美日韩高清一区二区不卡| 欧美日韩一区二区三区不卡| 日韩一区和二区| 国产色婷婷亚洲99精品小说| 欧美国产精品一区二区| 亚洲欧美国产三级| 曰韩精品一区二区| 奇米777欧美一区二区| 国内精品视频一区二区三区八戒| 粉嫩嫩av羞羞动漫久久久| 99re亚洲国产精品| 91精品免费在线观看| 精品少妇一区二区三区| 国产精品你懂的在线| 一区二区三区不卡视频| 三级亚洲高清视频| 国产不卡在线一区| 欧美在线你懂得| 欧美大肚乱孕交hd孕妇| 国产精品久久久久影院老司| 亚洲高清中文字幕| 国产大陆精品国产| 欧美日韩国产乱码电影| 久久久久久久久久久久久女国产乱| 国产精品第四页| 蜜桃av一区二区三区电影| 成人在线视频一区二区| 欧美日韩你懂的| 国产精品国产自产拍高清av王其| 日日摸夜夜添夜夜添国产精品| 国产麻豆精品在线| 欧美精品亚洲二区| 中文字幕日韩精品一区| 美女爽到高潮91| 欧美中文字幕一二三区视频| 久久久久久久久久美女| 天堂成人国产精品一区| 99精品欧美一区| 国产亚洲成年网址在线观看| 天涯成人国产亚洲精品一区av| 国产传媒欧美日韩成人| 在线成人午夜影院| 亚洲一级二级在线| 99在线精品免费| 中文字幕av一区 二区| 国模冰冰炮一区二区| 欧美日韩精品二区第二页| 最近日韩中文字幕| 成人精品免费看| 国产丝袜美腿一区二区三区| 久久99九九99精品| 日韩精品一区二区三区在线播放| 亚洲午夜激情网页| 欧美亚洲动漫精品| 亚洲影视在线播放| 色婷婷av久久久久久久| 中文字幕永久在线不卡| av网站免费线看精品| 国产清纯在线一区二区www| 韩国在线一区二区| 久久亚洲精品国产精品紫薇| 久久精品国产亚洲a| 精品国产免费视频| 国精品**一区二区三区在线蜜桃| 精品福利一区二区三区| 激情综合网天天干| 久久久久久久精| 国产精品一二三四| 国产精品五月天| www.激情成人| 洋洋av久久久久久久一区| 在线观看欧美黄色| 亚洲国产精品视频| 91精品国产一区二区| 美女免费视频一区| 欧美变态tickle挠乳网站| 国产精品一区二区在线观看不卡| 久久久不卡网国产精品一区| 成人午夜伦理影院| 亚洲另类在线制服丝袜| 欧美日韩成人在线一区| 蜜桃久久久久久| 国产精品国产精品国产专区不蜜 | 久久久精品中文字幕麻豆发布| 蜜桃av噜噜一区| 久久久久久久久岛国免费| 99视频国产精品| 五月天国产精品| 久久久久97国产精华液好用吗| 99久久99久久精品免费观看| 亚洲超丰满肉感bbw| 久久先锋资源网| 一本大道av一区二区在线播放| 图片区小说区区亚洲影院| xfplay精品久久| 在线亚洲一区观看| 精品亚洲国内自在自线福利| 成人免费小视频| 91精品国产色综合久久ai换脸| 国产白丝网站精品污在线入口| 亚洲精品国久久99热| 精品国产一二三| 日本韩国欧美在线| 国产一区亚洲一区| 亚洲第一激情av| 国产精品网站一区| 91精品一区二区三区在线观看| 国产精品一区二区在线播放| 亚洲综合免费观看高清在线观看| 欧美大白屁股肥臀xxxxxx| 91亚洲国产成人精品一区二区三 | 日本亚洲免费观看| 国产精品美女久久久久高潮| 欧美一级午夜免费电影| 99久精品国产| 国产98色在线|日韩| 五月天亚洲精品| 一区二区视频在线| 欧美经典一区二区三区| 欧美一区二区视频观看视频| 色哟哟一区二区三区| 国产精品一级黄| 奇米四色…亚洲| 香蕉乱码成人久久天堂爱免费| 中文字幕在线观看不卡视频| 久久久久久综合| 欧美mv和日韩mv的网站| 欧美日韩大陆在线| 在线观看免费成人| 91丨九色丨蝌蚪富婆spa| 成人小视频在线观看| 精品一区二区三区在线观看国产| 亚洲aaa精品| 亚洲自拍偷拍av| 一个色综合网站| 亚洲最大成人网4388xx| 亚洲色图视频免费播放| 中文一区在线播放| 最新日韩av在线| 亚洲欧美成人一区二区三区| 亚洲欧美在线高清| 一区二区三区中文字幕在线观看| 亚洲黄色片在线观看| 一区二区三区精品视频在线| 亚洲国产日产av| 日韩成人免费电影| 日韩专区一卡二卡| 久久国产精品一区二区| 国产一区二区三区不卡在线观看 | 国产日韩欧美不卡| 国产欧美一区二区三区网站| 久久精品亚洲乱码伦伦中文 | 欧美日韩国产一级片| 欧美三区免费完整视频在线观看| 欧美性猛交一区二区三区精品 | 亚洲精品一线二线三线| 精品区一区二区| 国产亚洲成年网址在线观看| 国产精品久久久久7777按摩| 亚洲四区在线观看| 日韩和欧美的一区| 国产经典欧美精品| 91猫先生在线| 91精品国产综合久久福利| 久久久天堂av| 亚洲欧美激情小说另类| 人人爽香蕉精品| 成人av资源站| 欧美福利视频导航| 国产精品久久毛片| 亚洲成av人片在线| 国产酒店精品激情| 色综合 综合色| 精品久久久久久无| 亚洲黄色性网站| 国产一区二区三区| 欧美午夜寂寞影院| 久久久午夜精品| 日韩高清在线一区| av影院午夜一区| 欧美va天堂va视频va在线| 亚洲私人黄色宅男| 老司机精品视频导航| 日本二三区不卡| 精品国产一区二区精华| 亚洲免费在线观看| 国产成人综合自拍| 日韩欧美国产一区二区三区| 国产精品―色哟哟| 美女在线视频一区|