lwmac.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Daniel Krebs
3  * 2016 INRIA
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
73 #ifndef NET_GNRC_LWMAC_LWMAC_H
74 #define NET_GNRC_LWMAC_LWMAC_H
75 
76 #include "kernel_types.h"
77 #include "net/gnrc/netif.h"
78 
79 #ifdef __cplusplus
80 extern "C" {
81 #endif
82 
102 #ifndef GNRC_LWMAC_WAKEUP_INTERVAL_US
103 #define GNRC_LWMAC_WAKEUP_INTERVAL_US (200LU *US_PER_MS)
104 #endif
105 
117 #ifndef GNRC_LWMAC_PREAMBLE_DURATION_US
118 #define GNRC_LWMAC_PREAMBLE_DURATION_US ((13LU *GNRC_LWMAC_WAKEUP_INTERVAL_US) / 10)
119 #endif
120 
136 #ifndef GNRC_LWMAC_TIME_BETWEEN_WR_US
137 #define GNRC_LWMAC_TIME_BETWEEN_WR_US (5U *US_PER_MS)
138 #endif
139 
152 #ifndef GNRC_LWMAC_WAKEUP_DURATION_US
153 #define GNRC_LWMAC_WAKEUP_DURATION_US (GNRC_LWMAC_TIME_BETWEEN_WR_US * 2)
154 #endif
155 
166 #ifndef GNRC_LWMAC_BROADCAST_DURATION_US
167 #define GNRC_LWMAC_BROADCAST_DURATION_US ((GNRC_LWMAC_WAKEUP_INTERVAL_US * 11) / 10)
168 #endif
169 
182 #ifndef GNRC_LWMAC_TIME_BETWEEN_BROADCAST_US
183 #define GNRC_LWMAC_TIME_BETWEEN_BROADCAST_US (GNRC_LWMAC_TIME_BETWEEN_WR_US)
184 #endif
185 
194 #ifndef GNRC_LWMAC_WR_PREPARATION_US
195 #define GNRC_LWMAC_WR_PREPARATION_US ((3U *US_PER_MS))
196 #endif
197 
214 #ifndef GNRC_LWMAC_DATA_DELAY_US
215 #define GNRC_LWMAC_DATA_DELAY_US (10U *US_PER_MS)
216 #endif
217 
226 #ifndef GNRC_LWMAC_DATA_CSMA_RETRIES
227 #define GNRC_LWMAC_DATA_CSMA_RETRIES (3U)
228 #endif
229 
240 #ifndef GNRC_LWMAC_MAX_DATA_TX_RETRIES
241 #define GNRC_LWMAC_MAX_DATA_TX_RETRIES (3U)
242 #endif
243 
265 #ifndef GNRC_LWMAC_MAX_TX_BURST_PKT_NUM
266 #define GNRC_LWMAC_MAX_TX_BURST_PKT_NUM (GNRC_LWMAC_WAKEUP_INTERVAL_US / GNRC_LWMAC_WAKEUP_DURATION_US)
267 #endif
268 
280 #ifndef GNRC_LWMAC_MAX_RX_EXTENSION_NUM
281 #define GNRC_LWMAC_MAX_RX_EXTENSION_NUM (3U)
282 #endif
283 
290 #ifndef GNRC_LWMAC_BROADCAST_CSMA_RETRIES
291 #define GNRC_LWMAC_BROADCAST_CSMA_RETRIES (3U)
292 #endif
293 
310 int gnrc_netif_lwmac_create(gnrc_netif_t *netif, char *stack, int stacksize,
311  char priority, char *name, netdev_t *dev);
312 #ifdef __cplusplus
313 }
314 #endif
315 
316 #endif /* NET_GNRC_LWMAC_LWMAC_H */
317 
Types used by the kernel.
Structure to hold driver state.
Definition: netdev.h:283
Representation of a network interface.
Definition: netif.h:107
Definition for GNRC's network interfaces.
int gnrc_netif_lwmac_create(gnrc_netif_t *netif, char *stack, int stacksize, char priority, char *name, netdev_t *dev)
Creates an IEEE 802.15.4 LWMAC network interface.