1 /******************************************************************/
\r
2 /* Copyright (C) 2008 ROCK-CHIPS FUZHOU . All Rights Reserved. */
\r
3 /*******************************************************************
\r
5 Desc : ¶¨ÒågpioµÄ¼Ä´æÆ÷½á¹¹Ìå\¼Ä´æÆ÷λµÄºê¶¨Òå\½Ó¿Úº¯Êý
\r
12 *********************************************************************/
\r
13 #ifndef _DRIVER_TCA6424_GPIO_H_
\r
14 #define _DRIVER_TCA6424_GPIO_H_
\r
16 #define TCA6424_PortNum 3
\r
17 #define TCA6424_PortPinNum 8
\r
18 #define TCA6424_Port0PinNum 8
\r
19 #define TCA6424_Port1PinNum 8
\r
20 #define TCA6424_Port2PinNum 8
\r
21 #define EXTGPIO_OUTPUT 0
\r
22 #define EXTGPIO_INPUT 1
\r
24 #define TCA6424_TotalPortPinNum (TCA6424_Port0PinNum+TCA6424_Port1PinNum+TCA6424_Port2PinNum)
\r
26 #define TCA6424_InputLevel_Reg 0x0 //r only
\r
27 #define TCA6424_OutputLevel_Reg 0x4 // r/w default ffff
\r
28 #define TCA6424_Invert_Reg 0x8 // r/w default 0
\r
29 #define TCA6424_Config_Reg 0x0c // r/w default ffff
\r
32 #define TCA6424_Auto_InputLevel_Reg 0x80
\r
33 #define TCA6424_Auto_OutputLevel_Reg 0x84
\r
34 #define TCA6424_Auto_Invert_Reg 0x88
\r
35 #define TCA6424_Auto_Config_Reg 0x8c
\r
37 #define TCA6424_OUTREGLOCK
\r
38 #define TCA6424_INPUTREGLOCK
\r
39 #define TCA6424_CONFIGREGLOCK
\r
41 #define tca6424getbit(a,num) (((a)>>(num))&0x01)
\r
42 #define tca6424setbit(a,num) ((a)|(0x01<<(num)))
\r
43 #define tca6424clearbit(a,num) ((a)&(~(0x01<<(num))))
\r
45 #define TCA6424_I2C_RATE 400*1000
\r