[riot-notifications] [RIOT-OS/RIOT] drivers/cc110x: add power off (sleep) functions (#12294)

Marian Buschsieweke notifications at github.com
Sun Sep 29 16:35:46 CEST 2019


OK, the datasheet says that all relevant config registers retain their values during sleep mode. So waking up the transceiver could be implemented as trivial as this:

```C
int cc110x_wake_up(cc110x_t *dev) {
    if (cc110x_acquire(dev) != SPI_OK) {
        return -EIO;
    }
    cc110x_power_on(dev);
    cc110x_enter_rx_mode(dev);
    cc110x_release(dev);
    return 0;
}
```

But I'm not sure if this should actually be user facing API, as instead the common netdev driver interface (`netdev_driver_t::set()` and `netdev_driver_t::get()`) could be used like this:

```C
    const netopt_state_t sleep = NETOPT_STATE_SLEEP;
    netdev_driver_t::set(NETOPT_STATE, &sleep, sizeof(sleep));
```

I think this way the user could use `ifconfig` to put the device to sleep mode and wake it back up.

-- 
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/12294#issuecomment-536307522
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190929/fee000fe/attachment.htm>


More information about the notifications mailing list