/*
* Copyright (c) 2005 David Young. All rights reserved.
*
* This code was written by David Young.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY David Young ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL David
* Young BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
#define SA2400_OPMODE 4 /* Operating mode, filter tuner,
* other controls
*/
/* 1: in Rx mode, RSSI-ADC always on 0: RSSI-ADC only on during AGC */
#define SA2400_OPMODE_ADC __BIT(19)
/* read-only filter tuner error: 1 if tuner out of range */
#define SA2400_OPMODE_FTERR __BIT(18)
/* Rx & Tx filter tuning, write tuning value (test mode only) or
* read tuner setting (in normal mode).
*/
#define SA2400_OPMODE_FILTTUNE_MASK __BITS(17,15)
#define SA2400_AGC 5 /* AGC adjustment */
#define SA2400_AGC_TARGETSIGN __BIT(23) /* fine-tune AGC target:
* -7dB to 7dB, sign bit ... */
#define SA2400_AGC_TARGET_MASK __BITS(22,20) /* ... plus 0dB - 7dB */
#define SA2400_AGC_MAXGAIN_MASK __BITS(19,15) /* maximum AGC gain, 0 to 31,
* (yields 54dB to 85dB)
*/
/* write: settling time after baseband gain switching, units of
* 182 nanoseconds.
* read: output of RSSI/Tx-peak detector's ADC in 5-bit Gray code.
*/
#define SA2400_AGC_BBPDELAY_MASK __BITS(14,10)
#define SA2400_AGC_ADCVAL_MASK SA2400_AGC_BBPDELAY_MASK
/* write: settling time after LNA gain switching, units of
* 182 nanoseconds
* read: 2nd sample of RSSI in AGC cycle
*/
#define SA2400_AGC_LNADELAY_MASK __BITS(9,5)
#define SA2400_AGC_SAMPLE2_MASK SA2400_AGC_LNADELAY_MASK
/* write: time between turning on Rx and AGCSET, units of
* 182 nanoseconds
* read: 1st sample of RSSI in AGC cycle
*/
#define SA2400_AGC_RXONDELAY_MASK __BITS(4,0)
#define SA2400_AGC_SAMPLE1_MASK SA2400_AGC_RXONDELAY_MASK
#define SA2400_MANRX 6 /* Manual receiver control settings */
#define SA2400_MANRX_AHSN __BIT(23) /* 1: AGC w/ high S/N---switch
* LNA at step 52
* (recommended)
* 0: switch LNA at step 60
*/
#define SA2400_MANRX_RXOSION __BIT(17) /* Rx I-channel correction. */
#define SA2400_MANRX_RXOSISIGN __BIT(16)
#define SA2400_MANRX_RXOSI_MASK __BITS(15,13)
#define SA2400_MANRX_TEN __BIT(12) /* use 10MHz offset cancellation
* cornerpoint for brief period
* after each gain change
*/
/* DC offset cancellation cornerpoint select
* write: in RXMGC, set the cornerpoint
* read: in other modes, read AGC-controlled cornerpoint
*/
#define SA2400_MANRX_CORNERFREQ_MASK __BITS(11,10)
/* write: in RXMGC mode, sets receiver gain
* read: in other modes, read AGC-controlled gain
*/
#define SA2400_MANRX_RXGAIN_MASK __BITS(9,0)
#define SA2400_TX 7 /* Transmitter settings */
/* Tx offsets
*
* write: in test mode, sets the offsets
* read: in normal mode, returns automatic settings
*/
#define SA2400_TX_TXOSQON __BIT(19)
#define SA2400_TX_TXOSQSIGN __BIT(18)
#define SA2400_TX_TXOSQ_MASK __BITS(17,15)
#define SA2400_TX_TXOSION __BIT(14)
#define SA2400_TX_TXOSISIGN __BIT(13)
#define SA2400_TX_TXOSI_MASK __BITS(12,10)
#define SA2400_VCO 8 /* VCO settings */
#define SA2400_VCO_ZERO __BITS(6,5) /* always zero */
#define SA2400_VCO_VCERR __BIT(4)/* VCO calibration error flag---no
* band with low enough frequency
* could be found
*/
#define SA2400_VCO_VCOBAND_MASK __BITS(3,0) /* VCO band,
* write: in test mode, sets
* VCO band
* read: in normal mode,
* the result of
* calibration (VCOCAL).
* 0 = highest
* frequencies
*/
#endif /* _DEV_IC_SA2400REG_H_ */