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

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

?? stm32f10x_gpio.c

?? LED循環(huán)點(diǎn)亮
?? C
?? 第 1 頁 / 共 2 頁
字號:
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  assert_param(IS_GET_GPIO_PIN(GPIO_Pin)); 
  
  if ((GPIOx->ODR & GPIO_Pin) != (u32)Bit_RESET)
  {
    bitstatus = (u8)Bit_SET;
  }
  else
  {
    bitstatus = (u8)Bit_RESET;
  }
  return bitstatus;
}

/*******************************************************************************
* Function Name  : GPIO_ReadOutputData
* Description    : Reads the specified GPIO output data port.
* Input          : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
* Output         : None
* Return         : GPIO output data port value.
*******************************************************************************/
u16 GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
{
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
    
  return ((u16)GPIOx->ODR);
}

/*******************************************************************************
* Function Name  : GPIO_SetBits
* Description    : Sets the selected data port bits.
* Input          : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
*                  - GPIO_Pin: specifies the port bits to be written.
*                    This parameter can be any combination of GPIO_Pin_x where 
*                    x can be (0..15).
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_SetBits(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
{
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  assert_param(IS_GPIO_PIN(GPIO_Pin));
  
  GPIOx->BSRR = GPIO_Pin;
}

/*******************************************************************************
* Function Name  : GPIO_ResetBits
* Description    : Clears the selected data port bits.
* Input          : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
*                  - GPIO_Pin: specifies the port bits to be written.
*                    This parameter can be any combination of GPIO_Pin_x where 
*                    x can be (0..15).
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_ResetBits(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
{
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  assert_param(IS_GPIO_PIN(GPIO_Pin));
  
  GPIOx->BRR = GPIO_Pin;
}

/*******************************************************************************
* Function Name  : GPIO_WriteBit
* Description    : Sets or clears the selected data port bit.
* Input          : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
*                  - GPIO_Pin: specifies the port bit to be written.
*                    This parameter can be one of GPIO_Pin_x where x can be (0..15).
*                  - BitVal: specifies the value to be written to the selected bit.
*                    This parameter can be one of the BitAction enum values:
*                       - Bit_RESET: to clear the port pin
*                       - Bit_SET: to set the port pin
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_WriteBit(GPIO_TypeDef* GPIOx, u16 GPIO_Pin, BitAction BitVal)
{
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  assert_param(IS_GET_GPIO_PIN(GPIO_Pin));
  assert_param(IS_GPIO_BIT_ACTION(BitVal)); 
  
  if (BitVal != Bit_RESET)
  {
    GPIOx->BSRR = GPIO_Pin;
  }
  else
  {
    GPIOx->BRR = GPIO_Pin;
  }
}

/*******************************************************************************
* Function Name  : GPIO_Write
* Description    : Writes data to the specified GPIO data port.
* Input          : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
*                  - PortVal: specifies the value to be written to the port output
*                    data register.
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_Write(GPIO_TypeDef* GPIOx, u16 PortVal)
{
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  
  GPIOx->ODR = PortVal;
}

/*******************************************************************************
* Function Name  : GPIO_PinLockConfig
* Description    : Locks GPIO Pins configuration registers.
* Input          : - GPIOx: where x can be (A..G) to select the GPIO peripheral.
*                  - GPIO_Pin: specifies the port bit to be written.
*                    This parameter can be any combination of GPIO_Pin_x where 
*                    x can be (0..15).
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_PinLockConfig(GPIO_TypeDef* GPIOx, u16 GPIO_Pin)
{
  u32 tmp = 0x00010000;
  
  /* Check the parameters */
  assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
  assert_param(IS_GPIO_PIN(GPIO_Pin));
  
  tmp |= GPIO_Pin;
  /* Set LCKK bit */
  GPIOx->LCKR = tmp;
  /* Reset LCKK bit */
  GPIOx->LCKR =  GPIO_Pin;
  /* Set LCKK bit */
  GPIOx->LCKR = tmp;
  /* Read LCKK bit*/
  tmp = GPIOx->LCKR;
  /* Read LCKK bit*/
  tmp = GPIOx->LCKR;
}

/*******************************************************************************
* Function Name  : GPIO_EventOutputConfig
* Description    : Selects the GPIO pin used as Event output.
* Input          : - GPIO_PortSource: selects the GPIO port to be used as source
*                    for Event output.
*                    This parameter can be GPIO_PortSourceGPIOx where x can be
*                    (A..E).
*                  - GPIO_PinSource: specifies the pin for the Event output.
*                    This parameter can be GPIO_PinSourcex where x can be (0..15).
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_EventOutputConfig(u8 GPIO_PortSource, u8 GPIO_PinSource)
{
  u32 tmpreg = 0x00;

  /* Check the parameters */
  assert_param(IS_GPIO_EVENTOUT_PORT_SOURCE(GPIO_PortSource));
  assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
    
  tmpreg = AFIO->EVCR;
  /* Clear the PORT[6:4] and PIN[3:0] bits */
  tmpreg &= EVCR_PORTPINCONFIG_MASK;
  tmpreg |= (u32)GPIO_PortSource << 0x04;
  tmpreg |= GPIO_PinSource;

  AFIO->EVCR = tmpreg;
}

/*******************************************************************************
* Function Name  : GPIO_EventOutputCmd
* Description    : Enables or disables the Event Output.
* Input          : - NewState: new state of the Event output.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_EventOutputCmd(FunctionalState NewState)
{
  /* Check the parameters */
  assert_param(IS_FUNCTIONAL_STATE(NewState));
  
  *(vu32 *) EVCR_EVOE_BB = (u32)NewState;
}

/*******************************************************************************
* Function Name  : GPIO_PinRemapConfig
* Description    : Changes the mapping of the specified pin.
* Input          : - GPIO_Remap: selects the pin to remap.
*                    This parameter can be one of the following values:
*                       - GPIO_Remap_SPI1
*                       - GPIO_Remap_I2C1
*                       - GPIO_Remap_USART1
*                       - GPIO_Remap_USART2
*                       - GPIO_PartialRemap_USART3
*                       - GPIO_FullRemap_USART3
*                       - GPIO_PartialRemap_TIM1
*                       - GPIO_FullRemap_TIM1
*                       - GPIO_PartialRemap1_TIM2
*                       - GPIO_PartialRemap2_TIM2
*                       - GPIO_FullRemap_TIM2
*                       - GPIO_PartialRemap_TIM3
*                       - GPIO_FullRemap_TIM3
*                       - GPIO_Remap_TIM4
*                       - GPIO_Remap1_CAN
*                       - GPIO_Remap2_CAN
*                       - GPIO_Remap_PD01
*                       - GPIO_Remap_TIM5CH4_LSI
*                       - GPIO_Remap_ADC1_ETRGINJ
*                       - GPIO_Remap_ADC1_ETRGREG
*                       - GPIO_Remap_ADC2_ETRGINJ
*                       - GPIO_Remap_ADC2_ETRGREG
*                       - GPIO_Remap_SWJ_NoJTRST
*                       - GPIO_Remap_SWJ_JTAGDisable
*                       - GPIO_Remap_SWJ_Disable
*                  - NewState: new state of the port pin remapping.
*                    This parameter can be: ENABLE or DISABLE.
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_PinRemapConfig(u32 GPIO_Remap, FunctionalState NewState)
{
  u32 tmp = 0x00, tmp1 = 0x00, tmpreg = 0x00, tmpmask = 0x00;

  /* Check the parameters */
  assert_param(IS_GPIO_REMAP(GPIO_Remap));
  assert_param(IS_FUNCTIONAL_STATE(NewState));  
  
  tmpreg = AFIO->MAPR;

  tmpmask = (GPIO_Remap & DBGAFR_POSITION_MASK) >> 0x10;
  tmp = GPIO_Remap & LSB_MASK;

  if ((GPIO_Remap & (DBGAFR_LOCATION_MASK | DBGAFR_NUMBITS_MASK)) == (DBGAFR_LOCATION_MASK | DBGAFR_NUMBITS_MASK))
  {
    tmpreg &= DBGAFR_SWJCFG_MASK;
    AFIO->MAPR &= DBGAFR_SWJCFG_MASK;
  }
  else if ((GPIO_Remap & DBGAFR_NUMBITS_MASK) == DBGAFR_NUMBITS_MASK)
  {
    tmp1 = ((u32)0x03) << tmpmask;
    tmpreg &= ~tmp1;
    tmpreg |= ~DBGAFR_SWJCFG_MASK;
  }
  else
  {
    tmpreg &= ~(tmp << ((GPIO_Remap >> 0x15)*0x10));
    tmpreg |= ~DBGAFR_SWJCFG_MASK;
  }

  if (NewState != DISABLE)
  {
    tmpreg |= (tmp << ((GPIO_Remap >> 0x15)*0x10));
  }

  AFIO->MAPR = tmpreg;
}

/*******************************************************************************
* Function Name  : GPIO_EXTILineConfig
* Description    : Selects the GPIO pin used as EXTI Line.
* Input          : - GPIO_PortSource: selects the GPIO port to be used as
*                    source for EXTI lines.
*                    This parameter can be GPIO_PortSourceGPIOx where x can be
*                    (A..G).
*                  - GPIO_PinSource: specifies the EXTI line to be configured.
*                   This parameter can be GPIO_PinSourcex where x can be (0..15).
* Output         : None
* Return         : None
*******************************************************************************/
void GPIO_EXTILineConfig(u8 GPIO_PortSource, u8 GPIO_PinSource)
{
  u32 tmp = 0x00;

  /* Check the parameters */
  assert_param(IS_GPIO_EXTI_PORT_SOURCE(GPIO_PortSource));
  assert_param(IS_GPIO_PIN_SOURCE(GPIO_PinSource));
  
  tmp = ((u32)0x0F) << (0x04 * (GPIO_PinSource & (u8)0x03));

  AFIO->EXTICR[GPIO_PinSource >> 0x02] &= ~tmp;
  AFIO->EXTICR[GPIO_PinSource >> 0x02] |= (((u32)GPIO_PortSource) << (0x04 * (GPIO_PinSource & (u8)0x03)));
}

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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩亚州综合| 欧美一区二区三区在线观看视频| 久久伊人蜜桃av一区二区| 97精品国产97久久久久久久久久久久| 成人深夜福利app| 亚洲一二三四区不卡| 欧美少妇xxx| 国产精品69久久久久水密桃| 欧美va在线播放| 美女精品自拍一二三四| 日韩免费观看高清完整版在线观看| 一区二区三区免费看视频| 99re在线视频这里只有精品| 欧美国产一区在线| 成人中文字幕在线| 中文字幕一区二区三| 大胆欧美人体老妇| 亚洲男人天堂av| 在线观看亚洲专区| 日韩精品91亚洲二区在线观看 | 精品日韩在线一区| 亚洲第一成年网| 欧美一级日韩免费不卡| 国产主播一区二区| 中文字幕av一区二区三区免费看| 国产成人aaa| 日韩毛片视频在线看| 精品视频在线看| 精品制服美女丁香| 国产精品久久二区二区| 欧美影院一区二区| 极品销魂美女一区二区三区| 欧美国产综合一区二区| jvid福利写真一区二区三区| 亚洲综合精品久久| 精品久久久网站| 97精品久久久午夜一区二区三区 | 久久久久久毛片| 欧美日韩精品免费观看视频| 成人毛片视频在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩一区欧美一区| 国产三级精品视频| 日韩一区二区三区在线| 国模少妇一区二区三区| 亚洲国产精品久久人人爱 | 欧美色综合天天久久综合精品| 国产一区二区三区高清播放| 亚洲一区在线观看视频| 亚洲国产精品成人久久综合一区| 亚洲一二三四在线观看| 亚洲三级理论片| 国产精品日韩成人| 久久久久久久久久久久久夜| 制服丝袜中文字幕亚洲| 欧美性xxxxxxxx| 在线中文字幕一区| 91啪在线观看| 91亚洲资源网| 成人综合在线视频| 福利一区福利二区| 国产91富婆露脸刺激对白| 国产真实乱偷精品视频免| 美女在线一区二区| 蓝色福利精品导航| 蜜桃视频第一区免费观看| 天堂成人免费av电影一区| 亚洲国产一区二区a毛片| 一区二区视频在线看| 亚洲人成在线观看一区二区| 亚洲素人一区二区| 国产精品久久影院| 又紧又大又爽精品一区二区| 一卡二卡欧美日韩| 三级欧美在线一区| 美女高潮久久久| 国产麻豆精品theporn| 成人免费视频播放| 在线视频综合导航| 欧美一区二区黄| 国产日韩欧美一区二区三区综合| 亚洲欧洲日韩在线| 亚洲福利一二三区| 韩国女主播成人在线| 不卡的电影网站| 欧美丰满美乳xxx高潮www| ww久久中文字幕| 久久久久久久久久久99999| 中文字幕一区二区在线播放| 亚洲成a天堂v人片| 国产精品18久久久久| 欧美性色黄大片手机版| 精品国产乱码久久久久久老虎| 综合中文字幕亚洲| 国产一区二区网址| 欧美午夜片在线观看| 久久奇米777| 天堂一区二区在线免费观看| 久久久久久影视| 亚洲成av人片| 91蝌蚪porny| 国产亚洲欧美中文| 日韩成人伦理电影在线观看| 99在线热播精品免费| 亚洲午夜三级在线| 不卡电影一区二区三区| 日韩精品一区二区三区在线| 亚洲影视在线播放| 99久久婷婷国产综合精品电影| 精品乱人伦小说| 免播放器亚洲一区| 欧美精品1区2区3区| 亚洲一区二区三区不卡国产欧美| 欧美精品一区二区精品网| 五月婷婷久久丁香| 欧美日韩视频在线第一区 | 蜜臀va亚洲va欧美va天堂| 欧美日韩成人综合在线一区二区| 一区二区三区精品视频| 91污在线观看| 亚洲在线视频网站| 亚洲三级在线观看| 色欧美片视频在线观看| 亚洲三级免费观看| 欧洲另类一二三四区| 一区二区三区在线观看动漫| 一本色道a无线码一区v| 亚洲综合色婷婷| 一本久道中文字幕精品亚洲嫩| 国产精品福利电影一区二区三区四区| 国产精品综合二区| 国产精品网站在线观看| 欧美日韩视频在线第一区| 国产精品久久久久久久浪潮网站 | 欧美日韩在线免费视频| 五月激情丁香一区二区三区| 欧美一区二区福利在线| 激情六月婷婷综合| 亚洲成a人片在线观看中文| 欧美在线免费播放| 久久国产精品区| 国产精品久久久久久久浪潮网站 | 中日韩av电影| 欧美系列在线观看| 国产毛片精品国产一区二区三区| 欧美高清在线精品一区| 欧洲一区二区三区在线| 久久国产精品色| 99精品偷自拍| 经典三级视频一区| 亚洲精品视频在线看| 欧美大片在线观看| 色婷婷激情综合| 国产在线播放一区| 亚洲国产另类av| 国产精品区一区二区三区| 欧美精品在线观看播放| 不卡在线观看av| 精品午夜久久福利影院| 亚洲午夜成aⅴ人片| 欧美国产一区二区| 欧美一级片在线观看| 91极品视觉盛宴| 成人性色生活片| 麻豆免费精品视频| 香蕉成人伊视频在线观看| 国产精品美女视频| 久久中文娱乐网| 欧美一级在线免费| 欧美美女一区二区| 日本福利一区二区| 99精品久久久久久| 国产suv精品一区二区883| 蜜臀精品一区二区三区在线观看 | 久久婷婷久久一区二区三区| 欧美性猛片xxxx免费看久爱| 91香蕉视频mp4| 91麻豆精品在线观看| 成人午夜免费视频| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产午夜久久久久| 久久夜色精品国产噜噜av| 欧美一区二区三区在线观看视频 | 欧美色网站导航| 欧美色成人综合| 69堂成人精品免费视频| 日韩三级精品电影久久久| 日韩视频在线观看一区二区| 日韩西西人体444www| 欧美一区二区三区四区五区| 91精品国产综合久久婷婷香蕉| 这里是久久伊人| 精品国产91久久久久久久妲己 | 欧美一卡2卡三卡4卡5免费| 日韩欧美一区二区在线视频| 日韩欧美国产三级电影视频| 欧美成人vr18sexvr| 国产精品久久久久久久久久免费看 | 成人精品视频一区二区三区 | 99久久免费国产|