STM32F4 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
GPIO Read and Write

GPIO Read and Write. More...

Functions

uint8_t GPIO_ReadInputDataBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Reads the specified input port pin. More...
 
uint16_t GPIO_ReadInputData (GPIO_TypeDef *GPIOx)
 Reads the specified GPIO input data port. More...
 
uint8_t GPIO_ReadOutputDataBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Reads the specified output data port bit. More...
 
uint16_t GPIO_ReadOutputData (GPIO_TypeDef *GPIOx)
 Reads the specified GPIO output data port. More...
 
void GPIO_SetBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Sets the selected data port bits. More...
 
void GPIO_ResetBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Clears the selected data port bits. More...
 
void GPIO_WriteBit (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, BitAction BitVal)
 Sets or clears the selected data port bit. More...
 
void GPIO_Write (GPIO_TypeDef *GPIOx, uint16_t PortVal)
 Writes data to the specified GPIO data port. More...
 
void GPIO_ToggleBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Toggles the specified GPIO pins.. More...
 

Detailed Description

GPIO Read and Write.

 ===============================================================================
                              GPIO Read and Write
 ===============================================================================  

Function Documentation

uint16_t GPIO_ReadInputData ( GPIO_TypeDef *  GPIOx)

Reads the specified GPIO input data port.

Parameters
GPIOx,:where x can be (A..I) to select the GPIO peripheral.
Return values
GPIOinput data port value.
uint8_t GPIO_ReadInputDataBit ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Reads the specified input port pin.

Parameters
GPIOx,:where x can be (A..I) 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).
Return values
Theinput port pin value.
uint16_t GPIO_ReadOutputData ( GPIO_TypeDef *  GPIOx)

Reads the specified GPIO output data port.

Parameters
GPIOx,:where x can be (A..I) to select the GPIO peripheral.
Return values
GPIOoutput data port value.
uint8_t GPIO_ReadOutputDataBit ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Reads the specified output data port bit.

Parameters
GPIOx,:where x can be (A..I) 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).
Return values
Theoutput port pin value.
void GPIO_ResetBits ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Clears the selected data port bits.

Note
This functions uses GPIOx_BSRR register to allow atomic read/modify accesses. In this way, there is no risk of an IRQ occurring between the read and the modify access.
Parameters
GPIOx,:where x can be (A..I) 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).
Return values
None
void GPIO_SetBits ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Sets the selected data port bits.

Note
This functions uses GPIOx_BSRR register to allow atomic read/modify accesses. In this way, there is no risk of an IRQ occurring between the read and the modify access.
Parameters
GPIOx,:where x can be (A..I) 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).
Return values
None
void GPIO_ToggleBits ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Toggles the specified GPIO pins..

Parameters
GPIOx,:where x can be (A..I) to select the GPIO peripheral.
GPIO_Pin,:Specifies the pins to be toggled.
Return values
None
void GPIO_Write ( GPIO_TypeDef *  GPIOx,
uint16_t  PortVal 
)

Writes data to the specified GPIO data port.

Parameters
GPIOx,:where x can be (A..I) to select the GPIO peripheral.
PortVal,:specifies the value to be written to the port output data register.
Return values
None
void GPIO_WriteBit ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin,
BitAction  BitVal 
)

Sets or clears the selected data port bit.

Parameters
GPIOx,:where x can be (A..I) 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
Return values
None