Functional Echo / Loopback on RFM23BP

KatanaLRS.c
Main Loop now has both Rx and Tx of Received Payload, working size mechanisms

rfm22b.c/.h
rfmReadFIFOn, wanted to do function overloading, time to do C++

Signed-off-by: Stephen Carlson <stephen_carlson@byu.edu>
Found Critical Bug in LRS Freq Calculation. Still Corrupt on Tx

Found the bug when using the current modifications to transmit along the offset range. Got 436 MHz when wanted 433 MHz.
The LRS Channel Set method in the rfm22b library was not casting operands correctly.
On the 23BP, the severe issue still remains that the RFM is corrupted after starting a TX.


KatanaLRS:
Main Loop modified for transmitting along the offset.
Was considering enabling the Low Battery Detector, as the Saleae scope is showing what may be brownout behavior:
	The last thing commited before it goes unstable is ordering Tx Manual (0x07 <- 0x0A)
	200 ms later, the system checks and write for TUNE, but the state is 0x82 on 0x07, so the Reset bit is active and Tx is done.
	Just about every register interaction thereafter is flagging an error and showing bogous values.
When the system goes unstable after attempting a manual Tx, I use the 'J' console command to dump registers, looks like everything is getting nuked, not to default values, but total messed-up ones.
EMI/RFI?

RFM22 Library:
Corrected some loops to i==199 instead of the faulty 200 on assert for loops.
Note: Need to make a utility method called assert, it would do all this for loop stuff.
Obviously, changed the rfmSetLrsChannel method to work.
Changed GPIO2 to Preamble output
Back-calculated the IF Loop and Clock coefficients, everything checks out, bumped the 0x1C value to 0x2B to cover the middle of the band the FHSS jumps in.
Enabled the AFC
The FHSS settings array is corrected back to the DragonLink Specs:
	Receive PH with reversed bits
	3 Sync Words
	3 nibbles of Preamble length. Learned more on the length requirement, must be honest when declaring length.
	1 nibble of Sync detect, not sure if it helps.
	Two versions of Sync word, use 0x90 0x42 0xE1, the 0xD0 0x50 are legacy/weird

Signed-off-by: Stephen Carlson <stephen_carlson@byu.edu>
DL Single FHSS Channel Tx Modification

Have the KatanaLRS spitting out packets that are fairly close to the DragonLink spec.
(Fairly close, relative to the entire project history.)
Don't have the long low period or the data contents made, but the sync and headers are correct.

KatanaLRS:
Populate dataBufferA with series set
Ticks at 500 ms instead of 2700 ms, as I'm producing test footage rather than trying to measure it.
Several chunks of code copied and moved around. Ok, that's sort of a useless comment, whatever....

RFM Library:
Tweaked IF and Clock settings, from Spreadsheet
	AFC increased to 20 kHz
	Deviation up to 5.6 from 5.4 kHz
	Clock Loop corrected for increased deviation
	Enabled Tx Packet Handler
	Increased Preamble Detect to 3 nibbles to reduce false locks. The mechanism is probably missing lots of good packets because of it's restart/timeout feature.
	Preamble Length increased to match DragonLink's
	Sync Words recalculated to match preamble parity/polarity on DragonLink



Signed-off-by: Stephen Carlson <stephen_carlson@byu.edu>
DL Single FHSS Channel Tx Modification Tweak

Scrapped the drifting carrier, stays on an exact frequency now.

Signed-off-by: Stephen Carlson <stephen_carlson@byu.edu>
DL Single FHSS Channel Rx Modification

Simple Frequency centering algorithm with holdoff/pause on loss of signal.
Tracks the Tx test signal from the RFM23BP fine.

KatanaLRS:
Repurposed manualFreq, rediscovered timestamp and found it was already doing what I would have done to it.
afcValue brought out to static in main loop.
Changed ticker to 2 seconds.
Enabled the Rx mechansims, commented out Tx, obvious.
Tried two approaches to the decay-tracking-residual controller. Best one active.
The AFC overrides the Freq Offset Registers 0x73 and 0x74, must calculate and insert offset in 0x76/0x77.
AFC is read out on 0x2B/0x2C. With 0x73/0x74 were mirror of that, appearently don't reflect their duals.

RFM Library:
Enabled AFC, oops, wrong 0x44 flipped to 0x04, need to fix that line.

Signed-off-by: Stephen Carlson <stephen_carlson@byu.edu>

Note: Works on the DragonLink! Tracks Channel 96 (5th entry in array)

CRITICAL NOTE!!!!!
Forgot that this needs to be flagged with the RFM22B, NOT the RFM23BP. RF switches are backward!
DL FHSS Following Rx w/ AFC Offset

This commit demonstrates the KatanaLRS following the DragonLink FHSS stream, but not at full sequence, but on missing most cycles and only catching the next.
I have included + and - in the UART jump table to manually increase and decrease the freqOffset variable.
In this test, I had to increase the freqOffset to +180 to catch the DL stream. All the frequencies jumpped to seem to be the same offset of 175 to 180.

KatanaLRS:
UART Rx Jump Table additions.
freqOffset now used to filter and store AFC offset. Declared static volatile for UART.
Redo of frequency formulas.
DL Channel is incremented on RFM_INT, manualFreq+freqOffset sent to RFM.
As mentioned last commit, changed to RFM22B for the device under test.

Signed-off-by: Stephen Carlson <stephen_carlson@byu.edu>

Ammendment: Added GPIO2 System Duty Indication, reduced packet size, now blazes through the list full-speed until it hicups.

Signed-off-by: Stephen Carlson <stephen_carlson@byu.edu>