Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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
@ CYRF_RX_LENGTH
Definition: cyrf6936_regs.h:42
@ CYRF_EOP_CTRL
Definition: cyrf6936_regs.h:52
@ CYRF_PWR_CTRL
Definition: cyrf6936_regs.h:43
@ CYRF_TX_CRC_MSB
Definition: cyrf6936_regs.h:56
@ CYRF_TX_CRC_LSB
Definition: cyrf6936_regs.h:55
@ CYRF_TX_OFFSET_LSB
Definition: cyrf6936_regs.h:59
@ CYRF_AUTO_CAL_TIME
Definition: cyrf6936_regs.h:74
@ CYRF_DATA32_THOLD
Definition: cyrf6936_regs.h:49
@ CYRF_RX_OVERRIDE
Definition: cyrf6936_regs.h:62
@ CYRF_FRAMING_CFG
Definition: cyrf6936_regs.h:48
@ CYRF_RX_CRC_MSB
Definition: cyrf6936_regs.h:58
@ CYRF_CHANNEL
Definition: cyrf6936_regs.h:32
@ CYRF_XACT_CFG
Definition: cyrf6936_regs.h:47
@ CYRF_RX_ABORT
Definition: cyrf6936_regs.h:73
@ CYRF_DATA64_THOLD
Definition: cyrf6936_regs.h:50
@ CYRF_SOP_CODE
Definition: cyrf6936_regs.h:66
@ CYRF_MFG_ID
Definition: cyrf6936_regs.h:69
@ CYRF_CLK_EN
Definition: cyrf6936_regs.h:72
@ CYRF_RX_CTRL
Definition: cyrf6936_regs.h:37
@ CYRF_RX_COUNT
Definition: cyrf6936_regs.h:41
@ CYRF_CRC_SEED_LSB
Definition: cyrf6936_regs.h:53
@ CYRF_TX_LENGTH
Definition: cyrf6936_regs.h:33
@ CYRF_CLK_OFFSET
Definition: cyrf6936_regs.h:71
@ CYRF_TX_CFG
Definition: cyrf6936_regs.h:35
@ CYRF_MODE_OVERRIDE
Definition: cyrf6936_regs.h:61
@ CYRF_XTAL_CFG
Definition: cyrf6936_regs.h:70
@ CYRF_TX_OFFSET_MSB
Definition: cyrf6936_regs.h:60
@ CYRF_TX_OVERRIDE
Definition: cyrf6936_regs.h:63
@ CYRF_TX_CTRL
Definition: cyrf6936_regs.h:34
@ CYRF_IO_CFG
Definition: cyrf6936_regs.h:45
@ CYRF_XTAL_CTRL
Definition: cyrf6936_regs.h:44
@ CYRF_CRC_SEED_MSB
Definition: cyrf6936_regs.h:54
@ CYRF_RX_CFG
Definition: cyrf6936_regs.h:38
@ CYRF_AUTO_CAL_OFFSET
Definition: cyrf6936_regs.h:75
@ CYRF_RX_IRQ_STATUS
Definition: cyrf6936_regs.h:39
@ CYRF_RX_STATUS
Definition: cyrf6936_regs.h:40
@ CYRF_GPIO_CTRL
Definition: cyrf6936_regs.h:46
@ CYRF_DATA_CODE
Definition: cyrf6936_regs.h:67
@ CYRF_TX_BUFFER
Definition: cyrf6936_regs.h:64
@ CYRF_ANALOG_CTRL
Definition: cyrf6936_regs.h:76
@ CYRF_TX_IRQ_STATUS
Definition: cyrf6936_regs.h:36
@ CYRF_RX_BUFFER
Definition: cyrf6936_regs.h:65
@ CYRF_RX_CRC_LSB
Definition: cyrf6936_regs.h:57
@ CYRF_PREAMBLE
Definition: cyrf6936_regs.h:68
@ CYRF_RSSI
Definition: cyrf6936_regs.h:51
@ CYRF_MODE_IDLE
Definition: cyrf6936_regs.h:89
@ CYRF_MODE_SYNTH_TX
Definition: cyrf6936_regs.h:90
@ CYRF_MODE_RX
Definition: cyrf6936_regs.h:92
@ CYRF_MODE_SYNTH_RX
Definition: cyrf6936_regs.h:91
@ CYRF_MODE_SLEEP
Definition: cyrf6936_regs.h:88
@ CYRF_PA_M30
@ CYRF_PA_M24
@ CYRF_PA_M13
@ CYRF_PA_M18
@ CYRF_PA_0
@ CYRF_PA_M35
@ CYRF_PA_4
@ CYRF_PA_M5
@ CYRF_DATA_MODE_SDR
@ CYRF_DATA_MODE_GFSK
@ CYRF_DATA_MODE_DDR
@ CYRF_DATA_MODE_8DR
@ CYRF_RX_DATA_MODE_NV
@ CYRF_RX_DATA_MODE_8DR
@ CYRF_RX_DATA_MODE_GFSK
@ CYRF_RX_DATA_MODE_DDR