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 Exported Constants

Macros

#define DS18B20_TEMP_ERROR_GENERIC   INT16_MIN
 Special error values (0.1°C units, outside -550..1250 range).
#define DS18B20_TEMP_ERROR_NO_SENSOR   (INT16_MIN + 1)
#define DS18B20_TEMP_ERROR_CRC_FAIL   (INT16_MIN + 2)
#define DS18B20_FAMILY_CODE   0x28
 DS18B20 1-Wire family code (LSB of the 64-bit ROM address).
#define DS18B20_BITS_PER_BYTE   8
 Standard 8 bits per byte.
#define DS18B20_ROM_BYTES   8
 Number of bytes in a device ROM address.
#define DS18B20_SEARCH_ROM   0xF0
 DS18B20 Search ROM command.
#define DS18B20_ALARM_SEARCH   0xEC
 DS18B20 Alarm Search ROM command.
#define DS18B20_MATCH_ROM   0x55
 DS18B20 Match ROM command.
#define DS18B20_CONVERT_T   0x44
 DS18B20 Convert T command.
#define DS18B20_READ_ROM   0x33
 DS18B20 Read ROM command.
#define DS18B20_READ_SCRATCHPAD   0xBE
 DS18B20 Read Scratchpad command.
#define DS18B20_WRITE_SCRATCHPAD   0x4E
 DS18B20 Write Scratchpad command.
#define DS18B20_COPY_SCRATCHPAD   0x48
 DS18B20 Copy Scratchpad command.
#define DS18B20_RECALL_EEPROM   0xB8
 DS18B20 Recall EEPROM command.
#define DS18B20_READ_POWER_SUPPLY   0xB4
 DS18B20 Read Power Supply command.
#define DS18B20_RES_MIN   9
 Minimum supported temperature resolution in bits.
#define DS18B20_RES_MAX   12
 Maximum supported temperature resolution in bits.
#define DS18B20_RES_DEFAULT   12
 Default temperature resolution in bits (power-on default of DS18B20).

Detailed Description

Macro Definition Documentation

◆ DS18B20_ALARM_SEARCH

#define DS18B20_ALARM_SEARCH   0xEC

DS18B20 Alarm Search ROM command.

Note
Returns only the devices currently in alarm state, i.e. whose last measured temperature is outside the TH/TL thresholds configured with Write Scratchpad (DS18B20_WRITE_SCRATCHPAD).

◆ DS18B20_BITS_PER_BYTE

#define DS18B20_BITS_PER_BYTE   8

Standard 8 bits per byte.

◆ DS18B20_CONVERT_T

#define DS18B20_CONVERT_T   0x44

DS18B20 Convert T command.

◆ DS18B20_COPY_SCRATCHPAD

#define DS18B20_COPY_SCRATCHPAD   0x48

DS18B20 Copy Scratchpad command.

Note
Copies the scratchpad (TH/TL/CFG) into the EEPROM (non-volatile). Exposed as a non-blocking transaction (ds18b20_copy_scratchpad()); the resolution state machine does not use it because the config write takes effect immediately.

◆ DS18B20_FAMILY_CODE

#define DS18B20_FAMILY_CODE   0x28

DS18B20 1-Wire family code (LSB of the 64-bit ROM address).

Note
Other 1-Wire devices on the bus use different family codes and are skipped by the device search.

◆ DS18B20_MATCH_ROM

#define DS18B20_MATCH_ROM   0x55

DS18B20 Match ROM command.

◆ DS18B20_READ_POWER_SUPPLY

#define DS18B20_READ_POWER_SUPPLY   0xB4

DS18B20 Read Power Supply command.

Note
The device drives one bit: 0 = parasite power, 1 = external power.

◆ DS18B20_READ_ROM

#define DS18B20_READ_ROM   0x33

DS18B20 Read ROM command.

Note
Valid only when exactly one device is on the bus (no addressing).

◆ DS18B20_READ_SCRATCHPAD

#define DS18B20_READ_SCRATCHPAD   0xBE

DS18B20 Read Scratchpad command.

◆ DS18B20_RECALL_EEPROM

#define DS18B20_RECALL_EEPROM   0xB8

DS18B20 Recall EEPROM command.

Note
Loads the last EEPROM copy (TH/TL/CFG) into the volatile scratchpad.

◆ DS18B20_RES_DEFAULT

#define DS18B20_RES_DEFAULT   12

Default temperature resolution in bits (power-on default of DS18B20).

◆ DS18B20_RES_MAX

#define DS18B20_RES_MAX   12

Maximum supported temperature resolution in bits.

◆ DS18B20_RES_MIN

#define DS18B20_RES_MIN   9

Minimum supported temperature resolution in bits.

◆ DS18B20_ROM_BYTES

#define DS18B20_ROM_BYTES   8

Number of bytes in a device ROM address.

◆ DS18B20_SEARCH_ROM

#define DS18B20_SEARCH_ROM   0xF0

DS18B20 Search ROM command.

◆ DS18B20_TEMP_ERROR_CRC_FAIL

#define DS18B20_TEMP_ERROR_CRC_FAIL   (INT16_MIN + 2)

CRC checksum validation failed

◆ DS18B20_TEMP_ERROR_GENERIC

#define DS18B20_TEMP_ERROR_GENERIC   INT16_MIN

Special error values (0.1°C units, outside -550..1250 range).

Note
These values are outside the normal temperature range to indicate errors Generic/unspecified error

◆ DS18B20_TEMP_ERROR_NO_SENSOR

#define DS18B20_TEMP_ERROR_NO_SENSOR   (INT16_MIN + 1)

No sensor detected on bus

◆ DS18B20_WRITE_SCRATCHPAD

#define DS18B20_WRITE_SCRATCHPAD   0x4E

DS18B20 Write Scratchpad command.

Note
Writes TH, TL and the configuration register in one command.