SWCU193 April 2023 CC2340R2 , CC2340R5 , CC2340R5-Q1
By using LGPT0 and LGPT1 the timers can generate IR codes with minimal software interaction. By enabling IRGEN.CTL in LGPT0 an AND gate is set between T0C0 and T1C0, the output of this AND gate replaces T0C0. In IR generation mode LGPT0 generates the carrier wave, while LGP1 works as the modulator.
Below is an example on how to setup the timers for IR with a 38 kHz carrier wave.
LGPT0 (Carrier wave generation):
(PRECFG.TICKDIV+1)*TGT*2 = 48 MHz / 38 kHz
E.g. PRECFG.TICKDIV = 3 and TGT 421. This gives a carrier wave of approximately 38 kHz (Theoretically 38.00475 kHz).
Configure EVTSVT
LGPT1 (Modulator, example for the NEC protocol)