anchor.diff:         $11 constant RF:PA
          $18 constant RF:LNA
          $1F constant RF:AFC
  -       $21 constant RF:FEI
          $24 constant RF:RSSI
          $27 constant RF:IRQ1
          $28 constant RF:IRQ2
          $2F constant RF:SYN1
  -       $30 constant RF:SYN2
  +       $31 constant RF:SYN3
          $39 constant RF:ADDR
          $3A constant RF:BCAST
          $3C constant RF:THRESH
  
positive.code:   29C4 h, \ RSSI thres -98dB
    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
    37D0 h, \ drop pkt if CRC fails
    3842 h, \ max 62 byte payload
    3C8F h, \ fifo thres
    3D12 h, \ PacketConfig2, interpkt = 1, autorxrestart on
  
negative.code:   ( u ) 6 lshift RF:FRF 2+ rf!
    ;
  
  : rf-correct ( -- ) \ correct the freq based on the AFC measurement of the last packet
    rf.afc @ 16 lshift 16 arshift 61 *         \ AFC correction applied in Hz
    2 arshift                                  \ apply 1/4 of measured offset as correction
    5000 over 0< if negate max else min then   \ don't apply more than 5khz
    rf.freq @ + dup rf.freq ! rf-freq          \ apply correction
    ;
  
  : rf-group ( u -- ) RF:SYN3 rf! ;  \ set the net group (1..250)
  
  : rf-check ( b -- )  \ check that the register can be accessed over SPI
    begin  dup RF:SYN1 rf!  RF:SYN1 rf@  over = until
  