BLE-Stack APIs  3.00.00
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
urfc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, Texas Instruments Incorporated
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  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * 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  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!*****************************************************************************
33  * @addtogroup Micro_BLE_Stack
34  * @{
35  * @defgroup URF Micro RF Settings
36  * @{
37  * @file urfc.h
38  * @brief This file contains configurable variables for the Micro BLE Stack
39  * radio.
40  *
41  * In general, the configuration values vary by device type, device version
42  * and board characteristics. The definitions and values listed in
43  * urfcfg.h and urfcfg.c can be changed or more sets of definitions and
44  * values can be added, depending on which version/type of device and what
45  * characteristics the board has.
46  *
47  * @note User configurable variables except the elements of
48  * the power table are only used during the initialization
49  * of the MAC. Changing the values of these variables
50  * except power table elements after this will have no
51  * effect.
52  */
53 
54 #ifndef URFC_H
55 #define URFC_H
56 
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61 
62 /*******************************************************************************
63  * INCLUDES
64  */
65 #include <hal_types.h>
66 #if !defined(CC26XX_R2)
67  #include <rf_patches/rf_patch_cpe_ble.h>
68  #include <rf_patches/rf_patch_rfe_ble.h>
69 #endif /* !CC26XX_R2 */
70 #include <ti/drivers/rf/rf.h>
71 
72 /*******************************************************************************
73  * MACROS
74  */
75 
82 #define TX_POUT( IB, GC, TC ) \
83  (uint16)((((TC) & 0xFF) << 8) | (((GC) & 0x03) << 6) | ((IB) & 0x3F))
84 
85 /*******************************************************************************
86  * CONSTANTS
87  */
88 
114 #define RF_FRONTEND_MODE_MASK 0x07
115 #define RF_FE_DIFFERENTIAL 0
116 #define RF_FE_SINGLE_ENDED_RFP 1
117 #define RF_FE_SINGLE_ENDED_RFN 2
118 #define RF_FE_ANT_DIVERSITY_RFP_FIRST 3
119 #define RF_FE_ANT_DIVERSITY_RFN_FIRST 4
120 #define RF_FE_SINGLE_ENDED_RFP_EXT_PINS 5
121 #define RF_FE_SINGLE_ENDED_RFN_EXT_PINS 6
122 
123 #define RF_BIAS_MODE_MASK 0x08
124 #define RF_FE_INT_BIAS (0<<3)
125 #define RF_FE_EXT_BIAS (1<<3)
126 
127 #if defined(CC2650_LAUNCHXL) || defined(CC2640R2_LAUNCHXL) || defined(CC2650DK_7ID)
128 
129 #define RF_FE_MODE_AND_BIAS (RF_FE_DIFFERENTIAL | RF_FE_EXT_BIAS)
130 #define RF_FE_IOD_NUM 3
131 #define RF_FE_IOD {NULL, NULL, NULL}
132 #define RF_FE_IOD_VAL {NULL, NULL, NULL}
133 #define RF_FE_SATURATION 0
134 #define RF_FE_SENSITIVITY 0
135 
136 
142 #define TX_POWER_5_DBM 5
143 #define TX_POWER_4_DBM 4
144 #define TX_POWER_3_DBM 3
145 #define TX_POWER_2_DBM 2
146 #define TX_POWER_1_DBM 1
147 #define TX_POWER_0_DBM 0
148 #define TX_POWER_MINUS_3_DBM -3
149 #define TX_POWER_MINUS_6_DBM -6
150 #define TX_POWER_MINUS_9_DBM -9
151 #define TX_POWER_MINUS_12_DBM -12
152 #define TX_POWER_MINUS_15_DBM -15
153 #define TX_POWER_MINUS_18_DBM -18
154 #define TX_POWER_MINUS_21_DBM -21
155 
157 #endif /* CC2650_LAUNCHXL || CC2640R2_LAUNCHXL || CC2650DK_7ID */
158 
161 /*******************************************************************************
162  * TYPEDEFS
163  */
164 
171 {
172  int8 dBm;
173  uint16 txPowerVal;
174 } ubTxPowerVal_t;
175 
178 {
179  ubTxPowerVal_t* pTxPowerVals;
181 } ubTxPowerTable_t;
182 
183 /*******************************************************************************
184  * LOCAL VARIABLES
185  */
186 
187 /*******************************************************************************
188  * GLOBAL VARIABLES
189  */
190 
192 extern const RF_Mode ubRfMode;
194 extern uint32 ubRfRegOverride[];
196 extern const ubTxPowerTable_t ubTxPowerTable;
198 extern const uint8 ubFeModeBias;
199 
202 /*********************************************************************
203  * FUNCTIONS
204  */
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif /* URFC_H */
211  // end of Micro_BLE_Stack
PACKED_TYPEDEF_CONST_STRUCT
Tx Power Value.
Definition: urfc.h:171
uint32 ubRfRegOverride[]
Overrides for CMD_RADIO_SETUP.
const uint8 ubFeModeBias
RF frontend mode bias.
const ubTxPowerTable_t ubTxPowerTable
TX Power table.
uint16 txPowerVal
Tx Power Value.
Definition: urfc.h:173
const RF_Mode ubRfMode
RF Core patch.
uint8 numTxPowerVal
Number of Tx Power Values.
Definition: urfc.h:180
Copyright 2016, Texas Instruments Incorporated