Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Embed: (wiki syntax)

« Back to documentation index

GPIO Read and Write

GPIO Read and Write
[GPIO_Private_Functions]

GPIO Read and Write. More...

Functions

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 input port pin.
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.

Detailed Description

GPIO Read and Write.

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


Function Documentation

uint16_t GPIO_ReadInputData ( GPIO_TypeDef *  GPIOx )

Reads the specified input port pin.

Parameters:
GPIOx,:where x can be (A, B, C, D, E, F, G or H) to select the GPIO peripheral.
Return values:
Theinput port pin value.

Definition at line 334 of file stm32f30x_gpio.c.

uint8_t GPIO_ReadInputDataBit ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Reads the specified input port pin.

Parameters:
GPIOx,:where x can be (A, B, C, D, E, F, G or H) to select the GPIO peripheral.
GPIO_Pin,:specifies the port bit to read.
Note:
This parameter can be GPIO_Pin_x where x can be : (0..15) for GPIOA, GPIOB, GPIOC, GPIOD or GPIOE; (0..2, 4, 6, 9..10) for GPIOF.
Return values:
Theinput port pin value.

Definition at line 310 of file stm32f30x_gpio.c.

uint16_t GPIO_ReadOutputData ( GPIO_TypeDef *  GPIOx )

Reads the specified GPIO output data port.

Parameters:
GPIOx,:where x can be (A, B, C, D, E, F, G or H) to select the GPIO peripheral.
Return values:
GPIOoutput data port value.

Definition at line 375 of file stm32f30x_gpio.c.

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, B, C, D, E, F, G or H) to select the GPIO peripheral.
GPIO_Pin,:Specifies the port bit to read.
Note:
This parameter can be GPIO_Pin_x where x can be : (0..15) for GPIOA, GPIOB, GPIOC, GPIOD or GPIOE; (0..2, 4, 6, 9..10) for GPIOF.
Return values:
Theoutput port pin value.

Definition at line 351 of file stm32f30x_gpio.c.

void GPIO_ResetBits ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Clears the selected data port bits.

Parameters:
GPIOx,:where x can be (A, B, C, D, E, F, G or H) to select the GPIO peripheral.
GPIO_Pin,:specifies the port bits to be written.
Note:
This parameter can be GPIO_Pin_x where x can be : (0..15) for GPIOA, GPIOB, GPIOC, GPIOD or GPIOE; (0..2, 4, 6, 9..10) for GPIOF.
Return values:
None

Definition at line 410 of file stm32f30x_gpio.c.

void GPIO_SetBits ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)

Sets the selected data port bits.

Parameters:
GPIOx,:where x can be (A, B, C, D, E, F, G or H) to select the GPIO peripheral.
GPIO_Pin,:specifies the port bits to be written.
Note:
This parameter can be GPIO_Pin_x where x can be : (0..15) for GPIOA, GPIOB, GPIOC, GPIOD or GPIOE; (0..2, 4, 6, 9..10) for GPIOF.
Return values:
None

Definition at line 392 of file stm32f30x_gpio.c.

void GPIO_Write ( GPIO_TypeDef *  GPIOx,
uint16_t  PortVal 
)

Writes data to the specified GPIO data port.

Parameters:
GPIOx,:where x can be (A, B, C, D, E, F, G or H) to select the GPIO peripheral.
PortVal,:specifies the value to be written to the port output data register.
Return values:
None

Definition at line 456 of file stm32f30x_gpio.c.

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, B, C, D, E, F, G or H) to select the GPIO peripheral.
GPIO_Pin,:specifies the port bit to be written.
Note:
This parameter can be GPIO_Pin_x where x can be : (0..15) for GPIOA, GPIOB, GPIOC, GPIOD or GPIOE; (0..2, 4, 6, 9..10) for GPIOF.
Parameters:
BitVal,:specifies the value to be written to the selected bit. This parameter can be one of the BitAction enumeration values:

  • Bit_RESET: to clear the port pin
  • Bit_SET: to set the port pin
Return values:
None

Definition at line 432 of file stm32f30x_gpio.c.