diff options
author | Jason Reiss <jreiss@multitech.com> | 2015-07-16 16:51:38 -0500 |
---|---|---|
committer | Jason Reiss <jreiss@multitech.com> | 2015-07-16 16:51:38 -0500 |
commit | 491c5a5896d082653e9b2f54cd8ce463e2f51814 (patch) | |
tree | dc608d572ec6c3c422c0def99e4b89ec5ebbe7ba /recipes-connectivity/lora/lora-gateway | |
parent | 974eb67a7552eac9389edfda32683031bb639df3 (diff) | |
download | meta-mlinux-491c5a5896d082653e9b2f54cd8ce463e2f51814.tar.gz meta-mlinux-491c5a5896d082653e9b2f54cd8ce463e2f51814.tar.bz2 meta-mlinux-491c5a5896d082653e9b2f54cd8ce463e2f51814.zip |
lora: patch gateway and basic packet forwarder to allow config of sync word
Diffstat (limited to 'recipes-connectivity/lora/lora-gateway')
-rw-r--r-- | recipes-connectivity/lora/lora-gateway/lora-gateway-sync-word.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/recipes-connectivity/lora/lora-gateway/lora-gateway-sync-word.patch b/recipes-connectivity/lora/lora-gateway/lora-gateway-sync-word.patch new file mode 100644 index 0000000..e51e02a --- /dev/null +++ b/recipes-connectivity/lora/lora-gateway/lora-gateway-sync-word.patch @@ -0,0 +1,40 @@ +diff --git a/libloragw/inc/loragw_hal.h b/libloragw/inc/loragw_hal.h +index 1516b65..24c5969 100644 +--- a/libloragw/inc/loragw_hal.h ++++ b/libloragw/inc/loragw_hal.h +@@ -302,6 +312,11 @@ struct lgw_pkt_tx_s { + + /* -------------------------------------------------------------------------- */ + /* --- PUBLIC FUNCTIONS PROTOTYPES ------------------------------------------ */ ++/** ++ * @brief Configure the lora synch word ++ * @param word for synch ++ */ ++void lgw_conf_lora_synch_word(uint8_t word); + + /** + @brief Configure an RF chain (must configure before start) +diff --git a/libloragw/src/loragw_hal.c b/libloragw/src/loragw_hal.c +index 5dbdf45..d0fe288 100644 +--- a/libloragw/src/loragw_hal.c ++++ b/libloragw/src/loragw_hal.c +@@ -827,6 +851,19 @@ void lgw_constant_adjust(void) { + /* -------------------------------------------------------------------------- */ + /* --- PUBLIC FUNCTIONS DEFINITION ------------------------------------------ */ + ++void lgw_conf_lora_synch_word(uint8_t word) { ++ uint8_t peak1 = word >> 4; ++ uint8_t peak2 = word & 0x0F; ++ ++ lgw_reg_w(LGW_FRAME_SYNCH_PEAK1_POS, peak1); /* default 1 */ ++ lgw_reg_w(LGW_FRAME_SYNCH_PEAK2_POS, peak2); /* default 2 */ ++ lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_PEAK1_POS, peak1); /* default 1 */ ++ lgw_reg_w(LGW_MBWSSF_FRAME_SYNCH_PEAK2_POS, peak2); /* default 2 */ ++ lgw_reg_w(LGW_TX_FRAME_SYNCH_PEAK1_POS, peak1); /* default 1 */ ++ lgw_reg_w(LGW_TX_FRAME_SYNCH_PEAK2_POS, peak2); /* default 2 */ ++} ++ ++ + int lgw_rxrf_setconf(uint8_t rf_chain, struct lgw_conf_rxrf_s conf) { + + /* check if the concentrator is running */ |