Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cyrf6936_regs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Freek van Tienen <freek.v.tienen@gmail.com>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
27 #ifndef CYRF6936_REGS_H
28 #define CYRF6936_REGS_H
29 
30 /* The SPI interface defines */
31 enum {
32  CYRF_CHANNEL = 0x00,
34  CYRF_TX_CTRL = 0x02,
35  CYRF_TX_CFG = 0x03,
37  CYRF_RX_CTRL = 0x05,
38  CYRF_RX_CFG = 0x06,
41  CYRF_RX_COUNT = 0x09,
43  CYRF_PWR_CTRL = 0x0B,
45  CYRF_IO_CFG = 0x0D,
47  CYRF_XACT_CFG = 0x0F,
51  CYRF_RSSI = 0x13,
52  CYRF_EOP_CTRL = 0x14,
66  CYRF_SOP_CODE = 0x22,
68  CYRF_PREAMBLE = 0x24,
69  CYRF_MFG_ID = 0x25,
70  CYRF_XTAL_CFG = 0x26,
72  CYRF_CLK_EN = 0x28,
73  CYRF_RX_ABORT = 0x29,
77 };
78 #define CYRF_DIR (1<<7)
80 // CYRF_MODE_OVERRIDE
81 #define CYRF_RST (1<<0)
82 
83 // CYRF_CLK_EN
84 #define CYRF_RXF (1<<1)
85 
86 // CYRF_XACT_CFG
87 enum {
88  CYRF_MODE_SLEEP = (0x0 << 2),
89  CYRF_MODE_IDLE = (0x1 << 2),
90  CYRF_MODE_SYNTH_TX = (0x2 << 2),
91  CYRF_MODE_SYNTH_RX = (0x3 << 2),
92  CYRF_MODE_RX = (0x4 << 2),
93 };
94 #define CYRF_FRC_END (1<<5)
95 #define CYRF_ACK_EN (1<<7)
96 
97 // CYRF_IO_CFG
98 #define CYRF_IRQ_GPIO (1<<0)
99 #define CYRF_SPI_3PIN (1<<1)
100 #define CYRF_PACTL_GPIO (1<<2)
101 #define CYRF_PACTL_OD (1<<3)
102 #define CYRF_XOUT_OD (1<<4)
103 #define CYRF_MISO_OD (1<<5)
104 #define CYRF_IRQ_POL (1<<6)
105 #define CYRF_IRQ_OD (1<<7)
106 
107 // CYRF_FRAMING_CFG
108 #define CYRF_LEN_EN (1<<5)
109 #define CYRF_SOP_LEN (1<<6)
110 #define CYRF_SOP_EN (1<<7)
111 
112 // CYRF_RX_STATUS
113 enum {
118 };
119 #define CYRF_RX_CODE (1<<2)
120 #define CYRF_BAD_CRC (1<<3)
121 #define CYRF_CRC0 (1<<4)
122 #define CYRF_EOP_ERR (1<<5)
123 #define CYRF_PKT_ERR (1<<6)
124 #define CYRF_RX_ACK (1<<7)
125 
126 // CYRF_TX_IRQ_STATUS
127 #define CYRF_TXE_IRQ (1<<0)
128 #define CYRF_TXC_IRQ (1<<1)
129 #define CYRF_TXBERR_IRQ (1<<2)
130 #define CYRF_TXB0_IRQ (1<<3)
131 #define CYRF_TXB8_IRQ (1<<4)
132 #define CYRF_TXB15_IRQ (1<<5)
133 #define CYRF_LV_IRQ (1<<6)
134 #define CYRF_OS_IRQ (1<<7)
135 
136 // CYRF_RX_IRQ_STATUS
137 #define CYRF_RXE_IRQ (1<<0)
138 #define CYRF_RXC_IRQ (1<<1)
139 #define CYRF_RXBERR_IRQ (1<<2)
140 #define CYRF_RXB1_IRQ (1<<3)
141 #define CYRF_RXB8_IRQ (1<<4)
142 #define CYRF_RXB16_IRQ (1<<5)
143 #define CYRF_SOPDET_IRQ (1<<6)
144 #define CYRF_RXOW_IRQ (1<<7)
145 
146 // CYRF_TX_CTRL
147 #define CYRF_TXE_IRQEN (1<<0)
148 #define CYRF_TXC_IRQEN (1<<1)
149 #define CYRF_TXBERR_IRQEN (1<<2)
150 #define CYRF_TXB0_IRQEN (1<<3)
151 #define CYRF_TXB8_IRQEN (1<<4)
152 #define CYRF_TXB15_IRQEN (1<<5)
153 #define CYRF_TX_CLR (1<<6)
154 #define CYRF_TX_GO (1<<7)
155 
156 // CYRF_RX_CTRL
157 #define CYRF_RXE_IRQEN (1<<0)
158 #define CYRF_RXC_IRQEN (1<<1)
159 #define CYRF_RXBERR_IRQEN (1<<2)
160 #define CYRF_RXB1_IRQEN (1<<3)
161 #define CYRF_RXB8_IRQEN (1<<4)
162 #define CYRF_RXB16_IRQEN (1<<5)
163 #define CYRF_RSVD (1<<6)
164 #define CYRF_RX_GO (1<<7)
165 
166 // CYRF_RX_OVERRIDE
167 #define CYRF_ACE (1<<1)
168 #define CYRF_DIS_RXCRC (1<<2)
169 #define CYRF_DIS_CRC0 (1<<3)
170 #define CYRF_FRC_RXDR (1<<4)
171 #define CYRF_MAN_RXACK (1<<5)
172 #define CYRF_RXTX_DLY (1<<6)
173 #define CYRF_ACK_RX (1<<7)
174 
175 // CYRF_TX_OVERRIDE
176 #define CYRF_TX_INV (1<<0)
177 #define CYRF_DIS_TXCRC (1<<2)
178 #define CYRF_OVRD_ACK (1<<3)
179 #define CYRF_MAN_TXACK (1<<4)
180 #define CYRF_FRC_PRE (1<<6)
181 #define CYRF_ACK_TX (1<<7)
182 
183 // CYRF_RX_CFG
184 #define CYRF_VLD_EN (1<<0)
185 #define CYRF_RXOW_EN (1<<1)
186 #define CYRF_FAST_TURN_EN (1<<3)
187 #define CYRF_HILO (1<<4)
188 #define CYRF_ATT (1<<5)
189 #define CYRF_LNA (1<<6)
190 #define CYRF_AGC_EN (1<<7)
191 
192 // CYRF_TX_CFG
193 enum {
194  CYRF_PA_M35 = 0x0,
195  CYRF_PA_M30 = 0x1,
196  CYRF_PA_M24 = 0x2,
197  CYRF_PA_M18 = 0x3,
198  CYRF_PA_M13 = 0x4,
199  CYRF_PA_M5 = 0x5,
200  CYRF_PA_0 = 0x6,
201  CYRF_PA_4 = 0x7,
202 };
203 enum {
204  CYRF_DATA_MODE_GFSK = (0x0 << 3),
205  CYRF_DATA_MODE_8DR = (0x1 << 3),
206  CYRF_DATA_MODE_DDR = (0x2 << 3),
207  CYRF_DATA_MODE_SDR = (0x3 << 3),
208 };
209 #define CYRF_DATA_CODE_LENGTH (1<<5)
210 
211 #endif // CYRF6936_REGS_H