Contiki-NG
cc1200-rf-cfg.h
1 /*
2  * Copyright (c) 2015, Weptech elektronik GmbH Germany
3  * http://www.weptech.de
4  *
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
30  * OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  * This file is part of the Contiki operating system.
33  */
34 
35 #ifndef CC1200_RF_CFG_H
36 #define CC1200_RF_CFG_H
37 
38 #include "contiki.h"
39 
40 #include <stdint.h>
41 #include <stdlib.h>
42 
43 /*---------------------------------------------------------------------------*/
44 /*
45  * We export the register setup from SmartRF using the standard template
46  * "trxEB RF Settings Performance Line" and have therefore to typedef
47  * the following struct.
48  */
49 typedef struct cc1200_registerSetting {
50  uint16_t addr;
51  uint8_t val;
52 } registerSetting_t;
53 /*---------------------------------------------------------------------------*/
54 /* Map SmartRF typedef to reflect Contiki's naming conventions */
55 typedef registerSetting_t cc1200_register_settings_t;
56 /*---------------------------------------------------------------------------*/
57 /* This struct holds the complete configuration for a given mode */
58 typedef struct cc1200_rf_cfg {
59  /* A string describing the mode */
60  const char *cfg_descriptor;
61  /* A pointer to a register setup exported from SmartRF */
62  const cc1200_register_settings_t *register_settings;
63  /* The size of the register setup */
64  size_t size_of_register_settings;
65  /*
66  * TX packet lifetime. Maximum duration of a TX packet including preamble,
67  * synch word + phy header, payload + CRC.
68  */
69  rtimer_clock_t tx_pkt_lifetime;
70  /* The maximum time it takes to switch from Tx to Rx */
71  rtimer_clock_t tx_rx_turnaround;
72  /* Base frequency in kHz */
73  uint32_t chan_center_freq0;
74  /* Channel spacing in Hz */
75  uint32_t chan_spacing;
76  /* The minimum channel */
77  uint8_t min_channel;
78  /* The maximum channel */
79  uint8_t max_channel;
80  /* The maximum output power in dBm */
81  int8_t max_txpower;
82  /*
83  * The carrier sense level used for CCA in dBm (int8_t). Limited by
84  * CC1200_CONST_CCA_THRESHOLD_MIN and CC1200_CONST_CCA_THRESHOLD_MAX.
85  */
86  int8_t cca_threshold;
87  /* The RSSI offset in dBm.
88  * -99 when MDMCFG1.DVGA_GAIN=00, -81 when MDMCFG1.DVGA_GAIN=01 */
89  int8_t rssi_offset;
90 } cc1200_rf_cfg_t;
91 /*---------------------------------------------------------------------------*/
92 #endif /* CC1200_RF_CFG_H */
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.
Definition: uip-nd6.c:115