{"id":6497,"date":"2024-03-20T21:01:01","date_gmt":"2024-03-20T13:01:01","guid":{"rendered":""},"modified":"2024-03-20T21:01:01","modified_gmt":"2024-03-20T13:01:01","slug":"ADT7410 \u00b10.5\u2103\u7cbe\u5ea6\u6e29\u5ea6\u4f20\u611f\u5668","status":"publish","type":"post","link":"https:\/\/mushiming.com\/6497.html","title":{"rendered":"ADT7410 \u00b10.5\u2103\u7cbe\u5ea6\u6e29\u5ea6\u4f20\u611f\u5668"},"content":{"rendered":"

\n <\/path> \n<\/svg> <\/p>\n

 <\/p>\n

\u25a0 \u524d\u8a00<\/font><\/h2>\n

ADT7410\u662f\u4e00\u6b3e\u57fa\u4e8eSOIC\u5c01\u88c5\u7684\u9ad8\u7cbe\u5ea6\u6570\u5b57\u6e29\u5ea6\u4f20\u611f\u5668\u3002\u5b83\u5185\u90e8\u5177\u6709\u5e26\u9699\u6e29\u5ea6\u53c2\u8003\u6e90\u4ee5\u53ca13\u4f4dADC\uff0c\u53ef\u4ee5\u63d0\u9ad80.0625\u6444\u6c0f\u5ea6\u7684\u6e29\u5ea6\u7cbe\u5ea6\u3002\u8fd9\u4e2a\u6e29\u5ea6\u5206\u8fa8\u7387\u8fd8\u53ef\u4ee5\u6539\u53d8\u621016\u4f4d\uff080.0075\u2103\uff09\u3002<\/p>\n

ADT7410\u53ef\u4ee5\u5de5\u4f5c\u57282.7V\u81f35.5V\u7684\u5de5\u4f5c\u7535\u6e90\u3002\u5de5\u4f5c\u57283.3V\u65f6\uff0c\u5de5\u4f5c\u7535\u6d41\u4e3a210uA\u3002 ADT\u5728Shutdown\u6a21\u5f0f\u4e0b\uff0c\u8017\u7535\u91cf\u4ec5\u4e3a2uA\u3002<\/p>\n

ADT7410\u53ef\u4ee5\u5de5\u4f5c\u5728-55\u2103\u81f3150\u2103\u3002\u53ef\u88ab\u5e7f\u6cdb \u5e94\u7528\u5728\u533b\u7597\u5668\u68b0\u3001\u73af\u5883\u76d1\u63a7\u3001\u8ba1\u7b97\u673a\u6e29\u5ea6\u68c0\u6d4b\u3001\u6e29\u5ea6\u4fdd\u62a4\u3001\u5de5\u4e1a\u8fc7\u7a0b\u63a7\u5236\u3001\u7535\u6e90\u7cfb\u7edf\u76d1\u6d4b\u4ee5\u53ca\u624b\u6301\u8bbe\u5907\u5e94\u7528\u7b49\u7b49\u3002<\/p>\n

\"ADT7410<\/p>\n


\n \u25b2 ADT7410\u5185\u90e8\u529f\u80fd\u56fe<\/code><\/sup>
\n<\/center> <\/p>\n

ADT7410\u901a\u8fc7I2C\u603b\u7ebf\u4e0eMCU\u8fde\u63a5\u3002\u672c\u6587\u901a\u8fc7\u5236\u4f5c\u57fa\u4e8eSTC8G1K08\u7535\u8def\u677f\uff0c\u6765\u8bbf\u95ee\u56db\u4e2a\u6e29\u5ea6\u4f20\u611f\u5668\u3002<\/p>\n

 <\/p>\n

01\u5b9e\u9a8c\u7535\u8def\u677f\u8bbe\u8ba1<\/font><\/h2>\n
\n

1.MCU\u63a7\u5236\u677f\u5236\u4f5c1<\/sup><\/font><\/h3>\n

\u25cb \u539f\u7406\u56fe\u8bbe\u8ba1<\/font><\/p>\n

\"ADT7410<\/p>\n


\n \u25b2 MCU\u539f\u7406\u56fe<\/code><\/sup>
\n<\/center> <\/p>\n

2. ADT7410\u82af\u7247\u5c0f\u677f2<\/sup><\/font><\/h3>\n

\"ADT7410<\/p>\n


\n \u25b2 ADT7410\u82af\u7247\u5c0f\u677f<\/code><\/sup>
\n<\/center> <\/p>\n

\"ADT7410<\/p>\n


\n \u25b2 ADT7410 PCB\u677f<\/code><\/sup>
\n<\/center> <\/p>\n

\u901a\u8fc7\u6e29\u5ea6\u677f\u7684\u53f3\u8fb9\u56db\u4e2a\u7535\u963b\uff0c\u6765\u8bbe\u5b9a\u6e29\u5ea6\u4f20\u611f\u5668\u7684I2C\u5730\u5740\uff1aA1A0\u3002\u5177\u4f53\u8bbe\u7f6e\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n

\"ADT7410<\/p>\n


\n \u25b2 ADT7410\u5730\u5740\u8bbe\u7f6e\u901a\u8fc7RA1234<\/code><\/sup>
\n<\/center> <\/p>\n

 <\/p>\n

02MCU\u8f6f\u4ef6\u8bbe\u8ba13<\/sup><\/font><\/h2>\n
\n

\u63a7\u5236\u5c0f\u677f\u7684\u4e32\u53e3\u547d\u4ee4\uff1a<\/p>\n

else<\/span> IFARG0<\/span>(<\/span>\"rt\"<\/span>)<\/span> { \n   <\/span>\n    printf<\/span>(<\/span>\"%f \"<\/span>,<\/span> ADT7410ReadT<\/span>(<\/span>0<\/span>)<\/span>)<\/span>;<\/span>\n    printf<\/span>(<\/span>\"%f \"<\/span>,<\/span> ADT7410ReadT<\/span>(<\/span>1<\/span>)<\/span>)<\/span>;<\/span>\n    printf<\/span>(<\/span>\"%f \"<\/span>,<\/span> ADT7410ReadT<\/span>(<\/span>2<\/span>)<\/span>)<\/span>;<\/span>\n    printf<\/span>(<\/span>\"%f\\r\\n\"<\/span>,<\/span> ADT7410ReadT<\/span>(<\/span>3<\/span>)<\/span>)<\/span>;<\/span>\n}<\/span> else<\/span> IFARG0<\/span>(<\/span>\"rtx\"<\/span>)<\/span> { \n   <\/span>\n    printf<\/span>(<\/span>\"%04x \"<\/span>,<\/span> ADT7410ReadTemp<\/span>(<\/span>0<\/span>)<\/span>)<\/span>;<\/span>\n    printf<\/span>(<\/span>\"%04x \"<\/span>,<\/span> ADT7410ReadTemp<\/span>(<\/span>1<\/span>)<\/span>)<\/span>;<\/span>\n    printf<\/span>(<\/span>\"%04x \"<\/span>,<\/span> ADT7410ReadTemp<\/span>(<\/span>2<\/span>)<\/span>)<\/span>;<\/span>\n    printf<\/span>(<\/span>\"%04x\\r\\n\"<\/span>,<\/span> ADT7410ReadTemp<\/span>(<\/span>3<\/span>)<\/span>)<\/span>;<\/span>\n}<\/span> else<\/span> IFARG0<\/span>(<\/span>\"rtb\"<\/span>)<\/span> { \n   <\/span>\n    nNumber =<\/span> ADT7410ReadTemp<\/span>(<\/span>0<\/span>)<\/span>;<\/span>\n    SendChar<\/span>(<\/span>(<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNumber >><\/span> 8<\/span>)<\/span>)<\/span>;<\/span>\n    SendChar<\/span>(<\/span>(<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNumber)<\/span>)<\/span>;<\/span>\n    nNumber =<\/span> ADT7410ReadTemp<\/span>(<\/span>1<\/span>)<\/span>;<\/span>\n    SendChar<\/span>(<\/span>(<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNumber >><\/span> 8<\/span>)<\/span>)<\/span>;<\/span>\n    SendChar<\/span>(<\/span>(<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNumber)<\/span>)<\/span>;<\/span>\n    nNumber =<\/span> ADT7410ReadTemp<\/span>(<\/span>2<\/span>)<\/span>;<\/span>\n    SendChar<\/span>(<\/span>(<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNumber >><\/span> 8<\/span>)<\/span>)<\/span>;<\/span>\n    SendChar<\/span>(<\/span>(<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNumber)<\/span>)<\/span>;<\/span>\n    nNumber =<\/span> ADT7410ReadTemp<\/span>(<\/span>3<\/span>)<\/span>;<\/span>\n    SendChar<\/span>(<\/span>(<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNumber >><\/span> 8<\/span>)<\/span>)<\/span>;<\/span>\n    SendChar<\/span>(<\/span>(<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNumber)<\/span>)<\/span>;<\/span>        \n}<\/span>\n<\/code><\/pre>\n

\"ADT7410<\/p>\n


\n \u25b2 \u4e0a\u7535\u540e\u5b9e\u9a8c\u7535\u8def\u677f<\/code><\/sup>
\n<\/center> <\/p>\n

 <\/p>\n

\u203b \u7ed3\u8bba<\/font><\/h2>\n
\n

\u672c\u6587\u6784\u9020\u53ef\u4ee5\u540c\u65f6\u8bbf\u95ee\u56db\u8defADT7410\u6e29\u5ea6\u4f20\u611f\u5668\u3002 \u901a\u8fc7\u4e32\u53e3\u547d\u4ee4\u53ef\u4ee5\u83b7\u5f97\u5bf9\u5e94\u7684\u6e29\u5ea6\u503c\u3002<\/p>\n

\"ADT7410<\/p>\n


\n \u25b2 \u6d4b\u91cf\u767d\u70bd\u706f\u6ce1\u5728\u70b9\u4eae\u540e\u7684\u6e29\u5ea6\u4e0a\u5347<\/code><\/sup>
\n<\/center> <\/p>\n

\"ADT7410<\/p>\n


\n \u25b2 \u6d4b\u91cf\u5236\u51b7\u7247\u7684\u6e29\u5ea6\u4e0b\u964d\u8fc7\u7a0b<\/code><\/sup>
\n<\/center> <\/p>\n

\"ADT7410<\/p>\n


\n \u25b2 \u6d4b\u91cf\u5236\u51b7\u7247\u7684\u6e29\u5ea6\u4e0a\u5347\u8fc7\u7a0b<\/code><\/sup>
\n<\/center> <\/p>\n
\/* **============================================================================== ** ADT7410.C: -- by Dr. ZhuoQing, 2020-07-08 ** **============================================================================== *\/<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\n#define<\/span> ADT7410_GLOBALS 1 <\/span>\/\/ Define the global variables<\/span>\n#include<\/span> \"ADT7410.H\"<\/span><\/span>\n#include<\/span> \"STC8G.H\"<\/span><\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\n\n\/\/==============================================================================<\/span>\n\/\/ INTERFACE FUNCTIONS<\/span>\n\/\/------------------------------------------------------------------------------<\/span>\nvoid<\/span> ADT7410SetAdd<\/span>(<\/span>unsigned<\/span> char<\/span> ucA10)<\/span> { \n   <\/span>\n    g_ucADT7410Add =<\/span> ADT7410_I2C_ADD +<\/span> (<\/span>ucA10 <<<\/span> 1<\/span>)<\/span>;<\/span>\n}<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nvoid<\/span> ADT7410Init<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd)<\/span> { \n   <\/span>\n    ADT7410SetAdd<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    ADT7410SetConfiguration<\/span>(<\/span>0x80<\/span>)<\/span>;<\/span>        \/\/ Set 16 bits resolution of temperature.<\/span>\n}<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nfloat<\/span> ADT7410ReadT<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd)<\/span> { \n   <\/span>\n    ADT7410SetAdd<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    ADT7410SetConfiguration<\/span>(<\/span>0x80<\/span>)<\/span>;<\/span>\n    return<\/span> ADT7410ReadTemperature<\/span>(<\/span>)<\/span> \/<\/span> 128.0<\/span>;<\/span>\n}<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nint<\/span> ADT7410ReadTemp<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd)<\/span> { \n   <\/span>\n    ADT7410SetAdd<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    ADT7410SetConfiguration<\/span>(<\/span>0x80<\/span>)<\/span>;<\/span>\n    return<\/span> ADT7410ReadTemperature<\/span>(<\/span>)<\/span>;<\/span>\n}<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nfloat<\/span> ADT7410Temperature<\/span>(<\/span>int<\/span> nNumber)<\/span> { \n   <\/span>\n    return<\/span> nNumber \/<\/span> 128.0<\/span>;<\/span>\n}<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nvoid<\/span> ADT7410WriteByte<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd,<\/span> unsigned<\/span> char<\/span> ucByte)<\/span> { \n   <\/span>\n    I2CStart<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>g_ucADT7410Add)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>ucByte)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    I2CStop<\/span>(<\/span>)<\/span>;<\/span>    \n}<\/span>\n\nvoid<\/span> ADT7410WriteInt<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd,<\/span> unsigned<\/span> int<\/span> nNum)<\/span> { \n   <\/span>\n    I2CStart<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>g_ucADT7410Add)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    \n    ucAdd =<\/span> (<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNum >><\/span> 8<\/span>)<\/span>;<\/span>    \n    I2CSendData<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    \n    ucAdd =<\/span> (<\/span>unsigned<\/span> char<\/span>)<\/span>(<\/span>nNum)<\/span>;<\/span>    \n    I2CSendData<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n        \n    I2CStop<\/span>(<\/span>)<\/span>;<\/span>\n}<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nunsigned<\/span> char<\/span> ADT7410ReadByte<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd)<\/span> { \n   <\/span>\n    unsigned<\/span> char<\/span> ucByte;<\/span>\n    \n    I2CStart<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>g_ucADT7410Add)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    \n    I2CStart<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>g_ucADT7410Add +<\/span> 1<\/span>)<\/span>;<\/span>\n    ucByte=<\/span> I2CReceiveData<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendNACK<\/span>(<\/span>)<\/span>;<\/span>\n    I2CStop<\/span>(<\/span>)<\/span>;<\/span>\n    \n    return<\/span> ucByte;<\/span>    \n}<\/span>\n\nvoid<\/span> ADT7410ReadDim<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd,<\/span> unsigned<\/span> char<\/span> ucLength,<\/span> unsigned<\/span> char<\/span> *<\/span> pDim)<\/span> { \n   <\/span>    \n    unsigned<\/span> char<\/span> ucByte,<\/span> i;<\/span>\n    \n    I2CStart<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>g_ucADT7410Add)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>ucAdd)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    \n    I2CStart<\/span>(<\/span>)<\/span>;<\/span>\n    I2CSendData<\/span>(<\/span>g_ucADT7410Add +<\/span> 1<\/span>)<\/span>;<\/span>\n    I2CReceiveACK<\/span>(<\/span>)<\/span>;<\/span>\n    \n    for<\/span>(<\/span>i =<\/span> 0<\/span>;<\/span> i <<\/span> ucLength;<\/span> i ++<\/span>)<\/span> { \n   <\/span>\n        ucByte=<\/span> I2CReceiveData<\/span>(<\/span>)<\/span>;<\/span>\n        if<\/span>(<\/span>i <<\/span> ucLength -<\/span> 1<\/span>)<\/span>\n            I2CSendACK<\/span>(<\/span>)<\/span>;<\/span>\n        else<\/span> I2CSendNACK<\/span>(<\/span>)<\/span>;<\/span>\n        \n        *<\/span>(<\/span>pDim +<\/span> i)<\/span> =<\/span> ucByte;<\/span>\n    }<\/span>\n    \n    I2CStop<\/span>(<\/span>)<\/span>;<\/span>\n}<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nint<\/span> ADT7410ReadTemperature<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    unsigned<\/span> char<\/span> ucBytes[<\/span>2<\/span>]<\/span>;<\/span>\n    int<\/span> nValue;<\/span>\n    \n    ADT7410ReadDim<\/span>(<\/span>0x0<\/span>,<\/span> 2<\/span>,<\/span> ucBytes)<\/span>;<\/span>\n\/\/ ucBytes[0] = ADT7410ReadByte(0);<\/span>\n\/\/ ucBytes[1] = ADT7410ReadByte(1);<\/span>\n    nValue =<\/span> ucBytes[<\/span>0<\/span>]<\/span>;<\/span>\n    nValue =<\/span> (<\/span>nValue <<<\/span> 8<\/span>)<\/span> |<\/span> ucBytes[<\/span>1<\/span>]<\/span>;<\/span>\n    return<\/span> nValue;<\/span>\n}<\/span>\n\nunsigned<\/span> char<\/span> ADT7410ReadStatus<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    unsigned<\/span> char<\/span> ucChar;<\/span>\n    ucChar =<\/span> ADT7410ReadByte<\/span>(<\/span>ADT7410_STATUS_ADD)<\/span>;<\/span>\n    return<\/span> ucChar;<\/span>\n}<\/span>\n    \nunsigned<\/span> char<\/span> ADT7410ReadConfiguration<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    unsigned<\/span> char<\/span> ucChar;<\/span>\n    ucChar =<\/span> ADT7410ReadByte<\/span>(<\/span>ADT7410_CONFIGURATION_ADD)<\/span>;<\/span>\n    return<\/span> ucChar;<\/span>\n}<\/span>\n    \nvoid<\/span> ADT7410SetConfiguration<\/span>(<\/span>unsigned<\/span> char<\/span> ucConfiguration)<\/span> { \n   <\/span>\n    ADT7410WriteByte<\/span>(<\/span>ADT7410_CONFIGURATION_ADD,<\/span> ucConfiguration)<\/span>;<\/span>\n}<\/span>\n\nunsigned<\/span> char<\/span> ADT7410ReadID<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    unsigned<\/span> char<\/span> ucChar;<\/span>\n    ucChar =<\/span> ADT7410ReadByte<\/span>(<\/span>ADT7410_ID_ADD)<\/span>;<\/span>\n    return<\/span> ucChar;<\/span>\n}<\/span>\n\nvoid<\/span> ADT7410SoftwareReset<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    ADT7410WriteByte<\/span>(<\/span>ADT7410_RESET_ADD,<\/span> 0xaa<\/span>)<\/span>;<\/span>\n}<\/span>\n    \nvoid<\/span> ADT7410SetHysteresisTemperature<\/span>(<\/span>unsigned<\/span> char<\/span> ucHysteresis)<\/span> { \n   <\/span>\n    ADT7410WriteByte<\/span>(<\/span>ADT7410_THYST_ADD,<\/span> ucHysteresis)<\/span>;<\/span>\n}<\/span>\n\nvoid<\/span> ADT7410SetHighTemperature<\/span>(<\/span>int<\/span> nT)<\/span> { \n   <\/span>\n    ADT7410WriteInt<\/span>(<\/span>ADT7410_THIGH_ADD,<\/span> nT)<\/span>;<\/span>\n}<\/span>\n\nvoid<\/span> ADT7410SetLowTemperature<\/span>(<\/span>int<\/span> nT)<\/span> { \n   <\/span>\n    ADT7410WriteInt<\/span>(<\/span>ADT7410_TLOW_ADD,<\/span> nT)<\/span>;<\/span>\n}<\/span>\n\nvoid<\/span> ADT7410SetCriticalTemperature<\/span>(<\/span>int<\/span> nT)<\/span> { \n   <\/span>\n    ADT7410WriteInt<\/span>(<\/span>ADT7410_TCRIT_ADD,<\/span> nT)<\/span>;<\/span>\n}<\/span>\n\nint<\/span> ADT7410ReadHighTemperature<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    unsigned<\/span> char<\/span> ucBytes[<\/span>2<\/span>]<\/span>;<\/span>\n    int<\/span> nValue;<\/span>\n    ADT7410ReadDim<\/span>(<\/span>ADT7410_THIGH_ADD,<\/span> 2<\/span>,<\/span> ucBytes)<\/span>;<\/span>\n    nValue =<\/span> ucBytes[<\/span>0<\/span>]<\/span>;<\/span>\n    nValue =<\/span> (<\/span>nValue <<<\/span> 8<\/span>)<\/span> |<\/span> ucBytes[<\/span>1<\/span>]<\/span>;<\/span>\n    return<\/span> nValue;<\/span>\n}<\/span>\n    \nint<\/span> ADT7410ReadLowTemperature<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    unsigned<\/span> char<\/span> ucBytes[<\/span>2<\/span>]<\/span>;<\/span>\n    int<\/span> nValue;<\/span>\n    ADT7410ReadDim<\/span>(<\/span>ADT7410_TLOW_ADD,<\/span> 2<\/span>,<\/span> ucBytes)<\/span>;<\/span>\n    nValue =<\/span> ucBytes[<\/span>0<\/span>]<\/span>;<\/span>\n    nValue =<\/span> (<\/span>nValue <<<\/span> 8<\/span>)<\/span> |<\/span> ucBytes[<\/span>1<\/span>]<\/span>;<\/span>\n    return<\/span> nValue;<\/span>\n}<\/span>\nint<\/span> ADT7410ReadCritialTemperature<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    unsigned<\/span> char<\/span> ucBytes[<\/span>2<\/span>]<\/span>;<\/span>\n    int<\/span> nValue;<\/span>\n    \n    ADT7410ReadDim<\/span>(<\/span>ADT7410_TCRIT_ADD,<\/span> 2<\/span>,<\/span> ucBytes)<\/span>;<\/span>\n    nValue =<\/span> ucBytes[<\/span>0<\/span>]<\/span>;<\/span>\n    nValue =<\/span> (<\/span>nValue <<<\/span> 8<\/span>)<\/span> |<\/span> ucBytes[<\/span>1<\/span>]<\/span>;<\/span>\n    return<\/span> nValue;<\/span>\n}<\/span>\n\nunsigned<\/span> char<\/span> ADT7410ReadHysteresisTemperature<\/span>(<\/span>void<\/span>)<\/span> { \n   <\/span>\n    return<\/span> ADT7410ReadByte<\/span>(<\/span>ADT7410_THYST_ADD)<\/span>;<\/span>\n}<\/span>\n\n\/\/==============================================================================<\/span>\n\/\/ END OF THE FILE : ADT7410.C<\/span>\n\/\/------------------------------------------------------------------------------<\/span>\n<\/code><\/pre>\n
\/* **============================================================================== ** ADT7410.H: -- by Dr. ZhuoQing, 2020-07-08 ** ** Description: ** **============================================================================== *\/<\/span>\n#ifndef<\/span> __ADT7410__<\/span>\n#define<\/span> __ADT7410__<\/span>\n\/\/------------------------------------------------------------------------------<\/span>\n#ifdef<\/span> ADT7410_GLOBALS<\/span>\n   #define<\/span> ADT7410_EXT<\/span>\n#else<\/span><\/span>\n   #define<\/span> ADT7410_EXT extern<\/span>\n#endif<\/span> <\/span>\/\/ ADT7410_GLOBALS<\/span>\n\/\/------------------------------------------------------------------------------<\/span>\n\/\/==============================================================================<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\n\n#define<\/span> ADT7410_I2C_ADD 0x90<\/span>\n\nADT7410_EXT unsigned<\/span> char<\/span> g_ucADT7410Add;<\/span>\nvoid<\/span> ADT7410SetAdd<\/span>(<\/span>unsigned<\/span> char<\/span> ucA10)<\/span>;<\/span>\n\nfloat<\/span> ADT7410Temperature<\/span>(<\/span>int<\/span> nNumber)<\/span>;<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nfloat<\/span> ADT7410ReadT<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd)<\/span>;<\/span>\nint<\/span> ADT7410ReadTemp<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd)<\/span>;<\/span>\n\n\/\/==============================================================================<\/span>\n\/\/ INTERFACE FUNCTIONS<\/span>\n\/\/------------------------------------------------------------------------------<\/span>\nvoid<\/span> ADT7410Init<\/span>(<\/span>unsigned<\/span> char<\/span> ucA10)<\/span>;<\/span>\n\nvoid<\/span> ADT7410WriteByte<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd,<\/span> unsigned<\/span> char<\/span> ucByte)<\/span>;<\/span>\nvoid<\/span> ADT7410WriteInt<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd,<\/span> unsigned<\/span> int<\/span> nNum)<\/span>;<\/span>\n\nunsigned<\/span> char<\/span> ADT7410ReadByte<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd)<\/span>;<\/span>\nvoid<\/span> ADT7410ReadDim<\/span>(<\/span>unsigned<\/span> char<\/span> ucAdd,<\/span> unsigned<\/span> char<\/span> ucLength,<\/span> unsigned<\/span> char<\/span> *<\/span> pDim)<\/span>;<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\n\n#define<\/span> ADT7410_TEMPERATURE_ADD 0x0<\/span>\n#define<\/span> ADT7410_STATUS_ADD 0x2<\/span>\n#define<\/span> ADT7410_CONFIGURATION_ADD 0x3<\/span>\n#define<\/span> ADT7410_THIGH_ADD 0x4<\/span>\n#define<\/span> ADT7410_TLOW_ADD 0x6<\/span>\n#define<\/span> ADT7410_TCRIT_ADD 0x8<\/span>\n#define<\/span> ADT7410_THYST_ADD 0xA<\/span>\n#define<\/span> ADT7410_ID_ADD 0x0B<\/span>\n#define<\/span> ADT7410_RESET_ADD 0x2F<\/span>\n\n\/\/------------------------------------------------------------------------------<\/span>\nint<\/span> ADT7410ReadTemperature<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\nunsigned<\/span> char<\/span> ADT7410ReadStatus<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\nunsigned<\/span> char<\/span> ADT7410ReadConfiguration<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\nvoid<\/span> ADT7410SetConfiguration<\/span>(<\/span>unsigned<\/span> char<\/span> ucConfiguration)<\/span>;<\/span>\nunsigned<\/span> char<\/span> ADT7410ReadID<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\nvoid<\/span> ADT7410SoftwareReset<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\nvoid<\/span> ADT7410SetHysteresisTemperature<\/span>(<\/span>unsigned<\/span> char<\/span> ucHysteresis)<\/span>;<\/span>\nvoid<\/span> ADT7410SetHighTemperature<\/span>(<\/span>int<\/span> nT)<\/span>;<\/span>\nvoid<\/span> ADT7410SetLowTemperature<\/span>(<\/span>int<\/span> nT)<\/span>;<\/span>\nvoid<\/span> ADT7410SetCriticalTemperature<\/span>(<\/span>int<\/span> nT)<\/span>;<\/span>\nint<\/span> ADT7410ReadHighTemperature<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\nint<\/span> ADT7410ReadLowTemperature<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\nint<\/span> ADT7410ReadCritialTemperature<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\n\nunsigned<\/span> char<\/span> ADT7410ReadHysteresisTemperature<\/span>(<\/span>void<\/span>)<\/span>;<\/span>\n\n\/\/==============================================================================<\/span>\n\/\/ END OF THE FILE : ADT7410.H<\/span>\n\/\/------------------------------------------------------------------------------<\/span>\n#endif<\/span> <\/span>\/\/ __ADT7410__<\/span>\n<\/code><\/pre>\n
\n
\n
    \n
  1. \n

    MCU\u63a7\u5236\u677fAD\u5de5\u7a0b\u6587\u4ef6<\/strong>:AD\\Test\\2020\\Tools\\ADT7410STC8G1k.SchDoc * \u21a9\ufe0e<\/p>\n<\/li>\n

  2. \n

    ADT7410\u5370\u5237\u7535\u8def\u677f\u8bbe\u8ba1\u5de5\u7a0b\u6587\u6863<\/strong>:AD\\Test\\2020\\Tools\\ADT7410MOD.SchDoc \u21a9\ufe0e<\/p>\n<\/li>\n

  3. \n

    STC8G \u5de5\u7a0b\u6587\u4ef6<\/strong>:C51\\STC\\Test\\2020\\Tools\\ADT7410STC8G1K\\ADT7410STC8G1K.uvproj \u21a9\ufe0e<\/p>\n<\/li>\n<\/ol>\n<\/section>\n","protected":false},"excerpt":{"rendered":"ADT7410 \u00b10.5\u2103\u7cbe\u5ea6\u6e29\u5ea6\u4f20\u611f\u5668\u25a0\u524d\u8a00ADT7410\u662f\u4e00\u6b3e\u57fa\u4e8eSOIC\u5c01\u88c5\u7684\u9ad8\u7cbe\u5ea6\u6570\u5b57\u6e29\u5ea6\u4f20\u611f\u5668","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6497"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=6497"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6497\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=6497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=6497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=6497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}