STM8S/A Standard Peripherals Drivers: GPIO_Exported_Functions

STM8S/A

STM8S/A Standard Peripherals Drivers
GPIO_Exported_Functions

Functions

void GPIO_DeInit (GPIO_TypeDef *GPIOx)
 Deinitializes the GPIOx peripheral registers to their default reset values.
void GPIO_ExternalPullUpConfig (GPIO_TypeDef *GPIOx, GPIO_Pin_TypeDef GPIO_Pin, FunctionalState NewState)
 Configures the external pull-up on GPIOx pins.
void GPIO_Init (GPIO_TypeDef *GPIOx, GPIO_Pin_TypeDef GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode)
 Initializes the GPIOx according to the specified parameters.
uint8_t GPIO_ReadInputData (GPIO_TypeDef *GPIOx)
 Reads the specified GPIO input data port.
BitStatus GPIO_ReadInputPin (GPIO_TypeDef *GPIOx, GPIO_Pin_TypeDef GPIO_Pin)
 Reads the specified GPIO input data pin.
uint8_t GPIO_ReadOutputData (GPIO_TypeDef *GPIOx)
 Reads the specified GPIO output data port.
void GPIO_Write (GPIO_TypeDef *GPIOx, uint8_t PortVal)
 Writes data to the specified GPIO data port.
void GPIO_WriteHigh (GPIO_TypeDef *GPIOx, GPIO_Pin_TypeDef PortPins)
 Writes high level to the specified GPIO pins.
void GPIO_WriteLow (GPIO_TypeDef *GPIOx, GPIO_Pin_TypeDef PortPins)
 Writes low level to the specified GPIO pins.
void GPIO_WriteReverse (GPIO_TypeDef *GPIOx, GPIO_Pin_TypeDef PortPins)
 Writes reverse level to the specified GPIO pins.

Function Documentation

void GPIO_DeInit ( GPIO_TypeDef GPIOx)

Deinitializes the GPIOx peripheral registers to their default reset values.

Parameters:
GPIOx,:Select the GPIO peripheral number (x = A to I).
Return values:
None

Definition at line 53 of file stm8s_gpio.c.

References GPIO_struct::CR1, GPIO_struct::CR2, GPIO_struct::DDR, GPIO_CR1_RESET_VALUE, GPIO_CR2_RESET_VALUE, GPIO_DDR_RESET_VALUE, GPIO_ODR_RESET_VALUE, and GPIO_struct::ODR.

void GPIO_ExternalPullUpConfig ( GPIO_TypeDef GPIOx,
GPIO_Pin_TypeDef  GPIO_Pin,
FunctionalState  NewState 
)

Configures the external pull-up on GPIOx pins.

Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
GPIO_Pin: Specifies the pin number
NewState: The new state of the pull up pin.
Return values:
None

Definition at line 225 of file stm8s_gpio.c.

References GPIO_struct::CR1, DISABLE, IS_FUNCTIONALSTATE_OK, and IS_GPIO_PIN_OK.

void GPIO_Init ( GPIO_TypeDef GPIOx,
GPIO_Pin_TypeDef  GPIO_Pin,
GPIO_Mode_TypeDef  GPIO_Mode 
)

Initializes the GPIOx according to the specified parameters.

Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
GPIO_Pin: This parameter contains the pin number, it can be any value of the GPIO_Pin_TypeDef enumeration.
GPIO_Mode: This parameter can be a value of the GPIO_Mode_TypeDef enumeration.
Return values:
None

Definition at line 71 of file stm8s_gpio.c.

References GPIO_struct::CR1, GPIO_struct::CR2, GPIO_struct::DDR, IS_GPIO_MODE_OK, IS_GPIO_PIN_OK, and GPIO_struct::ODR.

uint8_t GPIO_ReadInputData ( GPIO_TypeDef GPIOx)

Reads the specified GPIO input data port.

Note:
The port must be configured in input mode.
Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
Return values:
GPIOinput data port value.

Definition at line 202 of file stm8s_gpio.c.

References GPIO_struct::IDR.

BitStatus GPIO_ReadInputPin ( GPIO_TypeDef GPIOx,
GPIO_Pin_TypeDef  GPIO_Pin 
)

Reads the specified GPIO input data pin.

Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
GPIO_Pin: Specifies the pin number.
Return values:
BitStatus: GPIO input pin status.

Definition at line 213 of file stm8s_gpio.c.

References GPIO_struct::IDR.

uint8_t GPIO_ReadOutputData ( GPIO_TypeDef GPIOx)

Reads the specified GPIO output data port.

Note:
The port must be configured in input mode.
Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
Return values:
GPIOoutput data port value.

Definition at line 191 of file stm8s_gpio.c.

References GPIO_struct::ODR.

void GPIO_Write ( GPIO_TypeDef GPIOx,
uint8_t  PortVal 
)

Writes data to the specified GPIO data port.

Note:
The port must be configured in output mode.
Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
PortVal: Specifies the value to be written to the port output data register.
Return values:
None

Definition at line 141 of file stm8s_gpio.c.

References GPIO_struct::ODR.

void GPIO_WriteHigh ( GPIO_TypeDef GPIOx,
GPIO_Pin_TypeDef  PortPins 
)

Writes high level to the specified GPIO pins.

Note:
The port must be configured in output mode.
Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
PortPins: Specifies the pins to be turned high to the port output. data register.
Return values:
None

Definition at line 154 of file stm8s_gpio.c.

References GPIO_struct::ODR.

void GPIO_WriteLow ( GPIO_TypeDef GPIOx,
GPIO_Pin_TypeDef  PortPins 
)

Writes low level to the specified GPIO pins.

Note:
The port must be configured in output mode.
Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
PortPins: Specifies the pins to be turned low to the port output. data register.
Return values:
None

Definition at line 167 of file stm8s_gpio.c.

References GPIO_struct::ODR.

void GPIO_WriteReverse ( GPIO_TypeDef GPIOx,
GPIO_Pin_TypeDef  PortPins 
)

Writes reverse level to the specified GPIO pins.

Note:
The port must be configured in output mode.
Parameters:
GPIOx: Select the GPIO peripheral number (x = A to I).
PortPins: Specifies the pins to be reversed to the port output. data register.
Return values:
None

Definition at line 180 of file stm8s_gpio.c.

References GPIO_struct::ODR.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com