#ifndef PORTABLE_DS18B20_CONFIG_H #define PORTABLE_DS18B20_CONFIG_H #define DS18B20_DEFAULT_TIMEOUT_MS 750U #define DS18B20_FAMILY_CODE 0x28U /* Initial attempt + four retries for each tree branch, three full passes. */ #define DS18B20_SEARCH_RETRIES 4U #define DS18B20_SEARCH_PASSES 3U /* Bounds the blocking API too, even if noisy devices keep changing the tree. */ #define DS18B20_SEARCH_MAX_ATTEMPTS 512U /* Extra released-high time AFTER each search slot; sampling is unchanged. */ #define DS18B20_SLOT_RECOVERY_EXTRA_US 20U #if DS18B20_SEARCH_PASSES < 1U || DS18B20_SEARCH_PASSES > 255U || \ DS18B20_SEARCH_RETRIES > 254U || DS18B20_SEARCH_MAX_ATTEMPTS < 1U || \ DS18B20_SEARCH_MAX_ATTEMPTS > 65535U #error Invalid DS18B20 search limits #endif #endif