okokok, I found it again (in T1 at least) in
tos/platform/avrmote/avrhardware.h ::
#define TOSH_ASSIGN_PIN(name, port, bit) \
static inline void TOSH_SET_##name##_PIN() {sbi(PORT##port , bit);} \
static inline void TOSH_CLR_##name##_PIN() {cbi(PORT##port , bit);} \
static inline int TOSH_READ_##name##_PIN() \
{return (inp(PIN##port) & (1 << bit)) != 0;} \
static inline void TOSH_MAKE_##name##_OUTPUT() {sbi(DDR##port , bit);} \
static inline void TOSH_MAKE_##name##_INPUT() {cbi(DDR##port , bit);}
I just posted a reply to a question about TOSH_ASSIGN/TOSH_SET
and the above is the source. Looks like you may use TOSH_READ
in a similar manner.
And then for extra credit I (once again) found the defs for the
lowlevel accessors like sbi() and cbi() in:
/usr/local/avr/include/avr/sfr_defs.h
and there appear to be bit_is_{set,clr}() macros. Also it looks like
they are all implemented using port read/write even though there are
probably ASM bit level instructions...weird.
MS
[EMAIL PROTECTED] wrote:
I'm having a hard time finding sample code to read a value from an
individual pin. I'm working with an Intel SHIMMER mote, and I have a
signal going to a pin in the bluetooth pad. Any suggestions for how to
get the value on this pin?
Thanks,
-- Nathan
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help