123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590 |
- /* ---------------------------------------------------------------------
- Here we defined two functions here for I2C r/w via GPIO
- void DRV_GPIOI2C_WriteFun(UINT8 Mx
- UINT8 DeviceID
- UINT8 AddrLen
- UINT32 Addr
- UINT8 *pData
- UINT32 DataLen
- UINT8 Speed
- UINT8 *Status);
- UINT8 DRV_GPIOI2C_ReadFun(UINT8 Mx,
- UINT8 DeviceID,
- UINT8 AddrLen,
- UINT32 Addr,
- UINT8 *pData,
- UINT32 DataLen,
- UINT8 Speed,
- UINT8 *Status);
- --------------------------------------------------------------------- */
- #include <linux/time.h>
- #include <linux/delay.h>
- #include <drv_gpio.h>
- #include "drv_i2c_gpioi2c.h"
- #include "drv_i2c_main.h"
- #include <drv_i2c.h>
- #include "gpio_pin_define.h"
- #include "drv_gpio.h"
- #include "pin_config.h"
- extern I2C_DEV I2cDev;
- #if CONFIG_CHIPID == 0x330
- #define GPIO_I2C_CLK 21
- #define GPIO_I2C_DATA 22
- #else
- #define GPIO_I2C_CLK GPIO_I2C_SCL_PIN
- #define GPIO_I2C_DATA GPIO_I2C_SDA_PIN
- #endif
- #define GPIO_X_I2C_CLK 21
- #define GPIO_X_I2C_DATA 20
- #define LAG 8 /* 90=50k, 42 = 100k, 12 = 200k */
- //#define CONFIG_ENABLE_2ND_GPIO_I2C
- UINT8 GpioI2CSatus;
- void i2cGPIOOpenDrainWrite(UINT8 index, UINT32 value);
- void MxI2cGPIORestart(void);
- void MxI2cGPIOStart(void);
- void MxI2cGPIOStop(void);
- void MxI2cGPIOWriteByte(UINT8 Value);
- UINT8 MxI2cGPIOReadByte(UINT8 bMoreByte);
- UINT32 mmioRead(UINT32 addr)
- {
- volatile UINT32 dw = *((UINT32*)addr);
- return dw;
- }
- UINT32 mmioReadMask(UINT32 addr, UINT32 mask)
- {
- return mmioRead( addr ) & mask;
- }
- void mmioWrite(UINT32 addr, UINT32 data)
- {
- *(UINT32*)addr = data;
- }
- void mmioWriteMask(UINT32 addr, UINT32 mask, UINT32 data)
- {
- UINT32 dw;
- dw = mmioReadMask( addr, ~mask );
- mmioWrite( addr, ((data & mask) | dw) );
- }
- void i2cGPIOOpenDrainWrite(UINT8 index, UINT32 value)
- {
- UINT8 bits;
- // set GPIO output value
- bits = index ;
- mmioWriteMask(0xbe0f0610,(0x1 << bits),(0x0 << bits));
- // set GPIO input / output control register to "output mode"
- mmioWriteMask(0xbe0f0618,(0x1 << bits),(value << bits));
- // set "function selection" mux to "GPIO (set '01') "
- bits = (index % 16) * 2;
- mmioWriteMask(0xbe0f0604,(0x3 << bits),(0x1 << bits));
- }
- void MxI2cGPIOStart(void)
- {
- GpioI2CSatus = 0;
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,1);
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,0);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,0);
- udelay(LAG);
- }
- void MxI2cGPIOStop(void)
- {
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,0);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,1);
- udelay(LAG);
- i2cGPIO_readGPIO(GPIO_I2C_CLK);
- i2cGPIO_readGPIO(GPIO_I2C_DATA);
- udelay(LAG);
- }
- void MxI2cGPIORestart(void)
- {
- if(GpioI2CSatus) return;
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,0);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,0);
- udelay(LAG);
- }
- void MxI2cGPIOWriteByte(UINT8 Value)
- {
- UINT8 i;
- if(GpioI2CSatus) return;
- for(i=0;i<8;i++)
- {
- if(Value & 0x80)
- {
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,1);
- }
- else
- {
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,0);
- }
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,0);
- udelay(LAG);
- Value <<= 1;
- }
- i2cGPIO_readGPIO(GPIO_I2C_DATA);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,1);
- udelay(LAG);
- if(i2cGPIO_readGPIO(GPIO_I2C_DATA))
- {
- GpioI2CSatus = 1;
- }
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,0);
- udelay(LAG);
- }
- UINT8 MxI2cGPIOReadByte(UINT8 bMoreByte)
- {
- UINT8 i,Value;
- if(GpioI2CSatus) return 0;
- i2cGPIO_readGPIO(GPIO_I2C_DATA);
- udelay(LAG);
- Value = 0;
- for(i=0;i<8;i++)
- {
- Value <<= 1;
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,1);
- udelay(LAG);
- if(i2cGPIO_readGPIO(GPIO_I2C_DATA))
- {
- Value |= 1;
- }
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,0);
- udelay(LAG);
- }
- if(bMoreByte)
- {
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,0);
- }
- else
- {
- i2cGPIO_writeGPIO(GPIO_I2C_DATA,1);
- }
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_I2C_CLK,0);
- udelay(LAG);
- return Value;
- }
- void _GPIOI2C_0_WriteFun(UINT8 Mx, UINT8 DeviceID, UINT8 AddrLen, UINT32 Addr,UINT8 *pData, UINT32 DataLen,UINT8 Speed,UINT8 *Status)
- {
- UINT32 i;
- // printk(KERN_EMERG"Mx = %d",Mx);
- // printk(KERN_EMERG"DeviceID = 0x%x",DeviceID);
- // printk(KERN_EMERG"AddrLen = %d",AddrLen);
- // printk(KERN_EMERG"Addr = %d",Addr);
- // printk(KERN_EMERG"DataLen = %d",DataLen);
- // printk(KERN_EMERG"Speed = %d",Speed);
- DeviceID &= 0xFE;
- if(in_atomic())
- {
- DbgFunPrint("ID=%02x,Invalid Write Process!!",DeviceID);
- *Status = I2C_STATUS_DATA_ERROR;
- return;
- }
- down(&I2cDev.GPIOI2cMutex);
- MxI2cGPIOStart();
- MxI2cGPIOWriteByte(DeviceID);
-
- switch (AddrLen)
- {
- case ADDRESS_TYPE_BYTE:
- MxI2cGPIOWriteByte((UINT8) (Addr & 0xff));
- MxI2cGPIORestart();
- MxI2cGPIOWriteByte(DeviceID);
- break;
- case ADDRESS_TYPE_MULTIPLE:
- if( ((Addr&0x0f000000) >> 24) >= 1 ) { MxI2cGPIOWriteByte((UINT8) ((Addr>>0) & 0xff));}
- if( ((Addr&0x0f000000) >> 24) >= 2 ) { MxI2cGPIOWriteByte((UINT8) ((Addr>>8) & 0xff));}
- if( ((Addr&0x0f000000) >> 24) >= 3 ) { MxI2cGPIOWriteByte((UINT8) ((Addr>>16) & 0xff));}
- //if( ((Addr&0x0f000000) >> 24) >= 4 ) { MxI2cGPIOWriteByte((UINT8) ((Addr>>24) & 0xff));}
- MxI2cGPIORestart();
- MxI2cGPIOWriteByte(DeviceID);
- break;
- case ADDRESS_TYPE_NONE:
- break;
- default:
- printk("writeI2CviaGPIO write error:AddrLen must be equal to or less than 4.\n");
- GpioI2CSatus = I2C_STATUS_DATA_ERROR;
- break;
- }
- for(i=0;i<DataLen;i++)
- {
- MxI2cGPIOWriteByte(pData[i]);
- }
- MxI2cGPIOStop();
-
- *Status = GpioI2CSatus;
- up(&I2cDev.GPIOI2cMutex);
- }
- void _GPIOI2C_0_ReadFun(UINT8 Mx, UINT8 DeviceID, UINT8 AddrLen, UINT32 Addr,UINT8 *pData, UINT32 DataLen,UINT8 Speed,UINT8 *Status)
- {
- UINT32 i;
- // printk(KERN_EMERG"Mx = %d",Mx);
- // printk(KERN_EMERG"DeviceID = 0x%x",DeviceID);
- // printk(KERN_EMERG"AddrLen = %d",AddrLen);
- // printk(KERN_EMERG"Addr = %d",Addr);
- // printk(KERN_EMERG"DataLen = %d",DataLen);
- // printk(KERN_EMERG"Speed = %d",Speed);
- DeviceID &= 0xFE;
- if(in_atomic())
- {
- DbgFunPrint("ID=%02x,Invalid Read Process!!",DeviceID);
- *Status = I2C_STATUS_DATA_ERROR;
- return;
- }
- down(&I2cDev.GPIOI2cMutex);
- MxI2cGPIOStart();
- if(AddrLen != ADDRESS_TYPE_NONE)
- MxI2cGPIOWriteByte(DeviceID);
- switch (AddrLen)
- {
- case ADDRESS_TYPE_BYTE:
- MxI2cGPIOWriteByte((UINT8) (Addr & 0xff));
- break;
- case ADDRESS_TYPE_MULTIPLE:
- if( ((Addr&0x0f000000) >> 24) >= 1 ) { MxI2cGPIOWriteByte((UINT8) (Addr & 0xff));}
- if( ((Addr&0x0f000000) >> 24) >= 2 ) { MxI2cGPIOWriteByte((UINT8) ((Addr>>8) & 0xff));}
- if( ((Addr&0x0f000000) >> 24) >= 3 ) { MxI2cGPIOWriteByte((UINT8) ((Addr>>16) & 0xff));}
- //if( ((Addr&0x0f000000) >> 24) >= 4 ) { MxI2cGPIOWriteByte((UINT8) ((Addr>>24) & 0xff));}
- break;
- case ADDRESS_TYPE_NONE:
- break;
- default:
- printk(KERN_EMERG"writeI2CviaGPIO read error:DataLen must be equal to or less than 4.\n");
- GpioI2CSatus = I2C_STATUS_DATA_ERROR;
- break;
- }
- if (AddrLen != ADDRESS_TYPE_NONE)
- MxI2cGPIORestart();
- MxI2cGPIOWriteByte(DeviceID|1);
- for(i=0;i<DataLen-1;i++)
- {
- pData[i] = MxI2cGPIOReadByte(1);
- }
- pData[i] = MxI2cGPIOReadByte(0);
- MxI2cGPIOStop();
- *Status = GpioI2CSatus;
-
- up(&I2cDev.GPIOI2cMutex);
- }
- //EXPORT_SYMBOL(DRV_GPIOI2C_ReadFun);
- void i2cGPIO_writeGPIO(UINT8 idx, UINT8 val)
- {
- INT8 apiSel=0;
- if(apiSel == 0) i2cGPIOOpenDrainWrite(idx,val);
- if(apiSel == 1) GPIOWriteFun(idx,val);
- if(apiSel == 2)
- {
- if(idx == GPIO_I2C_CLK) GPIOSetValueByPinFunc(GPIO_PIN_GPIO_I2C_SCL, (val == 1) ? GPIO_FUNC_ONLEVEL:GPIO_FUNC_OFFLEVEL);
- if(idx == GPIO_I2C_DATA) GPIOSetValueByPinFunc(GPIO_PIN_GPIO_I2C_SDA, (val == 1) ? GPIO_FUNC_ONLEVEL:GPIO_FUNC_OFFLEVEL);
- }
- }
- UINT8 i2cGPIO_readGPIO(UINT8 idx)
- {
- INT8 apiSel=0;
- if(apiSel == 0) {return GPIOReadFun(idx);}
- else if(apiSel == 1) {return GPIOReadFun(idx);}
- else if(apiSel == 2)
- {
- if(idx == GPIO_I2C_CLK) return GPIOGetValueByPinFunc(GPIO_PIN_GPIO_I2C_SCL);
- if(idx == GPIO_I2C_DATA) return GPIOGetValueByPinFunc(GPIO_PIN_GPIO_I2C_SDA);
- return 0;
- }
- else return 0;
- }
- #ifdef CONFIG_ENABLE_2ND_GPIO_I2C
- void MxI2cXGPIOStart(void)
- {
- GpioI2CSatus = 0;
-
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,1);
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,0);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,0);
- udelay(LAG);
- }
- void MxI2cXGPIOStop(void)
- {
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,0);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,1);
- udelay(LAG);
- i2cGPIO_readGPIO(GPIO_X_I2C_CLK);
- i2cGPIO_readGPIO(GPIO_X_I2C_DATA);
- udelay(LAG);
- }
- void MxI2cXGPIORestart(void)
- {
- if(GpioI2CSatus) return;
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,0);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,0);
- udelay(LAG);
- }
- void MxI2cXGPIOWriteByte(UINT8 Value)
- {
- UINT8 i;
- if(GpioI2CSatus) return;
- for(i=0;i<8;i++)
- {
- if(Value & 0x80)
- {
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,1);
- }
- else
- {
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,0);
- }
-
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,0);
- udelay(LAG);
- Value <<= 1;
- }
-
- i2cGPIO_readGPIO(GPIO_X_I2C_DATA);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,1);
- udelay(LAG);
- if(i2cGPIO_readGPIO(GPIO_X_I2C_DATA))
- {
- GpioI2CSatus = 1;
- }
-
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,0);
- udelay(LAG);
- }
- UINT8 MxI2cXGPIOReadByte(UINT8 bMoreByte)
- {
- UINT8 i,Value;
- if(GpioI2CSatus) return 0;
- i2cGPIO_readGPIO(GPIO_X_I2C_DATA);
- udelay(LAG);
- Value = 0;
- for(i=0;i<8;i++)
- {
- Value <<= 1;
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,1);
- udelay(LAG);
- if(i2cGPIO_readGPIO(GPIO_X_I2C_DATA))
- {
- Value |= 1;
- }
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,0);
- udelay(LAG);
- }
- if(bMoreByte)
- {
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,0);
- }
- else
- {
- i2cGPIO_writeGPIO(GPIO_X_I2C_DATA,1);
- }
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,1);
- udelay(LAG);
- i2cGPIO_writeGPIO(GPIO_X_I2C_CLK,0);
- udelay(LAG);
- return Value;
- }
- void _GPIOI2C_1_WriteFun(UINT8 Mx, UINT8 DeviceID, UINT8 AddrLen, UINT32 Addr,UINT8 *pData, UINT32 DataLen,UINT8 Speed,UINT8 *Status)
- {
- UINT32 i;
- // printk(KERN_EMERG"Mx = %d",Mx);
- // printk(KERN_EMERG"DeviceID = 0x%x",DeviceID);
- // printk(KERN_EMERG"AddrLen = %d",AddrLen);
- // printk(KERN_EMERG"Addr = %d",Addr);
- // printk(KERN_EMERG"DataLen = %d",DataLen);
- // printk(KERN_EMERG"Speed = %d",Speed);
- DeviceID &= 0xFE;
- if(in_atomic())
- {
- DbgFunPrint("ID=%02x,Invalid Write Process!!",DeviceID);
- *Status = I2C_STATUS_DATA_ERROR;
- return;
- }
- down(&I2cDev.GPIOXI2cMutex);
- MxI2cXGPIOStart();
- MxI2cXGPIOWriteByte(DeviceID);
-
- switch (AddrLen)
- {
- case ADDRESS_TYPE_BYTE:
- MxI2cXGPIOWriteByte((UINT8) (Addr & 0xff));
- MxI2cXGPIORestart();
- MxI2cXGPIOWriteByte(DeviceID);
- break;
- case ADDRESS_TYPE_MULTIPLE:
- if( ((Addr&0x0f000000) >> 24) >= 1 ) { MxI2cXGPIOWriteByte((UINT8) ((Addr>>0) & 0xff));}
- if( ((Addr&0x0f000000) >> 24) >= 2 ) { MxI2cXGPIOWriteByte((UINT8) ((Addr>>8) & 0xff));}
- if( ((Addr&0x0f000000) >> 24) >= 3 ) { MxI2cXGPIOWriteByte((UINT8) ((Addr>>16) & 0xff));}
- //if( ((Addr&0x0f000000) >> 24) >= 4 ) { MxI2cXGPIOWriteByte((UINT8) ((Addr>>24) & 0xff));}
- MxI2cXGPIORestart();
- MxI2cXGPIOWriteByte(DeviceID);
- break;
- case ADDRESS_TYPE_NONE:
- break;
- default:
- printk("writeI2CviaGPIO write error:AddrLen must be equal to or less than 4.\n");
- GpioI2CSatus = I2C_STATUS_DATA_ERROR;
- break;
- }
- for(i=0;i<DataLen;i++)
- {
- MxI2cXGPIOWriteByte(pData[i]);
- }
- MxI2cXGPIOStop();
-
- *Status = GpioI2CSatus;
- up(&I2cDev.GPIOXI2cMutex);
- }
- void _GPIOI2C_1_ReadFun(UINT8 Mx, UINT8 DeviceID, UINT8 AddrLen, UINT32 Addr,UINT8 *pData, UINT32 DataLen,UINT8 Speed,UINT8 *Status)
- {
- UINT32 i;
- // printk(KERN_EMERG"Mx = %d",Mx);
- // printk(KERN_EMERG"DeviceID = 0x%x",DeviceID);
- // printk(KERN_EMERG"AddrLen = %d",AddrLen);
- // printk(KERN_EMERG"Addr = %d",Addr);
- // printk(KERN_EMERG"DataLen = %d",DataLen);
- // printk(KERN_EMERG"Speed = %d",Speed);
- DeviceID &= 0xFE;
- if(in_atomic())
- {
- DbgFunPrint("ID=%02x,Invalid Read Process!!",DeviceID);
- *Status = I2C_STATUS_DATA_ERROR;
- return;
- }
- down(&I2cDev.GPIOXI2cMutex);
- MxI2cXGPIOStart();
- if(AddrLen != ADDRESS_TYPE_NONE)
- MxI2cXGPIOWriteByte(DeviceID);
- switch (AddrLen)
- {
- case ADDRESS_TYPE_BYTE:
- MxI2cXGPIOWriteByte((UINT8) (Addr & 0xff));
- break;
- case ADDRESS_TYPE_MULTIPLE:
- if( ((Addr&0x0f000000) >> 24) >= 1 ) { MxI2cXGPIOWriteByte((UINT8) (Addr & 0xff));}
- if( ((Addr&0x0f000000) >> 24) >= 2 ) { MxI2cXGPIOWriteByte((UINT8) ((Addr>>8) & 0xff));}
- if( ((Addr&0x0f000000) >> 24) >= 3 ) { MxI2cXGPIOWriteByte((UINT8) ((Addr>>16) & 0xff));}
- //if( ((Addr&0x0f000000) >> 24) >= 4 ) { MxI2cXGPIOWriteByte((UINT8) ((Addr>>24) & 0xff));}
- break;
- case ADDRESS_TYPE_NONE:
- break;
- default:
- printk(KERN_EMERG"writeI2CviaGPIO read error:DataLen must be equal to or less than 4.\n");
- GpioI2CSatus = I2C_STATUS_DATA_ERROR;
- break;
- }
- if (AddrLen != ADDRESS_TYPE_NONE)
- MxI2cXGPIORestart();
- MxI2cXGPIOWriteByte(DeviceID|1);
- for(i=0;i<DataLen-1;i++)
- {
- pData[i] = MxI2cXGPIOReadByte(1);
- }
- pData[i] = MxI2cXGPIOReadByte(0);
- MxI2cXGPIOStop();
- *Status = GpioI2CSatus;
-
- up(&I2cDev.GPIOXI2cMutex);
- }
- #endif
- void DRV_GPIOI2C_WriteFun(UINT8 Mx, UINT8 DeviceID, UINT8 AddrLen, UINT32 Addr,UINT8 *pData, UINT32 DataLen,UINT8 Speed,UINT8 *Status)
- {
- if(Mx==0)
- _GPIOI2C_0_WriteFun(Mx, DeviceID, AddrLen, Addr, pData, DataLen, Speed, Status);
- #ifdef CONFIG_ENABLE_2ND_GPIO_I2C
- if(Mx==1)
- _GPIOI2C_1_WriteFun(Mx, DeviceID, AddrLen, Addr, pData, DataLen, Speed, Status);
- #endif
- }
- EXPORT_SYMBOL(DRV_GPIOI2C_WriteFun);
- void DRV_GPIOI2C_ReadFun(UINT8 Mx, UINT8 DeviceID, UINT8 AddrLen, UINT32 Addr,UINT8 *pData, UINT32 DataLen,UINT8 Speed,UINT8 *Status)
- {
- if(Mx==0)
- _GPIOI2C_0_ReadFun(Mx, DeviceID, AddrLen, Addr, pData, DataLen, Speed, Status);
- #ifdef CONFIG_ENABLE_2ND_GPIO_I2C
- if(Mx==1)
- _GPIOI2C_1_ReadFun(Mx, DeviceID, AddrLen, Addr, pData, DataLen, Speed, Status);
- #endif
- }
- EXPORT_SYMBOL(DRV_GPIOI2C_ReadFun);
|