54 #define ONEWIRE_UART_BAUD_SLOW 9600
55 #define ONEWIRE_UART_BAUD_FAST 115200
59 ONEWIRE_CMD_SEARCH_ROM = 0xF0,
60 ONEWIRE_CMD_READ_ROM = 0x33,
61 ONEWIRE_CMD_MATCH_ROM = 0x55,
62 ONEWIRE_CMD_SKIP_ROM = 0xCC,
63 ONEWIRE_CMD_ALARM_SEARCH = 0xEC
68 #define ONEWIRE_ALWAYS_SKIP_ROM 0
70 #define ONEWIRE_ROM_CODE_LENGTH 8
71 typedef uint64_t ow_rom_code_t;
void ow_init(void)
Initialize the 1-wire driver.
void ow_match_rom(const ow_rom_code_t id)
Issue a 1-wire MATCH ROM command.
void ow_skip_or_match_rom(const ow_rom_code_t id)
Shorthand function for MATCH ROM or SKIP ROM if id is zero.
void ow_read_bytes(uint8_t *dest, const uint8_t count)
Read a sequence of bytes from the 1-wire bus.
void ow_reset(void)
Reset the 1-wire bus.
void ow_write_byte(const uint8_t data)
Shorthand function to write a single byte to the 1-wire bus.
void ow_skip_rom(void)
Issue a 1-wire SKIP ROM command.
ow_rom_code_t ow_read_rom(void)
Issue a 1-wire READ ROM command.
void ow_write_bytes(const uint8_t *src, const uint8_t count)
Write a sequence of bytes to the 1-wire bus.
uint8_t ow_compute_crc(const uint8_t *data, const uint8_t count)
Compute a 1-wire 8-bit CRC.