[riot-notifications] [RIOT-OS/RIOT] RDM: The 802.15.4 Radio HAL (#13943)

José Alamos notifications at github.com
Tue May 12 20:02:52 CEST 2020


@maribu @benpicco @PeterKietzmann as promised (and after some thoughts) here's the abstract state machine:

```
                                          +---------+
                                          |         |
                                          |   Off   |
                                          |         |
                                          +---------+
                                            ^     |
                                   off()*[1] |     | on()
                                            |     v
          +---------+                     +---------+
          |         |                     |         |
          | CCA_BUSY|                     | TRX_OFF |
          |         |                     |         |
          +---------+                     +---------+
            |      ^                        |     ^
RF_CCA_DONE |      |    set_trx_state(IDLE) |     | set_trx_state(TRX_OFF)
            |      |                        |     |
            |      |                        |     |
            | cca()|                        v     |
            |      +----------------------+---------+  transmit()   +---------+
            +---------------------------->|         |-------------->|         |
                                          |   IDLE  |               | TX_BUSY |
                +------------------------>|         |<--------------|         |
                |                         +---------+  RF_TX_DONE   +---------+
                |                           ^    |
                |                           |    |
      RF_RX_DONE|       set_trx_state(IDLE) |    | set_trx_state(RX_ON)
                |                           |    |
                |                           |    |
                |                           |    v
         +---------+                     +---------+
         |         |                     |         |
         | RX_BUSY |<--------------------|  RX_ON  |
         |         |      SFD detected   |         |
         +---------+                     +---------+

*[1]: The off state can be access from any state.
```

All functions are non-blocking here. Some comments:
- "TX_ON" was replaced with an "IDLE" state to keep the semantics with modern radios. From this state, the radio should be able to transmit as fast as possible (same as the old TX_ON). In this state the radio doesn't receive any packets.
- Trying to set states from RX_BUSY and TX_BUSY states will return -EBUSY.
- `read` and `write` (not in the diagram) can be used for reading and writing packets to the framebuffer. These can be used in "IDLE" or "TRX_OFF" states (trade-off between power consumption and TX-RX turnaround time)
- `write` will return "-EBUSY" if the radio hasn't finished the transmission or there's a packet waiting to be read (in radios with single framebuffer).
- CCA always return to IDLE so it's possible to do a fast measurement of channel activity again.

This abstract state machine should fit well with modern radios (at86rf215) as well as old stuff (CCxxxx, at86rf231, etc).

Please let me know if something is not clear.

-- 
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/13943#issuecomment-627502056
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200512/cc188629/attachment.htm>


More information about the notifications mailing list