STM32F103CBT6_Thermograph/Core/Inc/ds18b20_onewire.h

21 lines
441 B
C

#ifndef __DS18B20_ONEWIRE_H
#define __DS18B20_ONEWIRE_H
#include "one_wire.h"
typedef struct {
uint8_t t_high;
uint8_t t_low;
int16_t t_decimal;
} ds18b20_temp_t;
typedef struct {
onewire_t *ow_driver;
onewire_rom_num_t rom;
} ds18b20_t;
onewire_ret_t ds18b20_start_convert(ds18b20_t *ds);
uint8_t ds18b20_check_busy(ds18b20_t *ds);
onewire_ret_t ds18b20_read_temperature(ds18b20_t *ds, ds18b20_temp_t *temp);
#endif