MySensors Library & Examples
2.3.2-62-ge298769
hal
transport
RFM95
driver
RFM95registers.h
1
/*
2
* The MySensors Arduino library handles the wireless radio link and protocol
3
* between your home built sensors/actuators and HA controller of choice.
4
* The sensors forms a self healing radio network with optional repeaters. Each
5
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
6
* network topology allowing messages to be routed to nodes.
7
*
8
* Created by Henrik Ekblad <
[email protected]
>
9
* Copyright (C) 2013-2022 Sensnology AB
10
* Full contributor list: https://github.com/mysensors/MySensors/graphs/contributors
11
*
12
* Documentation: http://www.mysensors.org
13
* Support Forum: http://forum.mysensors.org
14
*
15
* This program is free software; you can redistribute it and/or
16
* modify it under the terms of the GNU General Public License
17
* version 2 as published by the Free Software Foundation.
18
*
19
* Based on Mike McCauley's RFM95 library, Copyright (C) 2014 Mike McCauley <
[email protected]
>
20
* Radiohead http://www.airspayce.com/mikem/arduino/RadioHead/index.html
21
*
22
* RFM95 driver refactored and optimized for MySensors, Copyright (C) 2017-2018 Olivier Mauti <
[email protected]
>
23
*
24
* Definitions for HopeRF LoRa radios:
25
* http://www.hoperf.com/upload/rf/RFM95_96_97_98W.pdf
26
*
27
*/
28
29
// Register access
30
#define RFM95_READ_REGISTER (0x7Fu)
31
#define RFM95_WRITE_REGISTER (0x80u)
32
#define RFM95_NOP (0x00u)
33
34
// Registers, available in LoRa mode
35
#define RFM95_REG_00_FIFO 0x00
36
#define RFM95_REG_01_OP_MODE 0x01
37
#define RFM95_REG_02_RESERVED 0x02
38
#define RFM95_REG_03_RESERVED 0x03
39
#define RFM95_REG_04_RESERVED 0x04
40
#define RFM95_REG_05_RESERVED 0x05
41
#define RFM95_REG_06_FRF_MSB 0x06
42
#define RFM95_REG_07_FRF_MID 0x07
43
#define RFM95_REG_08_FRF_LSB 0x08
44
#define RFM95_REG_09_PA_CONFIG 0x09
45
#define RFM95_REG_0A_PA_RAMP 0x0a
46
#define RFM95_REG_0B_OCP 0x0b
47
#define RFM95_REG_0C_LNA 0x0c
48
#define RFM95_REG_0D_FIFO_ADDR_PTR 0x0d
49
#define RFM95_REG_0E_FIFO_TX_BASE_ADDR 0x0e
50
#define RFM95_REG_0F_FIFO_RX_BASE_ADDR 0x0f
51
#define RFM95_REG_10_FIFO_RX_CURRENT_ADDR 0x10
52
#define RFM95_REG_11_IRQ_FLAGS_MASK 0x11
53
#define RFM95_REG_12_IRQ_FLAGS 0x12
54
#define RFM95_REG_13_RX_NB_BYTES 0x13
55
#define RFM95_REG_14_RX_HEADER_CNT_VALUE_MSB 0x14
56
#define RFM95_REG_15_RX_HEADER_CNT_VALUE_LSB 0x15
57
#define RFM95_REG_16_RX_PACKET_CNT_VALUE_MSB 0x16
58
#define RFM95_REG_17_RX_PACKET_CNT_VALUE_LSB 0x17
59
#define RFM95_REG_18_MODEM_STAT 0x18
60
#define RFM95_REG_19_PKT_SNR_VALUE 0x19
61
#define RFM95_REG_1A_PKT_RSSI_VALUE 0x1a
62
#define RFM95_REG_1B_RSSI_VALUE 0x1b
63
#define RFM95_REG_1C_HOP_CHANNEL 0x1c
64
#define RFM95_REG_1D_MODEM_CONFIG1 0x1d
65
#define RFM95_REG_1E_MODEM_CONFIG2 0x1e
66
#define RFM95_REG_1F_SYMB_TIMEOUT_LSB 0x1f
67
#define RFM95_REG_20_PREAMBLE_MSB 0x20
68
#define RFM95_REG_21_PREAMBLE_LSB 0x21
69
#define RFM95_REG_22_PAYLOAD_LENGTH 0x22
70
#define RFM95_REG_23_MAX_PAYLOAD_LENGTH 0x23
71
#define RFM95_REG_24_HOP_PERIOD 0x24
72
#define RFM95_REG_25_FIFO_RX_BYTE_ADDR 0x25
73
#define RFM95_REG_26_MODEM_CONFIG3 0x26
74
75
// Reserved when in LoRa mode
76
#define RFM95_REG_40_DIO_MAPPING1 0x40
77
#define RFM95_REG_41_DIO_MAPPING2 0x41
78
#define RFM95_REG_42_VERSION 0x42
79
#define RFM95_REG_4B_TCXO 0x4b
80
#define RFM95_REG_4D_PA_DAC 0x4d
81
#define RFM95_REG_5B_FORMER_TEMP 0x5b
82
#define RFM95_REG_61_AGC_REF 0x61
83
#define RFM95_REG_62_AGC_THRESH1 0x62
84
#define RFM95_REG_63_AGC_THRESH2 0x63
85
#define RFM95_REG_64_AGC_THRESH3 0x64
86
87
// RFM95_REG_01_OP_MODE 0x01
88
#define RFM95_LONG_RANGE_MODE 0x80
89
#define RFM95_ACCESS_SHARED_REG 0x40
90
91
#define RFM95_MODE_SLEEP 0x00
92
#define RFM95_MODE_STDBY 0x01
93
#define RFM95_MODE_FSTX 0x02
94
#define RFM95_MODE_TX 0x03
95
#define RFM95_MODE_FSRX 0x04
96
#define RFM95_MODE_RXCONTINUOUS 0x05
97
#define RFM95_MODE_RXSINGLE 0x06
98
#define RFM95_MODE_CAD 0x07
99
100
// RFM95_REG_09_PA_CONFIG 0x09
101
#define RFM95_OUTPUT_POWER 0x0F
102
#define RFM95_MAX_POWER 0x70
103
#define RFM95_PA_SELECT 0x80
104
105
// RFM95_REG_0A_PA_RAMP 0x0a
106
#define RFM95_PA_RAMP_3_4MS 0x00
107
#define RFM95_PA_RAMP_2MS 0x01
108
#define RFM95_PA_RAMP_1MS 0x02
109
#define RFM95_PA_RAMP_500US 0x03
110
#define RFM95_PA_RAMP_250US 0x04
111
#define RFM95_PA_RAMP_125US 0x05
112
#define RFM95_PA_RAMP_100US 0x06
113
#define RFM95_PA_RAMP_62US 0x07
114
#define RFM95_PA_RAMP_50US 0x08
115
#define RFM95_PA_RAMP_40US 0x09
116
#define RFM95_PA_RAMP_31US 0x0A
117
#define RFM95_PA_RAMP_25US 0x0B
118
#define RFM95_PA_RAMP_20US 0x0C
119
#define RFM95_PA_RAMP_15US 0x0D
120
#define RFM95_PA_RAMP_12US 0x0E
121
#define RFM95_PA_RAMP_10US 0x0F
122
#define RFM95_LOW_PN_TX_PLL_OFF 0x10
123
124
// RFM95_REG_0B_OCP 0x0b
125
#define RFM95_OCP_TRIM 0x1f
126
#define RFM95_OCP_ON 0x20
127
128
// RFM95_REG_0C_LNA 0x0c
129
#define RFM95_LNA_BOOST_DEFAULT 0x20
130
#define RFM95_LNA_BOOST 0x03
131
132
// RFM95_REG_11_IRQ_FLAGS_MASK 0x11
133
#define RFM95_CAD_DETECTED_MASK 0x01
134
#define RFM95_FHSS_CHANGE_CHANNEL_MASK 0x02
135
#define RFM95_CAD_DONE_MASK 0x04
136
#define RFM95_TX_DONE_MASK 0x08
137
#define RFM95_VALID_HEADER_MASK 0x10
138
#define RFM95_PAYLOAD_CRC_ERROR_MASK 0x20
139
#define RFM95_RX_DONE_MASK 0x40
140
#define RFM95_RX_TIMEOUT_MASK 0x80
141
142
// RFM95_REG_12_IRQ_FLAGS 0x12
143
#define RFM95_CAD_DETECTED 0x01
144
#define RFM95_FHSS_CHANGE_CHANNEL 0x02
145
#define RFM95_CAD_DONE 0x04
146
#define RFM95_TX_DONE 0x08
147
#define RFM95_VALID_HEADER 0x10
148
#define RFM95_PAYLOAD_CRC_ERROR 0x20
149
#define RFM95_RX_DONE 0x40
150
#define RFM95_RX_TIMEOUT 0x80
151
#define RFM95_CLEAR_IRQ 0xFF //<! Clear IRQ
152
153
// RFM95_REG_18_MODEM_STAT 0x18
154
#define RFM95_MODEM_STATUS_SIGNAL_DETECTED 0x01
155
#define RFM95_MODEM_STATUS_SIGNAL_SYNCHRONIZED 0x02
156
#define RFM95_MODEM_STATUS_RX_ONGOING 0x04
157
#define RFM95_MODEM_STATUS_HEADER_INFO_VALID 0x08
158
#define RFM95_MODEM_STATUS_CLEAR 0x10
159
160
// RFM95_REG_1C_HOP_CHANNEL 0x1c
161
#define RFM95_RX_PAYLOAD_CRC_IS_ON 0x40
162
#define RFM95_PLL_TIMEOUT 0x80
163
164
// RFM95_REG_1D_MODEM_CONFIG1 0x1d
165
166
#define RFM95_BW_7_8KHZ 0x00
167
#define RFM95_BW_10_4KHZ 0x10
168
#define RFM95_BW_15_6KHZ 0x20
169
#define RFM95_BW_20_8KHZ 0x30
170
#define RFM95_BW_31_25KHZ 0x40
171
#define RFM95_BW_41_7KHZ 0x50
172
#define RFM95_BW_62_5KHZ 0x60
173
#define RFM95_BW_125KHZ 0x70
174
#define RFM95_BW_250KHZ 0x80
175
#define RFM95_BW_500KHZ 0x90
176
177
#define RFM95_IMPLICIT_HEADER_MODE_ON 0x01
178
#define RFM95_CODING_RATE_4_5 0x02
179
#define RFM95_CODING_RATE_4_6 0x04
180
#define RFM95_CODING_RATE_4_7 0x06
181
#define RFM95_CODING_RATE_4_8 0x08
182
183
// RFM95_REG_1E_MODEM_CONFIG2 0x1e
184
#define RFM95_SPREADING_FACTOR_64CPS 0x60
185
#define RFM95_SPREADING_FACTOR_128CPS 0x70
186
#define RFM95_SPREADING_FACTOR_256CPS 0x80
187
#define RFM95_SPREADING_FACTOR_512CPS 0x90
188
#define RFM95_SPREADING_FACTOR_1024CPS 0xA0
189
#define RFM95_SPREADING_FACTOR_2048CPS 0xB0
190
#define RFM95_SPREADING_FACTOR_4096CPS 0xC0
191
192
#define RFM95_SYM_TIMEOUT_MSB 0x03
193
#define RFM95_RX_PAYLOAD_CRC_ON 0x04
194
#define RFM95_TX_CONTINUOUS_MOdE 0x08
195
196
// RFM95_REG_26_MODEM_CONFIG3 0x26
197
#define RFM95_LOW_DATA_RATE_OPTIMIZE 0x08
198
#define RFM95_AGC_AUTO_ON 0x04
199
200
// RFM95_REG_4B_TCXO 0x4b
201
#define RFM95_TCXO_TCXO_INPUT_ON 0x10
202
203
// RFM95_REG_4D_PA_DAC 0x4d
204
#define RFM95_PA_DAC_DISABLE 0x04
205
#define RFM95_PA_DAC_ENABLE 0x07
Copyright (C) 2013-2019 Sensnology AB. Generated by
doxygen
1.8.17