This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: i2c questions


On 2007-02-18, Grant Edwards <grante@visi.com> wrote:
> On 2007-02-18, Grant Edwards <grante@visi.com> wrote:
>
>> 2) There doesn't seem to be any way to determine when writing
>>    zero bytes of data with cyg_i2c_tx() whether the operation
>>    was successful or not, since it returns 0 for both cases.  I
>>    presume one should use the lower-level "transaction"
>>    routines for this case?
>
> That doesn't seem to work.  i2c_transaction_tx always seems to
> write an extra byte.  If I tell it to send 1 byte, it sends 2.

Apparently the "start" flag also causes an address byte to be
sent?

> How do I send a single byte on the i2c bus??

I found a work-around that allows me to send 2 bytes, so I've
got my part talking -- but it bugs me that there's always an
extra useless byte being sent.

It would be quite useful if one were able to dermine the
difference between success and failure when calling tx/rx
functions with a zero byte-count.

Why not return -1 on failure?  That way you can tell the
difference between failure and successfully reading or writing
0 bytes.

-- 
Grant Edwards                   grante             Yow!  That's a decision
                                  at               that can only be made
                               visi.com            between you & SY SPERLING!!


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]