Template: Table 1 of SX1262 915M LoRa HAT
From Waveshare Wiki
Function | Descriptions | ||||||
Configure registers| | Command format | 0xC0 + Begin address + Length + Data | |||||
Answer format | 0xC1 + Begin address + Length + Data | ||||||
Examples 1: Set channel to 0x11 | |||||||
Head | Begin address | Length | Data | ||||
Command | 0xC0 | 0x05 | 0x01 | 0x11 | |||
Answer | 0xC1 | 0x05 | 0x01 | 0x11 | |||
Examples 2: Set Module address (0x1234), NETID(0x00), UART(9600, 8N1), Air speed(1.2K) | |||||||
Head | Begin address | Length | Data | ||||
Command | 0xC0 | 0x00 | 0x04 | 0x12 0x34 0x00 0x61 | |||
Answer | 0xC1 | 0x00 | 0x04 | 0x12 0x34 0x00 0x61 | |||
Read registers | Command format | 0xC1 + Begin address + Length | |||||
Answer format | 0xC1 + Begin address + Length + Data | ||||||
Examples 1: Read channel | |||||||
Head | Begin address | Length | Data | ||||
Command | 0xC1 | 0x05 | 0x01 | ||||
Answer | 0xC1 | 0x05 | 0x01 | 0x12 0x34 0x00 0x61 | |||
Examples 2: Read Module address, NETID, Serial port and air speed. | |||||||
Head | Begin address | Length | Data | ||||
Command | 0xC1 | 0x00 | 0x04 | ||||
Answer | 0xC1 | 0x00 | 0x04 | 0x12 0x34 0x00 0x61 | |||
Configure temporary registers | Command format | 0xC2 + Begin address + Lenght + Data | |||||
Answer format | 0xC1 + Begin address + Lenght + Data | ||||||
Examples 1:Set channel to 0x11 | |||||||
Head | Begin address | Length | Data | ||||
Command | 0xC2 | 0x05 | 0x01 | 0x11 | |||
Answer | 0xC1 | 0x00 | 0x01 | 0x11 | |||
Examples 2: Set module address(0x1234), NETID(0x00), serial port(9600 8N1), Air speed(1.2K) | |||||||
Head | Begin address | Length | Data | ||||
Command | 0xC2 | 0x00 | 0x04 | 0x12 0x34 0x00 0x61 | |||
Answer | 0xC1 | 0x00 | 0x04 | 0x12 0x34 0x00 0x61 | |||
Wireless configuration | Command format | 0xCF 0xCF + Common command | |||||
Answer format | 0xCD 0xCF + Common answer | ||||||
Examples 1: Wireless set channel to 0x11 | |||||||
Wireless Head | Head(common) | Begin address | Length | Data | |||
Command | 0xCF 0xCF | 0xC2 | 0x05 | 0x01 | 0x11 | ||
Answer | 0xCD 0xCF | 0xC1 | 0x05 | 0x01 | 0x11 | ||
Examples 2: Wireless set module (0x1234), NETID(0x00), serial port(9600 8N1), Air speed(1.2K) | |||||||
Wireless Head | Head (common) | Begin address | Length | Data | |||
Command | 0xCF 0xCF | 0xC2 | 0x00 | 0x04 | 0x12 0x34 0x00 0x61 | ||
Answer | 0xCD 0xCF | 0xC1 | 0x00 | 0x04 | 0x12 0x34 0x00 0x61 | ||
Format error | Answer of Format error | ||||||
0xFF 0xFF 0xFF |
【Note】
- 1. When wireless configuring, you need to firstly configure Modules address, NETID, Air speed and Key of both modules to same values. For example, if Modules A: Module address is 1, NETID is 1, Air speed is 2.4Kbps and Key is 1. Module B: Module address is 2, NETID is 2, Air speed is 62.5Kbps and Key is 2. If you want to use Module A to configure Module B via wireless network, you need to set Module A to be same as Module B. Then you can use 0xCF 0xCF command to configure Module B via wireless network.
- 2. After configure temporary registers, LoRa modules work by settings of temporary registers. If LoRa modules restart, the settings of temporary are invalid, LoRa module will re-configure registers according to network settings by 0xC1 commands.