1178 |
mija |
1 |
/* mija 2008 |
|
|
2 |
defines for module RFM02 - TX 868MHz |
|
|
3 |
*/ |
|
|
4 |
|
|
|
5 |
#define CMD_SETTING 0x8000 // b1, b0, d2..d0, x3..x0, ms, m2..m0 |
|
|
6 |
#define CMD_POWER 0xC000 // a1, a0, ex, es, ea, eb, et, dc |
|
|
7 |
#define CMD_POWER_OUT 0xB000 // p2..p0 -3*Pmax dBm |
|
|
8 |
#define CMD_FREQUENCY 0xA000 // f11..f0 860+F*0.005 MHz 36..3903 |
|
|
9 |
#define CMD_RATE 0xC800 // r7..r0 BR=10M/29/(R+1) |
|
|
10 |
#define CMD_WAKE_UP 0xE000 // r4..r0, m7..m0 T=M*2^R [ms] |
|
|
11 |
#define CMD_SLEEP 0xC400 // s7..s0 S stop CLK |
|
|
12 |
#define CMD_BATTERY 0xC200 // dwc, ebs , t4..t0 |
|
|
13 |
#define CMD_STATUS 0xCC00 // for read status |
|
|
14 |
|
|
|
15 |
// CMD_SETTING |
|
|
16 |
#define BAND_315 0x0000 |
|
|
17 |
#define BAND_433 0x800 |
|
|
18 |
#define BAND_868 0x1000 |
|
|
19 |
#define BADN_915 0x1800 |
|
|
20 |
|
|
|
21 |
#define C_8_5pF 0x00 |
|
|
22 |
#define C_9pF 0x10 |
|
|
23 |
#define C_9_5pF 0x20 |
|
|
24 |
#define C_10pF 0x30 |
|
|
25 |
#define C_10_5pF 0x40 |
|
|
26 |
#define C_11pF 0x50 |
|
|
27 |
#define C_11_5pF 0x60 |
|
|
28 |
#define C_12pF 0x70 |
|
|
29 |
#define C_12_5pF 0x80 |
|
|
30 |
#define C_13pF 0x90 |
|
|
31 |
#define C_13_5pF 0xA0 |
|
|
32 |
#define C_14pF 0xB0 |
|
|
33 |
#define C_14_5pF 0xC0 |
|
|
34 |
#define C_15pF 0xD0 |
|
|
35 |
#define C_15_5pF 0xE0 |
|
|
36 |
#define C_16pF 0xF0 |
|
|
37 |
#define SETTING_MS 0x08 // modulation polarity |
|
|
38 |
#define TX_DEV_30 0x00 // select frequency deviation |
|
|
39 |
#define TX_DEV_60 0x01 |
|
|
40 |
#define TX_DEV_90 0x02 |
|
|
41 |
#define TX_DEV_120 0x03 |
|
|
42 |
#define TX_DEV_150 0x04 |
|
|
43 |
#define TX_DEV_180 0x05 |
|
|
44 |
#define TX_DEV_210 0x06 |
|
|
45 |
|
|
|
46 |
// CMD_POWER |
|
|
47 |
#define POWER_A1 0x80 // enable crystal and syntheesizer by sleep |
|
|
48 |
#define POWER_A0 0x40 // enable PA by sleep |
|
|
49 |
#define POWER_EX 0x20 // enable transmitter |
|
|
50 |
#define POWER_ES 0x10 // enable synthesizer |
|
|
51 |
#define POWER_EA 0x08 // enable PA (power amplifier) |
|
|
52 |
#define POWER_EB 0x04 // enable low battery detector |
|
|
53 |
#define POWER_ET 0x02 // enable wake up timer |
|
|
54 |
#define POWER_DC 0x01 // disable clock output of CLK pin |
|
|
55 |
|
|
|
56 |
// CMD_POWER_OUT |
|
|
57 |
#define POWER_OUT_0 0xB000 // -0dBm |
|
|
58 |
#define POWER_OUT_3 0xB100 // -3dBm |
|
|
59 |
#define POWER_OUT_6 0xB200 // -6dBm |
|
|
60 |
#define POWER_OUT_9 0xB300 // -9dBm |
|
|
61 |
#define POWER_OUT_12 0xB400 // -12dBm |
|
|
62 |
#define POWER_OUT_15 0xB500 // -15dBm |
|
|
63 |
#define POWER_OUT_18 0xB600 // -18dBm |
|
|
64 |
#define POWER_OUT_21 0xB700 // -21dBm |
|
|
65 |
|
|
|
66 |
// CMD_FREQUENCY |
|
|
67 |
#define FREQUENCY_867 0x578 |
|
|
68 |
#define FREQUENCY_868 0x640 |
|
|
69 |
#define FREQUENCY_869 0x708 |
|
|
70 |
|
|
|
71 |
// CMD_RATE |
|
|
72 |
#define RATE_2400 0x8F |
|
|
73 |
#define RATE_4800 0x47 |
|
|
74 |
#define RATE_9600 0x23 |
|
|
75 |
#define RATE_19200 0x11 |
|
|
76 |
#define RATE_38400 0x8 |
|
|
77 |
#define RATE_57600 0x5 |
|
|
78 |
#define RATE_115200 0x2 |
|
|
79 |
|
|
|
80 |
// CMD_BATTERY |
|
|
81 |
#define WAKE_UP_DWC 0x80 // disable wake-up timer periodical calibration |
|
|
82 |
#define TX_EBS 0x20 // enable TX bit synchronization function |