From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3852 invoked by alias); 18 Feb 2007 21:56:36 -0000 Received: (qmail 3841 invoked by uid 22791); 18 Feb 2007 21:56:35 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 18 Feb 2007 21:56:29 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HIu13-0005fu-86 for ecos-discuss@sources.redhat.com; Sun, 18 Feb 2007 22:56:17 +0100 Received: from grante.dsl.visi.com ([208.42.141.248]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 18 Feb 2007 22:56:17 +0100 Received: from grante by grante.dsl.visi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 18 Feb 2007 22:56:17 +0100 To: ecos-discuss@sources.redhat.com From: Grant Edwards Date: Sun, 18 Feb 2007 21:56:00 -0000 Message-ID: References: User-Agent: slrn/0.9.8.1 (Linux) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: [ECOS] Re: i2c questions X-SW-Source: 2007-02/txt/msg00188.txt.bz2 On 2007-02-18, Grant Edwards wrote: > On 2007-02-18, Grant Edwards 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