30#define ONEWIRE_ROM_BYTES 8
32#define ONEWIRE_ROM_BITS (ONEWIRE_ROM_BYTES * 8)
34#define ONEWIRE_BITS_PER_BYTE 8
36#define ONEWIRE_MAX_SLOTS 256u
38#define ONEWIRE_MAX_READ_BYTES (ONEWIRE_MAX_SLOTS / ONEWIRE_BITS_PER_BYTE)
49#define ONEWIRE_RELEASE_PULSE 0u
51#define ONEWIRE_SEARCH_ROM 0xF0
53#define ONEWIRE_ALARM_SEARCH 0xEC
55#define ONEWIRE_MATCH_ROM 0x55
57#define ONEWIRE_SKIP_ROM 0xCC
283static inline uint8_t onewire_bit_from_pulse(uint16_t dur) {
333uint8_t onewire_long_wait_pending(
void);
348void onewire_sleep_until_done(
void);
383 uint8_t command, uint8_t family);
void onewire_encode_byte(ow_pulse_t *out, uint8_t byte)
Encode a byte into write-pulse durations.
void onewire_read_pair(volatile uint16_t *pair_pulses)
Schedule a two-slot read of a Search ROM id/cmp bit pair.
uint8_t onewire_reset_captured(void)
Edges captured by the last capture operation armed.
void onewire_pair_bits(const volatile uint16_t *pair_pulses, uint8_t *id_bit, uint8_t *cmp_bit)
Decode the id/cmp bits of a two-slot read pair.
uint8_t onewire_bus_done(void)
Non-blocking completion check for the scheduled bus operation.
void onewire_strong_pullup(uint8_t on)
Engage or release the parasite-power strong pull-up on the bus.
void onewire_write_then_read(uint8_t bit)
Schedule a merged single-slot write followed by a two-slot read pair.
uint8_t onewire_present(const volatile uint16_t *pulses, uint8_t captured)
Decode the presence pulse captured by onewire_reset().
void onewire_reset(volatile uint16_t *reset_pulses)
Schedule a 1-Wire bus reset (presence pulse captured via DMA).
uint8_t onewire_read_data(volatile uint8_t *dst, uint8_t bytes)
Schedule a read of bytes bytes from the bus.
uint8_t onewire_write_slots(const ow_pulse_t *pulses, uint16_t slots)
Schedule a write of slots bit slots.
uint8_t onewire_write_bit(uint8_t bit)
Schedule a single-slot write of one raw bit.
void onewire_decode_pulses(uint8_t *dst, const volatile uint8_t *pulse, uint8_t nbytes)
Decode captured pulse durations into data bytes (LSB-first bits).
uint16_t onewire_crc16(const uint8_t *data, uint8_t len)
Calculate the Maxim 1-Wire CRC-16 over a byte buffer.
uint8_t onewire_crc8(const uint8_t *data, uint8_t len)
Calculate the Dallas/Maxim 1-Wire CRC-8 over a byte buffer.
uint32_t onewire_config_token(void)
Configuration token the library was compiled with.
uint8_t onewire_clock_ok(uint32_t sysclk_mhz)
Whether the runtime core clock agrees with the build.
void onewire_init(void)
Initialize the shared 1-Wire timer/DMA/GPIO resources.
uint8_t onewire_search_count(void)
Number of devices found (valid once the search finished).
uint8_t onewire_search_active(void)
Check whether a search is currently running.
uint8_t(* onewire_search_sink_t)(const uint8_t *rom)
Per-device callback invoked by the search engine.
Definition onewire.h:367
void onewire_search_start(onewire_search_sink_t sink, uint8_t max_devices, uint8_t command, uint8_t family)
Start a non-blocking search (Search ROM or Alarm Search).
uint8_t onewire_search_poll(void)
Advance the non-blocking search by one hardware operation.
Public board-level facts for the non-blocking 1-Wire layer.
uint8_t ow_pulse_t
DMA feed entry width of the active family.
Definition ow_board.h:135
Central compile-time configuration for the 1-Wire stack.
#define ONEWIRE_SHORT_PULSE_MAX
Upper bound (in µs) for the short-pulse detection window.
Definition ow_config.h:122
Library version (semantic versioning).