> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/man/man4/lm75.4.md).

# lm75.4

`lm75` — lm75 i2c 数字温度传感器驱动

## 名称

`lm75`

## 概要

`device iic device iicbus device lm75`

## 描述

`lm75` 驱动通过 [iicbus(4)](/man/man4/iicbus.4.md) 提供对传感器数据的访问和配置。

它提供了一种简单的方法来检查 i2c 总线的功能，因为可以对 `lm75` 配置寄存器进行读写访问。

通过 [sysctl(8)](/man/man8/sysctl.8.md) 接口访问 `lm75` 数据：

```sh
dev.lm75.0.%desc: LM75 temperature sensor
dev.lm75.0.%driver: lm75
dev.lm75.0.%location: addr=0x49
dev.lm75.0.%pnpinfo: name=lm750 compat=national,lm75
dev.lm75.0.%parent: iicbus3
dev.lm75.0.temperature: 27.1C
dev.lm75.0.thyst: 75.0C
dev.lm75.0.tos: 80.0C
dev.lm75.0.faults: 1
dev.lm75.0.mode: comparator
dev.lm75.0.polarity: active-low
dev.lm75.0.shutdown: 0
```

**`dev.lm75.%d.temperature`** 传感器读取的当前温度的只读值。

**`dev.lm75.%d.thyst`** 设置滞后温度。一旦温度超过过热关断值（tos），需要降至滞后温度以下才能再次禁用输出（中断）引脚。

**`dev.lm75.%d.tos`** 设置过热关断值。一旦温度超过此值，输出引脚将被启用。输出（中断）引脚的工作方式取决于模式配置。

**`dev.lm75.%d.faults`** 为激活中断（输出）引脚而必须连续发生的故障次数。可设为 1、2、4 和 6。

**`dev.lm75.%d.mode`** 设置传感器中断引脚的工作模式。可设为 'comparator'（默认）或 'interrupt'。

**`dev.lm75.%d.polarity`** 设置传感器中断引脚的极性。可设为 'active-low'（默认）或 'active-high'。请注意，输出引脚是开漏输出，需要适当的上拉电阻才能工作。

**`dev.lm75.%d.shutdown`** 设为 '1' 时关闭传感器。温度转换停止，但传感器保持其 i2c 总线活动，即可以通过将此选项重新设为 '0' 来唤醒它。

更多详情请查阅 `lm75` 数据手册。

与 snmp\_lm75(3) 一起使用时，可通过 SNMP 监控 `lm75` 温度数据。

`lm75` 驱动同时支持低分辨率和高分辨率型号。

低分辨率型号（lm75）提供 9 位输出，最低有效位代表 0.5C。

高分辨率型号（lm75a）提供 11 位输出，最低有效位代表 0.125C。

驱动会尝试自动检测 `lm75` 型号，但对某些 `lm75` 兼容芯片的检测可能不可靠。

在基于 [device.hints(5)](/man/man5/device.hints.5.md) 的系统（如 `MIPS`）上，可以为 `lm75` 配置以下值：

**`hint.lm75.%d.at`** 要附加到的 [iicbus(4)](/man/man4/iicbus.4.md)。

**`hint.lm75.%d.addr`** `lm75` 在 [iicbus(4)](/man/man4/iicbus.4.md) 上的 i2c 地址。

在基于 FDT(4) 的系统（如 `ARM`）上，`lm75` 设备的 DTS 部分通常如下所示：

```sh
i2c {
	/* 描述控制器的属性出现在这里。 */
	...
	lm750@49 {
		compatible = "national,lm75";
		reg = <0x49>;
	};
};
```

其中：

**`compatible`** 应始终设为 "national,lm75"。

**`reg`** 指示 `lm75` 连接的 7 位 i2c 地址。`lm75` 温度传感器可连接到 8 个不同的地址，允许在同一 [iicbus(4)](/man/man4/iicbus.4.md) 上连接最多 8 个传感器。

## 参见

snmp\_lm75(3), [fdt(4)](/man/man4/fdt.4.md), [iic(4)](/man/man4/iic.4.md), [iicbus(4)](/man/man4/iicbus.4.md), [sysctl(8)](/man/man8/sysctl.8.md)

## 历史

`lm75` 驱动首次出现于 FreeBSD 11.0。

## 作者

`lm75` 驱动及本手册页由 Luiz Otavio O Souza <loos@FreeBSD.org> 编写。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man4/lm75.4.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
