This time using customized interrupts to fill RMT memory on-the-fly.
* Added getChannel() to RFControl
* Add 3rd, optional, boolean argument to RFControl(int pin, bool refTick, bool defaultDrive) to that RMT can be initialized but without the default driver (allows for use of custom interrupt code instead)
Also add getPin() to RFControl (which is used by SK68XX Class) as well as boolean operator overrides for both RFControl and PwmPin/ServoPin so that instances can be checked for validity.
Allows you to overlay a carrier wave on the RF Signal - in practice this is only used for IR signals (not RF). Automatically scales frequency to account for 80x difference between APB Clock and Ref Tick Clock depending on which is used. Checks to ensure resulting parameters (high period and low period) are all in bounds (0,65536) and reports an error if they are not.
Added second argument to RFControl(uint8_t pin, boolean refClock=true) to allow choice of Ref Tick (1 MHz) clock or APB (80 MHz) clock. Default is to use 1 MHz Ref Tick.
Also fixed bug in logic that divides clock for ESP32-C3. Factor should be 79, not 80, since divider is apparently configured to divide by factor+1.
Instead of limiting number of ticks to 15-bits (32767), RFControl allows for tick size to be any 32-bit number. If ticks > 32767, RFControl adds repeated LOW or HIGH phases as needed to match full duration. This provides for much more flexibility in creating pulse trains that include very long-duration "spaces" between repeats.
Testing completed for RFControl and PWM on all three ESP32 chip types.
To Do: update RFControl documentation to include total number of usable channels per chip, as well as the alternate version of start();
RFControl::phase() allows you to add either a HIGH or LOW entry (i.e. a single phase of a pulse. RFControl::add() continues to add a full HIGH/LOW pulse so these changes are fully backwards compatible.
Instead of pre-defining RF433 and RF315, the user should define their own RFControl{pin} as a variable in their device-specific DEV_*.h file. Makes RFControl more generic and not specific to any transmitter name (such as 433 or 315). Also means that the pin can be set by the user instead of having to modify RFControl.h deep in the library.