LoRa-HAT-Control
From Waveshare Wiki
| Function | Description | |||||
|---|---|---|---|---|---|---|
| Configure registers | ||||||
| Command format: C0 + Begin address + Length + Data | ||||||
| Answer format: C1 + Begin address + Length + Data | ||||||
| Example 1: Set channel to 0x11 | ||||||
| Head | Begin address | Length | Parameter | |||
| Command | C0 | 05 | 01 | 11 | ||
| Answer | C1 | 05 | 01 | 11 | ||
| Example 2: Configure the module address (0x1234), network address (0x00), serial port (9600 8N1), and airspeed (1.2K) at the same time | ||||||
| Head | Begin address | Length | Parameter | |||
| Command | C0 | 00 | 04 | 12 34 00 61 | ||
| Answer | C1 | 00 | 04 | 12 34 00 61 | ||
| Read register | ||||||
| Command format: 0xC1 + Begin address + Length | ||||||
| Answer format: 0xC1 + Begin address + Length | ||||||
| Example 1: Read channel | ||||||
| Head | Begin address | Length | Parameter | |||
| Command | C1 | 05 | 01 | |||
| Answer | C1 | 05 | 01 | 11 | ||
| Examples 2: Read module address, NETID, serial port, and airspeed. | ||||||
| Head | Begin address | Length | Parameter | |||
| Command | C0 | 00 | 04 | |||
| Answer | C1 | 00 | 04 | 12 34 00 61 | ||
| Configure temporary registers | Command format: C2 + Begin address + Length + Data | |||||
| Answer format: C1 + Begin address + Length + Data | ||||||
| Examples 1: Set channel to 0x11 | ||||||
| Head | Begin address | Length | Parameter | |||
| Command | C2 | 05 | 01 | 11 | ||
| Answer | C1 | 05 | 01 | 11 | ||
| Examples 2: Set module address (0x1234), NETID (0x00), Serial port (9600 8N1), Air speed (1.2K) | ||||||
| Head | Begin address | Length | Parameter | |||
| Command | C2 | 00 | 04 | 12 34 00 61 | ||
| Parameter | C1 | 00 | 04 | 12 34 00 61 | ||
| Wireless configuration | ||||||
| Command format: CF + CF + C0 + Begin address + Length + Data | ||||||
| Answer format: CF + CF + C1 + Begin address + Length + Data | ||||||
| Examples 1: Wireless set channel to 0x11 | ||||||
| Wireless head | Head | Begin address | Length | Parameter | ||
| Command | CF CF | C0 | 05 | 01 | 11 | |
| Parameter | CF CF | C1 | 05 | 01 | 11 | |
| Example 2: Configure the module address (0x1234), network address (0x00), serial port (9600 8N1), and airspeed (1.2K) at the same time | ||||||
| Wireless head | Head | Begin address | Length | Parameter | ||
| Send | CF CF | C0 | 00 | 04 | 12 34 00 61 | |
| Return | CF CF | C1 | 00 | 04 | 12 34 00 61 | |
| Answer: format error | Answer: format error | |||||
| FF FF FF | ||||||