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

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

?? stm32f10x_usart.c

?? 基于STM32的數碼相冊.rar
?? C
?? 第 1 頁 / 共 3 頁
字號:
*                  - USART_IT: specifies the USART interrupt sources to be
*                    enabled or disabled.
*                    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_PE:   Parity Error interrupt
*                       - USART_IT_ERR:  Error interrupt(Frame error, noise
*                                        error, overrun error)
*                  - NewState: new state of the specified USARTx interrupts.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_ITConfig(USART_TypeDef* USARTx, u16 USART_IT, FunctionalState NewState)
{
  u32 usartreg = 0x00, itpos = 0x00, itmask = 0x00;
  u32 usartxbase = 0x00;

  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_CONFIG_IT(USART_IT));
  assert_param(IS_USART_PERIPH_IT(USARTx, USART_IT)); /* The CTS interrupt is not available for UART4 and UART5 */     
  assert_param(IS_FUNCTIONAL_STATE(NewState));

  usartxbase = (*(u32*)&(USARTx));

  /* Get the USART register index */
  usartreg = (((u8)USART_IT) >> 0x05);

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

  itmask = (((u32)0x01) << itpos);
    
  if (usartreg == 0x01) /* The IT is in CR1 register */
  {
    usartxbase += 0x0C;
  }
  else if (usartreg == 0x02) /* The IT is in CR2 register */
  {
    usartxbase += 0x10;
  }
  else /* The IT is in CR3 register */
  {
    usartxbase += 0x14; 
  }
  if (NewState != DISABLE)
  {
    *(vu32*)usartxbase  |= itmask;
  }
  else
  {
    *(vu32*)usartxbase &= ~itmask;
  }
}

/*******************************************************************************
* Function Name  : USART_DMACmd
* Description    : Enables or disables the USART抯 DMA interface.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3 or UART4.
*                    Note: The DMA mode is not available for UART5.
*                  - USART_DMAReq: specifies the DMA request.
*                    This parameter can be any combination of the following values:
*                       - USART_DMAReq_Tx: USART DMA transmit request
*                       - USART_DMAReq_Rx: USART DMA receive request
*                  - NewState: new state of the DMA Request sources.
*                   This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_DMACmd(USART_TypeDef* USARTx, u16 USART_DMAReq, FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_USART_1234_PERIPH(USARTx));
  assert_param(IS_USART_DMAREQ(USART_DMAReq));  
  assert_param(IS_FUNCTIONAL_STATE(NewState)); 

  if (NewState != DISABLE)
  {
    /* Enable the DMA transfer for selected requests by setting the DMAT and/or
       DMAR bits in the USART CR3 register */
    USARTx->CR3 |= USART_DMAReq;
  }
  else
  {
    /* Disable the DMA transfer for selected requests by clearing the DMAT and/or
       DMAR bits in the USART CR3 register */
    USARTx->CR3 &= (u16)~USART_DMAReq;
  }
}

/*******************************************************************************
* Function Name  : USART_SetAddress
* Description    : Sets the address of the USART node.
* 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_Address: Indicates the address of the USART node.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_SetAddress(USART_TypeDef* USARTx, u8 USART_Address)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_ADDRESS(USART_Address)); 
    
  /* Clear the USART address */
  USARTx->CR2 &= CR2_Address_Mask;
  /* Set the USART address node */
  USARTx->CR2 |= USART_Address;
}

/*******************************************************************************
* Function Name  : USART_WakeUpConfig
* Description    : Selects the USART WakeUp method.
* 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_WakeUp: specifies the USART wakeup method.
*                    This parameter can be one of the following values:
*                        - USART_WakeUp_IdleLine: WakeUp by an idle line detection
*                        - USART_WakeUp_AddressMark: WakeUp by an address mark
* Output         : None
* Return         : None
*******************************************************************************/
void USART_WakeUpConfig(USART_TypeDef* USARTx, u16 USART_WakeUp)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_WAKEUP(USART_WakeUp));
  
  USARTx->CR1 &= CR1_WAKE_Mask;
  USARTx->CR1 |= USART_WakeUp;
}

/*******************************************************************************
* Function Name  : USART_ReceiverWakeUpCmd
* Description    : Determines if the USART is in mute mode 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.
*                  - NewState: new state of the USART mute mode.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_ReceiverWakeUpCmd(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 USART mute mode  by setting the RWU bit in the CR1 register */
    USARTx->CR1 |= CR1_RWU_Set;
  }
  else
  {
    /* Disable the USART mute mode by clearing the RWU bit in the CR1 register */
    USARTx->CR1 &= CR1_RWU_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_LINBreakDetectLengthConfig
* Description    : Sets the USART LIN Break detection length.
* 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_LINBreakDetectLength: specifies the LIN break
*                    detection length.
*                    This parameter can be one of the following values:
*                       - USART_LINBreakDetectLength_10b: 10-bit break detection
*                       - USART_LINBreakDetectLength_11b: 11-bit break detection
* Output         : None
* Return         : None
*******************************************************************************/
void USART_LINBreakDetectLengthConfig(USART_TypeDef* USARTx, u16 USART_LINBreakDetectLength)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_LIN_BREAK_DETECT_LENGTH(USART_LINBreakDetectLength));
  
  USARTx->CR2 &= CR2_LBDL_Mask;
  USARTx->CR2 |= USART_LINBreakDetectLength;  
}

/*******************************************************************************
* Function Name  : USART_LINCmd
* Description    : Enables or disables the USART抯 LIN mode.
* 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 LIN mode.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_LINCmd(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 LIN mode by setting the LINEN bit in the CR2 register */
    USARTx->CR2 |= CR2_LINEN_Set;
  }
  else
  {
    /* Disable the LIN mode by clearing the LINEN bit in the CR2 register */
    USARTx->CR2 &= CR2_LINEN_Reset;
  }
}

/*******************************************************************************
* Function Name  : USART_SendData
* Description    : Transmits single data through the USARTx peripheral.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  - Data: the data to transmit.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_SendData(USART_TypeDef* USARTx, u16 Data)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  assert_param(IS_USART_DATA(Data)); 
    
  /* Transmit Data */
  USARTx->DR = (Data & (u16)0x01FF);
}

/*******************************************************************************
* Function Name  : USART_ReceiveData
* Description    : Returns the most recent received data by the USARTx peripheral.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
* Output         : None
* Return         : The received data.
*******************************************************************************/
u16 USART_ReceiveData(USART_TypeDef* USARTx)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  
  /* Receive Data */
  return (u16)(USARTx->DR & (u16)0x01FF);
}

/*******************************************************************************
* Function Name  : USART_SendBreak
* Description    : Transmits break characters.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_SendBreak(USART_TypeDef* USARTx)
{
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  
  /* Send break characters */
  USARTx->CR1 |= CR1_SBK_Set;
}

/*******************************************************************************
* Function Name  : USART_SetGuardTime
* Description    : Sets the specified USART guard time.
* Input          : - USARTx: where x can be 1, 2 or 3 to select the USART
*                    peripheral.
*                  Note: The guard time bits are not available for UART4 and UART5.
*                  - USART_GuardTime: specifies the guard time.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_SetGuardTime(USART_TypeDef* USARTx, u8 USART_GuardTime)
{    
  /* Check the parameters */
  assert_param(IS_USART_123_PERIPH(USARTx));
  
  /* Clear the USART Guard time */
  USARTx->GTPR &= GTPR_LSB_Mask;
  /* Set the USART guard time */
  USARTx->GTPR |= (u16)((u16)USART_GuardTime << 0x08);
}

/*******************************************************************************
* Function Name  : USART_SetPrescaler
* Description    : Sets the system clock prescaler.
* Input          : - USARTx: Select the USART or the UART peripheral. 
*                    This parameter can be one of the following values:
*                     - USART1, USART2, USART3, UART4 or UART5.
*                  Note: The function is used for IrDA mode with UART4 and UART5.
*                  - USART_Prescaler: specifies the prescaler clock.
* Output         : None
* Return         : None
*******************************************************************************/
void USART_SetPrescaler(USART_TypeDef* USARTx, u8 USART_Prescaler)
{ 
  /* Check the parameters */
  assert_param(IS_USART_ALL_PERIPH(USARTx));
  
  /* Clear the USART prescaler */
  USARTx->GTPR &= GTPR_MSB_Mask;
  /* Set the USART prescaler */
  USARTx->GTPR |= USART_Prescaler;
}

/*******************************************************************************
* Function Name  : USART_SmartCardCmd
* Description    : Enables or disables the USART抯 Smart Card mode.
* 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 Smart Card mode.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本乱人伦aⅴ精品| 欧美r级电影在线观看| 欧美日韩一区二区三区四区| 精品日韩欧美在线| 亚洲综合色网站| 国产成人三级在线观看| 欧美一区二区三区在| 亚洲综合色区另类av| 波多野结衣在线一区| 日韩一级完整毛片| 一区二区三区在线影院| 成人国产精品免费观看| 亚洲精品在线电影| 丝袜亚洲另类欧美综合| 日本精品裸体写真集在线观看| 久久久久久99久久久精品网站| 蜜桃在线一区二区三区| 7777精品伊人久久久大香线蕉经典版下载 | 欧美日韩午夜精品| 亚洲日本韩国一区| 成人av在线播放网址| 久久综合99re88久久爱| 日韩av不卡在线观看| 欧美色视频在线观看| 亚洲一二三区在线观看| 91理论电影在线观看| 亚洲丝袜另类动漫二区| 99久久精品免费观看| 国产精品美女视频| 不卡的看片网站| ...av二区三区久久精品| 成人三级伦理片| 中文字幕一区av| 色天使色偷偷av一区二区| 亚洲精品久久久蜜桃| 欧美在线一区二区三区| 亚洲网友自拍偷拍| 欧美日韩中文一区| 日韩精品成人一区二区在线| 欧美日韩国产高清一区| 丝袜脚交一区二区| 亚洲精品一区二区三区蜜桃下载 | 欧美va亚洲va在线观看蝴蝶网| 久久99精品久久只有精品| 日韩精品一区在线观看| 国产一区中文字幕| 欧美国产国产综合| 色婷婷精品久久二区二区蜜臂av| 亚洲在线一区二区三区| 欧美一级国产精品| 国产精品资源站在线| 中文字幕一区日韩精品欧美| 欧洲一区在线电影| 久久aⅴ国产欧美74aaa| 欧美国产精品专区| 欧洲国内综合视频| 久久国产精品无码网站| 国产调教视频一区| 色综合天天狠狠| 日本伊人色综合网| 国产免费久久精品| 欧美日韩中文字幕精品| 国产精品一区一区| 一区二区三区欧美视频| 国产精品蜜臀av| 欧美在线播放高清精品| 韩国女主播成人在线观看| 亚洲日本中文字幕区| 欧美一级日韩免费不卡| 成人网男人的天堂| 青青草国产精品亚洲专区无| 成人欧美一区二区三区在线播放| 91精品在线观看入口| 国产成人高清在线| 日本欧美加勒比视频| 日韩美女久久久| 精品理论电影在线观看| 欧美三区在线观看| 成人动漫av在线| 秋霞国产午夜精品免费视频| 亚洲三级在线免费| 国产欧美日本一区二区三区| 7777精品伊人久久久大香线蕉的| thepron国产精品| 九九热在线视频观看这里只有精品| 亚洲欧美日韩国产手机在线| 国产日韩在线不卡| 91精品国产91综合久久蜜臀| 91色九色蝌蚪| 国产91精品一区二区麻豆网站 | 欧美三级资源在线| 一本色道久久综合精品竹菊| 国产精品一区久久久久| 狂野欧美性猛交blacked| 亚洲一区二区中文在线| 最新日韩av在线| 国产亚洲精品资源在线26u| 欧美日韩另类国产亚洲欧美一级| 97se亚洲国产综合自在线不卡| 国产曰批免费观看久久久| 日本视频在线一区| 亚洲国产乱码最新视频 | 欧美私模裸体表演在线观看| 99在线精品一区二区三区| 国产乱妇无码大片在线观看| 精一区二区三区| 久久99国产精品免费网站| 欧美aaaaaa午夜精品| 亚瑟在线精品视频| 夜色激情一区二区| 亚洲黄色av一区| 亚洲欧美一区二区三区国产精品| 亚洲人成网站精品片在线观看| 中文字幕在线一区二区三区| 日本一区二区视频在线| 国产精品免费看片| 亚洲日本一区二区| 亚洲在线观看免费视频| 亚洲一区在线观看网站| 亚洲动漫第一页| 蜜臀av性久久久久蜜臀av麻豆| 免费在线一区观看| 韩国成人福利片在线播放| 国产精华液一区二区三区| 国产精品亚洲视频| 99在线精品免费| 欧美在线观看视频在线| 3d成人h动漫网站入口| 欧美大片拔萝卜| 欧美激情一区二区三区在线| 亚洲欧美一区二区在线观看| 亚洲在线一区二区三区| 首页欧美精品中文字幕| 精品亚洲成av人在线观看| 国产成a人亚洲| 色婷婷亚洲综合| 欧美一区欧美二区| 国产午夜精品美女毛片视频| 婷婷中文字幕综合| 国内精品在线播放| 91丨九色丨尤物| 欧美久久免费观看| 久久精品人人做| 亚洲一区二区在线免费看| 久久66热偷产精品| 99在线精品观看| 日韩欧美一区二区免费| 国产精品久久久久桃色tv| 亚洲电影视频在线| 国产乱一区二区| 欧美自拍偷拍午夜视频| 久久久国产精品不卡| 亚洲午夜在线视频| 国产二区国产一区在线观看| 欧美视频一区二区在线观看| 久久免费国产精品| 亚洲超碰97人人做人人爱| 成人午夜电影网站| 日韩欧美一区中文| 亚洲视频免费观看| 国产老女人精品毛片久久| 日本伦理一区二区| 欧美极品aⅴ影院| 日本不卡的三区四区五区| av在线不卡网| 26uuu亚洲综合色欧美| 亚洲v日本v欧美v久久精品| 成人国产精品免费| 精品福利视频一区二区三区| 亚洲黄色免费网站| 成人国产精品免费网站| 26uuu色噜噜精品一区二区| 五月天激情综合网| 色国产精品一区在线观看| 久久精品网站免费观看| 欧美aaa在线| 欧美日韩免费高清一区色橹橹| 国产精品美女www爽爽爽| 韩国毛片一区二区三区| 欧美一级在线免费| 五月婷婷综合激情| 欧美日韩免费一区二区三区视频| 亚洲啪啪综合av一区二区三区| 国产99久久久久| 2020国产精品| 狠狠色狠狠色综合| 日韩精品资源二区在线| 婷婷中文字幕一区三区| 欧美色图免费看| 亚洲国产欧美在线| 欧美在线free| 亚洲图片欧美色图| 欧美色图在线观看| 亚洲国产成人av| 欧美日韩一区二区在线观看| 亚洲综合激情另类小说区| 色天天综合色天天久久| 亚洲综合清纯丝袜自拍| 在线一区二区三区| 亚洲成人av一区|