DS7505 C, C++ driver source code: The DS7505 low-voltage (1.7V to 3.7V) digital thermometer and thermostat provides 9 to 12-bit digital temperature readings over a -55°C to +125°C range with +-0.5°C accuracy in the 0°C (32°F) to +70°C (158°F) range.

Dependents:   DS7505_Temperature_Sensor_Low_Power

Committer:
phonemacro
Date:
Sat Apr 27 09:50:48 2019 +0000
Revision:
25:93287f99d225
Initial Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
phonemacro 25:93287f99d225 1 /*******************************************************************************
phonemacro 25:93287f99d225 2 * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved.
phonemacro 25:93287f99d225 3 *
phonemacro 25:93287f99d225 4 * Permission is hereby granted, free of charge, to any person obtaining a
phonemacro 25:93287f99d225 5 * copy of this software and associated documentation files (the "Software"),
phonemacro 25:93287f99d225 6 * to deal in the Software without restriction, including without limitation
phonemacro 25:93287f99d225 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
phonemacro 25:93287f99d225 8 * and/or sell copies of the Software, and to permit persons to whom the
phonemacro 25:93287f99d225 9 * Software is furnished to do so, subject to the following conditions:
phonemacro 25:93287f99d225 10 *
phonemacro 25:93287f99d225 11 * The above copyright notice and this permission notice shall be included
phonemacro 25:93287f99d225 12 * in all copies or substantial portions of the Software.
phonemacro 25:93287f99d225 13 *
phonemacro 25:93287f99d225 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
phonemacro 25:93287f99d225 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
phonemacro 25:93287f99d225 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
phonemacro 25:93287f99d225 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
phonemacro 25:93287f99d225 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
phonemacro 25:93287f99d225 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
phonemacro 25:93287f99d225 20 * OTHER DEALINGS IN THE SOFTWARE.
phonemacro 25:93287f99d225 21 *
phonemacro 25:93287f99d225 22 * Except as contained in this notice, the name of Maxim Integrated
phonemacro 25:93287f99d225 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
phonemacro 25:93287f99d225 24 * Products, Inc. Branding Policy.
phonemacro 25:93287f99d225 25 *
phonemacro 25:93287f99d225 26 * The mere transfer of this software does not imply any licenses
phonemacro 25:93287f99d225 27 * of trade secrets, proprietary technology, copyrights, patents,
phonemacro 25:93287f99d225 28 * trademarks, maskwork rights, or any other form of intellectual
phonemacro 25:93287f99d225 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
phonemacro 25:93287f99d225 30 * ownership rights.
phonemacro 25:93287f99d225 31 *******************************************************************************
phonemacro 25:93287f99d225 32 * @file ds7505_c.h
phonemacro 25:93287f99d225 33 *******************************************************************************
phonemacro 25:93287f99d225 34 */
phonemacro 25:93287f99d225 35 #ifndef DS7505_C_H
phonemacro 25:93287f99d225 36 #define DS7505_C_H
phonemacro 25:93287f99d225 37 #include "mbed.h"
phonemacro 25:93287f99d225 38 /*****************************************************************************/
phonemacro 25:93287f99d225 39 /* C header for DS7505 driver */
phonemacro 25:93287f99d225 40 /*****************************************************************************/
phonemacro 25:93287f99d225 41
phonemacro 25:93287f99d225 42 int ds7505_init(uint8_t slaveAddress);
phonemacro 25:93287f99d225 43
phonemacro 25:93287f99d225 44 int ds7505_read_cfg_reg(uint8_t *value, I2C &i2c_bus);
phonemacro 25:93287f99d225 45
phonemacro 25:93287f99d225 46 int ds7505_read_reg16(int16_t *value, char reg, I2C &i2c_bus);
phonemacro 25:93287f99d225 47
phonemacro 25:93287f99d225 48 float ds7505_read_reg_as_temperature(uint8_t reg, I2C &i2c_bus);
phonemacro 25:93287f99d225 49
phonemacro 25:93287f99d225 50 int ds7505_write_cfg_reg(uint8_t cfg, I2C &i2c_bus);
phonemacro 25:93287f99d225 51
phonemacro 25:93287f99d225 52 int ds7505_write_trip_low_thyst(float temperature, I2C &i2c_bus);
phonemacro 25:93287f99d225 53
phonemacro 25:93287f99d225 54 int ds7505_write_trip_high_tos(float temperature, I2C &i2c_bus);
phonemacro 25:93287f99d225 55
phonemacro 25:93287f99d225 56 float ds7505_celsius_to_fahrenheit(float temp_c);
phonemacro 25:93287f99d225 57
phonemacro 25:93287f99d225 58 #endif/* DS7505_C_H */