rf3000reg.h revision 1.3.2.2 1 1.3.2.2 skrll /* $NetBSD: rf3000reg.h,v 1.3.2.2 2004/08/03 10:46:18 skrll Exp $ */
2 1.3.2.2 skrll
3 1.3.2.2 skrll /*
4 1.3.2.2 skrll * Copyright (c) 2005 David Young. All rights reserved.
5 1.3.2.2 skrll *
6 1.3.2.2 skrll * This code was written by David Young.
7 1.3.2.2 skrll *
8 1.3.2.2 skrll * Redistribution and use in source and binary forms, with or without
9 1.3.2.2 skrll * modification, are permitted provided that the following conditions
10 1.3.2.2 skrll * are met:
11 1.3.2.2 skrll * 1. Redistributions of source code must retain the above copyright
12 1.3.2.2 skrll * notice, this list of conditions and the following disclaimer.
13 1.3.2.2 skrll * 2. Redistributions in binary form must reproduce the above copyright
14 1.3.2.2 skrll * notice, this list of conditions and the following disclaimer in the
15 1.3.2.2 skrll * documentation and/or other materials provided with the distribution.
16 1.3.2.2 skrll * 3. Neither the name of the author nor the names of any co-contributors
17 1.3.2.2 skrll * may be used to endorse or promote products derived from this software
18 1.3.2.2 skrll * without specific prior written permission.
19 1.3.2.2 skrll *
20 1.3.2.2 skrll * THIS SOFTWARE IS PROVIDED BY David Young ``AS IS'' AND ANY
21 1.3.2.2 skrll * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 1.3.2.2 skrll * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 1.3.2.2 skrll * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL David
24 1.3.2.2 skrll * Young BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 1.3.2.2 skrll * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26 1.3.2.2 skrll * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.3.2.2 skrll * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 1.3.2.2 skrll * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 1.3.2.2 skrll * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.3.2.2 skrll * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
31 1.3.2.2 skrll * OF SUCH DAMAGE.
32 1.3.2.2 skrll */
33 1.3.2.2 skrll
34 1.3.2.2 skrll #ifndef _DEV_IC_RF3000REG_H_
35 1.3.2.2 skrll #define _DEV_IC_RF3000REG_H_
36 1.3.2.2 skrll
37 1.3.2.2 skrll /*
38 1.3.2.2 skrll * Serial bus format for RF Microdevices RF3000 spread-spectrum
39 1.3.2.2 skrll * baseband modem.
40 1.3.2.2 skrll */
41 1.3.2.2 skrll #define RF3000_TWI_DATA_MASK 0xff
42 1.3.2.2 skrll #define RF3000_TWI_ADDR_MASK 0x7f
43 1.3.2.2 skrll #define RF3000_TWI_AI 0x80 /* auto-increment */
44 1.3.2.2 skrll
45 1.3.2.2 skrll /*
46 1.3.2.2 skrll * Registers for RFMD RF3000.
47 1.3.2.2 skrll */
48 1.3.2.2 skrll #define RF3000_CTL 0x01 /* modem control */
49 1.3.2.2 skrll #define RF3000_CTL_MODE_MASK BITS(7, 4)
50 1.3.2.2 skrll #define RF3000_CTL_MODE_1MBPS 0
51 1.3.2.2 skrll #define RF3000_CTL_MODE_RSVD0 1
52 1.3.2.2 skrll #define RF3000_CTL_MODE_2MBPS 2
53 1.3.2.2 skrll #define RF3000_CTL_MODE_2MBPS_SHORT 3
54 1.3.2.2 skrll #define RF3000_CTL_MODE_5MBPS 4
55 1.3.2.2 skrll #define RF3000_CTL_MODE_5MBPS_SHORT 5
56 1.3.2.2 skrll #define RF3000_CTL_MODE_11MBPS 6
57 1.3.2.2 skrll #define RF3000_CTL_MODE_11MBPS_SHORT 7
58 1.3.2.2 skrll #define RF3000_CTL_MODE_BPSK 8
59 1.3.2.2 skrll #define RF3000_CTL_MODE_QPSK 9
60 1.3.2.2 skrll #define RF3000_CTL_MODE_RSVD1 10
61 1.3.2.2 skrll #define RF3000_CTL_MODE_RSVD2 11
62 1.3.2.2 skrll #define RF3000_RXSTAT RF3000_CTL /* RX status */
63 1.3.2.2 skrll #define RF3000_RXSTAT_SHORTPRE BIT(3) /* 1: short preamble */
64 1.3.2.2 skrll #define RF3000_RXSTAT_ACQ BIT(2) /* 1: acquired */
65 1.3.2.2 skrll #define RF3000_RXSTAT_SFD BIT(1) /* 1: SFD detected */
66 1.3.2.2 skrll #define RF3000_RXSTAT_CRC BIT(0) /* 1: CRC invalid */
67 1.3.2.2 skrll #define RF3000_CCACTL 0x02 /* CCA control */
68 1.3.2.2 skrll /* CCA mode */
69 1.3.2.2 skrll #define RF3000_CCACTL_MODE_MASK BITS(7, 6)
70 1.3.2.2 skrll #define RF3000_CCACTL_MODE_RSSIT 0 /* RSSI threshold */
71 1.3.2.2 skrll #define RF3000_CCACTL_MODE_ACQ 1 /* acquisition */
72 1.3.2.2 skrll #define RF3000_CCACTL_MODE_BOTH 2 /* threshold or acq. */
73 1.3.2.2 skrll /* RSSI threshold for CCA */
74 1.3.2.2 skrll #define RF3000_CCACTL_RSSIT_MASK BITS(5, 0)
75 1.3.2.2 skrll #define RF3000_DIVCTL 0x03 /* diversity control */
76 1.3.2.2 skrll #define RF3000_DIVCTL_ENABLE BIT(7) /* enable diversity */
77 1.3.2.2 skrll #define RF3000_DIVCTL_ANTSEL BIT(6) /* if ENABLE = 0, set
78 1.3.2.2 skrll * ANT SEL
79 1.3.2.2 skrll */
80 1.3.2.2 skrll #define RF3000_RSSI RF3000_DIVCTL /* RSSI value */
81 1.3.2.2 skrll #define RF3000_RSSI_MASK BITS(5, 0)
82 1.3.2.2 skrll #define RF3000_GAINCTL 0x11 /* TX variable gain control */
83 1.3.2.2 skrll #define RF3000_GAINCTL_TXVGC_MASK BITS(7, 2)
84 1.3.2.2 skrll #define RF3000_GAINCTL_SCRAMBLER BIT(1)
85 1.3.2.2 skrll #define RF3000_LOGAINCAL 0x14 /* low gain calibration */
86 1.3.2.2 skrll #define RF3000_LOGAINCAL_CAL_MASK BITS(5, 0)
87 1.3.2.2 skrll #define RF3000_HIGAINCAL 0x15 /* high gain calibration */
88 1.3.2.2 skrll #define RF3000_HIGAINCAL_CAL_MASK BITS(5, 0)
89 1.3.2.2 skrll #define RF3000_HIGAINCAL_DSSSPAD BIT(6) /* 6dB gain pad for DSSS
90 1.3.2.2 skrll * modes (meaning?)
91 1.3.2.2 skrll */
92 1.3.2.2 skrll #define RF3000_OPTIONS1 0x1C /* Options Register 1 */
93 1.3.2.2 skrll /* Saturation threshold is 4 + offset, where -3 <= offset <= 3.
94 1.3.2.2 skrll * SAT_THRESH is the absolute value, SAT_THRESH_SIGN is the sign.
95 1.3.2.2 skrll */
96 1.3.2.2 skrll #define RF3000_OPTIONS1_SAT_THRESH_SIGN BIT(7)
97 1.3.2.2 skrll #define RF3000_OPTIONS1_SAT_THRESH BITS(6,5)
98 1.3.2.2 skrll #define RF3000_OPTIONS1_ALTAGC BIT(4) /* 1: retrigger AGC
99 1.3.2.2 skrll * algorithm on ADC
100 1.3.2.2 skrll * saturation
101 1.3.2.2 skrll */
102 1.3.2.2 skrll #define RF3000_OPTIONS1_ALTBUS BIT(3) /* 1: enable alternate
103 1.3.2.2 skrll * Tx/Rx data bus
104 1.3.2.2 skrll * interface.
105 1.3.2.2 skrll */
106 1.3.2.2 skrll #define RF3000_OPTIONS1_RESERVED0_MASK BITS(2,0)/* 0 */
107 1.3.2.2 skrll
108 1.3.2.2 skrll #define RF3000_OPTIONS2 0x1D /* Options Register 2 */
109 1.3.2.2 skrll /* 1: delay next AGC 2us instead of 1us after a 1->0 LNAGS-pin transition. */
110 1.3.2.2 skrll #define RF3000_OPTIONS2_LNAGS_DELAY BIT(7)
111 1.3.2.2 skrll #define RF3000_OPTIONS2_RESERVED0_MASK BITS(6,3) /* 0 */
112 1.3.2.2 skrll /* Threshold for AGC re-trigger. 0: high count, 1: low count. */
113 1.3.2.2 skrll #define RF3000_OPTIONS2_RTG_THRESH BIT(2)
114 1.3.2.2 skrll #define RF3000_OPTIONS2_RESERVED1_MASK BITS(1,0) /* 0 */
115 1.3.2.2 skrll
116 1.3.2.2 skrll #endif /* _DEV_IC_RF3000REG_H_ */
117