On Thu, Aug 29, 2013 at 6:45 PM, He Dajiang (I2R) <[email protected]>wrote:

> thx, Janos.
>
> I used the following low level calls to make it work:
>
>     cli();
>     PORTD = PORTD | 0x03;
>     sei();
>
> For you suggestion, I guess it is like
>
>         SensorP.IO0 -> HplAtm128GeneralIOC.PortE0;   // SCL
>         SensorP.IO1 -> HplAtm128GeneralIOC.PortE1;   // SDA
>
> However, I don't quite understand what the following calls do:
>         call IO.makeInput();
>         call IO.set();            // is it high or low
> Call IO.set(1) leads to compiling error.
>

First I would recommend reading the source code to answer your own question.

I don't remember how things work on the MicaZ but the Msp430 does something
similar.

A given digital I/O pin can be programmed to behave differently.  I.E. you
can have it be an input or an output or connected to some different i/o h/w
such as a UART or a SPI.  The call to makeInput sets the h/w up so the pin
referenced as "IO" is configured as an input.

IO.set is a call that causes the pin to be set to a particular state.
 Typically ".set" will set the pin to a high state (set).  .clear or .clr
will set the pin to a low value.

.set does not take a parameter and this is why "call IO.set(1)" gives you a
compilation error.


like I said earlier you really should have taken a look at the source code
yourself and answered these questions yourself.

when you make a build you can see exactly which files are being processed
by doing "make verbose <platform>"


eric




> ________________________________________
> From: [email protected] [[email protected]] on behalf of Janos
> Sallai [[email protected]]
> Sent: Thursday, 29 August, 2013 9:22:24 PM
> To: He Dajiang (I2R)
> Cc: [email protected]
> Subject: Re: [Tinyos-help] IO configuration
>
> The best way to go is wiring the PortD interface of GeneralIOC, and
> using the commands of the interface to get/set the levels and
> directions of the pins.
>
> Janos
>
> On Thu, Aug 29, 2013 at 4:23 AM, He Dajiang (I2R)
> <[email protected]> wrote:
> > Hi,
> >
> > For Micaz, what is the proper call to pull up the following two pins:
> >
> > PORTD0 and PORTD1
> >
> > Is it SET_BIT(PORTD, 0x03)?
> >
> > Best Regards
> >
> > Institute for Infocomm Research disclaimer:  "This email is confidential
> and may be privileged. If you are not the intended recipient, please delete
> it and notify us immediately. Please do not copy or use it for any purpose,
> or disclose its contents to any other person. Thank you."
> >
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
> Institute for Infocomm Research disclaimer:  "This email is confidential
> and may be privileged. If you are not the intended recipient, please delete
> it and notify us immediately. Please do not copy or use it for any purpose,
> or disclose its contents to any other person. Thank you."
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to