MCP980X(4)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’– MCP980X(4) β€” like, the manual page, but make it make sense πŸ’–

(Kernel Interfaces Manual, bestie edition)

okay so you found yourself in section 4 of the Kernel Interfaces Manual and your first thought was "what even is a mcp980x" β€” valid! Sit down, grab a lil drink πŸ“, this is gonna be cute and also fully accurate.


✨ NAME ✨

mcp980x β€” the Microchip 9800/1/2/3 I2C temperature sensor driver. yes THAT one. the temp-sensor girly πŸ’…


✨ SYNOPSIS ✨

mcp980x* at iic? addr 0x48

that's it. that's the whole vibe. drop it on the iic? bus at addr 0x48 and you're so back 🫢


✨ DESCRIPTION ✨

okay so the mcp980x driver is literally here to provide support for the MCP980x series of temperature sensors. that's the whole job, and it ate πŸ”₯

it lets you report the ambient temperature through the envsys(4) API β€” so yeah, your little chip is gonna be spilling the tea about how warm the room is, and envsys is the one relaying it. no cap.


✨ SYSCTL VARIABLES ✨

the following sysctl(3) variable are provided β€” yes, that's exactly what it says, we're keeping it, and here they are, all of them, none skipped πŸ™ˆ:

  • machdep.mcp980x0.res β€” the ADC resolution, and it's an integer. valid values are 0-3, where 0 is 9-bit (0.5 Celsius degree) resolution and 3 is 12-bit (0.0625 Celsius degree) resolution. so like, the higher the number, the more granular the tea. icon energy ✨
  • machdep.mcp980x0.templimit β€” if the ambient temperature exceeds this limit, the chip asserts an alert line (integer). think of it as a little "bestie it is TOO hot in here" signal πŸ’€πŸ”₯
  • machdep.mcp980x0.hysteresis β€” the hysteresis for the temperature limit (integer). yes it's a real word, yes it's important, we'll get to the caveat about it down below πŸ‘‘

✨ SEE ALSO ✨


✨ HISTORY ✨

the mcp980x device first appeared in NetBSD 7.0. a legend was born 🌈⭐


✨ AUTHORS ✨

the mcp980x driver was written by Radoslaw Kujawa <radoslaw.kujawa@gmail.com>. give them their flowers πŸ’πŸ‘‘


πŸ’€ CAVEATS πŸ’€

  • MCP9804 and MCP9805 chip are different and are supported by the sdtemp(4) driver. so do NOT come for mcp980x with those, they're literally a different breed. πŸ™…β€β™€οΈ
  • the MCP980x chip supports hysteresis and temperature limit values with a resolution of 0.5 Celsius degree, however the mcp980x driver supports setting only integer values. so like β€” the hardware can do the half-degree thing, but the driver is out here doing whole numbers only. it's giving "close enough" 😭 but that's just how it is, ngl.

also lowkey: MCP9804 / MCP9805 β†’ sdtemp(4). if you're looking for those, you're in the wrong group chat, bestie. πŸ¦‹

and that's the page, fr fr! πŸ’œ this lil beauty came to you from Debian, version vibes stamped July 26, 2016 β€” yeah she's been around, and she's still serving. periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from