pwm_config(9)
π pwm_config(9) β aka the Kernel API Manual glow-up π
Okay bestie, welcome to the pwm_config page from the Kernel API Manual, section 9. Buckle up, this one's short but it matters. β¨
π NAME π
pwm_config β change a PWM device configuration. That's it, that's the whole vibe. She tweaks the setup on a PWM device, and honestly? Iconic. π
β¨ SYNOPSIS β¨
int pwm_config (struct pwm_device *pwm , int duty_ns , int period_ns );
Three args, one int coming back at you. Simple. Clean. No cap. π«Ά
πΈ ARGUMENTS πΈ
pwmβ the PWM device itself. Like, the actual thing you're configuring. Your main character. πduty_nsβ the "on" time, measured in nanoseconds. So like, how long the signal stays high. Ngl, nanosecond precision is such a flex. βperiod_nsβ how long one whole cycle lasts, also in nanoseconds. One full lap around the sun, but make it a signal. π₯
π RETURN π
You get 0 on success β slay, everything worked π β or a negative error code on failure. If you see a negative number, that's your vibe check failing, bestie. π
π¦ SEE ALSO π¦
So many friends in the ./include/linux/pwm.h kernel file, and they all ate:
enum pwm_polarity(9)struct pwm_args(9)struct pwm_waveform(9)struct pwm_device(9)pwm_get_state(9)pwm_init_state(9)pwm_get_relative_duty_cycle(9)pwm_set_relative_duty_cycle(9)struct pwm_capture(9)struct pwm_ops(9)struct pwm_chip(9)pwmchip_supports_waveform(9)pwm_enable(9)pwm_disable(9)pwm_might_sleep(9)
Go read them. Seriously. They're giving lore. πβ¨
That's the whole page, bestie β short, sweet, and fully sourced from ./include/linux, dated October 2026. 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