Contiki-NG
Loading...
Searching...
No Matches
at86rf215-def.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023, ComLab, Jozef Stefan Institute - https://e6.ijs.si/
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its
14 * contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 * OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30/*---------------------------------------------------------------------------*/
31/**
32 * \file
33 * AT86RF215 radio constants and defines. Required by the Contiki-NG.
34 * The file is included by contiki-conf.h
35 * \author
36 * Grega Morano <grega.morano@ijs.si>
37 */
38/*---------------------------------------------------------------------------*/
39
40#ifndef AT86RF215_DEF_H_
41#define AT86RF215_DEF_H_
42
43
44/**
45 * The delay between radio Tx request and SFD sent
46 * 1) transition to TXPREP --> done in prepare(), needed only if CCA is enabled
47 * 2) tx_bb_delay --> <3 us for OQPSK
48 * 3) tx_proc_delay --> depends on register settings (~10 us)
49 * 4) tx_start_delay --> 4 us
50 *
51 * However, the current drivers require appx. 240 us delay before TX.
52 *
53 * If we put state transition to TXPREP into at86rf215_prepare(), then this
54 * time can be reduced for 80us. However, that would disrupt the CSMA ...
55 */
56#define AT86RF215_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(315))
57
58/**
59 * The delay between radio Rx request and start listening
60 * 1) transition to RX --> 90 us
61 *
62 * The radio drivers are built in a way, that radio must be on during the
63 * timeslot (TSCH_CONF_RADIO_ON_DURING_TIMESLOT), so this time could be
64 * smaller. The delay is added to compensate the "large" TX_DELAY.
65 */
66#define AT86RF215_DELAY_BEFORE_RX ((unsigned)US_TO_RTIMERTICKS(100))
67
68/**
69 * The delay between the end of SFD reception and the radio returning 1
70 * to receiving_packet(). Preamble length is
71 * 8 symbols (16 us) + SFD (2 us) = 18 us
72 */
73#define AT86RF215_DELAY_BEFORE_DETECT ((unsigned)US_TO_RTIMERTICKS(20))
74
75/**
76 * The number of header and footer bytes of overhead at the PHY
77 * layer after SFD (1 length + 2 CRC)
78 */
79#define AT86RF215_PHY_OVERHEAD (3)
80
81/**
82 * The air time for one byte in microsecond:
83 * 1 / (250kbps/8) == 32 us/byte
84 */
85#define AT86RF215_BYTE_AIR_TIME (32)
86
87#define AT86RF215_MAX_PAYLOAD_SIZE (127)
88#define AT86RF215_OUTPUT_POWER_MIN (-15)
89#define AT86RF215_OUTPUT_POWER_MAX (15)
90#define AT86RF215_RF_CHANNEL_MIN (11)
91#define AT86RF215_RF_CHANNEL_MAX (26)
92
93
94/*---------------------------------------------------------------------------*/
95/* TSCH additional configuration.
96 *
97 * Prior to now, the OpenMoteB used only CC2538 radio so the setup/config of
98 * the node is adopted only to that radio.
99 * Some values are already defined in cc2538-def.h and the file must be / is
100 * included before this one (by contiki-conf.h). Since I don't want to change
101 * the original file, I just comment-out the values here.
102 *---------------------------------------------------------------------------*/
103
104/* Drivers optimized so radio can be turned off within the timeslot */
105#define TSCH_CONF_RADIO_ON_DURING_TIMESLOT (0)
106
107/* Frame filtering is done in software (promiscuous mode) */
108//#define TSCH_CONF_HW_FRAME_FILTERING (0)
109
110/* The drift compared to "true" 10ms slots.*/
111//#define TSCH_CONF_BASE_DRIFT_PPM -977
112
113/* Rtimer arch second */
114//#define RTIMER_ARCH_SECOND 32768
115
116#ifndef TSCH_CONF_RX_WAIT
117#define TSCH_CONF_RX_WAIT 2200
118#endif
119
120#endif /* AT86RF215_DEF_H_ */