Bit-Bang PWM at high speed

For IR signals you have to not have some bits.
I wonder if SPI or soft-SPI could be used to drive the led?