#include <stdio.h>
#include "stm32f0xx_hal.h"
/************* Global Variable ************/
extern volatile float temperature;
#define DS18B20_GPIO              GPIOB
#define DS18B20_PIN               GPIO_PIN_5
#define CONFIG_OUTPUT             HAL_GPIO_WritePin(GPIOB,GPIO_PIN_5,GPIO_PIN_RESET)
#define READ_INPUT                HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_5)
#define DS18B20_CMD_CONVERTTEMP   0x44
#define DS18B20_CMD_RSCRATCHPAD   0xbe
#define DS18B20_CMD_WSCRATCHPAD   0x4E
#define DS18B20_CMD_CPYSCRATCHPAD 0x48
#define DS18B20_CMD_RECEEPROM     0xB8
#define DS18B20_CMD_RPWRSUPPLY    0xB4
#define DS18B20_CMD_SEARCHROM     0xF0
#define DS18B20_CMD_READROM       0x33
#define DS18B20_CMD_MATCHROM      0x55
#define DS18B20_CMD_SKIPROM       0xCC
#define DS18B20_CMD_ALARMSEARCH   0xEC
#define THERM_DECIMAL_STEPS_12BIT .0625      //.0625
uint8_t DS18B20Reset(void);
void DS18B20Write(uint8_t byte);
uint8_t DS18B20Read(void);
uint8_t DS18B20ReadTemp(void);
void _delay_us(uint16_t delay);
void output(void);
void input(void);