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 Alarm Search

Maxim Alarm Search ROM (0xEC) state machine, driven from the main loop exactly like the device search. It reports only the DS18B20 devices currently in alarm state (temperature outside the TH/TL thresholds set with Write Scratchpad); the regular Search ROM returns every device regardless of alarm state. More...

Functions

void ds18b20_alarm_search_start (ds18b20_search_sink_t sink, uint8_t max_devices)
 Start a non-blocking alarm search.
uint8_t ds18b20_alarm_search_poll (void)
 Advance the non-blocking alarm search by one hardware operation.
uint8_t ds18b20_alarm_search_count (void)
 Number of DS18B20 devices found in alarm (valid once finished).

Detailed Description

Maxim Alarm Search ROM (0xEC) state machine, driven from the main loop exactly like the device search. It reports only the DS18B20 devices currently in alarm state (temperature outside the TH/TL thresholds set with Write Scratchpad); the regular Search ROM returns every device regardless of alarm state.

The alarm search reuses the device search engine (same poll/ownership model, same family filter, same sink protocol) and does not touch the scan-mode device table: run ds18b20_search_start() to (re)populate it. When it finishes the driver stays idle until the application requests the next operation (ds18b20_start_measure(), a new search or a command).

Function Documentation

◆ ds18b20_alarm_search_count()

uint8_t ds18b20_alarm_search_count ( void )

Number of DS18B20 devices found in alarm (valid once finished).

Returns
Count of alarmed devices

◆ ds18b20_alarm_search_poll()

uint8_t ds18b20_alarm_search_poll ( void )

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

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

◆ ds18b20_alarm_search_start()

void ds18b20_alarm_search_start ( ds18b20_search_sink_t sink,
uint8_t max_devices )

Start a non-blocking alarm search.

Parameters
[in]sinkCallback invoked per DS18B20 currently in alarm (may be NULL)
[in]max_devicesMaximum number of alarmed devices to report (0 aborts)
Note
Only devices in alarm state respond to Alarm Search (0xEC). The scan-mode device table is left untouched by the alarm search.