19 #ifndef OWI_DRIVER_ARDUINO_H 20 #define OWI_DRIVER_ARDUINO_H 26 #define MATCH() m_owi.skip_rom() 78 if (!
MATCH())
return (-1);
92 if (!
MATCH())
return (-1);
107 if (!
MATCH())
return (-1);
122 if (!
MATCH())
return (-1);
126 delayMicroseconds(200);
127 if (!
m_owi.
read(&res,
sizeof(res)))
return (-1);
140 if (!
MATCH())
return (-1);
154 if (!
MATCH())
return (-1);
166 if (!
MATCH())
return (-1);
204 out.print(F(
"family="));
205 if (
m_rom[0] < 0x10) out.print(
'0');
206 out.print(
m_rom[0], HEX);
207 out.print(F(
",rom="));
209 if (
m_rom[i] < 0x10) out.print(
'0');
210 out.print(
m_rom[i], HEX);
212 out.print(F(
",crc="));
214 if (crc < 0x10) out.print(
'0');
242 } __attribute__((packed));
uint8_t crc
Cyclic Redundancy Check-sum.
Read digital pin: 6b pin, 1b return.
int print_rom(Print &out=Serial)
static const uint8_t FAMILY_CODE
Arduino(OWI &owi, uint8_t *rom=NULL)
Get number of analog inputs: 6b return.
Write analog pin: 6b pin, 8b duty.
Set pin mode: 6b pin, 2b mode.
int label_rom(uint8_t nr)
int digitalWrite(int pin, int value)
uint16_t value
Analog value read.
virtual void write(uint8_t value, uint8_t bits=CHARBITS)=0
Software::Serial< BOARD::D0 > Serial
Software::OWI< BOARD::D7 > owi
Set short address (8-bit).
Write digital pin: 6b pin, 1b value.
int analogWrite(int pin, int duty)
Get number of digital pins: 6b return.
Read analog pin: 6b pin, 16b+8b return.
bool read_rom(uint8_t *code)
int pinMode(int pin, int mode)
static const size_t ROM_MAX
virtual uint8_t read(uint8_t bits=CHARBITS)=0
Device(OWI &owi, const uint8_t *rom=NULL)