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

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

?? stm32f10x_gpio.c

?? 基于Cortex-M3的STM32的IAR EWARM的工程模塊
?? C
?? 第 1 頁 / 共 2 頁
字號:
  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****/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀99久久精品久久久久久软件| 国产精品区一区二区三区| 91香蕉视频黄| 91猫先生在线| 在线观看一区二区视频| 在线观看亚洲专区| 欧美午夜在线观看| 欧美日韩高清一区二区不卡| 精品视频123区在线观看| 欧美午夜精品久久久久久超碰 | 亚洲精品视频一区| 一区二区三国产精华液| 亚洲第一狼人社区| 久久精品国产精品亚洲精品 | 国产精品久久福利| 亚洲精品网站在线观看| 亚洲国产精品影院| 另类小说欧美激情| 国产suv精品一区二区6| 一本色道a无线码一区v| 欧美日韩dvd在线观看| 日韩一区二区三区电影在线观看| 欧美成人性战久久| 国产精品久久久久aaaa| 亚洲午夜精品网| 精品一区二区在线观看| 色综合中文字幕| 日韩一区二区精品葵司在线| 久久九九久久九九| 亚洲成人中文在线| 国产91精品露脸国语对白| 欧美三级电影一区| 久久久久久久综合日本| 亚洲黄网站在线观看| 精品一区精品二区高清| 在线一区二区视频| 久久久久久久精| 亚洲影视在线播放| 粉嫩aⅴ一区二区三区四区| 欧美日韩精品一区二区三区| 国产日韩视频一区二区三区| 亚洲123区在线观看| 岛国av在线一区| 日韩一卡二卡三卡| 亚洲欧洲国产专区| 精东粉嫩av免费一区二区三区| 一本在线高清不卡dvd| 久久综合五月天婷婷伊人| 亚洲自拍偷拍综合| 成人av资源在线| 欧美成人欧美edvon| 亚洲综合一区二区精品导航| 国产成人aaa| 久久久久久久久久久久久夜| 午夜一区二区三区在线观看| 99re66热这里只有精品3直播| 久久久久国产一区二区三区四区| 亚洲国产精品久久久久婷婷884 | 成人欧美一区二区三区| 国产一区二区影院| 亚洲精品在线免费观看视频| 天堂va蜜桃一区二区三区| 欧美视频中文一区二区三区在线观看| 国产精品久线观看视频| 国产精品白丝jk黑袜喷水| 欧美大片日本大片免费观看| 日韩在线观看一区二区| 欧美日韩国产综合一区二区三区| 一区二区三区在线不卡| 91蜜桃婷婷狠狠久久综合9色| 国产色一区二区| 国产传媒一区在线| 国产欧美日韩不卡免费| 国产99久久久国产精品潘金网站| 久久综合九色综合97婷婷 | 亚洲你懂的在线视频| www.亚洲免费av| 亚洲欧洲国产日本综合| 91免费国产在线观看| 一区二区三区四区五区视频在线观看| 成人av免费在线播放| 亚洲欧洲一区二区三区| 91国在线观看| 图片区小说区区亚洲影院| 日韩写真欧美这视频| 国产麻豆精品久久一二三| 亚洲国产成人私人影院tom| 99r国产精品| 天使萌一区二区三区免费观看| 欧美一区二区视频在线观看2022| 美女一区二区在线观看| 亚洲国产精品国自产拍av| 日本道在线观看一区二区| 日韩av午夜在线观看| 国产亚洲精品资源在线26u| 91麻豆精品秘密| 免费在线一区观看| 亚洲国产成人自拍| 欧美四级电影网| 国产乱淫av一区二区三区 | 免费成人av在线播放| 久久久精品天堂| 在线亚洲+欧美+日本专区| 日本视频免费一区| 欧美激情一区二区三区不卡| 在线免费精品视频| 国产真实精品久久二三区| 综合久久久久综合| 精品少妇一区二区三区日产乱码| av在线播放成人| 看电影不卡的网站| 亚洲视频在线观看三级| 555www色欧美视频| 色综合天天综合色综合av| 九九在线精品视频| 香蕉成人伊视频在线观看| 国产精品情趣视频| 日韩三级.com| 在线视频国产一区| 国产成人午夜精品5599| 日本成人在线看| 亚洲综合图片区| 国产精品国产馆在线真实露脸| 欧美一级理论性理论a| 91免费观看视频| 国产成人精品亚洲777人妖| 日韩一区精品视频| 亚洲综合免费观看高清完整版| 国产欧美日韩激情| 欧美精品一区二区久久久| 欧美一区二区女人| 色嗨嗨av一区二区三区| 成人激情免费视频| 国产高清精品久久久久| 麻豆成人久久精品二区三区红 | 亚洲色图视频网| 日本一区二区三级电影在线观看| 欧美久久一区二区| 欧美少妇bbb| 91福利在线播放| 99久久久免费精品国产一区二区| 国产一区二区三区观看| 麻豆精品视频在线观看视频| 亚洲gay无套男同| 亚洲图片有声小说| 亚洲国产精品久久久男人的天堂| 亚洲黄色尤物视频| 一区二区三区加勒比av| 亚洲精品一二三四区| 亚洲精品视频自拍| 一区二区三区四区在线| 亚洲综合激情网| 午夜精品久久久久久久久久 | 成人综合在线视频| 成人国产精品免费观看动漫| 粉嫩高潮美女一区二区三区| 岛国一区二区在线观看| 99久久777色| 91看片淫黄大片一级在线观看| 成人性视频免费网站| 波多野结衣91| 色欧美乱欧美15图片| 欧美精品v日韩精品v韩国精品v| 欧美一区二区大片| 久久综合久久99| 亚洲色图19p| 日日噜噜夜夜狠狠视频欧美人 | 亚洲综合视频网| 三级在线观看一区二区| 国产真实乱偷精品视频免| 成人动漫一区二区| 在线免费观看不卡av| 欧美一区二区三区的| 国产欧美日本一区视频| 一卡二卡三卡日韩欧美| 久久精品国产一区二区三区免费看| 精品影视av免费| 91丨国产丨九色丨pron| 欧美一级二级在线观看| 国产精品女上位| 丝袜亚洲精品中文字幕一区| 韩国女主播成人在线| 91在线porny国产在线看| 91精品黄色片免费大全| 国产视频一区二区在线观看| 亚洲午夜在线电影| 国产精品一区二区免费不卡| 91福利小视频| 国产午夜精品久久| 天天综合日日夜夜精品| 成人av在线网| 日韩欧美一区二区三区在线| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 久久精品国产77777蜜臀| 91女神在线视频| 久久综合成人精品亚洲另类欧美| 亚洲国产精品一区二区久久恐怖片| 极品尤物av久久免费看| 欧美少妇性性性| 国产精品久久免费看|