STM32L476G-Discovery board drivers V1.0.0

Dependents:   DiscoLogger DISCO_L476VG_GlassLCD DISCO_L476VG_MicrophoneRecorder DISCO_L476VG_UART ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers io.h Source File

io.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    io.h
00004   * @author  MCD Application Team
00005   * @brief   This file contains all the functions prototypes for the IO driver.
00006   ******************************************************************************
00007   * @attention
00008   *
00009   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
00010   * All rights reserved.</center></h2>
00011   *
00012   * This software component is licensed by ST under BSD 3-Clause license,
00013   * the "License"; You may not use this file except in compliance with the
00014   * License. You may obtain a copy of the License at:
00015   *                        opensource.org/licenses/BSD-3-Clause
00016   *
00017   ******************************************************************************
00018   */ 
00019 
00020 /* Define to prevent recursive inclusion -------------------------------------*/
00021 #ifndef __IO_H
00022 #define __IO_H
00023 
00024 #ifdef __cplusplus
00025  extern "C" {
00026 #endif
00027 
00028 /* Includes ------------------------------------------------------------------*/
00029 #include <stdint.h>
00030 
00031 /** @addtogroup BSP
00032   * @{
00033   */
00034 
00035 /** @addtogroup Components
00036   * @{
00037   */
00038     
00039 /** @addtogroup IO
00040   * @{
00041   */
00042 
00043 /** @defgroup IO_Exported_Types
00044   * @{
00045   */
00046 
00047 /**
00048   * @brief  IO Bit SET and Bit RESET enumeration
00049   */
00050 typedef enum
00051 {
00052   IO_PIN_RESET = 0,
00053   IO_PIN_SET
00054 }IO_PinState;
00055 
00056 typedef enum
00057 {
00058    IO_MODE_INPUT = 0,   /* input floating */
00059    IO_MODE_OUTPUT,      /* output Push Pull */
00060    IO_MODE_IT_RISING_EDGE,   /* float input - irq detect on rising edge */
00061    IO_MODE_IT_FALLING_EDGE,  /* float input - irq detect on falling edge */
00062    IO_MODE_IT_LOW_LEVEL,     /* float input - irq detect on low level */
00063    IO_MODE_IT_HIGH_LEVEL,    /* float input - irq detect on high level */
00064    /* following modes only available on MFX*/
00065    IO_MODE_ANALOG,           /* analog mode */
00066    IO_MODE_OFF,              /* when pin isn't used*/
00067    IO_MODE_INPUT_PU,         /* input with internal pull up resistor */
00068    IO_MODE_INPUT_PD,         /* input with internal pull down resistor */
00069    IO_MODE_OUTPUT_OD,          /* Open Drain output without internal resistor */
00070    IO_MODE_OUTPUT_OD_PU,       /* Open Drain output with  internal pullup resistor */
00071    IO_MODE_OUTPUT_OD_PD,       /* Open Drain output with  internal pulldown resistor */
00072    IO_MODE_OUTPUT_PP,          /* PushPull output without internal resistor */
00073    IO_MODE_OUTPUT_PP_PU,       /* PushPull output with  internal pullup resistor */
00074    IO_MODE_OUTPUT_PP_PD,       /* PushPull output with  internal pulldown resistor */
00075    IO_MODE_IT_RISING_EDGE_PU,   /* push up resistor input - irq on rising edge  */
00076    IO_MODE_IT_RISING_EDGE_PD,   /* push dw resistor input - irq on rising edge  */
00077    IO_MODE_IT_FALLING_EDGE_PU,  /* push up resistor input - irq on falling edge */
00078    IO_MODE_IT_FALLING_EDGE_PD,  /* push dw resistor input - irq on falling edge */
00079    IO_MODE_IT_LOW_LEVEL_PU,     /* push up resistor input - irq detect on low level */
00080    IO_MODE_IT_LOW_LEVEL_PD,     /* push dw resistor input - irq detect on low level */
00081    IO_MODE_IT_HIGH_LEVEL_PU,    /* push up resistor input - irq detect on high level */
00082    IO_MODE_IT_HIGH_LEVEL_PD,    /* push dw resistor input - irq detect on high level */
00083 
00084 }IO_ModeTypedef;
00085 
00086 /** @defgroup IO_Driver_structure  IO Driver structure
00087   * @{
00088   */
00089 typedef struct
00090 {  
00091   void       (*Init)(uint16_t);
00092   uint16_t   (*ReadID)(uint16_t);
00093   void       (*Reset)(uint16_t);
00094   
00095   void       (*Start)(uint16_t, uint32_t);
00096   uint8_t    (*Config)(uint16_t, uint32_t, IO_ModeTypedef);
00097   void       (*WritePin)(uint16_t, uint32_t, uint8_t);
00098   uint32_t   (*ReadPin)(uint16_t, uint32_t);
00099   
00100   void       (*EnableIT)(uint16_t);
00101   void       (*DisableIT)(uint16_t);
00102   uint32_t    (*ITStatus)(uint16_t, uint32_t);
00103   void       (*ClearIT)(uint16_t, uint32_t);
00104     
00105 }IO_DrvTypeDef;
00106 /**
00107   * @}
00108   */
00109 
00110 /**
00111   * @}
00112   */
00113 
00114 /**
00115   * @}
00116   */
00117 
00118 /**
00119   * @}
00120   */
00121 
00122 /**
00123   * @}
00124   */
00125 
00126 #ifdef __cplusplus
00127 }
00128 #endif
00129 
00130 #endif /* __IO_H */
00131 
00132 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/