This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/EmbededSTM32/lab8/Core/Inc/LM75A.h

19 lines
570 B
C
Raw Permalink Normal View History

2023-06-23 09:30:03 +00:00
#ifndef __LM75A_H
#define __LM75A_H
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "stm32f4xx_hal.h"
#define LM75A_ADDR 0x9f //LM75A <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ
#define TEMP_ADDR 0x00 //<2F>¶ȼĴ<C8BC><C4B4><EFBFBD><EFBFBD>ӵ<EFBFBD>ַ
#define CONF_ADDR 0x01 //<2F><><EFBFBD>üĴ<C3BC><C4B4><EFBFBD><EFBFBD>ӵ<EFBFBD>ַ
#define NORMOR_MODE 0x00 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
void LM75SetMode(uint8_t ConfReg, uint8_t Mode); //<2F><><EFBFBD>ù<EFBFBD><C3B9><EFBFBD>ģʽ
uint16_t LM75GetTempReg(void); //<2F><> LM75A <20><>ȡ<EFBFBD><EFBFBD><C2B6><EFBFBD><EFBFBD>ݣ<EFBFBD>2<EFBFBD>ֽڣ<D6BD>
double LM75GetTempValue(uint16_t tempreg); //<2F><><EFBFBD><EFBFBD><C2B6><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD><EFBFBD>ֵ
#endif