"""Anaren-recommended settings for FCC/ETSI compat. 

From: 
    http://www.anaren.com/sites/default/files/uploads/File/BoosterPack_Users_Manual.pdf
"""


# use third column as starting settings
_data = """
0 00 IOCFG2 29 29 29 29 29 29 FF
1 01 IOCFG1 2E 2E 2E 2E 2E 2E FF
2 02 IOCFG0 06 06 06 06 06 06 FF
3 03 FIFOTHR 07 07 07 07 07 07 FF
4 04 SYNC1 D3 D3 D3 D3 D3 D3 FF
5 05 SYNC0 91 91 91 91 91 91 FF
6 06 PKTLEN FF 3D 3D FF FF 3D FF
7 07 PKTCTRL1 04 04 04 04 04 04 FF
8 08 PKTCTRL0 05 05 05 05 05 05 8F
9 09 ADDR 00 00 00 00 00 00 FF
10 0A CHANNR 00 00 00 00 00 00 FF
11 0B FSCTRL1 06 05 0C 0C 0D 0D FF
12 0C FSCTRL0 00 00 00 00 00 00 FF
13 0D FREQ2 20 20 21 21 21 21 00
14 0E FREQ1 25 25 6B 6B 6B 6B 00
15 0F FREQ0 ED ED 24 24 24 24 00
16 10 MDMCFG4 EA F7 15 1A 1B 0D F0
17 11 MDMCFG3 71 75 75 71 E5 2F 00
18 12 MDMCFG2 13 13 03 03 03 03 07
19 13 MDMCFG1 20 20 21 21 21 21 FC
20 14 MDMCFG0 F8 F8 E5 E5 E5 E5 00
21 15 DEVIATN 33 30 71 71 71 71 88
22 16 MCSM2 07 07 07 07 07 07 FF
23 17 MCSM1 30 30 30 30 30 30 FF
24 18 MCSM0 18 18 18 18 18 18 FF
25 19 FOCCFG 16 16 1D 1D 1D 1D FF
26 1A BSCFG 6C 6C 1C 1C 1C 1C FF
27 1B AGCCTRL2 43 04 47 47 47 C7 FF
28 1C AGCCTRL1 4F 4F 40 40 40 40 FF
29 1D AGCCTRL0 91 91 B0 B0 B0 B0 FF
30 1E WOREVT1 00 00 00 00 00 00 FF
31 1F WOREVT0 00 00 00 00 00 00 FF
32 20 WORCTRL F8 FB F8 F8 F8 F8 FF
33 21 FREND1 56 56 B7 B7 B7 B7 FF
34 22 FREND0 10 10 10 10 10 10 FF
35 23 FSCAL3 E9 E9 E9 E9 EA EA FF
36 24 FSCAL2 2A 2A 2A 2A 2A 2A FF
37 25 FSCAL1 00 00 00 00 00 00 FF
38 26 FSCAL0 1F 1F 1F 1F 1F 1F FF
39 27 RCCTRL1 00 00 00 00 00 00 FF
40 28 RCCTRL0 00 00 00 00 00 00 FF
41 29 FSTEST 59 59 59 59 59 59 00
42 2A PTEST 7F 7F 7F 7F 7F 7F 7F
43 2B AGCTEST 3F 3F 3E 3F 3F 3C 0
44 2C TEST2 81 81 88 88 88 88 FF
45 2D TEST1 35 35 31 31 31 31 FF
46 2E TEST0 09 09 09 09 09 09 FF
47 2F 0 00 00 00 00 00 00 0
""".split('\n')

def proc(line):
    line = line.split()
    addr = int('0x'+line[1], 16)
    val = int('0x'+line[5], 16)
    return (addr, val)

_data = [proc(d) for d in _data if d]

fcc_default = _data
