Loading...
Searching...
No Matches
gomach.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 INRIA
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
42#ifndef NET_GNRC_GOMACH_GOMACH_H
43#define NET_GNRC_GOMACH_GOMACH_H
44
45#include "periph/rtt.h"
46#include "net/gnrc/netif.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
67#ifndef CONFIG_GNRC_GOMACH_CP_DURATION_US
68#define CONFIG_GNRC_GOMACH_CP_DURATION_US (10U * US_PER_MS)
69#endif
70
91#ifndef CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US
92#define CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US (300LU * US_PER_MS)
93#endif
94
95#ifndef RTT_FREQUENCY
96#error "RTT_FREQUENCY undefined."
97#else
98#if ((CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US < ((1000LU *US_PER_MS) / RTT_FREQUENCY)) || \
99 (CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US < (10 * CONFIG_GNRC_GOMACH_CP_DURATION_US)))
100#undef CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US
101#if (((1000LU *US_PER_MS) / RTT_FREQUENCY) > (10 * CONFIG_GNRC_GOMACH_CP_DURATION_US))
102#define CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US ((1000LU * US_PER_MS) / RTT_FREQUENCY)
103#else
104#define CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US (10 * CONFIG_GNRC_GOMACH_CP_DURATION_US)
105#endif
106#endif
107#endif
108
119#ifndef CONFIG_GNRC_GOMACH_CP_RANDOM_END_US
120#define CONFIG_GNRC_GOMACH_CP_RANDOM_END_US (1U * US_PER_MS)
121#endif
122
134#ifndef GNRC_GOMACH_CP_DURATION_MAX_US
135#define GNRC_GOMACH_CP_DURATION_MAX_US (5LU * CONFIG_GNRC_GOMACH_CP_DURATION_US)
136#endif
137
150#ifndef GNRC_GOMACH_WAIT_BEACON_TIME_US
151#define GNRC_GOMACH_WAIT_BEACON_TIME_US (GNRC_GOMACH_CP_DURATION_MAX_US)
152#endif
153
163#ifndef CONFIG_GNRC_GOMACH_CP_MIN_GAP_US
164#define CONFIG_GNRC_GOMACH_CP_MIN_GAP_US (25U * US_PER_MS)
165#endif
166
175#ifndef CONFIG_GNRC_GOMACH_WAIT_RX_END_US
176#define CONFIG_GNRC_GOMACH_WAIT_RX_END_US (6U * US_PER_MS)
177#endif
178
187#ifndef CONFIG_GNRC_GOMACH_NO_TX_ISR_US
188#define CONFIG_GNRC_GOMACH_NO_TX_ISR_US (50U * US_PER_MS)
189#endif
190
198#ifndef CONFIG_GNRC_GOMACH_MAX_PREAM_INTERVAL_US
199#define CONFIG_GNRC_GOMACH_MAX_PREAM_INTERVAL_US (6U * US_PER_MS)
200#endif
201
213#ifndef CONFIG_GNRC_GOMACH_PREAMBLE_INTERVAL_US
214#define CONFIG_GNRC_GOMACH_PREAMBLE_INTERVAL_US (2U * US_PER_MS)
215#endif
216
226#ifndef CONFIG_GNRC_GOMACH_BCAST_INTERVAL_US
227#define CONFIG_GNRC_GOMACH_BCAST_INTERVAL_US (1U * US_PER_MS)
228#endif
229
241#ifndef GNRC_GOMACH_PREAMBLE_DURATION_US
242#define GNRC_GOMACH_PREAMBLE_DURATION_US \
243 (21LU * CONFIG_GNRC_GOMACH_SUPERFRAME_DURATION_US / 10)
244#endif
245
255#ifndef CONFIG_GNRC_GOMACH_VTDMA_SLOT_SIZE_US
256#define CONFIG_GNRC_GOMACH_VTDMA_SLOT_SIZE_US (5U * US_PER_MS)
257#endif
258
270#ifndef CONFIG_GNRC_GOMACH_TX_BUSY_THRESHOLD
271#define CONFIG_GNRC_GOMACH_TX_BUSY_THRESHOLD (5U)
272#endif
273
282#ifndef CONFIG_GNRC_GOMACH_CP_EXTEND_THRESHOLD
283#define CONFIG_GNRC_GOMACH_CP_EXTEND_THRESHOLD (5U)
284#endif
285
295#ifndef CONFIG_GNRC_GOMACH_RX_DUPCHK_UNIT_LIFE
296#define CONFIG_GNRC_GOMACH_RX_DUPCHK_UNIT_LIFE (30U)
297#endif
298
309#ifndef CONFIG_GNRC_GOMACH_MAX_ALLOC_SENDER_NUM
310#define CONFIG_GNRC_GOMACH_MAX_ALLOC_SENDER_NUM (11U)
311#endif
312
324#ifndef CONFIG_GNRC_GOMACH_REPHASELOCK_THRESHOLD
325#define CONFIG_GNRC_GOMACH_REPHASELOCK_THRESHOLD (4U)
326#endif
327
336#ifndef CONFIG_GNRC_GOMACH_T2U_RETYR_THRESHOLD
337#define CONFIG_GNRC_GOMACH_T2U_RETYR_THRESHOLD (2U)
338#endif
339
350#ifndef CONFIG_GNRC_GOMACH_MAX_T2U_RETYR_THRESHOLD
351#define CONFIG_GNRC_GOMACH_MAX_T2U_RETYR_THRESHOLD (10U)
352#endif
370int gnrc_netif_gomach_create(gnrc_netif_t *netif, char *stack, int stacksize,
371 char priority, const char *name, netdev_t *dev);
372
373#ifdef __cplusplus
374}
375#endif
376
377#endif /* NET_GNRC_GOMACH_GOMACH_H */
Definition for GNRC's network interfaces.
int gnrc_netif_gomach_create(gnrc_netif_t *netif, char *stack, int stacksize, char priority, const char *name, netdev_t *dev)
Creates an IEEE 802.15.4 GoMacH network interface.
Low-level RTT (Real Time Timer) peripheral driver interface definitions.
Representation of a network interface.
Definition netif.h:135
Structure to hold driver state.
Definition netdev.h:363