阅读:3437回复:6
在WINCE 6下面如果访问通过I2C访问EEPROM
我使用S3C6410的开发板,BSP包里面已经I2C的驱动了,但我不知道,我如何通过I2C驱动去实现读写EEPROM,并且如何在应用程序里面使用??
请各位高手帮帮忙。 |
|
沙发#
发布于:2009-11-18 18:36
我没有6410的BSP,猜测你可能应该这样访问,在应用里通过CreateFile(TEXT("IIC1:"),.......;这样打开IIC驱动,然后通过IOCTL将EEPROM的IIC地址设置进去,或者直接有一个结构体里面有一项就是IIC地址的,然后调用IOCTL或者write,read来读写EEPROM
以上仅供参考,具体还要看你的IIC驱动如何实现的 |
|
板凳#
发布于:2009-11-19 08:16
;; I2C Bus Driver
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\IIC] "Prefix"="IIC" "Dll"="s3c6410_iic.dll" "Order"=dword:5 "Index"=dword:0 "Mode"=dword:1 ; Mode: 0 = POLLING, 1 = INTERRUPT "SlaveAddress"=dword:0 ; Bus Driver's Slave Address "FriendlyName"="IIC Bus Driver" "IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}" ; Power-manageable generic 这个是platform.reg里面的注册信息。 我不清楚是否这样写就可以了 HANDLE handle=CreateFile(_T("IIC1:"),GENERIC_READ|GENERIC_WRITE,0, NULL,OPEN_EXISTING,0,NULL); |
|
地板#
发布于:2009-11-19 08:21
请大侠在帮我看看!!
|
|
地下室#
发布于:2009-11-20 20:29
引用第3楼zhangjyabc于2009-11-19 08:21发表的 : 这个看注册表是看不出来的,方便的话,发bsp到我的信箱bluesky.coco@gmail.com 帮你看看 |
|
|
5楼#
发布于:2009-12-30 23:12
一直ACK not reciver
|
|
6楼#
发布于:2009-12-30 23:14
HW_Open(0xD2A53C40)
+CalculateClockSet(0xD2A53C40), Clock(3000) -CalculateClockSet(0xD2A53C40), ClockSel(1), ClockDiv(42) +HW_SetRegister(0xD2A53C40) -HW_SetRegister(0xD2A53C40) -HW_Open(0xD2A53C40) -IIC_Open handle xD2A53C40, xD0722680, Ref x3 +IIC_IOControl(0xD2A53C40, 262152-262160, 0x1AEEB4, 4, 0x0, 0, 0x1AEEB8) +CalculateClockSet(0xD2A53C40), Clock(200000) -CalculateClockSet(0xD2A53C40), ClockSel(1), ClockDiv(255) -IIC_IOControl Success Ecode=31 (len=0) +IIC_IOControl(0xD2A53C40, 262144-262160, 0x181D60, 12, 0x1AE6F0, 12, 0x181D6C) ------- read 1------ +HW_Read(0xD2A53C40) +HW_SetRegister(0xD2A53C40) -HW_SetRegister(0xD2A53C40) +HW_Write(0xD2A53C40) [IIC TX]Slave Address is 0xA0 I2C_IST[0xd2a53c40, 0]: ACK NOT received --write-23724038- [IIC TX THREAD]g_pIICReg->IICDS is 0x00 I2C_IST[0xd2a53c40, 1]: ACK NOT received --write-23724038- SetEvent DONE -HW_Write(0xD2A53C40) I2C_IST[0xd2a53c40, 0]: ACK NOT received --read-23724038- I2C_IST[0xd2a53c40, 1]: ACK NOT received --read-23724038- [IIC ERROR]RX Time out. +HW_Read(0xD2A53C40) ------- read 2 ------ -IIC_IOControl Error Ecode=1460 (len=0) +IIC_IOControl(0xD2A53C40, 262144-262160, 0x181D60, 12, 0x1AE6F0, 12, 0x181D6C) |
|