LM75(4)

πŸ’– LM75(4) πŸ’–

okay bestie, so this is a page from the Kernel Interfaces Manual and it's literally all about the lm75 driver β€” no cap. pull up a chair, grab a boba, let's get into it πŸ§‹βœ¨


🌸 NAME 🌸

lm75 β€” the lm75 i2c digital temperature sensor driver, aka the little guy that tells you how hot it is πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

device iic
device iicbus
device lm75

periodt. that's the whole lineup.


✨ DESCRIPTION ✨

so the lm75 driver gives you access to sensor data and configuration over the iicbus(4). it's giving main character energy on the i2c bus fr fr.

it's also a super easy and simple way to check the functionality of an i2c bus, because it hands you read and write access to the lm75 configuration register. handy πŸ’…

the access to lm75 data goes through the sysctl(8) interface, and it looks like this:

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

and here's what every single one of those lil knobs actually does, bestie:

  • dev.lm75.%d.temperature β€” this is the read-only value of whatever temperature the sensor is currently reading. no touching, just looking πŸ‘€
  • dev.lm75.%d.thyst β€” sets the hysteresis temperature. the way this works: once the temp climbs over the overtemperature shutdown value (tos), it then has to drop below the hysteresis temperature before the output (interrupt) pin gets disabled again. so it's the "okay you can chill now" threshold 🧊
  • dev.lm75.%d.tos β€” sets the overtemperature shutdown value. once the temperature gets over this value, the output pin gets enabled. and how that output (interrupt) pin behaves depends on the mode configuration, iykyk.
  • dev.lm75.%d.faults β€” the number of faults that have to happen consecutively before the interrupt (output) pin activates. you can set it to 1, 2, 4, and 6. that's it, that's the whole menu.
  • dev.lm75.%d.mode β€” sets the operation mode for the sensor interrupt pin. options are 'comparator' (which is the default) or 'interrupt'. choose wisely bestie.
  • dev.lm75.%d.polarity β€” sets the polarity of the sensor interrupt pin. can be 'active-low' (the default) or 'active-high'. ⚠️ but listen: the output pin is an open-drain output, so it needs a proper pull-up resistor to actually work. don't skip that part, it's not optional.
  • dev.lm75.%d.shutdown β€” set it to '1' and the sensor shuts down. temperature conversion stops, but the sensor keeps its i2c bus active, meaning you can wake it back up by setting this option to '0' again. it's just napping, not gone πŸ’€
please check the lm75 datasheet for more details β€” that's where the real lore lives πŸ“–

when you use this together with snmp_lm75(3), you get to monitor lm75 temperature data over SNMP. iconic collab honestly 🀝

the lm75 driver supports both the low and the high resolution models:

  • the low resolution model (lm75) gives a 9 bit output, with the LSB representing 0.5C.
  • the high resolution model (lm75a) gives an 11 bit output, with the LSB representing 0.125C.

the driver tries to auto-detect which lm75 model you've got, but heads up β€” the detection of some lm75 clones may not work reliably. so like, don't be shocked if it guesses wrong πŸ™ˆ


πŸ¦‹ On a device.hints(5) based system πŸ¦‹

on a system like MIPS, these values are configurable for lm75:

  • hint.lm75.%d.at β€” this is the iicbus(4) you're attaching to.
  • hint.lm75.%d.addr β€” this is the lm75 i2c address on the iicbus(4).

🌈 On a FDT(4) based system 🌈

on a system like ARM, the DTS part for an lm75 device usually looks like this:

i2c {
        /* Properties describing the controller appear here. */
        ...
        lm750@49 {
                compatible = "national,lm75";
                reg = <0x49>;
        };
};

where:

  • compatible β€” should always be set to "national,lm75". no alternatives, no vibes-based substitutions.
  • reg β€” indicates which 7-bit i2c address the lm75 is wired at. lm75 temperature sensors can be wired to 8 different addresses, which means you can have up to 8 sensors on the same iicbus(4). squad goals honestly πŸ‘‘

πŸ’œ SEE ALSO πŸ’œ

snmp_lm75(3), fdt(4), iic(4), iicbus(4), sysctl(8)


⭐ HISTORY ⭐

the lm75 driver first appeared in FreeBSD 11.0. throwback era 🫢


πŸ‘‘ AUTHORS πŸ‘‘

the lm75 driver and this manual page were written by Luiz Otavio O Souza <loos@FreeBSD.org>. thank you for your service, king πŸ’–


and that's the whole page, bestie! this lil slice of Debian manpage lore is dated December 26, 2017, and now you know everything it knows. go forth and read your temperatures 🌑️✨ mwah πŸ’…

πŸ“¦ where this page comes from