|
53 | 53 | #define FG_THRESHOLD 32
|
54 | 54 | #define FIFO_AVAILABLE_SPACE FIFO_SIZE - FG_THRESHOLD
|
55 | 55 |
|
56 |
| -// modulation settings |
57 |
| -// lo rate |
58 |
| -// BR 0x0D05 => 9600.960 bps |
59 |
| -#define BITRATEMSB_L 0x0D |
60 |
| -#define BITRATELSB_L 0x05 |
61 |
| -// Fdev => 4.8 kHz |
62 |
| -#define FDEVMSB_L 0x00 |
63 |
| -#define FDEVLSB_L 0x4F |
64 |
| -// Carson's rule: 2 x fm + 2 x fd = 9.600 + 2 x 4.800 = 19.2 kHz |
65 |
| -// assuming 1 ppm crystals gives max error of: 2 * 1 ppm * 868 = 1.736 kHz |
66 |
| -// => BW > 19.2 + 1.736 kHz => > 20.936 kHZ. |
67 |
| -// This results in 10.468 kHz on a single sideband. |
68 |
| -// Closest possible value is 10.4 kHz. This is an actual ppm of 0.92. ((2 << 3) | 5) |
69 |
| -// Other possibility is 12.5 kHz. This is an actual ppm of 3.34. ((1 << 3) | 5) |
70 |
| -#define RXBW_L ((2 << 3) | 5) // TODO validate sensitivity / xtal accuracy tradeoff |
71 |
| - |
72 |
| -// normal rate |
73 |
| -// BR 0x0240 => 55555.55555 bps |
74 |
| -#define BITRATEMSB_N 0x02 |
75 |
| -#define BITRATELSB_N 0x40 |
76 |
| -// Fdev => 49.988 kHz |
77 |
| -#define FDEVMSB_N 0x03 |
78 |
| -#define FDEVLSB_N 0x33 |
79 |
| -// data rate 55.542 kBaud |
80 |
| -// Carson's rule: 2 x fm + 2 x fd = 55.555 + 2 x 50 = 155.555 kHz |
81 |
| -// assuming 1 ppm crystals gives max error of: 2 * 1 ppm * 868 = 1.736 kHz |
82 |
| -// => BW > 155.555 + 1.736 => 157.291 kHz. |
83 |
| -// This results in 78.646 kHz on a single sideband. |
84 |
| -// Closest possible value is 83.3 kHz. This is an actual ppm of 6.36. |
85 |
| -// TODO bit too high, next step is 200, validate sensitivity / xtal accuracy tradeoff |
86 |
| -#define RXBW_N ((2 << 3) | 2) |
87 |
| - |
88 |
| -// hi rate |
89 |
| -// BR 0x00C0 => 166666.667 bps |
90 |
| -#define BITRATEMSB_H 0x00 |
91 |
| -#define BITRATELSB_H 0xC0 |
92 |
| -// Fdev => 41.667 kHz |
93 |
| -#define FDEVMSB_H 0x02 |
94 |
| -#define FDEVLSB_H 0xAA |
95 |
| -// Carson's rule: 2 x fm + 2 x fd = 166.667 + 2 x 41.667 = 250 kHz |
96 |
| -// assuming 1 ppm crystals gives max error of: 2 * 1 ppm * 868 = 1.736 kHz |
97 |
| -// => BW > 250 + 1.736 kHz => 251.736 kHz. |
98 |
| -// This results in 125.868 kHz on a single sideband. |
99 |
| -// Closest possible value is 125 kHz. This is an actual ppm of 0. ((0 << 3) | 2) |
100 |
| -// Other possibility is 166.7 kHz. This is an actual ppm of 48.04. ((2 << 3) | 1) |
101 |
| -#define RXBW_H ((0 << 3) | 2) // TODO validate sensitivity / xtal accuracy tradeoff |
102 |
| - |
103 | 56 | #if defined(FRAMEWORK_LOG_ENABLED) && defined(FRAMEWORK_PHY_LOG_ENABLED)
|
104 | 57 | #define DPRINT(...) log_print_stack_string(LOG_STACK_PHY, __VA_ARGS__)
|
105 | 58 | #define DPRINT_DATA(...) log_print_data(__VA_ARGS__)
|
@@ -932,7 +885,7 @@ void hw_radio_enable_preloading(bool enable) {
|
932 | 885 | enable_preloading = enable;
|
933 | 886 | }
|
934 | 887 |
|
935 |
| -void hw_radio_set_tx_power(uint8_t eirp) { // TODO signed |
| 888 | +void hw_radio_set_tx_power(int8_t eirp) { // TODO signed |
936 | 889 | if(eirp < -5) {
|
937 | 890 | eirp = -5;
|
938 | 891 | DPRINT("The given eirp is too low, adjusted to %d dBm, offset excluded", eirp);
|
|
0 commit comments