Switch from GPLv2 to GPLv2+
[fw/altos] / src / drivers / ao_cc1120.h
index 0f03f2c7c74dea874ba976e640f2c8cf070b4455..87b083d4f61aef6d60afa4b13efbe47a6e759265 100644 (file)
@@ -3,7 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
 #define  CC1120_PREAMBLE_CFG1_PREAMBLE_WORD_MASK       3
 
 #define CC1120_PREAMBLE_CFG0   0x0e
+#define  CC1120_PREAMBLE_CFG0_PQT_EN           5
+#define  CC1120_PREAMBLE_CFG0_PQT_VALID_TIMEOUT        4
+#define  CC1120_PREAMBLE_CFG0_PQT              0
+#define  CC1120_PREAMBLE_CFG0_PQT_MASK                 0xf
+
 #define CC1120_FREQ_IF_CFG     0x0f
 #define CC1120_IQIC            0x10
 #define CC1120_CHAN_BW         0x11
+#define  CC1120_CHAN_BW_CHFILT_BYPASS          7
+#define  CC1120_CHAN_BW_ADC_CIC_DECFACT                6
+#define  CC1120_CHAN_BW_ADC_CIC_DECFACT_20             0
+#define  CC1120_CHAN_BW_ADC_CIC_DECFACT_32             1
+#define  CC1120_CHAN_BW_BB_CIC_DECFACT         0
+
 #define CC1120_MDMCFG1         0x12
 #define  CC1120_MDMCFG1_CARRIER_SENSE_GATE     7
 #define  CC1120_MDMCFG1_FIFO_EN                        6
 #define CC1120_AGC_REF         0x17
 #define CC1120_AGC_CS_THR      0x18
 #define CC1120_AGC_GAIN_ADJUST 0x19
+
 #define CC1120_AGC_CFG3                0x1a
+#define  CC1120_AGC_CFG3_RSSI_STEP_THR         7
+#define  CC1120_AGC_CFG3_AGC_MIN_GAIN          0
+#define  CC1120_AGC_CFG3_AGC_MIN_GAIN_MASK     0x1f
+
 #define CC1120_AGC_CFG2                0x1b
+#define  CC1120_AGC_CFG2_START_PREVIOUS_GAIN_EN        7
+#define  CC1120_AGC_CFG2_FE_PERFORMANCE_MODE   5
+#define  CC1120_AGC_CFG2_FE_PERFORMANCE_MODE_OPTIMIZE_LINEARITY        0
+#define  CC1120_AGC_CFG2_FE_PERFORMANCE_MODE_NORMAL            1
+#define  CC1120_AGC_CFG2_FE_PERFORMANCE_MODE_LOW_POWER         2
+#define  CC1120_AGC_CFG2_FE_PERFORMANCE_MODE_MASK              3
+#define  CC1120_AGC_CFG2_AGC_MAX_GAIN          0
+#define  CC1120_AGC_CFG2_AGC_MAX_MASK          0x1f
+
 #define CC1120_AGC_CFG1                0x1c
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR     5
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR_UPDATE_AGC_UPDATE_RSSI              0
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR_FREEZE_AGC_UPDATE_RSSI              1
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR_UPDATE_AGC_UPDATE_RSSI_SLOW         2
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR_FREEZE_AGC_FREEZE_RSSI              3
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR_UPDATE_AGC_UPDATE_RSSI_4            4
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR_FREEZE_AGC_FREEZE_RSSI_5            5
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR_UPDATE_AGC_UPDATE_RSSI_SLOW_6       6
+#define  CC1120_AGC_CFG1_AGC_SYNC_BEHAVIOR_FREEZE_AGC_FREEZE_RSSI_7            7
+#define  CC1120_AGC_CFG1_AGC_WIN_SIZE          2
+#define  CC1120_AGC_CFG1_AGC_WIN_SIZE_8                        0
+#define  CC1120_AGC_CFG1_AGC_WIN_SIZE_16               1
+#define  CC1120_AGC_CFG1_AGC_WIN_SIZE_32               2
+#define  CC1120_AGC_CFG1_AGC_WIN_SIZE_64               3
+#define  CC1120_AGC_CFG1_AGC_WIN_SIZE_128              4
+#define  CC1120_AGC_CFG1_AGC_WIN_SIZE_256              5
+#define  CC1120_AGC_CFG1_AGC_WIN_SIZE_MASK             7
+#define  CC1120_AGC_CFG1_AGC_SETTLE_WAIT       0
+#define  CC1120_AGC_CFG1_AGC_SETTLE_WAIT_24            0
+#define  CC1120_AGC_CFG1_AGC_SETTLE_WAIT_32            1
+#define  CC1120_AGC_CFG1_AGC_SETTLE_WAIT_40            2
+#define  CC1120_AGC_CFG1_AGC_SETTLE_WAIT_48            3
+
 #define CC1120_AGC_CFG0                0x1d
+
+#define  CC1120_AGC_CFG0_AGC_HYST_LEVEL                6
+#define   CC1120_AGC_CFG0_AGC_HYST_LEVEL_2             0
+#define   CC1120_AGC_CFG0_AGC_HYST_LEVEL_4             1
+#define   CC1120_AGC_CFG0_AGC_HYST_LEVEL_7             2
+#define   CC1120_AGC_CFG0_AGC_HYST_LEVEL_10            3
+
+#define  CC1120_AGC_CFG0_AGC_SLEWRATE_LIMIT    4
+#define   CC1120_AGC_CFG0_AGC_SLEWRATE_LIMIT_60                0
+#define   CC1120_AGC_CFG0_AGC_SLEWRATE_LIMIT_30                1
+#define   CC1120_AGC_CFG0_AGC_SLEWRATE_LIMIT_18                2
+#define   CC1120_AGC_CFG0_AGC_SLEWRATE_LIMIT_9         3
+
+#define  CC1120_AGC_CFG0_RSSI_VALID_CNT                2
+#define   CC1120_AGC_CFG0_RSSI_VALID_CNT_2             0
+#define   CC1120_AGC_CFG0_RSSI_VALID_CNT_3             1
+#define   CC1120_AGC_CFG0_RSSI_VALID_CNT_5             2
+#define   CC1120_AGC_CFG0_RSSI_VALID_CNT_9             3
+
+#define  CC1120_AGC_CFG0_AGC_ASK_DECAY         0
+#define   CC1120_AGC_CFG0_AGC_ASK_DECAY_1_16           0
+#define   CC1120_AGC_CFG0_AGC_ASK_DECAY_1_32           1
+#define   CC1120_AGC_CFG0_AGC_ASK_DECAY_1_64           2
+#define   CC1120_AGC_CFG0_AGC_ASK_DECAY_1_128          3
+
 #define CC1120_FIFO_CFG                0x1e
+#define  CC1120_FIFO_CFG_CRC_AUTOFLUSH         7
+#define  CC1120_FIFO_CFG_FIFO_THR              0
 #define CC1120_DEV_ADDR                0x1f
 #define CC1120_SETTLING_CFG    0x20
 #define  CC1120_SETTLING_CFG_FS_AUTOCAL                3
 #define  CC1120_SETTLING_CFG_FS_AUTOCAL_MASK           3
 #define  CC1120_SETTLING_CFG_LOCK_TIME         1
 #define  CC1120_SETTLING_CFG_LOCK_TIME_50_20           0
-#define  CC1120_SETTLING_CFG_LOCK_TIME_70_30           1
+#define  CC1120_SETTLING_CFG_LOCK_TIME_75_30           1
 #define  CC1120_SETTLING_CFG_LOCK_TIME_100_40          2
 #define  CC1120_SETTLING_CFG_LOCK_TIME_150_60          3
 #define  CC1120_SETTLING_CFG_LOCK_TIME_MASK            3
 #define  CC1120_PKT_CFG1_APPEND_STATUS 0
 
 #define CC1120_PKT_CFG0                0x28
+#define  CC1120_PKT_CFG0_RESERVED7     7
 #define  CC1120_PKT_CFG0_LENGTH_CONFIG 5
 #define  CC1120_PKT_CFG0_LENGTH_CONFIG_FIXED           0
 #define  CC1120_PKT_CFG0_LENGTH_CONFIG_VARIABLE                1
 #define CC1120_DIRECT_FIFO     0x3e
 #define CC1120_FIFO            0x3f
 
+#define CC1120_FIFO_SIZE       128
+
 /* Extended register space */
 
 #define CC1120_EXTENDED_BIT    0x8000
 #define CC1120_MARC_SPARE      (CC1120_EXTENDED_BIT | 0x03)
 #define CC1120_ECG_CFG         (CC1120_EXTENDED_BIT | 0x04)
 #define CC1120_SOFT_TX_DATA_CFG        (CC1120_EXTENDED_BIT | 0x05)
+#define  CC1120_SOFT_TX_DATA_CFG_SYMBOL_MAP_CFG                5
+#define  CC1120_SOFT_TX_DATA_CFG_SOFT_TX_DATA_EN       0
 #define CC1120_EXT_CTRL                (CC1120_EXTENDED_BIT | 0x06)
 #define CC1120_RCCAL_FINE      (CC1120_EXTENDED_BIT | 0x07)
 #define CC1120_RCCAL_COARSE    (CC1120_EXTENDED_BIT | 0x08)