126 for (i = 0; i < times; i++)
128 res =
ds18b20_read(&gs_handle, (int16_t *)&raw, (
float *)&temperature);
150 for (i = 0; i < times; i++)
152 res =
ds18b20_read(&gs_handle, (int16_t *)&raw, (
float *)&temperature);
174 for (i = 0; i < times; i++)
176 res =
ds18b20_read(&gs_handle, (int16_t *)&raw, (
float *)&temperature);
198 for (i = 0; i < times; i++)
200 res =
ds18b20_read(&gs_handle, (int16_t *)&raw, (
float *)&temperature);
251 for (i = 0; i < times; i++)
253 res =
ds18b20_read(&gs_handle, (int16_t *)&raw, (
float *)&temperature);
275 for (i = 0; i < times; i++)
277 res =
ds18b20_read(&gs_handle, (int16_t *)&raw, (
float *)&temperature);
299 for (i = 0; i < times; i++)
301 res =
ds18b20_read(&gs_handle, (int16_t *)&raw, (
float *)&temperature);
323 for (i = 0; i < times; i++)
325 res =
ds18b20_read(&gs_handle, (int16_t *)&raw, (
float *)&temperature);
driver ds18b20 read test header file
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_info(ds18b20_info_t *info)
get chip's information
uint8_t ds18b20_read(ds18b20_handle_t *handle, int16_t *raw, float *temp)
read data from the chip
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
uint8_t ds18b20_deinit(ds18b20_handle_t *handle)
close the chip
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_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_read_test(uint32_t times)
read test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v