stm32-async-1wire 3.2.0
Non-blocking 1-Wire master for STM32 with DS18B20 temperature and DS2431 EEPROM drivers
Loading...
Searching...
No Matches
DS18B20 Non-Blocking Device Search

Maxim Search ROM (0xF0) state machine, driven from the main loop like the measurement state machine. It filters by family code, validates the CRC and reports each found DS18B20 via a callback. When the search finishes the driver stays idle until the application requests the next operation (ds18b20_start_measure(), a new search or a command). More...

Typedefs

typedef uint8_t(* ds18b20_search_sink_t) (const uint8_t *rom)
 Callback invoked for every DS18B20 found by the search.

Functions

void ds18b20_search_start (ds18b20_search_sink_t sink, uint8_t max_devices)
 Start a non-blocking device search.
uint8_t ds18b20_search_poll (void)
 Advance the non-blocking device search by one hardware operation.
uint8_t ds18b20_search_count (void)
 Number of DS18B20 devices found (valid once the search finished).

Detailed Description

Maxim Search ROM (0xF0) state machine, driven from the main loop like the measurement state machine. It filters by family code, validates the CRC and reports each found DS18B20 via a callback. When the search finishes the driver stays idle until the application requests the next operation (ds18b20_start_measure(), a new search or a command).

Typedef Documentation

◆ ds18b20_search_sink_t

typedef uint8_t(* ds18b20_search_sink_t) (const uint8_t *rom)

Callback invoked for every DS18B20 found by the search.

Parameters
[in]romPointer to the 8-byte ROM address (LSB first)
Returns
0 to continue the search, non-zero to stop
Note
The pointer is only valid for the duration of the callback.

Function Documentation

◆ ds18b20_search_count()

uint8_t ds18b20_search_count ( void )

Number of DS18B20 devices found (valid once the search finished).

Returns
Count of found devices

◆ ds18b20_search_poll()

uint8_t ds18b20_search_poll ( void )

Advance the non-blocking device search by one hardware operation.

Returns
1 when the search is finished, 0 while still running

◆ ds18b20_search_start()

void ds18b20_search_start ( ds18b20_search_sink_t sink,
uint8_t max_devices )

Start a non-blocking device search.

Parameters
[in]sinkCallback invoked per found DS18B20 device (may be NULL)
[in]max_devicesMaximum number of devices to report (0 aborts)