Hello.
I'm a complete novice in everything except maybe breathing, so sorry if I'm not being clear, but here goes:
I have a function in C which writes bytes to a circuit via an I2C bus, and in the header file it looks like this:
BOOL WINAPI JidaI2CWrite(HJIDA hJida, DWORD dwType, BYTE bAddr, LPBYTE pBytes, DWORD dwLen);
- hJida: Board handle.
- dwType: Zero-based number of the I2C bus.
- bAddr: Address of the device on the I2C bus, the full 8 bits as it is written to the bus.
- pBytes: Pointer to location that contains the bytes.
- dwLen: Number of bytes to write.
If I wanted to write just one byte to a circuit with the address 0x98, I would do something like this:
unsigned char writing[1];
writing[0]=0x10;
unsigned char *pointer;
pointer = &writing[0];
JidaI2CWrite(hJida,0,0x98,pointer,1);
which seems to work, but if I wanted to write two bytes, say 0x10FF, it doesn't. So how do I make a pointer that points to two bytes instead of just one?
Thanks