ds18b20_new_device() function
Create a new DS18B20 device based on the general 1-Wire device
Arguments
device
1-Wire device basic information, including bus handle and device ROM ID
config
DS18B20 configuration
ret_ds18b20
Returned DS18B20 device handle
Return value
- ESP_OK: Create DS18B20 device successfully - ESP_ERR_INVALID_ARG: Create DS18B20 device failed due to invalid argument - ESP_ERR_NO_MEM: Create DS18B20 device failed due to out of memory - ESP_ERR_NOT_SUPPORTED: Create DS18B20 device failed because the device is unknown (e.g. a wrong family ID code) - ESP_FAIL: Create DS18B20 device failed due to other reasons
Notes
The general 1-Wire device can be enumerated during the 1-Wire bus device search process, this function is going to check and upgrade that into a DS18B20 device.