CC26xx Driver Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
chipinfo.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: chipinfo.h
3 * Revised: 2015-01-13 16:59:55 +0100 (ti, 13 jan 2015)
4 * Revision: 42365
5 *
6 * Description: Collection of functions returning chip information.
7 *
8 * Copyright (c) 2015, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38 
39 //*****************************************************************************
40 //
43 //
44 //*****************************************************************************
45 
46 #ifndef __CHIP_INFO_H__
47 #define __CHIP_INFO_H__
48 
49 //*****************************************************************************
50 //
51 // If building with a C++ compiler, make all of the definitions in this header
52 // have a C binding.
53 //
54 //*****************************************************************************
55 #ifdef __cplusplus
56 extern "C"
57 {
58 #endif
59 
60 #include <stdint.h>
61 #include <stdbool.h>
62 #include <inc/hw_types.h>
63 #include <inc/hw_memmap.h>
64 #include <inc/hw_fcfg1.h>
65 
66 //*****************************************************************************
67 //
73 //
74 //*****************************************************************************
75 typedef enum {
77  PROTOCOLBIT_BLE = 0x02,
81 
82 //*****************************************************************************
83 //
88 //
89 //*****************************************************************************
91 
92 
93 //*****************************************************************************
94 //
99 //
100 //*****************************************************************************
101 __STATIC_INLINE bool
103 {
104  return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_BLE ) != 0 );
105 }
106 
107 //*****************************************************************************
108 //
113 //
114 //*****************************************************************************
115 __STATIC_INLINE bool
117 {
119 }
120 
121 //*****************************************************************************
122 //
127 //
128 //*****************************************************************************
129 __STATIC_INLINE bool
131 {
133 }
134 
135 
136 //*****************************************************************************
137 //
139 //
140 //*****************************************************************************
141 typedef enum {
146 } PackageType_t;
147 
148 //*****************************************************************************
149 //
154 //
155 //*****************************************************************************
157 
158 //*****************************************************************************
159 //
164 //
165 //*****************************************************************************
166 __STATIC_INLINE bool
168 {
169  return ( ChipInfo_GetPackageType() == PACKAGE_4x4 );
170 }
171 
172 //*****************************************************************************
173 //
178 //
179 //*****************************************************************************
180 __STATIC_INLINE bool
182 {
183  return ( ChipInfo_GetPackageType() == PACKAGE_5x5 );
184 }
185 
186 //*****************************************************************************
187 //
192 //
193 //*****************************************************************************
194 __STATIC_INLINE bool
196 {
197  return ( ChipInfo_GetPackageType() == PACKAGE_7x7 );
198 }
199 
200 
201 //*****************************************************************************
202 //
207 //*****************************************************************************
208 __STATIC_INLINE uint32_t
210 {
211  // Returns HwRevCode = FCFG1_O_ICEPICK_DEVICE_ID[31:28]
212  return ( HWREG( FCFG1_BASE + FCFG1_O_ICEPICK_DEVICE_ID ) >> 28 );
213 }
214 
215 
216 //*****************************************************************************
217 //
219 //
220 //*****************************************************************************
221 typedef enum {
225 } ChipFamily_t;
226 
227 //*****************************************************************************
228 //
233 //
234 //*****************************************************************************
235 extern ChipFamily_t ChipInfo_GetChipFamily( void );
236 
237 //*****************************************************************************
238 //
243 //
244 //*****************************************************************************
245 __STATIC_INLINE bool
247 {
248  return ( ChipInfo_GetChipFamily() == FAMILY_CC26xx );
249 }
250 
251 //*****************************************************************************
252 //
257 //
258 //*****************************************************************************
259 __STATIC_INLINE bool
261 {
262  return ( ChipInfo_GetChipFamily() == FAMILY_CC13xx );
263 }
264 
265 //*****************************************************************************
266 //
268 //
269 //*****************************************************************************
270 typedef enum {
272  HWREV_1_0 = 0,
273  HWREV_2_0 = 1,
274  HWREV_2_1 = 2,
276 } HwRevision_t;
277 
278 //*****************************************************************************
279 //
284 //
285 //*****************************************************************************
286 extern HwRevision_t ChipInfo_GetHwRevision( void );
287 
288 //*****************************************************************************
289 //
294 //
295 //*****************************************************************************
296 __STATIC_INLINE bool
298 {
299  return ( ChipInfo_GetHwRevision() == HWREV_1_0 );
300 }
301 
302 //*****************************************************************************
303 //
308 //
309 //*****************************************************************************
310 __STATIC_INLINE bool
312 {
313  return ( ChipInfo_GetHwRevision() >= HWREV_2_0 );
314 }
315 
316 //*****************************************************************************
317 //
322 //
323 //*****************************************************************************
324 __STATIC_INLINE bool
326 {
327  return ( ChipInfo_GetHwRevision() == HWREV_2_0 );
328 }
329 
330 //*****************************************************************************
331 //
336 //
337 //*****************************************************************************
338 __STATIC_INLINE bool
340 {
341  return ( ChipInfo_GetHwRevision() == HWREV_2_1 );
342 }
343 
344 //*****************************************************************************
345 //
350 //
351 //*****************************************************************************
352 __STATIC_INLINE bool
354 {
355  return ( ChipInfo_GetHwRevision() == HWREV_2_2 );
356 }
357 
358 //*****************************************************************************
359 //
364 //
365 //*****************************************************************************
366 __STATIC_INLINE bool
368 {
369  return ( ChipInfo_GetHwRevision() >= HWREV_2_2 );
370 }
371 
372 #if defined( CHECK_AT_STARTUP_FOR_CORRECT_FAMILY_ONLY )
373 //*****************************************************************************
374 //
378 //
379 //*****************************************************************************
380 extern void ThisCodeIsBuiltForCC26xxHwRev20AndLater_HaltIfViolated( void );
381 
382 #else
383 
384 //*****************************************************************************
385 //
389 //
390 //*****************************************************************************
392 
393 #endif
394 
395 //*****************************************************************************
396 //
397 // Mark the end of the C bindings section for C++ compilers.
398 //
399 //*****************************************************************************
400 #ifdef __cplusplus
401 }
402 #endif
403 
404 #endif // __CHIP_INFO_H__
405 
406 //*****************************************************************************
407 //
410 //
411 //*****************************************************************************
__STATIC_INLINE bool ChipInfo_HwRevisionIs_1_0(void)
Returns true if HW revision for this chip is 1.0.
Definition: chipinfo.h:297
PackageType_t ChipInfo_GetPackageType(void)
Returns package type.
Definition: chipinfo.c:67
None of the known protocols are supported.
Definition: chipinfo.h:76
HwRevision_t
HW revision enumeration.
Definition: chipinfo.h:270
__STATIC_INLINE bool ChipInfo_HwRevisionIs_GTEQ_2_2(void)
Returns true if HW revision for this chip is 2.2 or greater.
Definition: chipinfo.h:367
PackageType_t
Package type enumeration.
Definition: chipinfo.h:141
__STATIC_INLINE bool ChipInfo_SupportsPROPRIETARY(void)
Returns true if the chip supports propriatary protocols.
Definition: chipinfo.h:130
__STATIC_INLINE bool ChipInfo_PackageTypeIs4x4(void)
Returns true if this is a 4x4mm chip.
Definition: chipinfo.h:167
Chip family member is unknown.
Definition: chipinfo.h:222
Current chip type is unknown.
Definition: chipinfo.h:142
Bit[3] set, indicates that proprietary protocols are supported.
Definition: chipinfo.h:79
This chip's HW revision is 2.1.
Definition: chipinfo.h:274
ProtocolBitVector_t ChipInfo_GetSupportedProtocol_BV(void)
Returns bit vector showing supported protocols.
Definition: chipinfo.c:56
void ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated(void)
Verifies that current chip is built for CC26xx HwRev 2.2 or later and never returns if violated...
Definition: chipinfo.c:161
__STATIC_INLINE bool ChipInfo_PackageTypeIs7x7(void)
Returns true if this is a 7x7mm chip.
Definition: chipinfo.h:195
__STATIC_INLINE bool ChipInfo_HwRevisionIs_2_0(void)
Returns true if HW revision for this chip is 2.0.
Definition: chipinfo.h:325
Bit[1] set, indicates that Bluetooth Low Energy is supported.
Definition: chipinfo.h:77
__STATIC_INLINE bool ChipInfo_HwRevisionIs_2_2(void)
Returns true if HW revision for this chip is 2.2.
Definition: chipinfo.h:353
__STATIC_INLINE bool ChipInfo_SupportsBLE(void)
Returns true if the chip supports the BLE protocol.
Definition: chipinfo.h:102
Chip HW revision is unknown.
Definition: chipinfo.h:271
HwRevision_t ChipInfo_GetHwRevision(void)
Returns chip HW revision.
Definition: chipinfo.c:111
__STATIC_INLINE bool ChipInfo_HwRevisionIs_GTEQ_2_0(void)
Returns true if HW revision for this chip is 2.0 or greater.
Definition: chipinfo.h:311
This chip's HW revision is 2.0.
Definition: chipinfo.h:273
This is a 5x5mm chip.
Definition: chipinfo.h:144
__STATIC_INLINE bool ChipInfo_SupportsIEEE_802_15_4(void)
Returns true if the chip supports the IEEE 802.15.4 protocol.
Definition: chipinfo.h:116
This chip's HW revision is 2.2.
Definition: chipinfo.h:275
ChipFamily_t
Chip family enumeration.
Definition: chipinfo.h:221
__STATIC_INLINE bool ChipInfo_PackageTypeIs5x5(void)
Returns true if this is a 5x5mm chip.
Definition: chipinfo.h:181
ProtocolBitVector_t
Enumeration identifying the protocols supported.
Definition: chipinfo.h:75
__STATIC_INLINE bool ChipInfo_ChipFamilyIsCC26xx(void)
Returns true if this chip is member of the CC26xx family.
Definition: chipinfo.h:246
ChipFamily_t ChipInfo_GetChipFamily(void)
Returns chip family member.
Definition: chipinfo.c:90
__STATIC_INLINE uint32_t ChipInfo_GetDeviceIdHwRevCode(void)
Returns the internal chip HW revision code.
Definition: chipinfo.h:209
__STATIC_INLINE bool ChipInfo_ChipFamilyIsCC13xx(void)
Returns true if this chip is member of the CC13xx family.
Definition: chipinfo.h:260
__STATIC_INLINE bool ChipInfo_HwRevisionIs_2_1(void)
Returns true if HW revision for this chip is 2.1.
Definition: chipinfo.h:339
This chip is a CC13xx family member.
Definition: chipinfo.h:224
Bit[2] set, indicates that IEEE 802.15.4 is supported.
Definition: chipinfo.h:78
This chip's HW revision is 1.0.
Definition: chipinfo.h:272
This is a 4x4mm chip.
Definition: chipinfo.h:143
This is a 7x7mm chip.
Definition: chipinfo.h:145
This chip is a CC26xx family member.
Definition: chipinfo.h:223