Subversion Repositories NaviCtrl

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ingob 1
/******************** (C) COPYRIGHT 2006 STMicroelectronics ********************
2
* File Name          : 91x_gpio.h
3
* Author             : MCD Application Team
4
* Date First Issued  : 05/18/2006 : Version 1.0
5
* Description        : This file contains all the functions prototypes for the
6
*                      GPIO software library.
7
********************************************************************************
8
* History:
9
* 05/22/2007 : Version 1.2
10
* 05/24/2006 : Version 1.1
11
* 05/18/2006 : Version 1.0
12
********************************************************************************
13
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH
14
* CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS
15
* A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
16
* OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
17
* OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
18
* CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
19
*******************************************************************************/
20
 
21
/* Define to prevent recursive inclusion ------------------------------------ */
22
 
23
#ifndef _91x_GPIO_H
24
#define _91x_GPIO_H
25
 
26
/* Includes ------------------------------------------------------------------*/
27
#include "91x_map.h"
28
 
29
/* GPIO Init structure definition */
30
typedef struct
31
{
32
  u8 GPIO_Pin;
33
  u8 GPIO_Direction;
34
  u8 GPIO_Type;
35
  u8 GPIO_IPConnected;
36
  u16 GPIO_Alternate;
37
}GPIO_InitTypeDef;
38
 
39
/* Bit_SET and Bit_RESET enumeration */
40
typedef enum
41
{ Bit_RESET = 0,
42
  Bit_SET
43
}BitAction;
44
 
45
 
46
/* Exported constants --------------------------------------------------------*/
47
#define GPIO_Pin_None 0x00
48
#define GPIO_Pin_0    0x01
49
#define GPIO_Pin_1    0x02
50
#define GPIO_Pin_2    0x04
51
#define GPIO_Pin_3    0x08
52
#define GPIO_Pin_4    0x10
53
#define GPIO_Pin_5    0x20
54
#define GPIO_Pin_6    0x40
55
#define GPIO_Pin_7    0x80
56
#define GPIO_Pin_All  0xFF
57
 
58
#define GPIO_PinInput  0x00
59
#define GPIO_PinOutput 0x01
60
 
61
#define GPIO_Type_PushPull      0x00
62
#define GPIO_Type_OpenCollector 0x01
63
 
64
#define GPIO_IPConnected_Disable 0x00
65
#define GPIO_IPConnected_Enable  0x01
66
 
67
#define GPIO_InputAlt1  0x00
68
#define GPIO_OutputAlt1 0x01
69
#define GPIO_OutputAlt2 0x02
70
#define GPIO_OutputAlt3 0x03
71
 
72
#define GPIO_ANAChannel0   0x01
73
#define GPIO_ANAChannel1   0x02
74
#define GPIO_ANAChannel2   0x04
75
#define GPIO_ANAChannel3   0x08
76
#define GPIO_ANAChannel4   0x10
77
#define GPIO_ANAChannel5   0x20
78
#define GPIO_ANAChannel6   0x40
79
#define GPIO_ANAChannel7   0x80
80
#define GPIO_ANAChannelALL 0xFF
81
 
82
void GPIO_DeInit(GPIO_TypeDef* GPIOx);
83
void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct);
84
void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct);
85
u8 GPIO_ReadBit(GPIO_TypeDef* GPIOx, u8 GPIO_Pin);
86
u8 GPIO_Read(GPIO_TypeDef* GPIOx);
87
void GPIO_WriteBit(GPIO_TypeDef* GPIOx, u8 GPIO_Pin, BitAction BitVal);
88
void GPIO_Write(GPIO_TypeDef* GPIOx, u8 PortVal);
89
void GPIO_EMIConfig(FunctionalState NewState);
90
void GPIO_ANAPinConfig(u8 GPIO_ANAChannel, FunctionalState NewState);
91
 
92
 
93
 
94
#endif /* _91x_GPIO_H */
95
 
96
/******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/