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 
103 #ifndef CONFIG_GNRC_LWMAC_WAKEUP_INTERVAL_US
104 #define CONFIG_GNRC_LWMAC_WAKEUP_INTERVAL_US (200LU *US_PER_MS)
105 #endif
106 
119 #ifndef GNRC_LWMAC_PREAMBLE_DURATION_US
120 #define GNRC_LWMAC_PREAMBLE_DURATION_US ((13LU * CONFIG_GNRC_LWMAC_WAKEUP_INTERVAL_US) / 10)
121 #endif
122 
139 #ifndef CONFIG_GNRC_LWMAC_TIME_BETWEEN_WR_US
140 #define CONFIG_GNRC_LWMAC_TIME_BETWEEN_WR_US (5U *US_PER_MS)
141 #endif
142 
157 #ifndef GNRC_LWMAC_WAKEUP_DURATION_US
158 #define GNRC_LWMAC_WAKEUP_DURATION_US (CONFIG_GNRC_LWMAC_TIME_BETWEEN_WR_US * 2)
159 #endif
160 
173 #ifndef GNRC_LWMAC_BROADCAST_DURATION_US
174 #define GNRC_LWMAC_BROADCAST_DURATION_US ((CONFIG_GNRC_LWMAC_WAKEUP_INTERVAL_US * 11) / 10)
175 #endif
176 
191 #ifndef GNRC_LWMAC_TIME_BETWEEN_BROADCAST_US
192 #define GNRC_LWMAC_TIME_BETWEEN_BROADCAST_US (CONFIG_GNRC_LWMAC_TIME_BETWEEN_WR_US)
193 #endif
194 
204 #ifndef CONFIG_GNRC_LWMAC_WR_PREPARATION_US
205 #define CONFIG_GNRC_LWMAC_WR_PREPARATION_US ((3U *US_PER_MS))
206 #endif
207 
225 #ifndef CONFIG_GNRC_LWMAC_DATA_DELAY_US
226 #define CONFIG_GNRC_LWMAC_DATA_DELAY_US (10U *US_PER_MS)
227 #endif
228 
237 #ifndef CONFIG_GNRC_LWMAC_DATA_CSMA_RETRIES
238 #define CONFIG_GNRC_LWMAC_DATA_CSMA_RETRIES (3U)
239 #endif
240 
253 #ifndef CONFIG_GNRC_LWMAC_MAX_DATA_TX_RETRIES
254 #define CONFIG_GNRC_LWMAC_MAX_DATA_TX_RETRIES (3U)
255 #endif
256 
284 #ifndef GNRC_LWMAC_MAX_TX_BURST_PKT_NUM
285 #define GNRC_LWMAC_MAX_TX_BURST_PKT_NUM \
286  (CONFIG_GNRC_LWMAC_WAKEUP_INTERVAL_US / GNRC_LWMAC_WAKEUP_DURATION_US)
287 #endif
288 
301 #ifndef CONFIG_GNRC_LWMAC_MAX_RX_EXTENSION_NUM
302 #define CONFIG_GNRC_LWMAC_MAX_RX_EXTENSION_NUM (3U)
303 #endif
304 
314 #ifndef CONFIG_GNRC_LWMAC_BROADCAST_CSMA_RETRIES
315 #define CONFIG_GNRC_LWMAC_BROADCAST_CSMA_RETRIES (3U)
316 #endif
317 
334 int gnrc_netif_lwmac_create(gnrc_netif_t *netif, char *stack, int stacksize,
335  char priority, char *name, netdev_t *dev);
336 #ifdef __cplusplus
337 }
338 #endif
339 
340 #endif /* NET_GNRC_LWMAC_LWMAC_H */
341 
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.