STM8S/A Standard Peripherals Firmware Library
|
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 assert_param, GPIO_struct::CR1, DISABLE, IS_FUNCTIONALSTATE_OK, and IS_GPIO_PIN_OK.
Referenced by SD_LowLevel_Init().
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 assert_param, GPIO_struct::CR1, GPIO_struct::CR2, GPIO_struct::DDR, IS_GPIO_MODE_OK, IS_GPIO_PIN_OK, and GPIO_struct::ODR.
Referenced by ADC_Config(), main(), Multiplexer_EvalBoard_Config(), SD_LowLevel_DeInit(), SD_LowLevel_Init(), sEE_LowLevel_DeInit(), STM8S_EVAL_LCD_Init(), STM_EVAL_LEDInit(), and STM_EVAL_PBInit().
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:
-
GPIO input data port value.
Definition at line 202 of file stm8s_gpio.c.
References GPIO_struct::IDR.
Referenced by INTERRUPT_HANDLER(), main(), and SD_Detect().
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.
Referenced by STM_EVAL_PBGetState().
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:
-
GPIO output 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). GPIO_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.
Referenced by LCD_BacklightCmd(), and main().
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.
Referenced by INTERRUPT_HANDLER(), LCD_BacklightCmd(), and main().
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.
Referenced by INTERRUPT_HANDLER(), and main().