[En-Nut-Discussion] TwMasterTransact is blocked

CAMBON, Olivier Olivier.CAMBON at astrium.eads.net
Tue Sep 11 14:03:53 CEST 2012


Hello Uwe,
I don't understand what you mean "the old API".
Where could I found this.

Thanks for your help.

Olivier.

_________________________________________
Olivier CAMBON
ASTRIUM Satellites,
Tests and Products - ASG83 - CZ108
Email : olivier.cambon at astrium.eads.net
Phone : Int.+ 33(0)5 62 19 62 29
_________________________________________


-----Original Message-----
From: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Uwe Bonnes
Sent: Tuesday, September 11, 2012 10:52 AM
To: Ethernut User Chat (English)
Subject: Re: [En-Nut-Discussion] TwMasterTransact is blocked

>>>>> "CAMBON," == CAMBON, Olivier <Olivier.CAMBON at astrium.eads.net>
writes:

    CAMBON,> Dear all, I am a new user of the board Ethernut 2.1 ver C
with
    CAMBON,> Nut/OS 4.10.1.  In my system, the ethernut board drives
some
    CAMBON,> slave electronic using TWI / I2C bus.

    CAMBON,> I found in the documentation the API TwMasterRegRead and
    CAMBON,> TwMasterRegWrite but it seems that they are not implemented
for
    CAMBON,> AVR.  So, a wrote my own "i2c_get" and "i2c_set" API.

    CAMBON,> The problem is that sometimes, in the function "i2c_set",
the
    CAMBON,> call to "TwMasterTransact" is blocked.  I tried with or
without
    CAMBON,> timeout. The result is the same. The TwMasterTransact does
NOT
    CAMBON,> return.
Maybe the API is not yet available for AVR in 4.10.
You should try again with the old API with something like

      TwInit(0);
      if (TwMasterError())
        {
          /*FIXME: Toggle some pin here*/
        }    
      TwIOCtl(TWI_SETSPEED,&TWI_speed);
      if (TwMasterError())
        {
          /*FIXME: Toggle some pin here*/
        }
      rc =TwMasterTransact(a, lbuf, 1, NULL, 0, 1);

It's a pity that neither there is an example in the app directory using
either the old or the new Api. I will try to find time to write an
example,
but don't hold your breath.

Bye
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
Ce courriel (incluant ses eventuelles pieces jointes) peut contenir des informations confidentielles et/ou protegees ou dont la diffusion est restreinte. Si vous avez recu ce courriel par erreur, vous ne devez ni le copier, ni l'utiliser, ni en divulguer le contenu a quiconque. Merci d'en avertir immediatement l'expediteur et d'effacer ce courriel de votre systeme. Astrium decline toute responsabilite en cas de corruption par virus, d'alteration ou de falsification de ce courriel lors de sa transmission par voie electronique.
This email (including any attachments) may contain confidential and/or privileged information or information otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately, do not copy this message or any attachments and do not use it for any purpose or disclose its content to any person, but delete this message and any attachments from your system. Astrium disclaims any and all liability if this email transmission was virus corrupted, altered or falsified. 
---------------------------------------------------------------------
Astrium SAS (393 341 516 RCS Nanterre) - Capital: 16.587.728 EUR - Siege social: 12 rue Pasteur, 92150 Suresnes, France




More information about the En-Nut-Discussion mailing list