1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

26 Commits

Author SHA1 Message Date
Benjamin Valentin
a379658fa1 drivers/at86rf215: tx_frame_len is already set by at86rf215_tx_load() 2024-11-22 19:50:12 +01:00
Benjamin Valentin
ef639df76f drivers/at86rf215: return ENETDOWN when interface is down 2024-11-22 19:44:12 +01:00
Marian Buschsieweke
51f969d655
Merge pull request #20993 from benpicco/netdev_new_api-enhance
gnrc_netif: netdev_new_api implies TX end irq, no need to check it
2024-11-17 08:45:19 +00:00
Benjamin Valentin
140c3afbcc drivers/at86rf215: don't use netdev events internally 2024-11-15 14:08:44 +01:00
Benjamin Valentin
62eb2935c8 drivers/at86rf215 drop get for NETOPT_TX_END_IRQ
This is always true with netdev_new_api
2024-11-14 17:39:23 +01:00
Benjamin Valentin
1629a6aa41 drivers/at86rf215: properly implement netdev_new 2024-11-14 11:57:58 +01:00
Benjamin Valentin
c1e79c84d0 drivers/at86rf215: port to new netdev API 2024-05-15 17:24:42 +02:00
Frederik Haxel
ec7fe8d598 drivers: Use size_t print format specifier
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
2023-12-21 12:02:28 +01:00
Benjamin Valentin
838a5e4bd3 netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
benpicco
cb5e19beb5
Merge pull request #17979 from maribu/drivers/netdev_ieee802154
drivers/netdev_ieee802154: drop duplicate struct member
2022-06-02 00:47:56 +02:00
Benjamin Valentin
9ea5e58774 drivers: drop NETOPT_RX_END_IRQ 2022-05-11 23:44:24 +02:00
Marian Buschsieweke
1fd4d41d76
driver/netdev_ieee802154: Make timestamp optional
Also remove duplicate struct member.
2022-04-22 14:33:56 +02:00
Benjamin Valentin
03dc48602e drivers/at86rf215: fix disabling individual modulations
This should work now:

DISABLE_MODULE += netdev_ieee802154_mr_oqpsk
DISABLE_MODULE += netdev_ieee802154_mr_ofdm
DISABLE_MODULE += netdev_ieee802154_mr_fsk
2022-02-16 18:01:07 +01:00
Jose Alamos
8c0c603146
drivers/at86rf215: remove msg queue dependency 2021-08-16 15:28:06 +02:00
Jose Alamos
343ffa9f7e
at86rf215: avoid explicit cast to netdev 2021-07-09 10:38:33 +02:00
Jnae
b287d120ff at86rf215: timestamp counter for rx frames 2021-05-12 15:27:36 +02:00
Marian Buschsieweke
08063bebfe
drivers/at86rf215: make TX/RX IRQs read only
This brings the implementation in sync with the API.
2021-03-22 08:15:54 +01:00
Benjamin Valentin
f9650bdbc3 drivers/at86rf215: implement Battery Monitor 2020-11-13 22:59:09 +01:00
Benjamin Valentin
6f23263503 drivers/at86rf215: implement MR-FSK 2020-11-03 10:51:21 +01:00
Benjamin Valentin
634714ff78 drivers/at86rf215: implement Reduced Power Consumption
Reduced Power Consumption is available for MR-O-QPSK and
MR-FSK.
In this mode the receiver will be turned off periodically,
defaulting to a 50% duty cycle.

This reduces power consumption when in IDLE RX by almost 50%
and is therefore enabled by default.
2020-09-07 13:48:47 +02:00
Benjamin Valentin
feba1d1bcb drivers/at86rf215: don't compile modulations that are not selected
Don't compile in code for MR-OFDM, etc if `netdev_ieee802154_mr_oqpsk` is
disabled.
2020-06-09 11:48:59 +02:00
Benjamin Valentin
cc5fbdf9f8 drivers/at86rf215: implement MR-OFDM 2020-06-03 15:58:50 +02:00
Benjamin Valentin
e6d47aa825 drivers/at86rf215: implement MR-O-QPSK 2020-04-29 10:41:37 +02:00
Benjamin Valentin
0cf9f6aa7f drivers/at86rf215: implement at86rf215_get_phy_mode() 2020-04-29 10:41:37 +02:00
Benjamin Valentin
8c6791b136 drivers/at86rf215: return error when switching state while busy
Previously the function attempted to block here and manually service
the ISR.
This lead to unexpected results, in particular messages queuing up in
the threads message queue.

The result was that the radio would not end up in the correct state.
E.g. sending SLEEP to both interfaces while a transmission was ongoing
would lead to the interfaces waking up again.

With this patch the operation will just return -ERRNO so the caller can
try again.

To reproduce, try the attached patch for the `gnrc_networking` example:

On master you will find that the radio still consumes ~2.4mA after 'shutdown'.
(It is in fact in the state TRXOFF as it woke up again)
With this change the radio should consume less than 1µA (DEEP SLEEP).

diff --git a/examples/gnrc_networking/main.c b/examples/gnrc_networking/main.c
index 6301f4291d..93b96eb939 100644
--- a/examples/gnrc_networking/main.c
+++ b/examples/gnrc_networking/main.c
@@ -23,12 +23,47 @@
 #include "shell.h"
 #include "msg.h"

+#include "periph/pm.h"
+
+#include "net/netopt.h"
+#include "net/gnrc/netif.h"
+
 #define MAIN_QUEUE_SIZE     (8)
 static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];

 extern int udp_cmd(int argc, char **argv);

+extern void send(char *addr_str, char *port_str, char *data, unsigned int num,
+                 unsigned int delay);
+
+static int send_and_shutdown(int argc, char **argv)
+{
+    (void) argc;
+    (void) argv;
+
+    /* the address must not exist */
+    char addr[] = "fe80::2068:3123:59f5:d238%7";
+    char port[] = "1234";
+    char data[] = "Hello World!";
+
+    send(addr, port, data, 1, 0);
+
+    /* disable radio */
+    gnrc_netif_t* netif = NULL;
+    netopt_state_t state = NETOPT_STATE_SLEEP;
+    while ((netif = gnrc_netif_iter(netif))) {
+        /* retry while busy */
+        while (gnrc_netapi_set(netif->pid, NETOPT_STATE, 0, &state,
+               sizeof(netopt_state_t)) == -EBUSY);
+    }
+
+    pm_set(0);
+
+    return 0;
+}
+
 static const shell_command_t shell_commands[] = {
+    { "shutdown", "turn off the radio & shut down", send_and_shutdown },
     { "udp", "send data over UDP and listen on UDP ports", udp_cmd },
     { NULL, NULL, NULL }
 };
diff --git a/examples/gnrc_networking/udp.c b/examples/gnrc_networking/udp.c
index e8a559846e..cb80855b76 100644
--- a/examples/gnrc_networking/udp.c
+++ b/examples/gnrc_networking/udp.c
@@ -36,7 +36,7 @@ static gnrc_netreg_entry_t server = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX
                                                                KERNEL_PID_UNDEF);

-static void send(char *addr_str, char *port_str, char *data, unsigned int num,
+void send(char *addr_str, char *port_str, char *data, unsigned int num,
                  unsigned int delay)
 {
     gnrc_netif_t *netif = NULL;
2020-04-01 23:08:44 +02:00
Benjamin Valentin
d35511bee7 drivers/at86rf215: Add basic driver for the AT86RF215 radio
This adds a driver for the SPI based AT86RF215 transceiver.
The chip supports the IEEE Std 802.15.4-2015 and IEEE Std 802.15.4g-2012 standard.

This driver supports two versions of the chip:
    - AT86RF215:  dual sub-GHz & 2.4 GHz radio & baseband
    - AT86RF215M: sub-GHz radio & baseband only

Both radios support the following PHY modes:
    - MR-FSK
    - MR-OFDM
    - MR-O-QPKS
    - O-QPSK (legacy)

The driver currently only implements support for legacy O-QPSK.

To use both interfaces, add

    GNRC_NETIF_NUMOF := 2

to your Makefile.

The transceiver is able to send frames of up to 2047 bytes according to
IEEE 802.15.4g-2012 when operating in non-legacy mode.

Known issues:

 - [ ] dBm setting values are bogus
 - [ ] Channel spacing for sub-GHz MR-O-QPSK might be wrong
 - [ ] TX/RX stress test will lock up the driver on openmote-b
2020-03-19 14:39:18 +01:00