ir_raw_gen_pd(9)
π 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.*evgets 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 β
0on success β slay, we ate, everything fit π-ENOBUFSif there isn't enough space in the array to fit the full encoded data. and yes, in that case allmaxevents will have been written β so it filled the whole thing up and then ran out of room π
bestie pls check yourmaxbefore you call this, because-ENOBUFSmeans 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:
ir_raw_event_store(9)ir_raw_event_store_edge(9)ir_raw_event_store_with_filter(9)ir_raw_event_set_idle(9)ir_raw_event_handle(9)ir_raw_gen_manchester(9)ir_raw_gen_pl(9)ir_raw_encode_scancode(9)ir_raw_edge_handle(9)ir_raw_encode_carrier(9)
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
- 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