anchor.diff:    begin  dup RF:SYN1 rf!  RF:SYN1 rf@  over = until
     drop ;
   
  -: rf-init ( group freq -- )  \ init the RFM69 radio module
  +: rf-ini ( group freq -- )  \ internal init of the RFM69 radio module
     spi-init
     $AA rf-check  $55 rf-check  \ will hang if there is no radio!
     rf:init rf-config!
     rf-freq rf-group ;
   
  +\ rf-rssi checks whether the rssi bit is set in IRQ1 reg and sets the LED to match.
  +\ It also checks whether there is an rssi timeout and restarts the receiver if so.
  +: rf-rssi ( -- )
  +  RF:IRQ1 rf@
  +  dup RF:IRQ1_RSSI and 3 rshift 1 swap - LED io!
  +  dup RF:IRQ1_TIMEOUT and if
  +      RF:M_FS rf!mode
  +    then
  +  drop ;
  +
  +\ rf-status fetches the IRQ1 reg, checks whether rx_ready is set and was not set
  +\ in rf.last. If so, it saves rssi, lna, and afc values; and then updates rf.last.
  +\ rf.last ensures that the info is grabbed only once per packet.
   : rf-status ( -- )  \ update status values on RXRDY
     RF:IRQ1 rf@  RF:IRQ1_RXRDY and  rf.last @ <> if
       rf.last  RF:IRQ1_RXRDY over xor!  @ if
  
positive.code: 
       7 bit constant RF:IRQ1_MRDY
       6 bit constant RF:IRQ1_RXRDY
       0 bit constant RF:IRQ1_SMATCH
  
       6 bit constant RF:IRQ2_FIFO_NE
  
negative.code:    0 variable rf.afc
    66 buffer:  rf.buf
  
  8683 variable rf.freq
    42 variable rf.group
    61 variable rf.nodeid
  
  \ jcw version
  \ create rf:init  \ initialise the radio, each 16-bit word is <reg#,val>
  \ hex
  \   0200 h, 0302 h, 048A h, 0502 h, 06E1 h, 0B20 h, 194A h, 1A42 h,
  \   1E0C h, 2607 h, 29A0 h, 2B40 h, 2D05 h, 2E88 h, 2F2D h, 302A h, 37D0 h,
  \   3842 h, 3C8F h, 3D12 h, 6F20 h, 7102 h, 0 h,  \ sentinel
  
  \  0200 h, 0302 h, 048A h, 0505 h, 06C3 h, 0B20 h, 1942 h, 1A42 h,
  \  1E0C h, 2607 h, 29C4 h, 2D05 h, 2E88 h, 2F2D h, 302A h, 37D0 h,
  \  3842 h, 3C8F h, 3D12 h, 6F20 h, 7102 h, 0 h,  \ sentinel
  
  \ tve version copied from Go driver
  create rf:init  \ initialise the radio, each 16-bit word is <reg#,val>
  hex
    0100 h, \ opmode: sleep
    0200 h, \ packet mode, fsk
    0302 h, 048A h, \ bit rate 49,261 hz
    0502 h, 06E1 h, \ 45Khz Fdev
    0B20 h, \ low M
    194A h, 1A42 h, \ RxBw 100khz, AFCBw 125khz
    1E0C h, \ AFC auto-clear, auto-on
    2607 h, \ disable clkout
    29A0 h, \ RSSI thres -80dB
    2B40 h, \ RSSI timeout after 128 bytes
    2D05 h, \ Preamble 5 bytes
    2E88 h, \ sync size 2 bytes
    2F2D h, \ sync1: 0x2D
    302A h, \ sync2: network group
    37D8 h, \ deliver even if CRC fails
    3842 h, \ max 62 byte payload
    3C8F h, \ fifo thres
    3D12 h, \ PacketConfig2, interpkt = 1, autorxrestart on
    6F20 h, \ Test DAGC
    7102 h, \ RegTestAfc
    0 h,  \ sentinel
  decimal align
  
  \ r/w access to the RF registers
  