]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/ARM7_STR75x_IAR/STLibrary/inc/75x_gpio.h
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / ARM7_STR75x_IAR / STLibrary / inc / 75x_gpio.h
1 /******************** (C) COPYRIGHT 2006 STMicroelectronics ********************\r
2 * File Name          : 75x_gpio.h\r
3 * Author             : MCD Application Team\r
4 * Date First Issued  : 03/10/2006\r
5 * Description        : This file contains all the functions prototypes for the\r
6 *                      GPIO software library.\r
7 ********************************************************************************\r
8 * History:\r
9 * 07/17/2006 : V1.0\r
10 * 03/10/2006 : V0.1\r
11 ********************************************************************************\r
12 * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS\r
13 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.\r
14 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,\r
15 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE\r
16 * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING\r
17 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.\r
18 *******************************************************************************/\r
19 \r
20 /* Define to prevent recursive inclusion -------------------------------------*/\r
21 #ifndef __75x_GPIO_H\r
22 #define __75x_GPIO_H\r
23 \r
24 /* Includes ------------------------------------------------------------------*/\r
25 #include "75x_map.h"\r
26 \r
27 /* Exported types ------------------------------------------------------------*/\r
28 /* Configuration Mode enumeration */\r
29 typedef enum\r
30 { GPIO_Mode_AIN = 1,\r
31   GPIO_Mode_IN_FLOATING,\r
32   GPIO_Mode_IPD,\r
33   GPIO_Mode_IPU,\r
34   GPIO_Mode_Out_OD,\r
35   GPIO_Mode_Out_PP,\r
36   GPIO_Mode_AF_OD,\r
37   GPIO_Mode_AF_PP\r
38 }GPIOMode_TypeDef;\r
39 \r
40 /* GPIO Init structure definition */\r
41 typedef struct\r
42 {\r
43   u32 GPIO_Pin;\r
44   GPIOMode_TypeDef GPIO_Mode;\r
45 }GPIO_InitTypeDef;\r
46 \r
47 /* Bit_SET and Bit_RESET enumeration */\r
48 typedef enum\r
49 { Bit_RESET = 0,\r
50   Bit_SET\r
51 }BitAction;\r
52 \r
53 \r
54 /* Exported constants --------------------------------------------------------*/\r
55 /* GPIO pins define */\r
56 #define GPIO_Pin_None        0x00000000  /* No pin selected */\r
57 #define GPIO_Pin_0           0x00000001  /* Pin 0 selected */\r
58 #define GPIO_Pin_1           0x00000002  /* Pin 1 selected */\r
59 #define GPIO_Pin_2           0x00000004  /* Pin 2 selected */\r
60 #define GPIO_Pin_3           0x00000008  /* Pin 3 selected */\r
61 #define GPIO_Pin_4           0x00000010  /* Pin 4 selected */\r
62 #define GPIO_Pin_5           0x00000020  /* Pin 5 selected */\r
63 #define GPIO_Pin_6           0x00000040  /* Pin 6 selected */\r
64 #define GPIO_Pin_7           0x00000080  /* Pin 7 selected */\r
65 #define GPIO_Pin_8           0x00000100  /* Pin 8 selected */\r
66 #define GPIO_Pin_9           0x00000200  /* Pin 9 selected */\r
67 #define GPIO_Pin_10          0x00000400  /* Pin 10 selected */\r
68 #define GPIO_Pin_11          0x00000800  /* Pin 11 selected */\r
69 #define GPIO_Pin_12          0x00001000  /* Pin 12 selected */\r
70 #define GPIO_Pin_13          0x00002000  /* Pin 13 selected */\r
71 #define GPIO_Pin_14          0x00004000  /* Pin 14 selected */\r
72 #define GPIO_Pin_15          0x00008000  /* Pin 15 selected */\r
73 #define GPIO_Pin_16          0x00010000  /* Pin 16 selected */\r
74 #define GPIO_Pin_17          0x00020000  /* Pin 17 selected */\r
75 #define GPIO_Pin_18          0x00040000  /* Pin 18 selected */\r
76 #define GPIO_Pin_19          0x00080000  /* Pin 19 selected */\r
77 #define GPIO_Pin_20          0x00100000  /* Pin 20 selected */\r
78 #define GPIO_Pin_21          0x00200000  /* Pin 21 selected */\r
79 #define GPIO_Pin_22          0x00400000  /* Pin 22 selected */\r
80 #define GPIO_Pin_23          0x00800000  /* Pin 23 selected */\r
81 #define GPIO_Pin_24          0x01000000  /* Pin 24 selected */\r
82 #define GPIO_Pin_25          0x02000000  /* Pin 25 selected */\r
83 #define GPIO_Pin_26          0x04000000  /* Pin 26 selected */\r
84 #define GPIO_Pin_27          0x08000000  /* Pin 27 selected */\r
85 #define GPIO_Pin_28          0x10000000  /* Pin 28 selected */\r
86 #define GPIO_Pin_29          0x20000000  /* Pin 29 selected */\r
87 #define GPIO_Pin_30          0x40000000  /* Pin 30 selected */\r
88 #define GPIO_Pin_31          0x80000000  /* Pin 31 selected */\r
89 #define GPIO_Pin_All         0xFFFFFFFF  /* All pins selected */\r
90 \r
91 /* GPIO Remap define */\r
92 #define GPIO_Remap_SMI_CS3_EN  0x23 /* SMI CS3 Enable */\r
93 #define GPIO_Remap_SMI_CS2_EN  0x22 /* SMI CS2 Enable */\r
94 #define GPIO_Remap_SMI_CS1_EN  0x21 /* SMI CS1 Enable */\r
95 #define GPIO_Remap_SMI_EN      0x20 /* SMI Enable */\r
96 #define GPIO_Remap_DBGOFF      0x45 /* JTAG Disable */\r
97 #define GPIO_Remap_UART1       0x44 /* UART1 Alternate Function mapping */\r
98 #define GPIO_Remap_UART2       0x43 /* UART2 Alternate Function mapping */\r
99 #define GPIO_Remap_SSP1        0x42 /* SSP1 Alternate Function mapping */\r
100 #define GPIO_Remap_TIM2        0x41 /* TIM2 Alternate Function mapping */\r
101 #define GPIO_Remap_TIM0        0x40 /* TIM0 Alternate Function mapping */\r
102 \r
103 \r
104 /* Exported macro ------------------------------------------------------------*/\r
105 /* Exported functions ------------------------------------------------------- */\r
106 \r
107 void GPIO_DeInit(GPIO_TypeDef* GPIOx);\r
108 void GPIO_Init(GPIO_TypeDef* GPIOx, GPIO_InitTypeDef* GPIO_InitStruct);\r
109 void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct);\r
110 u32  GPIO_Read(GPIO_TypeDef* GPIOx);\r
111 u8   GPIO_ReadBit(GPIO_TypeDef* GPIOx, u32 GPIO_Pin);\r
112 void GPIO_Write(GPIO_TypeDef* GPIOx, u32 PortVal);\r
113 void GPIO_WriteBit(GPIO_TypeDef* GPIOx,u32 GPIO_Pin, BitAction BitVal);\r
114 void GPIO_PinMaskConfig(GPIO_TypeDef* GPIOx, u32 GPIO_Pin, FunctionalState NewState);\r
115 u32  GPIO_GetPortMask(GPIO_TypeDef* GPIOx);\r
116 void GPIO_PinRemapConfig(u16 GPIO_Remap, FunctionalState NewState);\r
117 \r
118 #endif /* __75x_GPIO_H */\r
119 \r
120 /******************* (C) COPYRIGHT 2006 STMicroelectronics *****END OF FILE****/\r