public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Grant Edwards <grante@visi.com>
To: ecos-discuss@sources.redhat.com
Subject: [ECOS]  Re: i2c questions
Date: Sun, 18 Feb 2007 21:56:00 -0000	[thread overview]
Message-ID: <erai1m$752$1@sea.gmane.org> (raw)
In-Reply-To: <era7i3$o7$1@sea.gmane.org>

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

  reply	other threads:[~2007-02-18 21:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18 17:51 [ECOS] " Grant Edwards
2007-02-18 18:57 ` [ECOS] " Grant Edwards
2007-02-18 21:56   ` Grant Edwards [this message]
2007-02-19  7:23 ` [ECOS] building and debugging Laurie Gellatly
2007-02-20 19:32   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='erai1m$752$1@sea.gmane.org' \
    --to=grante@visi.com \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).