ir_raw_gen_pd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ir_raw_gen_pd(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” specifically the page for ir_raw_gen_pd, which is literally the function that encodes your data into raw events using pulse-distance modulation. yes, that kind of infrared vibe. iykyk. πŸ¦‹


✨ NAME ✨

ir_raw_gen_pd β€” Encode data to raw events with pulse-distance modulation.

like, it takes your bits and turns them into IR pulses and spaces. iconic behavior honestly. πŸŽ€


🌸 SYNOPSIS 🌸

int ir_raw_gen_pd (struct ir_raw_event **ev , unsigned int max , const
       struct ir_raw_timings_pd *timings , unsigned int n , u64 data );

copy it exactly bestie, no typos, the compiler does NOT forgive πŸ’€


🫢 ARGUMENTS 🫢

  • ev β€” Pointer to pointer to next free event. *ev gets incremented for each raw event filled. it's giving "the cursor moves as you write" energy ✨
  • max β€” Maximum number of raw events to fill. the ceiling. the limit. the budget, if you will. πŸ‘‘
  • timings β€” Pulse distance modulation timings. all the pulse-y/spacey numbers live here πŸ’…
  • n β€” Number of bits of data. how many bits we're actually cooking with πŸ“
  • data β€” Data bits to encode. the actual payload, the main character 😌

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea: it encodes the n least significant bits of data using pulse-distance modulation, with all the timing characteristics described by timings, writing up to max raw IR events using the *ev pointer.

lowkey that's the whole thing. n bits go in, pulses come out, *ev keeps scooting forward. no cap, it's just that. 🌈


⭐ RETURN ⭐

  • 0 on success β€” slay, we ate, everything fit πŸ’–
  • -ENOBUFS if there isn't enough space in the array to fit the full encoded data. and yes, in that case all max events will have been written β€” so it filled the whole thing up and then ran out of room 😭
bestie pls check your max before you call this, because -ENOBUFS means you already burned your entire buffer. not a drill. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/media/rc/rc-ir-raw.c, plus the whole friend group:


and that's the page!! 🧚 mwah πŸ’‹

sign-off ~ this little gem lives in ./drivers/media/rc and the date on the tin is October 2026. go forth and modulate, bestie πŸ’œβœ¨
πŸ“¦ where this page comes from