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:
parent
82346acf6a
commit
05c0327e8b
|
@ -1,11 +1,16 @@
|
||||||
BasedOnStyle: LLVM
|
BasedOnStyle: LLVM
|
||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
|
ColumnLimit: 120
|
||||||
IndentAccessModifiers: false
|
IndentAccessModifiers: false
|
||||||
AccessModifierOffset: -4
|
AccessModifierOffset: -4
|
||||||
DerivePointerAlignment: false
|
DerivePointerAlignment: false
|
||||||
PointerAlignment: Left
|
PointerAlignment: Right
|
||||||
SortIncludes: CaseSensitive
|
SortIncludes: CaseSensitive
|
||||||
IndentPPDirectives: BeforeHash
|
IndentPPDirectives: None
|
||||||
AlignAfterOpenBracket: BlockIndent
|
AlignAfterOpenBracket: BlockIndent
|
||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
|
AlignTrailingComments: true
|
||||||
|
ReflowComments: false
|
||||||
|
CommentPragmas: "^(!|\\*|\\n)"
|
||||||
|
PenaltyBreakComment: 1000000
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,6 +12,7 @@
|
||||||
#define __LORA_RADIO_TESTER_H__
|
#define __LORA_RADIO_TESTER_H__
|
||||||
|
|
||||||
#include <lora-radio-rtos-config.h>
|
#include <lora-radio-rtos-config.h>
|
||||||
|
#include "lora-radio.h"
|
||||||
|
|
||||||
/* application debug */
|
/* application debug */
|
||||||
#ifndef LR_DBG_SHELL
|
#ifndef LR_DBG_SHELL
|
||||||
|
@ -73,11 +74,11 @@
|
||||||
// 2: 500 kHz,
|
// 2: 500 kHz,
|
||||||
// 3: Reserved]
|
// 3: Reserved]
|
||||||
#define LORA_SPREADING_FACTOR 12 // [SF7..SF12]
|
#define LORA_SPREADING_FACTOR 12 // [SF7..SF12]
|
||||||
#define LORA_CODINGRATE 2 // [1: 4/5,
|
#define LORA_CODINGRATE 4 // [1: 4/5,
|
||||||
// 2: 4/6,
|
// 2: 4/6,
|
||||||
// 3: 4/7,
|
// 3: 4/7,
|
||||||
// 4: 4/8]
|
// 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_SYMBOL_TIMEOUT 0 // Symbols
|
||||||
#define LORA_FIX_LENGTH_PAYLOAD_ON_DISABLE false
|
#define LORA_FIX_LENGTH_PAYLOAD_ON_DISABLE false
|
||||||
#define LORA_IQ_INVERSION_ON_DISABLE false
|
#define LORA_IQ_INVERSION_ON_DISABLE false
|
||||||
|
@ -121,14 +122,14 @@
|
||||||
#define MAC_HEADER_OVERHEAD 13
|
#define MAC_HEADER_OVERHEAD 13
|
||||||
|
|
||||||
// Ping pong event
|
// Ping pong event
|
||||||
#define EV_RADIO_INIT 0x0001
|
#define EV_RADIO_RX_START 0x0001
|
||||||
#define EV_RADIO_TX_START 0x0002
|
#define EV_RADIO_TX_START 0x0002
|
||||||
#define EV_RADIO_TX_DONE 0x0004
|
#define EV_RADIO_TX_DONE 0x0004
|
||||||
#define EV_RADIO_TX_TIMEOUT 0x0008
|
#define EV_RADIO_TX_TIMEOUT 0x0008
|
||||||
#define EV_RADIO_RX_DONE 0x0010
|
#define EV_RADIO_RX_DONE 0x0010
|
||||||
#define EV_RADIO_RX_TIMEOUT 0x0020
|
#define EV_RADIO_RX_TIMEOUT 0x0020
|
||||||
#define EV_RADIO_RX_ERROR 0x0040
|
#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
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -139,7 +140,7 @@ typedef struct
|
||||||
int8_t txpower;
|
int8_t txpower;
|
||||||
|
|
||||||
// LoRa
|
// LoRa
|
||||||
uint8_t sf; // spreadfactor
|
uint8_t sf; // spreading factor
|
||||||
uint8_t bw; // bandwidth
|
uint8_t bw; // bandwidth
|
||||||
uint8_t cr; // coderate
|
uint8_t cr; // coderate
|
||||||
uint8_t iq_inversion;
|
uint8_t iq_inversion;
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
xsconfig.h
|
xsconfig.h
|
||||||
xsconfig.mk
|
xsconfig.mk
|
||||||
|
|
||||||
.config
|
.config
|
||||||
.config.old
|
.config.old
|
||||||
build
|
|
||||||
|
build/
|
||||||
|
temp/
|
||||||
|
|
||||||
XiUOS.*
|
XiUOS.*
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
.vscode
|
.vscode
|
||||||
# for kernel_selector
|
# for kernel_selector
|
||||||
.selector
|
.selector
|
||||||
|
|
Loading…
Reference in New Issue