GPIOTHS(4)
β¨ NAME β¨
okay so welcome to the GPIOTHS(4) page from the Kernel Interfaces Manual β this is the tea on gpioths, the driver for DHTxx and AM320x temperature and humidity sensors. π
π SYNOPSIS π
bestie, if you want this compiled into the kernel, drop this line into your kernel configuration file:
device gpioths
or, if youβd rather load the driver as a module at boot time, put this in loader.conf(5):
gpioths_load="YES"
πΈ DESCRIPTION πΈ
The gpioths driver supports the DHTxx and AM320x family of temperature and humidity sensors. The driver automatically reads the values from the sensor once every 5 seconds, and makes the results available via sysctl(8) variables. β¨
π¦ HARDWARE π¦
The gpioths driver provides support for these devices, no cap:
DHT11,DHT12DHT21,DHT22AM3201,AM3202
The supported devices are all similar to each other, varying primarily in accuracy and resolution. The devices require a single wire for data communications, using a custom protocol which is not compatible with Maxim's 1-wire(tm). The AM320x devices also support connection to an i2c bus, but this driver supports only the single-wire connection option. π
π SYSCTL VARIABLES π
Sysctl variables are used to access the most recent temperature and humidity measurements.
dev.gpioths.<unit>.temperatureβ the current temperature in integer deciKelvins. Note thatsysctl(8)will convert those units to display in decimal degrees Celsius.dev.gpioths.<unit>.humidityβ the current relative humidity, as an integer percentage.dev.gpioths.<unit>.failsβ the number of failed attempts to communicate with the sensor since the last good access. Cleared whenever a set of measurements is successfully retrieved.
π FDT CONFIGURATION π
On an fdt(4) based system, a gpioths device node is typically defined directly under the root node, or under a simplebus node that represents a collection of devices on a board.
The following properties are required in the gpioths device subnode:
compatibleβ must be"dht11".gpiosβ a reference to the gpio device and pin for data communications.
π Example of adding a sensor with an overlay π
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "wand,imx6q-wandboard";
};
&{/} {
dht0 {
compatible = "dht11";
gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>;
};
};
π§ HINTS CONFIGURATION π§
On a device.hints(5) based system, such as MIPS, these values are configurable for gpioths:
hint.gpioths.<unit>.atβ thegpiobus(4)instance thegpiothsinstance is attached to.hint.gpioths.pinsβ a bitmask with a single bit set to indicate which gpio pin on thegpiobus(4)to use for data communications.
π SEE ALSO π
π HISTORY π
The gpioths driver first appeared in FreeBSD 11.1. periodt. π«Ά
π cute little sign-off, bestie: footer source/version is Debian, the date is December 8, 2019, and the page is GPIOTHS(4). slay. π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- π the page's license: BSD-2-Clause
- Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms