[riot-notifications] [RIOT-OS/RIOT] drivers/sx126x : r/NETOPT_RX_TIMEOUT/NETOPT_RX_SYMBOL_TIMEOUT (#16599)

Akshai M (Augustus Diode) notifications at github.com
Thu Jul 8 10:54:17 CEST 2021


@akshaim commented on this pull request.



> @@ -97,6 +99,23 @@ void sx126x_setup(sx126x_t *dev, const sx126x_params_t *params, uint8_t index);
  */
 int sx126x_init(sx126x_t *dev);
 
+/**
+ * @brief   Converts symbol value to time in milliseconds.
+ *
+ * @param[in] dev                      Device descriptor of the driver
+ * @param[in] symbols                  Symbols
+ *
+ * @return Time for symbol(s) in milliseconds
+ */
+static inline int sx126x_symbol_to_msec(sx126x_t *dev, uint16_t symbols)
+{
+    assert(dev && (dev->mod_params.bw <= SX126X_LORA_BW_500) && \
+           (dev->mod_params.bw >= SX126X_LORA_BW_125));
+
+    /* Refer section 4.1.1.7  Time on air in SX1276/77/78/79 datasheet */
+    return (symbols * (1 << (dev->mod_params.sf + 7 - dev->mod_params.bw)) / 1000);

It's a simplified version, just put in the numbers and the results are the same. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16599#discussion_r666001191
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210708/6ab492a2/attachment.htm>


More information about the notifications mailing list