OneWire + DS18X20 Library
Basic functions for OneWire operations + specific DS18x20 operations
 All Functions Groups Pages
/*****************************************************************************
DS18x20 library
Copyright (C) 2016 Falk Brunner
*****************************************************************************/
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <Falk.Brunner@gmx.de> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Falk Brunner
* ----------------------------------------------------------------------------
*/
#ifndef DS18x20_H_
#define DS18x20_H_
#include <stdint.h>
#define DS18x20_CMD_SKIP_ROM 0xCC
#define DS18x20_CMD_CONVERT_T 0x44
#define DS18x20_CMD_READ_SCRATCHPAD 0xBE
#define DS18x20_CMD_WRITE_SCRATCHPAD 0x4E
#define DS18x20_CMD_COPY_SCRATCHPAD 0x48
#define DS18x20_CMD_RECALL_E2 0xB8
#define DS18x20_CMD_READ_POWER_SUPPLY 0xB4
#define DS18B20_ID 0x28
#define DS18S20_ID 0x10
void ds18x20_convert_t(uint8_t parasitic_power);
#define ds18B20_convert_t(x) ds18x20_convert_t(x)
#define ds18S20_convert_t(x) ds18x20_convert_t(x)
uint8_t ds18B20_read_temp(int16_t *temperature);
uint8_t ds18S20_read_temp(int16_t *temperature);
void ds18x20_read_scratchpad(uint8_t *buffer);
#define ds18B20_read_scratchpad(x) ds18x20_read_scratchpad(x)
#define ds18S20_read_scratchpad(x) ds18x20_read_scratchpad(x)
void ds18S20_write_scratchpad(int8_t tl, int8_t th);
void ds18B20_write_scratchpad(int8_t tl, int8_t th, uint8_t adc_resolution);
void ds18x20_copy_scratchpad(uint8_t parasitic_power);
#define ds18B20_copy_scratchpad(x) ds18x20_copy_scratchpad(x);
#define ds18S20_copy_scratchpad(x) ds18x20_copy_scratchpad(x);
void ds18x20_recall_E2(void);
#define ds18B20_recall_E2(x) ds18x20_recall_E2(x)
#define ds18S20_recall_E2(x) ds18x20_recall_E2(x)
#define ds18B20_read_power_supply(x) ds18x20_read_power_supply(x)
#define ds18S20_read_power_supply(x) ds18x20_read_power_supply(x)
#endif