53 float temp, temp_check;
55 int8_t threshold_high, threshold_low;
56 int8_t threshold_high_check, threshold_low_check;
57 uint8_t rom[8], rom_check[8];
181 if (rom[i] != rom_check[i])
286 threshold_high = (int8_t)(rand()%128);
287 threshold_low = (int8_t)(-(rand()%128));
348 temp = (float)(rand()%36000)/1000.0f;
driver ds18b20 register test header file
uint8_t ds18b20_alarm_convert_to_data(ds18b20_handle_t *handle, int8_t reg, float *temp)
convert the register data to the alarm temperature
uint8_t ds18b20_get_power_mode(ds18b20_handle_t *handle, ds18b20_power_mode_t *power_mode)
get the power mode
uint8_t ds18b20_scrachpad_get_alarm_threshold(ds18b20_handle_t *handle, int8_t *threshold_high, int8_t *threshold_low)
get the alarm threshold in the scratchpad
uint8_t ds18b20_scratchpad_set_alarm_threshold(ds18b20_handle_t *handle, int8_t threshold_high, int8_t threshold_low)
set the alarm threshold in the scratchpad
uint8_t ds18b20_alarm_convert_to_register(ds18b20_handle_t *handle, float temp, int8_t *reg)
convert the alarm temperature to the register data
uint8_t ds18b20_scratchpad_get_resolution(ds18b20_handle_t *handle, ds18b20_resolution_t *resolution)
get the resolution in the scratchpad
ds18b20_power_mode_t
ds18b20 power mode enumeration definition
uint8_t ds18b20_init(ds18b20_handle_t *handle)
initialize the chip
uint8_t ds18b20_set_rom(ds18b20_handle_t *handle, uint8_t rom[8])
set the handle rom
uint8_t ds18b20_copy_eeprom_to_scratchpad(ds18b20_handle_t *handle)
copy the eeprom content to the scratchpad
uint8_t ds18b20_copy_scratchpad_to_eeprom(ds18b20_handle_t *handle)
copy the scratchpad content to the eeprom
ds18b20_resolution_t
ds18b20 resolution enumeration definition
uint8_t ds18b20_info(ds18b20_info_t *info)
get chip's information
uint8_t ds18b20_scratchpad_set_resolution(ds18b20_handle_t *handle, ds18b20_resolution_t resolution)
set the resolution in the scratchpad
struct ds18b20_handle_s ds18b20_handle_t
ds18b20 handle structure definition
ds18b20_mode_t
ds18b20 mode enumeration definition
uint8_t ds18b20_deinit(ds18b20_handle_t *handle)
close the chip
uint8_t ds18b20_get_mode(ds18b20_handle_t *handle, ds18b20_mode_t *mode)
get the chip mode
uint8_t ds18b20_set_mode(ds18b20_handle_t *handle, ds18b20_mode_t mode)
set the chip mode
struct ds18b20_info_s ds18b20_info_t
ds18b20 info structure definition
uint8_t ds18b20_get_rom(ds18b20_handle_t *handle, uint8_t rom[8])
get the chip rom
@ DS18B20_POWER_MODE_EXTERNALLY
@ DS18B20_RESOLUTION_11BIT
@ DS18B20_RESOLUTION_9BIT
@ DS18B20_RESOLUTION_10BIT
@ DS18B20_RESOLUTION_12BIT
uint8_t ds18b20_interface_deinit(void)
interface bus deinit
void ds18b20_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t ds18b20_interface_write(uint8_t value)
interface bus write
uint8_t ds18b20_interface_init(void)
interface bus init
uint8_t ds18b20_interface_read(uint8_t *value)
interface bus read
void ds18b20_interface_debug_print(const char *const fmt,...)
interface print format data
void ds18b20_interface_disable_irq(void)
interface disable the interrupt
void ds18b20_interface_enable_irq(void)
interface enable the interrupt
void ds18b20_interface_delay_us(uint32_t us)
interface delay us
#define DRIVER_DS18B20_LINK_DISABLE_IRQ(HANDLE, FUC)
link disable_irq function
#define DRIVER_DS18B20_LINK_ENABLE_IRQ(HANDLE, FUC)
link enable_irq function
#define DRIVER_DS18B20_LINK_BUS_WRITE(HANDLE, FUC)
link bus_write function
#define DRIVER_DS18B20_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_DS18B20_LINK_BUS_INIT(HANDLE, FUC)
link bus_init function
#define DRIVER_DS18B20_LINK_BUS_READ(HANDLE, FUC)
link bus_read function
#define DRIVER_DS18B20_LINK_DELAY_US(HANDLE, FUC)
link delay_us function
#define DRIVER_DS18B20_LINK_BUS_DEINIT(HANDLE, FUC)
link bus_deinit function
#define DRIVER_DS18B20_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_DS18B20_LINK_INIT(HANDLE, STRUCTURE)
initialize ds18b20_handle_t structure
uint8_t ds18b20_register_test(void)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v