STM8L15x Standard Peripherals Drivers: stm8l15x_gpio.c File Reference

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

stm8l15x_gpio.c File Reference

This file provides firmware functions to manage the following functionalities of the GPIO peripheral:

  • Initialization and Configuration
  • GPIO Read and Write.
More...
#include "stm8l15x_gpio.h"

Go to the source code of this file.

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.
uint8_t GPIO_ReadInputData (GPIO_TypeDef *GPIOx)
 Reads the specified GPIO input data port.
BitStatus GPIO_ReadInputDataBit (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.
BitStatus GPIO_ReadOutputDataBit (GPIO_TypeDef *GPIOx, GPIO_Pin_TypeDef GPIO_Pin)
 Reads the specified GPIO Output data pin.
void GPIO_ResetBits (GPIO_TypeDef *GPIOx, uint8_t GPIO_Pin)
 Writes low level to the specified GPIO pins.
void GPIO_SetBits (GPIO_TypeDef *GPIOx, uint8_t GPIO_Pin)
 Writes high level to the specified GPIO pins.
void GPIO_ToggleBits (GPIO_TypeDef *GPIOx, uint8_t GPIO_Pin)
 Toggles the specified GPIO pins.
void GPIO_Write (GPIO_TypeDef *GPIOx, uint8_t GPIO_PortVal)
 Writes data to the specified GPIO data port.
void GPIO_WriteBit (GPIO_TypeDef *GPIOx, GPIO_Pin_TypeDef GPIO_Pin, BitAction GPIO_BitVal)
 Sets or clears the selected data port bit.

Detailed Description

This file provides firmware functions to manage the following functionalities of the GPIO peripheral:

  • Initialization and Configuration
  • GPIO Read and Write.
Author:
MCD Application Team
Version:
V1.5.0
Date:
13-May-2011 =================================================================== How to use this driver =================================================================== 1. Configure the GPIO pin(s) using GPIO_Init() Two main configuration are available for each pin:
  • Input: Floating Pull-up. In Input mode, external interrupt can be enabled or disabled
  • Output: Push-Pull Open Drain. In output mode, the GPIO pin speed is configurable: Slow (2 MHz) or Fast (10MHz).

2. To get the level of a pin configured in input mode use GPIO_ReadInputDataBit()

3. To set/reset GPIO pins sharing the same GPIO port use GPIO_SetBits() / GPIO_ResetBits()

4. To enable external interrupt, the GPIO pin must be configured in input mode with interrupt enabled. Interrupt sensitivity (rising, falling...) is configurable using EXTI_SetPinSensitivity() in the EXTI peripheral driver "stm8l15x_exti.c"

Attention:

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

© COPYRIGHT 2011 STMicroelectronics

Definition in file stm8l15x_gpio.c.

STM8S Firmware Library: Overview

 

 

 

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