| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- /**
- * @file ADS1112_ATY.h
- *
- * @param Project DEVICE_GENERAL_ATY_LIB
- *
- * @author ATY
- *
- * @copyright
- * - Copyright 2017 - 2023 MZ-ATY
- * - This code follows:
- * - MZ-ATY Various Contents Joint Statement -
- * <a href="https://mengze.top/MZ-ATY_VCJS">
- * https://mengze.top/MZ-ATY_VCJS</a>
- * - CC 4.0 BY-NC-SA -
- * <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- * https://creativecommons.org/licenses/by-nc-sa/4.0/</a>
- * - Your use will be deemed to have accepted the terms of this statement.
- *
- * @brief Familiar functions of DS18B20 for all embedded device
- *
- * @version
- * - 1_01_230828 > ATY
- * -# Preliminary version, first Release
- ********************************************************************************
- */
- #ifndef __ADS1112_ATY_H
- #define __ADS1112_ATY_H
- #include "INCLUDE_ATY.h"
- #include "HW_I2C_ATY.h"
- /******************************* For user *************************************/
- // Set AD0/AD1 voltage level for device address, 0 for low, 1 for high, 2 for float
- #define ADS1112_AD0 0
- #define ADS1112_AD1 0
- #define VREF_COM 1.24f
- // #define __DEBUG_ADS1112_ATY
- /******************************************************************************/
- #if ((ADS1112_AD0 == 0) && (ADS1112_AD1 == 0))
- #define ADS1112_ADDRESS (0x48)
- #elif ((ADS1112_AD0 == 0) && (ADS1112_AD1 == 2))
- #define ADS1112_ADDRESS (0x49)
- #elif ((ADS1112_AD0 == 0) && (ADS1112_AD1 == 1))
- #define ADS1112_ADDRESS (0x4A)
- #elif ((ADS1112_AD0 == 2) && (ADS1112_AD1 == 0))
- #define ADS1112_ADDRESS (0x4B)
- #elif ((ADS1112_AD0 == 1) && (ADS1112_AD1 == 0))
- #define ADS1112_ADDRESS (0x4C)
- #elif ((ADS1112_AD0 == 1) && (ADS1112_AD1 == 2))
- #define ADS1112_ADDRESS (0x4D)
- #elif ((ADS1112_AD0 == 1) && (ADS1112_AD1 == 1))
- #define ADS1112_ADDRESS (0x4E)
- #elif ((ADS1112_AD0 == 2) && (ADS1112_AD1 == 1))
- #define ADS1112_ADDRESS (0x4F)
- #endif
- #define CHANNEL_0_1 0
- #define CHANNEL_2_3 1
- #define CHANNEL_0_3 2
- #define CHANNEL_1_3 3
- #define CONVERSION_CONTINUOUS 0
- #define CONVERSION_ONCE 1
- #define RESOLUTION_12BIT 0
- #define RESOLUTION_14BIT 1
- #define RESOLUTION_15BIT 2
- #define RESOLUTION_16BIT 3
- #define GAIN_1 0
- #define GAIN_2 1
- #define GAIN_4 2
- #define GAIN_8 3
- uint8_t ADS1112_Setting(uint8_t channel, uint8_t conversion, uint8_t resolution, uint8_t gain);
- uint16_t ADS1112_Read(uint8_t chipAddr);
- float ADS1112_Voltage(uint16_t u16Data);
- #endif /* __ADS1112_ATY_H */
- /******************************** End Of File *********************************/
|