pwm_capture(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pwm_capture(9) β€” a Kernel API Manual moment πŸ’–

okay so bestie, welcome to pwm_capture(9), aka the kernel API manual page that's literally about capturing a PWM signal and reporting back what it found πŸŽ€ like, it goes and looks at the signal for you and comes back with the tea.


✨ NAME ✨

pwm_capture β€” capture and report a PWM signal πŸ’…


🌸 SYNOPSIS 🌸

int pwm_capture (struct pwm_device *pwm , struct pwm_capture *result ,
       unsigned long timeout );

that's the whole vibe, no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • pwm β€” the PWM device, the main character of this whole operation πŸ‘‘
  • result β€” the structure you fill with the capture result, like a little tupperware container for signal data πŸ“
  • timeout β€” how long to wait, in milliseconds, before giving up on the capture 😭 like a situationship with a deadline

⭐ RETURN ⭐

0 on success, or a negative error code on failure πŸ’€ so basically: zero = slay, negative = not slay.


🌈 SEE ALSO 🌈

Kernel file ./drivers/pwm/core.c β€” that's where the magic lives, iykyk ✨

and then the whole friend group, fr fr:

go read them all, they ate πŸ”₯


lowkey reminder: the capture can time out on you, and when it does you get that negative error code β€” no signal, no problem, just handle it bestie πŸ™ˆ

and that's the page!! πŸ’œ it lives under ./drivers/pwm, dated October 2026, and yes it's still called pwm_capture(9) β€” periodt. bye bestie, go capture some waveforms πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from