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
2023-06-23 17:30:03 +08:00

18 lines
570 B
C
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __LM75A_H
#define __LM75A_H
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "stm32f4xx_hal.h"
#define LM75A_ADDR 0x9f //LM75A 的器件地址
#define TEMP_ADDR 0x00 //温度寄存器子地址
#define CONF_ADDR 0x01 //配置寄存器子地址
#define NORMOR_MODE 0x00 //正常工作模式
void LM75SetMode(uint8_t ConfReg, uint8_t Mode); //设置工作模式
uint16_t LM75GetTempReg(void); //从 LM75A 读取温度数据2字节
double LM75GetTempValue(uint16_t tempreg); //将温度数据转换为温度值
#endif