Simple "hello world" style program for X-NUCLEO-IKS01A1 MEMS Inertial

Dependencies:   BLE_API X_NUCLEO_IDB0XA1 X_NUCLEO_IKS01A1 mbed

Fork of HelloWorld_IKS01A1 by ST

Embed: (wiki syntax)

« Back to documentation index

stm32f4xx_gpio.c File Reference

stm32f4xx_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
  • GPIO Alternate functions configuration.
More...

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_Init (GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_InitStruct)
 Initializes the GPIOx peripheral according to the specified parameters in the GPIO_InitStruct.
void GPIO_StructInit (GPIO_InitTypeDef *GPIO_InitStruct)
 Fills each GPIO_InitStruct member with its default value.
void GPIO_PinLockConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Locks GPIO Pins configuration registers.
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 GPIO input data port.
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.
void GPIO_ToggleBits (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Toggles the specified GPIO pins.
void GPIO_PinAFConfig (GPIO_TypeDef *GPIOx, uint16_t GPIO_PinSource, uint8_t GPIO_AF)
 Changes the mapping of the specified pin.

Detailed Description

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

  • Initialization and Configuration
  • GPIO Read and Write
  • GPIO Alternate functions configuration.
Author:
MCD Application Team
Version:
V1.0.0
Date:
30-September-2011
  *
  *          ===================================================================
  *                                 How to use this driver
  *          ===================================================================       
  *           1. Enable the GPIO AHB clock using the following function
  *                RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOx, ENABLE);
  *             
  *           2. Configure the GPIO pin(s) using GPIO_Init()
  *              Four possible configuration are available for each pin:
  *                - Input: Floating, Pull-up, Pull-down.
  *                - Output: Push-Pull (Pull-up, Pull-down or no Pull)
  *                          Open Drain (Pull-up, Pull-down or no Pull).
  *                  In output mode, the speed is configurable: 2 MHz, 25 MHz,
  *                  50 MHz or 100 MHz.
  *                - Alternate Function: Push-Pull (Pull-up, Pull-down or no Pull)
  *                                      Open Drain (Pull-up, Pull-down or no Pull).
  *                - Analog: required mode when a pin is to be used as ADC channel
  *                          or DAC output.
  * 
  *          3- Peripherals alternate function:
  *              - For ADC and DAC, configure the desired pin in analog mode using 
  *                  GPIO_InitStruct->GPIO_Mode = GPIO_Mode_AN;
  *              - For other peripherals (TIM, USART...):
  *                 - Connect the pin to the desired peripherals' Alternate 
  *                   Function (AF) using GPIO_PinAFConfig() function
  *                 - Configure the desired pin in alternate function mode using
  *                   GPIO_InitStruct->GPIO_Mode = GPIO_Mode_AF
  *                 - Select the type, pull-up/pull-down and output speed via 
  *                   GPIO_PuPd, GPIO_OType and GPIO_Speed members
  *                 - Call GPIO_Init() function
  *        
  *          4. To get the level of a pin configured in input mode use GPIO_ReadInputDataBit()
  *          
  *          5. To set/reset the level of a pin configured in output mode use
  *             GPIO_SetBits()/GPIO_ResetBits()
  *               
  *          6. During and just after reset, the alternate functions are not 
  *             active and the GPIO pins are configured in input floating mode
  *             (except JTAG pins).
  *
  *          7. The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as 
  *             general-purpose (PC14 and PC15, respectively) when the LSE
  *             oscillator is off. The LSE has priority over the GPIO function.
  *
  *          8. The HSE oscillator pins OSC_IN/OSC_OUT can be used as 
  *             general-purpose PH0 and PH1, respectively, when the HSE 
  *             oscillator is off. The HSE has priority over the GPIO function.
  *             
  *  
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 stm32f4xx_gpio.c.