LoRa radio codec + driver (PROTOCORE_ENABLE_LORA) - Semtech SX127x / RFM95-96.
More...
|
| | PROTOCORE_NS_LAYOUT (LoraNs, frame_parse, frame_build, init, send, tx_done, set_rx, recv) |
| |
| proto_bool | protocore_lora_frame_parse (uint8_t *work, const uint8_t *raw, uint16_t len, protocore_lora_header *hdr, const uint8_t **payload, uint16_t *payload_len) |
| | Split a received frame into its header and payload.
|
| |
| uint16_t | protocore_lora_frame_build (uint8_t *work, const protocore_lora_header *hdr, const uint8_t *payload, uint16_t len, uint8_t *out, uint16_t cap) |
| | Build a frame (header + payload) into out.
|
| |
| proto_bool | protocore_lora_init (uint8_t *work, const protocore_lora_bus *bus, const protocore_lora_config *cfg) |
| | Initialize the SX127x: verify the chip, switch to LoRa mode, and .
|
| |
| proto_bool | protocore_lora_send (uint8_t *work, const protocore_lora_bus *bus, const uint8_t *frame, uint8_t len) |
| | Load frame into the FIFO and start a transmit (the radio returns to .
|
| |
| proto_bool | protocore_lora_tx_done (uint8_t *work, const protocore_lora_bus *bus) |
| | True once a transmit has finished (RegIrqFlags TxDone); clears the .
|
| |
| void | protocore_lora_set_rx (uint8_t *work, const protocore_lora_bus *bus) |
| | Put the radio in continuous-receive mode (call once, then poll .
|
| |
| int | protocore_lora_recv (uint8_t *work, const protocore_lora_bus *bus, uint8_t *buf, uint8_t cap, int16_t *rssi) |
| | If a frame has been received, copy it into buf and report its RSSI.
|
| |
LoRa radio codec + driver (PROTOCORE_ENABLE_LORA) - Semtech SX127x / RFM95-96.
A per-radio plugin for the gateway (PROTOCORE_ENABLE_GATEWAY): the southbound-radio half of a LoRa-to-web bridge. Two layers:
- Codec - the RadioHead-compatible 4-byte frame header (
to / from / id / flags) that virtually every hobby / sensor LoRa deployment uses on top of the header-less LoRa PHY. protocore_lora_frame_parse() splits a received frame into that header and the payload; protocore_lora_frame_build() prepends it. Pure, no hardware.
- Driver - the SX127x register protocol (init / send / receive / enter-RX) over a caller-supplied register-access bus (protocore_lora_bus). The SPI transfer and the chip-select / reset GPIOs are the integration's - you implement two callbacks that read and write a chip register - so the register sequence is host-testable with a mock bus and portable across whatever SPI peripheral you wire the module to.
Wiring to the gateway (see example LoRaGateway): poll protocore_lora_recv(); on a frame, protocore_lora_frame_parse() then protocore_gateway_uplink(port, header.from, payload, len, rssi). A downlink builds a frame with protocore_lora_frame_build() and protocore_lora_send()s it. The codec + register protocol are verified on the host; the RF link itself needs the module.
work is bytes the CALLER holds. This module reads none of them: it carries nothing between calls, so there is no state to keep and nothing to wipe. The parameter is there so a caller drives every namespace the same way.
- Author
- Douglas Quigg (dstroy0)
- Date
- 2026
Definition in file lora.h.