drivers: lora: Add support for setting sync-word and iq-inverted

Add support for setting sync-word and iq-inverted in lora_modem_config. By
being able to set the sync-word it's possible to send "raw" public-network
packets using lora_send and using iq-inverted both uplink and downlink
messages can be sent.

Signed-off-by: Tim Cooijmans <timcooijmans@gmail.com>
This commit is contained in:
Tim Cooijmans 2022-07-13 15:34:21 +02:00 committed by Carles Cufí
commit 4c285fc53c
2 changed files with 24 additions and 2 deletions

View file

@ -316,15 +316,17 @@ int sx12xx_lora_config(const struct device *dev,
Radio.SetTxConfig(MODEM_LORA, config->tx_power, 0,
config->bandwidth, config->datarate,
config->coding_rate, config->preamble_len,
false, true, 0, 0, false, 4000);
false, true, 0, 0, config->iq_inverted, 4000);
} else {
/* TODO: Get symbol timeout value from config parameters */
Radio.SetRxConfig(MODEM_LORA, config->bandwidth,
config->datarate, config->coding_rate,
0, config->preamble_len, 10, false, 0,
false, 0, 0, false, true);
false, 0, 0, config->iq_inverted, true);
}
Radio.SetPublicNetwork(config->public_network);
modem_release(&dev_data);
return 0;
}