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 
97 #ifndef GNRC_LWMAC_WAKEUP_INTERVAL_US
98 #define GNRC_LWMAC_WAKEUP_INTERVAL_US (200LU *US_PER_MS)
99 #endif
100 
112 #ifndef GNRC_LWMAC_PREAMBLE_DURATION_US
113 #define GNRC_LWMAC_PREAMBLE_DURATION_US ((13LU *GNRC_LWMAC_WAKEUP_INTERVAL_US) / 10)
114 #endif
115 
131 #ifndef GNRC_LWMAC_TIME_BETWEEN_WR_US
132 #define GNRC_LWMAC_TIME_BETWEEN_WR_US (5U *US_PER_MS)
133 #endif
134 
147 #ifndef GNRC_LWMAC_WAKEUP_DURATION_US
148 #define GNRC_LWMAC_WAKEUP_DURATION_US (GNRC_LWMAC_TIME_BETWEEN_WR_US * 2)
149 #endif
150 
161 #ifndef GNRC_LWMAC_BROADCAST_DURATION_US
162 #define GNRC_LWMAC_BROADCAST_DURATION_US ((GNRC_LWMAC_WAKEUP_INTERVAL_US * 11) / 10)
163 #endif
164 
177 #ifndef GNRC_LWMAC_TIME_BETWEEN_BROADCAST_US
178 #define GNRC_LWMAC_TIME_BETWEEN_BROADCAST_US (GNRC_LWMAC_TIME_BETWEEN_WR_US)
179 #endif
180 
189 #ifndef GNRC_LWMAC_WR_PREPARATION_US
190 #define GNRC_LWMAC_WR_PREPARATION_US ((3U *US_PER_MS))
191 #endif
192 
209 #ifndef GNRC_LWMAC_DATA_DELAY_US
210 #define GNRC_LWMAC_DATA_DELAY_US (10U *US_PER_MS)
211 #endif
212 
221 #ifndef GNRC_LWMAC_DATA_CSMA_RETRIES
222 #define GNRC_LWMAC_DATA_CSMA_RETRIES (3U)
223 #endif
224 
235 #ifndef GNRC_LWMAC_MAX_DATA_TX_RETRIES
236 #define GNRC_LWMAC_MAX_DATA_TX_RETRIES (3U)
237 #endif
238 
260 #ifndef GNRC_LWMAC_MAX_TX_BURST_PKT_NUM
261 #define GNRC_LWMAC_MAX_TX_BURST_PKT_NUM (GNRC_LWMAC_WAKEUP_INTERVAL_US / GNRC_LWMAC_WAKEUP_DURATION_US)
262 #endif
263 
275 #ifndef GNRC_LWMAC_MAX_RX_EXTENSION_NUM
276 #define GNRC_LWMAC_MAX_RX_EXTENSION_NUM (3U)
277 #endif
278 
285 #ifndef GNRC_LWMAC_BROADCAST_CSMA_RETRIES
286 #define GNRC_LWMAC_BROADCAST_CSMA_RETRIES (3U)
287 #endif
288 
296 #ifndef GNRC_LWMAC_IPC_MSG_QUEUE_SIZE
297 #define GNRC_LWMAC_IPC_MSG_QUEUE_SIZE (8U)
298 #endif
299 
314 gnrc_netif_t *gnrc_netif_lwmac_create(char *stack, int stacksize,
315  char priority, char *name,
316  netdev_t *dev);
317 #ifdef __cplusplus
318 }
319 #endif
320 
321 #endif /* NET_GNRC_LWMAC_LWMAC_H */
322 
Types used by the kernel.
gnrc_netif_t * gnrc_netif_lwmac_create(char *stack, int stacksize, char priority, char *name, netdev_t *dev)
Creates an IEEE 802.15.4 LWMAC network interface.
Definition for GNRC's network interfaces.
Structure to hold driver state.
Definition: netdev.h:274
Representation of a network interface.
Definition: netif.h:61