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