The MAX31725, MAX31726 temperature sensors provides temperature measurements with an accuracy of up to +-0.5°C. Extended format allows for high temperature readings up to 150°C. The MAX31725 can operate in a low powered mode by utilizing the shutdown and one-shot mode. Supports two-wire serial, I2C bus communications. 8-pin TQDFN 3x3 mm package. Accuracy is +-0.5°C from -40°C to +105°C (-40°F to +221°). The operating temperature range is -55°C to +150°C (-67°F to +302°). VDD is 2.5V to 3.7V.
Dependents: MAX31725_High_Temperature_Accurate_IC
max31725.h@20:c9805b01e814, 2019-04-09 (annotated)
- Committer:
- phonemacro
- Date:
- Tue Apr 09 07:00:32 2019 +0000
- Revision:
- 20:c9805b01e814
- Child:
- 22:692515ac2bb7
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
phonemacro | 20:c9805b01e814 | 1 | /******************************************************************************* |
phonemacro | 20:c9805b01e814 | 2 | * Copyright (C) 2019 Maxim Integrated Products, Inc., All Rights Reserved. |
phonemacro | 20:c9805b01e814 | 3 | * |
phonemacro | 20:c9805b01e814 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
phonemacro | 20:c9805b01e814 | 5 | * copy of this software and associated documentation files (the "Software"), |
phonemacro | 20:c9805b01e814 | 6 | * to deal in the Software without restriction, including without limitation |
phonemacro | 20:c9805b01e814 | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
phonemacro | 20:c9805b01e814 | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
phonemacro | 20:c9805b01e814 | 9 | * Software is furnished to do so, subject to the following conditions: |
phonemacro | 20:c9805b01e814 | 10 | * |
phonemacro | 20:c9805b01e814 | 11 | * The above copyright notice and this permission notice shall be included |
phonemacro | 20:c9805b01e814 | 12 | * in all copies or substantial portions of the Software. |
phonemacro | 20:c9805b01e814 | 13 | * |
phonemacro | 20:c9805b01e814 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
phonemacro | 20:c9805b01e814 | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
phonemacro | 20:c9805b01e814 | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
phonemacro | 20:c9805b01e814 | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
phonemacro | 20:c9805b01e814 | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
phonemacro | 20:c9805b01e814 | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
phonemacro | 20:c9805b01e814 | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
phonemacro | 20:c9805b01e814 | 21 | * |
phonemacro | 20:c9805b01e814 | 22 | * Except as contained in this notice, the name of Maxim Integrated |
phonemacro | 20:c9805b01e814 | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
phonemacro | 20:c9805b01e814 | 24 | * Products, Inc. Branding Policy. |
phonemacro | 20:c9805b01e814 | 25 | * |
phonemacro | 20:c9805b01e814 | 26 | * The mere transfer of this software does not imply any licenses |
phonemacro | 20:c9805b01e814 | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
phonemacro | 20:c9805b01e814 | 28 | * trademarks, maskwork rights, or any other form of intellectual |
phonemacro | 20:c9805b01e814 | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
phonemacro | 20:c9805b01e814 | 30 | * ownership rights. |
phonemacro | 20:c9805b01e814 | 31 | ******************************************************************************* |
phonemacro | 20:c9805b01e814 | 32 | * @file MAX31725.h |
phonemacro | 20:c9805b01e814 | 33 | ******************************************************************************* |
phonemacro | 20:c9805b01e814 | 34 | */ |
phonemacro | 20:c9805b01e814 | 35 | #ifndef MAX31725_H |
phonemacro | 20:c9805b01e814 | 36 | #define MAX31725_H |
phonemacro | 20:c9805b01e814 | 37 | #include "mbed.h" |
phonemacro | 20:c9805b01e814 | 38 | |
phonemacro | 20:c9805b01e814 | 39 | #define MAX31725_NO_ERROR 0 |
phonemacro | 20:c9805b01e814 | 40 | #define MAX31725_ERROR -1 |
phonemacro | 20:c9805b01e814 | 41 | |
phonemacro | 20:c9805b01e814 | 42 | #define MAX31725_REG_TEMPERATURE 0X00 |
phonemacro | 20:c9805b01e814 | 43 | #define MAX31725_REG_CONFIGURATION 0X01 |
phonemacro | 20:c9805b01e814 | 44 | #define MAX31725_REG_THYST_LOW_TRIP 0X02 |
phonemacro | 20:c9805b01e814 | 45 | #define MAX31725_REG_TOS_HIGH_TRIP 0X03 |
phonemacro | 20:c9805b01e814 | 46 | #define MAX31725_REG_MAX 0X03 |
phonemacro | 20:c9805b01e814 | 47 | |
phonemacro | 20:c9805b01e814 | 48 | #define WAIT_MARGIN (0.0000) |
phonemacro | 20:c9805b01e814 | 49 | #define MAX31725_WAIT_CONV_TIME (.050+WAIT_MARGIN) |
phonemacro | 20:c9805b01e814 | 50 | |
phonemacro | 20:c9805b01e814 | 51 | #define MAX31725_CFG_CONTINUOUS (0X00 << 0) |
phonemacro | 20:c9805b01e814 | 52 | #define MAX31725_CFG_SHUTDOWN (0X01 << 0) |
phonemacro | 20:c9805b01e814 | 53 | |
phonemacro | 20:c9805b01e814 | 54 | #define MAX31725_CFG_COMPARATOR_MODE (0X00 << 1) |
phonemacro | 20:c9805b01e814 | 55 | #define MAX31725_CFG_INTERRUPT_MODE (0X01 << 1) |
phonemacro | 20:c9805b01e814 | 56 | |
phonemacro | 20:c9805b01e814 | 57 | #define MAX31725_CFG_OS_POLARITY_ACT_LOW (0x00 << 2) |
phonemacro | 20:c9805b01e814 | 58 | #define MAX31725_CFG_OS_POLARITY_ACT_HIGH (0x01 << 2) |
phonemacro | 20:c9805b01e814 | 59 | |
phonemacro | 20:c9805b01e814 | 60 | #define MAX31725_CFG_FAULT_FILTER_1 (0x00 << 3) |
phonemacro | 20:c9805b01e814 | 61 | #define MAX31725_CFG_FAULT_FILTER_2 (0x01 << 3) |
phonemacro | 20:c9805b01e814 | 62 | #define MAX31725_CFG_FAULT_FILTER_4 (0x02 << 3) |
phonemacro | 20:c9805b01e814 | 63 | #define MAX31725_CFG_FAULT_FILTER_6 (0x03 << 3) |
phonemacro | 20:c9805b01e814 | 64 | |
phonemacro | 20:c9805b01e814 | 65 | #define MAX31725_CFG_NORMAL_FORMAT (0x00 << 5) |
phonemacro | 20:c9805b01e814 | 66 | #define MAX31725_CFG_EXTENDED_FORMAT (0x01 << 5) /* add 64°C to temperature */ |
phonemacro | 20:c9805b01e814 | 67 | #define MAX31725_EXTENDED_FORMAT_OFFSET (64.0f) |
phonemacro | 20:c9805b01e814 | 68 | #define MAX31725_CFG_TIMEOUT_ENABLE (0X00 << 6) |
phonemacro | 20:c9805b01e814 | 69 | #define MAX31725_CFG_TIMEOUT_DISABLE (0X01 << 6) |
phonemacro | 20:c9805b01e814 | 70 | #define MAX31725_CFG_ONE_SHOT_START (0X01 << 7) |
phonemacro | 20:c9805b01e814 | 71 | |
phonemacro | 20:c9805b01e814 | 72 | |
phonemacro | 20:c9805b01e814 | 73 | #define MAX31725_I2C_SLAVE_ADR_R0 (0x90 >> 1) // code uses the 7 bit address |
phonemacro | 20:c9805b01e814 | 74 | #define MAX31725_I2C_SLAVE_ADR_R1 (0x92 >> 1) |
phonemacro | 20:c9805b01e814 | 75 | #define MAX31725_I2C_SLAVE_ADR_R2 (0x94 >> 1) |
phonemacro | 20:c9805b01e814 | 76 | #define MAX31725_I2C_SLAVE_ADR_R3 (0x96 >> 1) |
phonemacro | 20:c9805b01e814 | 77 | #define MAX31725_I2C_SLAVE_ADR_R4 (0x98 >> 1) |
phonemacro | 20:c9805b01e814 | 78 | #define MAX31725_I2C_SLAVE_ADR_R5 (0x9A >> 1) |
phonemacro | 20:c9805b01e814 | 79 | #define MAX31725_I2C_SLAVE_ADR_R6 (0x9C >> 1) |
phonemacro | 20:c9805b01e814 | 80 | #define MAX31725_I2C_SLAVE_ADR_R7 (0x9E >> 1) |
phonemacro | 20:c9805b01e814 | 81 | |
phonemacro | 20:c9805b01e814 | 82 | #define MAX31725_CF_LSB (0.00390625F) |
phonemacro | 20:c9805b01e814 | 83 | |
phonemacro | 20:c9805b01e814 | 84 | /** @union max31725_raw_data |
phonemacro | 20:c9805b01e814 | 85 | * @brief union data structure for byte word manipulations |
phonemacro | 20:c9805b01e814 | 86 | */ |
phonemacro | 20:c9805b01e814 | 87 | union max31725_raw_data { |
phonemacro | 20:c9805b01e814 | 88 | struct { |
phonemacro | 20:c9805b01e814 | 89 | uint8_t lsb; |
phonemacro | 20:c9805b01e814 | 90 | uint8_t msb; |
phonemacro | 20:c9805b01e814 | 91 | }; |
phonemacro | 20:c9805b01e814 | 92 | struct { |
phonemacro | 20:c9805b01e814 | 93 | uint16_t magnitude_bits:15; |
phonemacro | 20:c9805b01e814 | 94 | uint16_t sign_bit:1; |
phonemacro | 20:c9805b01e814 | 95 | }; |
phonemacro | 20:c9805b01e814 | 96 | uint16_t uwrd; |
phonemacro | 20:c9805b01e814 | 97 | int16_t swrd; |
phonemacro | 20:c9805b01e814 | 98 | }; |
phonemacro | 20:c9805b01e814 | 99 | |
phonemacro | 20:c9805b01e814 | 100 | #endif/* MAX31875_H */ |