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

75 Commits

Author SHA1 Message Date
490126cfa0
drivers: move USEMODULE_INCLUDES in each driver directories 2020-07-15 20:36:27 +02:00
Benjamin Valentin
14bb15d91f drivers/at86rf215: make reset pulse width configurable
Some hardware designers like to include filtering capacitors into reset
lines in order to protect against ESD or other pulses.

This increases the raise time of the reset signal. To still reach the
required 16 µs reset pulse width, we thus have to increase the reset pulse
width via board config.
2020-06-11 15:05:21 +02:00
Leandro Lanzieri
ab996823ee
Merge pull request #14197 from benpicco/driver/at86rf215_cleanup
driver/at86rf215: cleanup
2020-06-09 18:38:57 +02:00
Benjamin Valentin
93236e0f2c drivers/at86rf215: add modulation config to KConfig 2020-06-09 11:48:59 +02:00
Benjamin Valentin
6a2d9f9762 drivers/at86rf215: make default O-QPSK rate configutable 2020-06-09 11:48:59 +02:00
Benjamin Valentin
1ab35b16ae drivers/at86rf215: include board.h
Board-specific configuration is typically defined in board.h, so
include it here so it gets applied.
2020-06-09 11:48:59 +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
4e9420bffc drivers/at86rf215: prefix configuration defines with CONFIG_ 2020-06-09 11:48:59 +02:00
Marian Buschsieweke
7862baf348
drivers/at86rf215: Fix documentation
- Balance Doxygen groups
- Move drivers_at86rf215_oqpsk into drivers_at86rf215
2020-06-03 21:09:50 +02:00
Benjamin Valentin
164e239160 at86rf215: remove obsolete at86rf215_switch_mode() 2020-06-03 15:58:50 +02:00
Benjamin Valentin
cc5fbdf9f8 drivers/at86rf215: implement MR-OFDM 2020-06-03 15:58:50 +02:00
Francisco
80b300289d
Merge pull request #13912 from benpicco/at86rf215-mr-qpsk
drivers/at86rf215: implement MR-O-QPSK
2020-04-29 12:44:00 +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
Akshai M
7b2591ea09 drivers_at86rf215 : Expose to Kconfig
Expose Configurations to Kconfig

Co-Authored-By: benpicco <benpicco@googlemail.com>
Co-Authored-By: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
2020-04-22 15:55:21 +05:30
Akshai M
68e2fc5845 drivers/at86rf215 : Add CONFIG
Add CONFIG_ Prefix for configuring AT86RF215_TRIM_VAL
2020-04-22 15:54:33 +05:30
Akshai M
8617991312 drivers/at86rf215 : Add CONFIG_
Add Add CONFIG_ Prefix for AT86RF215_USE_CLOCK_OUTPUT and model
it as a bool

Co-Authored-By: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
2020-04-22 15:54:33 +05:30
Jose Alamos
77325b4cde ieee802154: add CONFIG_ prefix to config macros 2020-04-08 19:08:25 +02:00
benpicco
750db2a910
Merge pull request #13788 from benpicco/drivers/at86rf215_shutdown_fix
drivers/at86rf215: return error when switching state while busy
2020-04-03 17:50:48 +02:00
Benjamin Valentin
46544c5d7a drivers/at86rf215: add comment to _tx_ongoing() 2020-04-03 12:48:52 +02:00
Benjamin Valentin
5ed88ecb0a drivers/at86rf215: unexport at86rf215_block_while_busy()
It's a private function that should not be used lightly.
2020-04-01 23:14:46 +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
611f4161d6 drivers/at86rf215: fix reset after deep sleep
When the radio is in DEEP SLEEP, reading the state register will return 0.
This makes the reset routine abort early even though the device is connected
and still waking up.

Instead, just add a timeout to the polling of the WAKEUP IRQ bit.
In practise it has shown that the loop will be taken two times on 'normal'
reset and four times when the radio was in DEEP SLEEP.

Polling 255 times sure does not hurt.

To reproduce the issue, put both interfaces into SLEEP mode,
then reboot the module:

    ifconfig 7 set state sleep
    ifconfig 8 set state sleep
    reboot
2020-03-29 19:44:40 +02:00
Benjamin Valentin
f673e275f3 drivers/at86rf215: adapt default config to same54-xpro EXT1
Previously the default config was for connecting the REB215-XPRO
module to EXT3 on same54-xpro.

Since now more SPI buses are configured on same54-xpro and the default
config also serves as a compile test for boards with only one SPI bus,
connect the module to the (new) first SPI bus by default.
2020-03-24 01:16:47 +01: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