54 #include "dev/ds2411.h"
56 unsigned char ds2411_id[8];
58 #ifdef CONTIKI_TARGET_SKY
68 #define OUTP_0() (P2DIR |= PIN)
69 #define OUTP_1() (P2DIR &= ~PIN)
72 #define INP() (P2IN & PIN)
90 #define udelay(u) clock_delay((u*8 - 14)/6)
96 #define udelay_6() { _NOP(); _NOP(); _NOP(); _NOP(); _NOP(); _NOP(); _NOP(); }
103 #define udelay_tA() udelay_6()
129 owwriteb(
unsigned byte)
176 crc8_add(
unsigned acc,
unsigned byte)
180 for(i = 0; i < 8; i++) {
182 acc = (acc >> 1) ^ 0x8c;
194 unsigned family, crc, acc;
206 for(i = 7; i >= 2; i--) {
207 ds2411_id[i] = owreadb();
216 acc = crc8_add(0x0, family);
217 for(i = 7; i >= 2; i--) {
218 acc = crc8_add(acc, ds2411_id[i]);
221 #ifdef CONTIKI_TARGET_SKY
232 memset(ds2411_id, 0x0,
sizeof(ds2411_id));