comparison nuc-fw/bsp/armio.h @ 93:45911ad957fd

nuc-fw: beginning to integrate TI's BSP code
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 31 Aug 2013 23:43:23 +0000
parents
children 91460c8957f0
comparison
equal deleted inserted replaced
92:f459043fae0c 93:45911ad957fd
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 #endif
43
44
45 #if (CHIPSET != 12)
46 #define ARMIO_DCD (2) /* IO used for DCD on C-Sample - Output */
47 #endif
48 #define ARMIO_DTR (3) /* IO used for DTR on C-Sample - Input */
49
50 #define ARMIO_FALLING_EDGE (0)
51 #define ARMIO_RISING_EDGE (1)
52
53 #if (CHIPSET != 12)
54 #define ARMIO_KEYPDAD_INT (0x0001)
55 #define ARMIO_GPIO_INT (0x0002)
56
57 #define ARMIO_MASKIT_KBD (0x0001)
58 #define ARMIO_MASKIT_GPIO (0x0002)
59
60 void AI_EnableBit(int bit);
61 void AI_DisableBit(int bit);
62 #endif
63 void AI_SetBit(int bit);
64 void AI_ResetBit(int bit);
65 void AI_ConfigBitAsOutput(int bit);
66 void AI_ConfigBitAsInput(int bit);
67 SYS_BOOL AI_ReadBit(int bit);
68 void AI_SetSimIO3V(SYS_UWORD8 StdOutput);
69 void AI_Power(SYS_UWORD8 power);
70 void AI_ResetTspIO(void);
71 void AI_ResetDbgReg(void);
72 void AI_ResetIoConfig(void);
73 void AI_InitIOConfig(void);
74 void AI_ClockEnable (void);
75
76 void AI_SelectIOForIT (SYS_UWORD16 Pin, SYS_UWORD16 Edge);
77 #if (CHIPSET != 12)
78 int AI_CheckITSource (SYS_UWORD16 Source);
79 #endif
80 void AI_UnmaskIT (SYS_UWORD16 Source);
81 void AI_MaskIT (SYS_UWORD16 Source);
82
83 #if 0
84
85 /*
86 * The following stuff appears to be additions by whatever handset
87 * manufacturer was behind the MV100 code - not TI's reference code.
88 * It looks unclean, so let's try omitting it for FreeCalypso.
89 */
90
91 /* glowing, 2004-06-08 import from M188A, defined by Robert.Chen*/
92 #define AI_CFGBIT_OUTPUT(bit) (*((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) &= ~(1<<bit))
93 #define AI_CFGBIT_INPUT(bit) (*((volatile SYS_UWORD16 *) ARMIO_IO_CNTL) |= (1<<bit))
94 #define AI_SETBIT(bit) (*((volatile SYS_UWORD16 *) ARMIO_OUT) |= (1<<bit))
95 #define AI_RESETBIT(bit) (*((volatile SYS_UWORD16 *) ARMIO_OUT) &= ~(1<<bit))
96
97 #define GPIO_LEDG 0
98 #define GPIO_LEDB 1
99 #define GPIO_HALL 2
100 #define GPIO_HEADSET_DETECT 3
101
102 #define GPIO_MIDI_RESET 5
103
104 #define GPIO_LCD_RESET 7
105 #define GPIO_LCD_DIMM2 8
106 #define GPIO_MIDI_IRQ 9
107
108 #define GPIO_CAMERA_IRQ 11
109
110 #define GPIO_HEADSET_KEY 13
111
112 #endif /* the #if 0 above */
113
114 #endif /* file include guard */