Hi Paul,

> On Apr 19, 2016, at 11:42 AM, [email protected] wrote:
> 
> All,
> 
> Please take a look at the i2c HAL api in
> 
> https://github.com/apache/incubator-mynewt-core/pull/44
> 
> I chose a simple blocking API for now to get some I2C functionality fast.   
> Its mostly just read/write, with a few other functions.
> 
> 
>  1.  probe - I found that immediately after writing this I need some way to 
> discovery what was on the bus.  I wrote this simple function to look for a 
> single address.
>  2.  Start/stop - Many devices are just read/write registers so there is no 
> need to control transactions on the bus.  However, for serial eeprom random 
> access, its more efficient to write an address then read the data.  In this 
> case you would issue start,write,read,stop.


What’s a bit confusing about the API is that the i2c address is present
in argument for both read and write operation. To me it would make
sense to include the i2c address in the call to start(), but not to 
read()/write().

Let’s say I have device with i2c address X. And what I need to do
is write 2 bytes of address to it, followed by read of 1024 bytes.
So the transaction would look like : start - send address - write 2 bytes - 
read 1024 bytes - stop.

Also, if i2c bus is busy/miswired is there a way to time-out during start?
I think I also want a timeout when sending i2c address; in case the device is
not there.

Hope this helps,
M

Reply via email to