comparison gsm-fw/bsp/armio.h @ 143:afceeeb2cba1

Our nuc-fw is destined to become gsm-fw, so I went ahead and did the big hg mv
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 12 Nov 2013 05:35:48 +0000
parents nuc-fw/bsp/armio.h@3b2e941043d8
children
comparison
equal deleted inserted replaced
142:15d5977390c2 143:afceeeb2cba1
1 /*
2 * ARMIO.H * * Control diagnostic bits * * Reference : GCS207 *
3 *
4 * FreeCalypso note: this version of armio.h originates
5 * from the MV100-0.1.rar find.
6 */
7
8 #ifndef _ARM_IO_H_
9 #define _ARM_IO_H_
10
11 #include "../include/sys_types.h"
12
13
14 // Duplicate address with ARMIO_IO_CNTL
15 // Need to investigate !!!
16 //#define ARMIO_CNTL (MEM_ARMIO + 0x04) /* I/O control */
17
18 #define ARMIO_IN (MEM_ARMIO + 0x00) /* inputs */
19 #define ARMIO_OUT (MEM_ARMIO + 0x02) /* outputs */
20 #define ARMIO_IO_CNTL (MEM_ARMIO + 0x04) /* I/O control */
21 #define ARMIO_CNTL_REG (MEM_ARMIO + 0x06) /* control ARMIO */
22 #define ARMIO_LOAD_TIM (MEM_ARMIO + 0x08) /* load TIM */
23 #if (CHIPSET != 12)
24 #define ARMIO_KBR_IN (MEM_ARMIO + 0x0A) /* KBR inputs (rows) */
25 #define ARMIO_KBR_OUT (MEM_ARMIO + 0x0C) /* KBR outputs (columns) */
26 #endif
27 #define ARMIO_PWM_CNTL (MEM_ARMIO + 0x0E) /* LIGHT/BUZZER control */
28 #define ARMIO_LIGHT (MEM_ARMIO + 0x10) /* light value */
29 #define ARMIO_BUZZER (MEM_ARMIO + 0x12) /* buzzer value */
30 #define ARMIO_CLOCKEN 0x0020
31 #if (CHIPSET != 12)
32 #define CLKM_IO_CNTL MEM_IO_SEL /* control IO */
33 #endif
34
35 #if (CHIPSET == 12)
36 #define GPIO_INTERRUPT_LEVEL_REG * (volatile SYS_UWORD16 *) (MEM_ARMIO + 0x16)
37 #define GPIO_INTERRUPT_MASK_REG * (volatile SYS_UWORD16 *) (MEM_ARMIO + 0x18)
38 #else
39 #define ARMIO_GPIO_EVENT_MODE (MEM_ARMIO + 0x14) /* GPIO event mode */
40 #define ARMIO_KBD_GPIO_INT (MEM_ARMIO + 0x16) /* Kbd/GPIO IRQ register */
41 #define ARMIO_KBD_GPIO_MASKIT (MEM_ARMIO + 0x18) /* Kbd/GPIO mask IRQ */
42 // CC test 0316
43 #define ARMIO_GPIO_DEBOUNCE (MEM_ARMIO + 0x1A) /* GPIO debounceing register*/
44 // end
45 #endif
46
47
48 #if (CHIPSET != 12)
49 #define ARMIO_DCD (2) /* IO used for DCD on C-Sample - Output */
50 #endif
51 #define ARMIO_DTR (3) /* IO used for DTR on C-Sample - Input */
52
53 #define ARMIO_FALLING_EDGE (0)
54 #define ARMIO_RISING_EDGE (1)
55
56 #if (CHIPSET != 12)
57 #define ARMIO_KEYPAD_INT (0x0001)
58 #define ARMIO_KEYPDAD_INT ARMIO_KEYPAD_INT /* TI's misspelling */
59 #define ARMIO_GPIO_INT (0x0002)
60
61 #define ARMIO_MASKIT_KBD (0x0001)
62 #define ARMIO_MASKIT_GPIO (0x0002)
63
64 void AI_EnableBit(int bit);
65 void AI_DisableBit(int bit);
66 #endif
67 void AI_SetBit(int bit);
68 void AI_ResetBit(int bit);
69 void AI_ConfigBitAsOutput(int bit);
70 void AI_ConfigBitAsInput(int bit);
71 SYS_BOOL AI_ReadBit(int bit);
72 void AI_SetSimIO3V(SYS_UWORD8 StdOutput);
73 void AI_Power(SYS_UWORD8 power);
74 void AI_ResetTspIO(void);
75 void AI_ResetDbgReg(void);
76 void AI_ResetIoConfig(void);
77 void AI_InitIOConfig(void);
78 void AI_ClockEnable (void);
79
80 void AI_SelectIOForIT (SYS_UWORD16 Pin, SYS_UWORD16 Edge);
81 #if (CHIPSET != 12)
82 int AI_CheckITSource (SYS_UWORD16 Source);
83 #endif
84 void AI_UnmaskIT (SYS_UWORD16 Source);
85 void AI_MaskIT (SYS_UWORD16 Source);
86
87 #if 0
88
89 /*
90 * The following stuff appears to be additions by whatever handset
91 * manufacturer was behind the MV100 code - not TI's reference code.
92 * It looks unclean, so let's try omitting it for FreeCalypso.
93 */
94
95 /* glowing, 2004-06-08 import from M188A, defined by Robert.Chen*/
96 #define AI_CFGBIT_OUTPUT(bit) (*((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) &= ~(1<<bit))
97 #define AI_CFGBIT_INPUT(bit) (*((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) |= (1<<bit))
98 #define AI_SETBIT(bit) (*((volatile SYS_UWORD16 *) ARMIO_OUT) |= (1<<bit))
99 #define AI_RESETBIT(bit) (*((volatile SYS_UWORD16 *) ARMIO_OUT) &= ~(1<<bit))
100
101 #define GPIO_LEDG 0
102 #define GPIO_LEDB 1
103 #define GPIO_HALL 2
104 #define GPIO_HEADSET_DETECT 3
105
106 #define GPIO_MIDI_RESET 5
107
108 #define GPIO_LCD_RESET 7
109 #define GPIO_LCD_DIMM2 8
110 #define GPIO_MIDI_IRQ 9
111
112 #define GPIO_CAMERA_IRQ 11
113
114 #define GPIO_HEADSET_KEY 13
115
116 #endif /* the #if 0 above */
117
118 #endif /* file include guard */