WB32F10x Standard Peripherals Firmware Library

函数
GPIO_Private_Functions
WB32F10x_StdPeriph_Driver » GPIO

## 函数
void | GPIO_DeInit (GPIO_TypeDef *GPIOx)
| De-initializes the GPIOx peripheral registers to their default reset values. 更多...
void | GPIO_Init (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t PinConfig)
| Initializes the GPIOx peripheral according to the PinConfig. 更多...
void | GPIO_SetAFPin_0_7 (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t Alternate)
| Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port. 更多...
void | GPIO_SetAFPin_8_15 (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t Alternate)
| Configure gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port. 更多...
void | GPIO_SetAFPin (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t Alternate)
| Configure gpio alternate function of any pins for a dedicated port. 更多...
uint8_t | GPIO_ReadInputDataBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
| Reads the specified input port pin. 更多...
uint16_t | GPIO_ReadInputData (GPIO_TypeDef *GPIOx)
| Reads the specified GPIO input data port. 更多...
uint8_t | GPIO_ReadOutputDataBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
| Reads the specified output data port bit. 更多...
uint16_t | GPIO_ReadOutputData (GPIO_TypeDef *GPIOx)
| Reads the specified GPIO output data port. 更多...
void | GPIO_SetBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
| Sets the selected data port bits. 更多...
void | GPIO_ResetBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
| Clears the selected data port bits. 更多...
void | GPIO_WriteBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, BitAction BitVal)
| Sets or clears the selected data port bit. 更多...
void | GPIO_Write (GPIO_TypeDef *GPIOx, uint16_t PortVal)
| Writes data to the specified GPIO data port. 更多...
void | GPIO_ToggleBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
| Toggle data value for several pin of specified port. 更多...
void | GPIO_LockPin (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
| Lock configuration of several pins for a specified port. 更多...
uint32_t | GPIO_IsPinLocked (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
| Return 1 if all pins passed as parameter, of a specified port, are locked. else Return 0. 更多...
void | GPIO_SchmittTriggerCmd (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, FunctionalState NewState)
| Enables or disables the schmitt trigger of several pins for a specified port. 更多...
void | GPIO_DriveCurrentConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint32_t Current)
| Configure the drive current of several pins for a specified port. 更多...
void | GPIO_EXTILineConfig (uint8_t GPIO_PortSource, uint8_t GPIO_PinSource)
| Selects the GPIO pin used as EXTI Line. 更多...

## 详细描述

## 函数说明

## ◆ GPIO_DeInit()

void GPIO_DeInit | ( | GPIO_TypeDef * | GPIOx | ) |

De-initializes the GPIOx peripheral registers to their default reset values.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.

返回
  None

## ◆ GPIO_DriveCurrentConfig()

void GPIO_DriveCurrentConfig | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin,
|  | uint32_t | Current
| ) |  |

Configure the drive current of several pins for a specified port.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the pins to be configured. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
  Current | specifies the drive current.

返回
  None

## ◆ GPIO_EXTILineConfig()

void GPIO_EXTILineConfig | ( | uint8_t | GPIO_PortSource,
|  | uint8_t | GPIO_PinSource
| ) |  |

Selects the GPIO pin used as EXTI Line.

参数

  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..D).
  GPIO_PinSource | specifies the EXTI line to be configured. This parameter can be GPIO_PinSourcex where x can be (0..15).

返回
  None

## ◆ GPIO_Init()

void GPIO_Init | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin,
|  | uint32_t | PinConfig
| ) |  |

Initializes the GPIOx peripheral according to the PinConfig.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the port bit to be initialized. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
  PinConfig | the port bit configuration. This parameter must be a combination of one GPIO_MODE_x flag, one GPIO_OTYPE_x flag, one GPIO_PUPD_x flag and one GPIO_SPEED_x flag.

返回
  None

## ◆ GPIO_IsPinLocked()

uint32_t GPIO_IsPinLocked | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin
| ) |  |

Return 1 if all pins passed as parameter, of a specified port, are locked. else Return 0.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the pins to check lock. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).

返回
  State of bit (1 or 0).

## ◆ GPIO_LockPin()

void GPIO_LockPin | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin
| ) |  |

Lock configuration of several pins for a specified port.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the pins to be locked. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).

返回
  None

注解
  When the lock sequence has been applied on a port bit, the value of this port bit can no longer be modified until the next reset.

## ◆ GPIO_ReadInputData()

uint16_t GPIO_ReadInputData | ( | GPIO_TypeDef * | GPIOx | ) |

Reads the specified GPIO input data port.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.

返回
  GPIO input data port value.

## ◆ GPIO_ReadInputDataBit()

uint8_t GPIO_ReadInputDataBit | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin
| ) |  |

Reads the specified input port pin.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the port bit to read. This parameter can be GPIO_Pin_x where x can be (0..15).

返回
  The input port pin value.

## ◆ GPIO_ReadOutputData()

uint16_t GPIO_ReadOutputData | ( | GPIO_TypeDef * | GPIOx | ) |

Reads the specified GPIO output data port.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.

返回
  GPIO output data port value.

## ◆ GPIO_ReadOutputDataBit()

uint8_t GPIO_ReadOutputDataBit | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin
| ) |  |

Reads the specified output data port bit.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the port bit to read. This parameter can be GPIO_Pin_x where x can be (0..15).

返回
  The output port pin value.

## ◆ GPIO_ResetBits()

void GPIO_ResetBits | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin
| ) |  |

Clears the selected data port bits.

参数

  GPIOx | where x can be (A..D) 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).

返回
  None

## ◆ GPIO_SchmittTriggerCmd()

void GPIO_SchmittTriggerCmd | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the schmitt trigger of several pins for a specified port.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the pins to enable/disable schmitt trigger. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
  NewState | new state of the schmitt trigger. This parameter can be: ENABLE or DISABLE.

返回
  None

## ◆ GPIO_SetAFPin()

void GPIO_SetAFPin | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin,
|  | uint32_t | Alternate
| ) |  |

Configure gpio alternate function of any pins for a dedicated port.

注解
  Possible values are from AF0 to AF15 depending on target.
  Warning: only one pin can be passed as parameter.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the port bits to configure. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
  Alternate | This parameter can be GPIO_AFx where x can be (0..15).

返回
  None

## ◆ GPIO_SetAFPin_0_7()

void GPIO_SetAFPin_0_7 | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin,
|  | uint32_t | Alternate
| ) |  |

Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port.

注解
  Possible values are from AF0 to AF15 depending on target.
  Warning: only one pin can be passed as parameter.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the port bit to configure. This parameter can be GPIO_Pin_x where x can be (0..7).
  Alternate | This parameter can be GPIO_AFx where x can be (0..15).

返回
  None

## ◆ GPIO_SetAFPin_8_15()

void GPIO_SetAFPin_8_15 | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin,
|  | uint32_t | Alternate
| ) |  |

Configure gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port.

注解
  Possible values are from AF0 to AF15 depending on target.
  Warning: only one pin can be passed as parameter.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the port bit to configure. This parameter can be GPIO_Pin_x where x can be (8..15).
  Alternate | This parameter can be GPIO_AFx where x can be (0..15).

返回
  None

## ◆ GPIO_SetBits()

void GPIO_SetBits | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin
| ) |  |

Sets the selected data port bits.

参数

  GPIOx | where x can be (A..D) 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).

返回
  None

## ◆ GPIO_ToggleBits()

void GPIO_ToggleBits | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin
| ) |  |

Toggle data value for several pin of specified port.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  GPIO_Pin | specifies the pins to be toggled. This parameter can be any combination of GPIO_Pin_x where x can be (0..15).

返回
  None

## ◆ GPIO_Write()

void GPIO_Write | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | PortVal
| ) |  |

Writes data to the specified GPIO data port.

参数

  GPIOx | where x can be (A..D) to select the GPIO peripheral.
  PortVal | specifies the value to be written to the port output data register.

返回
  None

## ◆ GPIO_WriteBit()

void GPIO_WriteBit | ( | GPIO_TypeDef * | GPIOx,
|  | uint16_t | GPIO_Pin,
|  | BitAction | BitVal
| ) |  |

Sets or clears the selected data port bit.

参数

  GPIOx | where x can be (A..D) 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

返回
  None