CC26xx Driver Library
chipinfo.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: chipinfo.h
3 * Revised: 2016-07-07 17:52:37 +0200 (Thu, 07 Jul 2016)
4 * Revision: 46847
5 *
6 * Description: Collection of functions returning chip information.
7 *
8 * Copyright (c) 2015 - 2016, 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 //
45 //
46 //*****************************************************************************
47 
48 #ifndef __CHIP_INFO_H__
49 #define __CHIP_INFO_H__
50 
51 //*****************************************************************************
52 //
53 // If building with a C++ compiler, make all of the definitions in this header
54 // have a C binding.
55 //
56 //*****************************************************************************
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61 
62 #include <stdint.h>
63 #include <stdbool.h>
64 #include <inc/hw_types.h>
65 #include <inc/hw_memmap.h>
66 #include <inc/hw_fcfg1.h>
67 
68 //*****************************************************************************
69 //
70 // Support for DriverLib in ROM:
71 // This section renames all functions that are not "static inline", so that
72 // calling these functions will default to implementation in flash. At the end
73 // of this file a second renaming will change the defaults to implementation in
74 // ROM for available functions.
75 //
76 // To force use of the implementation in flash, e.g. for debugging:
77 // - Globally: Define DRIVERLIB_NOROM at project level
78 // - Per function: Use prefix "NOROM_" when calling the function
79 //
80 //*****************************************************************************
81 #if !defined(DOXYGEN)
82  #define ChipInfo_GetSupportedProtocol_BV NOROM_ChipInfo_GetSupportedProtocol_BV
83  #define ChipInfo_GetPackageType NOROM_ChipInfo_GetPackageType
84  #define ChipInfo_GetChipType NOROM_ChipInfo_GetChipType
85  #define ChipInfo_GetChipFamily NOROM_ChipInfo_GetChipFamily
86  #define ChipInfo_GetHwRevision NOROM_ChipInfo_GetHwRevision
87  #define ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated NOROM_ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated
88 #endif
89 
90 //*****************************************************************************
91 //
97 //
98 //*****************************************************************************
99 typedef enum {
105 
106 //*****************************************************************************
107 //
112 //
113 //*****************************************************************************
115 
116 
117 //*****************************************************************************
118 //
123 //
124 //*****************************************************************************
125 __STATIC_INLINE bool
127 {
128  return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_BLE ) != 0 );
129 }
130 
131 //*****************************************************************************
132 //
137 //
138 //*****************************************************************************
139 __STATIC_INLINE bool
141 {
143 }
144 
145 //*****************************************************************************
146 //
151 //
152 //*****************************************************************************
153 __STATIC_INLINE bool
155 {
157 }
158 
159 
160 //*****************************************************************************
161 //
163 //
164 //*****************************************************************************
165 typedef enum {
172 } PackageType_t;
173 
174 //*****************************************************************************
175 //
180 //
181 //*****************************************************************************
183 
184 //*****************************************************************************
185 //
190 //
191 //*****************************************************************************
192 __STATIC_INLINE bool
194 {
195  return ( ChipInfo_GetPackageType() == PACKAGE_4x4 );
196 }
197 
198 //*****************************************************************************
199 //
204 //
205 //*****************************************************************************
206 __STATIC_INLINE bool
208 {
209  return ( ChipInfo_GetPackageType() == PACKAGE_5x5 );
210 }
211 
212 //*****************************************************************************
213 //
218 //
219 //*****************************************************************************
220 __STATIC_INLINE bool
222 {
223  return ( ChipInfo_GetPackageType() == PACKAGE_7x7 );
224 }
225 
226 //*****************************************************************************
227 //
232 //
233 //*****************************************************************************
234 __STATIC_INLINE bool
236 {
237  return ( ChipInfo_GetPackageType() == PACKAGE_WAFER );
238 }
239 
240 //*****************************************************************************
241 //
246 //
247 //*****************************************************************************
248 __STATIC_INLINE bool
250 {
251  return ( ChipInfo_GetPackageType() == PACKAGE_WCSP );
252 }
253 
254 
255 //*****************************************************************************
256 //
261 //*****************************************************************************
262 __STATIC_INLINE uint32_t
264 {
265  // Returns HwRevCode = FCFG1_O_ICEPICK_DEVICE_ID[31:28]
266  return ( HWREG( FCFG1_BASE + FCFG1_O_ICEPICK_DEVICE_ID ) >> 28 );
267 }
268 
269 //*****************************************************************************
270 //
278 //
279 //*****************************************************************************
280 __STATIC_INLINE uint32_t
282 {
283  uint32_t minorRev = (( HWREG( FCFG1_BASE + FCFG1_O_MISC_CONF_1 ) &
286 
287  if ( minorRev >= 0x80 ) {
288  minorRev = 0;
289  }
290 
291  return( minorRev );
292 }
293 
294 
295 //*****************************************************************************
296 //
303 //
304 //*****************************************************************************
305 __STATIC_INLINE uint32_t
307 {
308  return ( HWREG( FCFG1_BASE + FCFG1_O_USER_ID ));
309 }
310 
311 
312 //*****************************************************************************
313 //
315 //
316 //*****************************************************************************
317 typedef enum {
327 } ChipType_t;
328 
329 //*****************************************************************************
330 //
335 //
336 //*****************************************************************************
337 extern ChipType_t ChipInfo_GetChipType( void );
338 
339 
340 //*****************************************************************************
341 //
343 //
344 //*****************************************************************************
345 typedef enum {
352 } ChipFamily_t;
353 
354 //*****************************************************************************
355 //
360 //
361 //*****************************************************************************
362 extern ChipFamily_t ChipInfo_GetChipFamily( void );
363 
364 //*****************************************************************************
365 //
370 //
371 //*****************************************************************************
372 __STATIC_INLINE bool
374 {
375  return ( ChipInfo_GetChipFamily() == FAMILY_CC26xx );
376 }
377 
378 //*****************************************************************************
379 //
384 //
385 //*****************************************************************************
386 __STATIC_INLINE bool
388 {
389  return ( ChipInfo_GetChipFamily() == FAMILY_CC13xx );
390 }
391 
392 //*****************************************************************************
393 //
398 //
399 //*****************************************************************************
400 __STATIC_INLINE bool
402 {
404 }
405 
406 //*****************************************************************************
407 //
412 //
413 //*****************************************************************************
414 __STATIC_INLINE bool
416 {
418 }
419 
420 //*****************************************************************************
421 //
426 //
427 //*****************************************************************************
428 __STATIC_INLINE bool
430 {
432 }
433 
434 
435 //*****************************************************************************
436 //
438 //
439 //*****************************************************************************
440 typedef enum {
442  HWREV_1_0 = 10,
443  HWREV_2_0 = 20,
444  HWREV_2_1 = 21,
445  HWREV_2_2 = 22,
446  HWREV_2_3 = 23
447 } HwRevision_t;
448 
449 //*****************************************************************************
450 //
455 //
456 //*****************************************************************************
457 extern HwRevision_t ChipInfo_GetHwRevision( void );
458 
459 //*****************************************************************************
460 //
465 //
466 //*****************************************************************************
467 __STATIC_INLINE bool
469 {
470  return ( ChipInfo_GetHwRevision() == HWREV_1_0 );
471 }
472 
473 //*****************************************************************************
474 //
479 //
480 //*****************************************************************************
481 __STATIC_INLINE bool
483 {
484  return ( ChipInfo_GetHwRevision() == HWREV_2_0 );
485 }
486 
487 //*****************************************************************************
488 //
493 //
494 //*****************************************************************************
495 __STATIC_INLINE bool
497 {
498  return ( ChipInfo_GetHwRevision() >= HWREV_2_0 );
499 }
500 
501 //*****************************************************************************
502 //
507 //
508 //*****************************************************************************
509 __STATIC_INLINE bool
511 {
512  return ( ChipInfo_GetHwRevision() == HWREV_2_1 );
513 }
514 
515 //*****************************************************************************
516 //
521 //
522 //*****************************************************************************
523 __STATIC_INLINE bool
525 {
526  return ( ChipInfo_GetHwRevision() >= HWREV_2_1 );
527 }
528 
529 //*****************************************************************************
530 //
535 //
536 //*****************************************************************************
537 __STATIC_INLINE bool
539 {
540  return ( ChipInfo_GetHwRevision() == HWREV_2_2 );
541 }
542 
543 //*****************************************************************************
544 //
549 //
550 //*****************************************************************************
551 __STATIC_INLINE bool
553 {
554  return ( ChipInfo_GetHwRevision() >= HWREV_2_2 );
555 }
556 
557 //*****************************************************************************
558 //
563 //
564 //*****************************************************************************
565 __STATIC_INLINE bool
567 {
568  return ( ChipInfo_GetHwRevision() >= HWREV_2_3 );
569 }
570 
571 
572 //*****************************************************************************
573 //
577 //
578 //*****************************************************************************
580 
581 //*****************************************************************************
582 //
583 // Support for DriverLib in ROM:
584 // Redirect to implementation in ROM when available.
585 //
586 //*****************************************************************************
587 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
588  #include <driverlib/rom.h>
589  #ifdef ROM_ChipInfo_GetSupportedProtocol_BV
590  #undef ChipInfo_GetSupportedProtocol_BV
591  #define ChipInfo_GetSupportedProtocol_BV ROM_ChipInfo_GetSupportedProtocol_BV
592  #endif
593  #ifdef ROM_ChipInfo_GetPackageType
594  #undef ChipInfo_GetPackageType
595  #define ChipInfo_GetPackageType ROM_ChipInfo_GetPackageType
596  #endif
597  #ifdef ROM_ChipInfo_GetChipType
598  #undef ChipInfo_GetChipType
599  #define ChipInfo_GetChipType ROM_ChipInfo_GetChipType
600  #endif
601  #ifdef ROM_ChipInfo_GetChipFamily
602  #undef ChipInfo_GetChipFamily
603  #define ChipInfo_GetChipFamily ROM_ChipInfo_GetChipFamily
604  #endif
605  #ifdef ROM_ChipInfo_GetHwRevision
606  #undef ChipInfo_GetHwRevision
607  #define ChipInfo_GetHwRevision ROM_ChipInfo_GetHwRevision
608  #endif
609  #ifdef ROM_ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated
610  #undef ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated
611  #define ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated ROM_ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated
612  #endif
613 #endif
614 
615 //*****************************************************************************
616 //
617 // Mark the end of the C bindings section for C++ compilers.
618 //
619 //*****************************************************************************
620 #ifdef __cplusplus
621 }
622 #endif
623 
624 #endif // __CHIP_INFO_H__
625 
626 //*****************************************************************************
627 //
631 //
632 //*****************************************************************************
PackageType_t ChipInfo_GetPackageType(void)
Returns package type.
Definition: chipinfo.c:80
static bool ChipInfo_PackageTypeIs5x5(void)
Returns true if this is a 5x5mm chip.
Definition: chipinfo.h:207
static bool ChipInfo_HwRevisionIs_GTEQ_2_2(void)
Returns true if HW revision for this chip is 2.2 or greater.
Definition: chipinfo.h:552
0 means that this is a CC1310 chip.
Definition: chipinfo.h:319
None of the known protocols are supported.
Definition: chipinfo.h:100
static bool ChipInfo_PackageTypeIsWCSP(void)
Returns true if this is a WCSP chip (flip chip).
Definition: chipinfo.h:249
HwRevision_t
HW revision enumeration.
Definition: chipinfo.h:440
PackageType_t
Package type enumeration.
Definition: chipinfo.h:165
static bool ChipInfo_HwRevisionIs_2_0(void)
Returns true if HW revision for this chip is 2.0.
Definition: chipinfo.h:482
23 means that the chip's HW revision is 2.3
Definition: chipinfo.h:446
static bool ChipInfo_SupportsBLE(void)
Returns true if the chip supports the BLE protocol.
Definition: chipinfo.h:126
static bool ChipInfo_HwRevisionIs_GTEQ_2_0(void)
Returns true if HW revision for this chip is 2.0 or greater.
Definition: chipinfo.h:496
-1 means that the chip's family member is unknown.
Definition: chipinfo.h:346
static bool ChipInfo_ChipFamilyIsCC26xx_Liz(void)
Returns true if this chip is member of the CC26xx_Liz family.
Definition: chipinfo.h:415
-1 means that current chip type is unknown.
Definition: chipinfo.h:166
static bool ChipInfo_HwRevisionIs_GTEQ_2_3(void)
Returns true if HW revision for this chip is 2.3 or greater.
Definition: chipinfo.h:566
4 means that this is a WCSP chip (flip chip).
Definition: chipinfo.h:171
Bit[3] set, indicates that proprietary protocols are supported.
Definition: chipinfo.h:103
21 means that the chip's HW revision is 2.1
Definition: chipinfo.h:444
ProtocolBitVector_t ChipInfo_GetSupportedProtocol_BV(void)
Returns bit vector showing supported protocols.
Definition: chipinfo.c:68
static uint32_t ChipInfo_GetUserId(void)
Returns the 32 bits USER_ID field.
Definition: chipinfo.h:306
static bool ChipInfo_PackageTypeIsWAFER(void)
Returns true if this is a wafer sale chip (naked die).
Definition: chipinfo.h:235
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:237
static bool ChipInfo_ChipFamilyIsCC26xx_Aga(void)
Returns true if this chip is member of the CC26xx_Aga family.
Definition: chipinfo.h:429
static bool ChipInfo_HwRevisionIs_1_0(void)
Returns true if HW revision for this chip is 1.0.
Definition: chipinfo.h:468
5 means that this is a CC2650 chip.
Definition: chipinfo.h:324
static bool ChipInfo_SupportsPROPRIETARY(void)
Returns true if the chip supports propriatary protocols.
Definition: chipinfo.h:154
Bit[1] set, indicates that Bluetooth Low Energy is supported.
Definition: chipinfo.h:101
-1 means that the chip type is unknown.
Definition: chipinfo.h:318
7 means that this is a CUSTOM_1 chip.
Definition: chipinfo.h:326
3 means that this is a CC2630 chip.
Definition: chipinfo.h:322
1 means that this is a CC1350 chip.
Definition: chipinfo.h:320
6 means that this is a CUSTOM_0 chip.
Definition: chipinfo.h:325
-1 means that the chip's HW revision is unknown.
Definition: chipinfo.h:441
static bool ChipInfo_SupportsIEEE_802_15_4(void)
Returns true if the chip supports the IEEE 802.15.4 protocol.
Definition: chipinfo.h:140
3 means that this is a wafer sale chip (naked die).
Definition: chipinfo.h:170
HwRevision_t ChipInfo_GetHwRevision(void)
Returns chip HW revision.
Definition: chipinfo.c:179
static bool ChipInfo_PackageTypeIs7x7(void)
Returns true if this is a 7x7mm chip.
Definition: chipinfo.h:221
static bool ChipInfo_ChipFamilyIsCC13xx(void)
Returns true if this chip is member of the CC13xx family.
Definition: chipinfo.h:387
20 means that the chip's HW revision is 2.0
Definition: chipinfo.h:443
1 means that this is a 5x5mm chip.
Definition: chipinfo.h:168
static bool ChipInfo_HwRevisionIs_2_2(void)
Returns true if HW revision for this chip is 2.2.
Definition: chipinfo.h:538
static bool ChipInfo_ChipFamilyIsCC26xx_R2(void)
Returns true if this chip is member of the CC26xx_R2 family.
Definition: chipinfo.h:401
4 means that this is a CC2640 chip.
Definition: chipinfo.h:323
22 means that the chip's HW revision is 2.2
Definition: chipinfo.h:445
ChipType_t
Chip type enumeration.
Definition: chipinfo.h:317
ChipFamily_t
Chip family enumeration.
Definition: chipinfo.h:345
static bool ChipInfo_ChipFamilyIsCC26xx(void)
Returns true if this chip is member of the CC26xx family.
Definition: chipinfo.h:373
static bool ChipInfo_PackageTypeIs4x4(void)
Returns true if this is a 4x4mm chip.
Definition: chipinfo.h:193
ProtocolBitVector_t
Enumeration identifying the protocols supported.
Definition: chipinfo.h:99
ChipFamily_t ChipInfo_GetChipFamily(void)
Returns chip family member.
Definition: chipinfo.c:102
static bool ChipInfo_HwRevisionIs_2_1(void)
Returns true if HW revision for this chip is 2.1.
Definition: chipinfo.h:510
1 means that the chip is a CC13x0 family member.
Definition: chipinfo.h:348
static uint32_t ChipInfo_GetDeviceIdHwRevCode(void)
Returns the internal chip HW revision code.
Definition: chipinfo.h:263
ChipType_t ChipInfo_GetChipType(void)
Returns chip type.
Definition: chipinfo.c:131
Bit[2] set, indicates that IEEE 802.15.4 is supported.
Definition: chipinfo.h:102
2 means that the chip is a CC26x1 family member.
Definition: chipinfo.h:349
static bool ChipInfo_HwRevisionIs_GTEQ_2_1(void)
Returns true if HW revision for this chip is 2.1 or greater.
Definition: chipinfo.h:524
10 means that the chip's HW revision is 1.0
Definition: chipinfo.h:442
2 means that this is a CC2620 chip.
Definition: chipinfo.h:321
0 means that this is a 4x4mm chip.
Definition: chipinfo.h:167
2 means that this is a 7x7mm chip.
Definition: chipinfo.h:169
static uint32_t ChipInfo_GetMinorHwRev(void)
Returns minor hardware revision number.
Definition: chipinfo.h:281
3 means that the chip is a CCxxx2/xxx4 family member.
Definition: chipinfo.h:350
4 means that the chip is a CC26x0_R2 family (new ROM contents).
Definition: chipinfo.h:351
0 means that the chip is a CC26x0 family member.
Definition: chipinfo.h:347