67 #define ONEWIRE_BIT PA0
68 #define ONEWIRE_PIN PINA
69 #define ONEWIRE_PORT PORTA
70 #define ONEWIRE_DDR DDRA
77 #define ONEWIRE_STRONG_PU_ON ONEWIRE_PORT |= ONEWIRE_MASK; ONEWIRE_DDR |= ONEWIRE_MASK;
78 #define ONEWIRE_STRONG_PU_OFF ONEWIRE_DDR &= ~ONEWIRE_MASK;
85 #define ONEWIRE_MASK (1<<ONEWIRE_BIT)
92 #define ONEWIRE_MATCH_ROM 0x55
93 #define ONEWIRE_SEARCH_ROM 0xF0
94 #define ONEWIRE_SKIP_ROM 0xCC
95 #define ONEWIRE_READ_ROM 0x33
96 #define ONEWIRE_ALARM_SEARCH 0xEC
208 uint8_t
onewire_crc(
const uint8_t *data, uint8_t cnt);
uint8_t onewire_reset(void)
OneWire reset.
uint8_t onewire_match_rom(const uint8_t rom[8])
select device on bus
void onewire_write_byte(uint8_t data)
write one byte
uint8_t onewire_read_rom(uint8_t rom[8])
read ROM of device
void onewire_search_init(uint8_t buffer[8])
init rom search buffer and internal variables
uint8_t onewire_crc(const uint8_t *data, uint8_t cnt)
calculate CRC over data array, fast version, 0.3ms for 8 bytes @1MHz
void onewire_write_bit(uint8_t data)
write one bit to bus
uint8_t onewire_search(uint8_t buffer[8], uint8_t cmd)
scan OneWire bus for normal ROM or alarm search
uint8_t onewire_skip_rom(void)
select device on bus
uint8_t onewire_read_bit(void)
read one bit from bus
uint8_t onewire_read_byte(void)
read one byte
uint8_t onewire_alarm_search(uint8_t buffer[8])
scan OneWire bus for devices with active alarm flag
uint8_t onewire_search_rom(uint8_t buffer[8])
scan OneWire bus for ROMs