STM8L15x Standard Peripherals Drivers: Initialization and Configuration

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Initialization and Configuration

Initialization and Configuration. More...

Functions

void GPIO_DeInit (GPIO_TypeDef *GPIOx)
 Deinitializes the GPIOx peripheral registers to their default reset values.
void GPIO_ExternalPullUpConfig (GPIO_TypeDef *GPIOx, uint8_t GPIO_Pin, FunctionalState NewState)
 Configures the external pull-up on GPIOx pins.
void GPIO_Init (GPIO_TypeDef *GPIOx, uint8_t GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode)
 Initializes the GPIOx according to the specified parameters.

Detailed Description

Initialization and Configuration.

 ===============================================================================
                        Initialization and Configuration
 ===============================================================================  


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 90 of file stm8l15x_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,
uint8_t  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 This parameter can be one of the following values:
  • GPIO_Pin_0: Pin 0
  • GPIO_Pin_1: Pin 1
  • GPIO_Pin_2: Pin 2
  • GPIO_Pin_3: Pin 3
  • GPIO_Pin_4: Pin 4
  • GPIO_Pin_5: Pin 5
  • GPIO_Pin_6: Pin 6
  • GPIO_Pin_7: Pin 7
NewState: The new state of the pull up pin. Can be ENABLE or DISABLE
Return values:
None

Definition at line 203 of file stm8l15x_gpio.c.

References GPIO_struct::CR1, DISABLE, IS_FUNCTIONAL_STATE, and IS_GPIO_PIN.

void GPIO_Init ( GPIO_TypeDef GPIOx,
uint8_t  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 This parameter can be one of the following values:
  • GPIO_Pin_0: Pin 0
  • GPIO_Pin_1: Pin 1
  • GPIO_Pin_2: Pin 2
  • GPIO_Pin_3: Pin 3
  • GPIO_Pin_4: Pin 4
  • GPIO_Pin_5: Pin 5
  • GPIO_Pin_6: Pin 6
  • GPIO_Pin_7: Pin 7
GPIO_Mode: This parameter can be a value of the This parameter can be one of the following values:
  • GPIO_Mode_In_FL_No_IT: Input floating, no external interrupt
  • GPIO_Mode_In_PU_No_IT: Input pull-up, no external interrupt
  • GPIO_Mode_In_FL_IT: Input pull-up, external interrupt
  • GPIO_Mode_Out_OD_Low_Fast: Output open-drain, low level, 10MHz
  • GPIO_Mode_Out_PP_Low_Fast: Output push-pull, low level, 10MHz
  • GPIO_Mode_Out_OD_Low_Slow: Output open-drain, low level, 2MHz
  • GPIO_Mode_Out_PP_Low_Slow: Output push-pull, low level, 2MHz
  • GPIO_Mode_Out_OD_HiZ_Fast: Output open-drain, high-impedance level, 10MHz
  • GPIO_Mode_Out_PP_High_Fast: Output push-pull, high level, 10MHz
  • GPIO_Mode_Out_OD_HiZ_Slow: Output open-drain, high-impedance level, 2MHz
  • GPIO_Mode_Out_PP_High_Slow: Output push-pull, high level, 2MHz
Return values:
None

Definition at line 127 of file stm8l15x_gpio.c.

References GPIO_struct::CR1, GPIO_struct::CR2, GPIO_struct::DDR, IS_GPIO_MODE, IS_GPIO_PIN, and GPIO_struct::ODR.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com