Finally a working example of lora tx/rx

TODOS:
- LoraWAN verification
- Freq hopping
(if developing protocol of our own:)
- CSMA using radio cad, implemented as hw random exp backoff?
- MAC address & up/downlink handling
- Encryption?
This commit is contained in:
KirisameMashiro 2025-01-23 15:57:50 +08:00
parent 82346acf6a
commit 05c0327e8b
4 changed files with 504 additions and 1118 deletions

View File

@ -1,11 +1,16 @@
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 120
IndentAccessModifiers: false
AccessModifierOffset: -4
DerivePointerAlignment: false
PointerAlignment: Left
PointerAlignment: Right
SortIncludes: CaseSensitive
IndentPPDirectives: BeforeHash
IndentPPDirectives: None
AlignAfterOpenBracket: BlockIndent
BinPackArguments: false
BinPackParameters: false
AlignTrailingComments: true
ReflowComments: false
CommentPragmas: "^(!|\\*|\\n)"
PenaltyBreakComment: 1000000

View File

@ -12,6 +12,7 @@
#define __LORA_RADIO_TESTER_H__
#include <lora-radio-rtos-config.h>
#include "lora-radio.h"
/* application debug */
#ifndef LR_DBG_SHELL
@ -73,11 +74,11 @@
// 2: 500 kHz,
// 3: Reserved]
#define LORA_SPREADING_FACTOR 12 // [SF7..SF12]
#define LORA_CODINGRATE 2 // [1: 4/5,
#define LORA_CODINGRATE 4 // [1: 4/5,
// 2: 4/6,
// 3: 4/7,
// 4: 4/8]
#define LORA_PREAMBLE_LENGTH 8 // Same for Tx and Rx
#define LORA_PREAMBLE_LENGTH 16 // Same for Tx and Rx
#define LORA_SYMBOL_TIMEOUT 0 // Symbols
#define LORA_FIX_LENGTH_PAYLOAD_ON_DISABLE false
#define LORA_IQ_INVERSION_ON_DISABLE false
@ -121,14 +122,14 @@
#define MAC_HEADER_OVERHEAD 13
// Ping pong event
#define EV_RADIO_INIT 0x0001
#define EV_RADIO_RX_START 0x0001
#define EV_RADIO_TX_START 0x0002
#define EV_RADIO_TX_DONE 0x0004
#define EV_RADIO_TX_TIMEOUT 0x0008
#define EV_RADIO_RX_DONE 0x0010
#define EV_RADIO_RX_TIMEOUT 0x0020
#define EV_RADIO_RX_ERROR 0x0040
#define EV_RADIO_ALL (EV_RADIO_INIT | EV_RADIO_TX_START | EV_RADIO_TX_DONE | EV_RADIO_TX_TIMEOUT | EV_RADIO_RX_DONE | EV_RADIO_RX_TIMEOUT | EV_RADIO_RX_ERROR)
#define EV_RADIO_ALL (EV_RADIO_RX_START | EV_RADIO_TX_START | EV_RADIO_TX_DONE | EV_RADIO_TX_TIMEOUT | EV_RADIO_RX_DONE | EV_RADIO_RX_TIMEOUT | EV_RADIO_RX_ERROR)
typedef struct
{
@ -139,7 +140,7 @@ typedef struct
int8_t txpower;
// LoRa
uint8_t sf; // spreadfactor
uint8_t sf; // spreading factor
uint8_t bw; // bandwidth
uint8_t cr; // coderate
uint8_t iq_inversion;

View File

@ -1,10 +1,15 @@
xsconfig.h
xsconfig.mk
.config
.config.old
build
build/
temp/
XiUOS.*
*.swp
.vscode
# for kernel_selector
.selector