Hi list,
Sorry if this question has been asked.
I am wondering why in the I2C interface functions read and write, there is no
field for register address.
async command error_t read(i2c_flags_t flags, uint16_t addr, uint8_t length, u
int8_t* data);
async command error_t write(i2c_flags_t flags, uint16_t addr, uint8_t length,
uint8_t* data);
I guess the addr field is for device address, isn't it?
For reading data from a register, my function calls like:
call I2CPacket.write(I2C_START | I2C_STOP, deviceAddress, 1, registerAddr)
if sucessful,
call I2CPacket.read(I2C_START | I2C_STOP, deviceAddress, NumberOfBytes2Read
+ 1, &readData);
By using the above method, seemingly I am able to read values through I2C.
How about write? Anyone can shed some light on this issue.
Thx.
Institute for Infocomm Research disclaimer: "This email is confidential and
may be privileged. If you are not the intended recipient, please delete it and
notify us immediately. Please do not copy or use it for any purpose, or
disclose its contents to any other person. Thank you."
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help