STRUCT PWMCHIP_WAVEFORM(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ struct pwmchip_waveform(9) β€” like, the whole vibe ✨

okay so bestie, welcome to the Kernel API Manual entry for struct pwmchip_waveform, and no cap, this one is literally the blueprint for describing a PWM waveform on a pwm_chip's PWM channel. every field is about to eat, so let's go πŸ’…


✨ NAME ✨

struct pwmchip_waveform β€” describes a PWM waveform for a pwm_chip's PWM channel πŸŽ€


🌸 SYNOPSIS 🌸

struct pwmchip_waveform {
    __u32 hwpwm;
    __u32 __pad;
    __u64 period_length_ns;
    __u64 duty_length_ns;
    __u64 duty_offset_ns;
 };

like, that's the whole struct. she's cute, she's tidy, she's iconic πŸ¦‹


πŸ’– MEMBERS πŸ’–

girlies, meet the fields β€” every single one matters, so pay attention πŸ™ˆ

  • hwpwm β€” the per-chip relative index of the PWM device. think of it as her little ID number inside the chip πŸ‘‘
  • __pad β€” padding, and it must be zero. no negotiations, no exceptions, fr fr πŸ’€
  • period_length_ns β€” the duration of the repeating period. and listen: a value of 0 represents a disabled PWM, so don't be out here acting surprised πŸŒ™
  • duty_length_ns β€” the duration of the active part in each period. that's the "on" chunk of the wave, the main character energy of the whole thing ⚑
  • duty_offset_ns β€” the offset of the rising edge from a period's start. where the wave gets up and starts living πŸŒ…

🌈 SEE ALSO 🌈

kernel file ./include/uapi/linux/pwm.h β€” go read it, iykyk πŸ“–


lowkey reminder bestie: __pad stays zero and period_length_ns = 0 means the PWM is off. that's the whole mood, don't forget it πŸ’œ

and that's the page!! sourced from ./include/uapi/linux, dated October 2026, and yes the header up top said struct pwmchip_waveform(9) like the queen she is 🫢 slay, bye πŸ’…βœ¨

πŸ“¦ where this page comes from