Please send messages to the help list, I'm cc'ing this back there...

I believe a similar protocol works for I2C register reading.
The devices I've worked with need a command that specifies
which register will be read, followed by the actual read.
Again, study your device's spec sheet carefully and you will
probably find the information -- sometimes it's written in a
kind of code invented by the authors though.

MS

bin chen wrote:
> Hi,
> Thaks for your reply, I wrote the data to the slave device just as you 
> tell me. the first byte of the data is register address, and the 
> followings are the data i should be writeen to the register. But how can 
> i read the data from specify register? The command async command error_t 
> read(i2c_flags_t flags, uint16_t addr, uint8_t length, uint8_t* data); 
> of interface I2Cpacket only provides the parameters of slave device 
> address. Thanks for your help!
> Best regards
> 
> 2010/10/19 Michael Schippling <[email protected] <mailto:[email protected]>>
> 
>     Usually the message sent to the I2C device
>     contains the register address along with
>     the data. Look carefully at the message
>     format spec for your device.
> 
>     MS
> 
>     bin chen wrote:
> 
>         Hi,
>             I need to connect an I2C device to the telosb mote. The I2C
>         device has a device address, besides, it has mutiple registers.
>         When I use the device, some registers are needed to be writeen
>         and read. But I found that the I2Cpacket interface provides the
>         command/event only with the parameters of slave device address
>         without register address. How can I do to writen or read one of
>         the registers? Thanks for your help!
>         Best regards,
>         Bob
> 
> 
>         
> ------------------------------------------------------------------------
> 
>         _______________________________________________
>         Tinyos-help mailing list
> 
>         [email protected]
>         <mailto:[email protected]>
>         
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 
> 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to