STRUCT W1_UART_DEVICE(9)
πΈ NAME πΈ
struct w1_uart_device β the 1-Wire UART device structure, bestie π
okay so like, quick vibe check: this is from the Kernel API Manual, section 9, and it's the little struct that holds literally everything a 1-Wire-over-UART device needs to function. it's giving "main character energy" for the whole driver ngl π
β¨ SYNOPSIS β¨
struct w1_uart_device {
struct serdev_device *serdev;
struct w1_bus_master bus;
struct w1_uart_config cfg_reset;
struct w1_uart_config cfg_touch_0;
struct w1_uart_config cfg_touch_1;
struct completion rx_byte_received;
struct mutex rx_mutex;
int rx_err;
u8 rx_byte;
};
like yes, that's the whole glow-up π copy it exactly, no cap.
π¦ Members π¦
serdevβ the serial device, aka the actual hardware bestie this whole thing rides on π«Άbusβ the w1-bus master, the icon that runs the 1-Wire show πcfg_resetβ the config for a 1-Wire reset β¨cfg_touch_0β the config for a 1-Wire write-0 cycle π (yes, zero, that's not a typo)cfg_touch_1β the config for a 1-Wire write-1 and read cycle π two jobs, one struct field, we love a multitaskerrx_byte_receivedβ completion for serdev receive, aka the "omg the byte arrived!!" notification πrx_mutexβ a mutex to protectrx_errandrx_byte, because sharing is caring but also race conditions are not it πrx_errβ indicates an error in serdev-receive πrx_byteβ the result byte from serdev-receive π
lowkey important:rx_mutexguardsrx_errandrx_bytetogether. don't be out here touching those two without it, fr fr.
π₯ SEE ALSO π₯
- Kernel file
./drivers/w1/masters/w1-uart.c struct w1_uart_config(9)struct w1_uart_limits(9)
go read those next, iykyk π
and that's the tea, bestie β this page lives under Kernel file ./drivers/w1/masters, dated October 2026 β slay, go write some 1-Wire code, periodt π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms