I'm trying to get the OMAP35x Zoom Development kit to communicate over I2C using Win CE 6.0.
The goal is to communicate with an I2C device connected to I2C2 bus. Our device is at address 0x39.
I used three API functions CreateFile, DeviceIoControl, WriteFile, and ReadFile to open I2C2 port, set slave address, and transmitted data in and out.
Here is portion of my code.
hPort = CreateFile(TEXT("I2C2:"),GENERIC_READ | GENERIC_WRITE,0,0,OPEN_EXISTING,0,NULL);
result = DeviceIoControl(hPort, IOCTL_I2C_SET_SLAVE_ADDRESS, &dwSlaveAddr, sizeof(dwSlaveAddr), NULL, 0, NULL, NULL);
SetFilePointer(hPort, 0, NULL, FILE_BEGIN);
result = WriteFile(hPort, outdata, 2, &len, 0);
I never get to talk to the device.
Has anyone else seen this issue or do you have any ideas what may be wrong?
|