CC13xx Driver Library
chipinfo.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: chipinfo.h
3 * Revised: 2015-12-09 13:11:01 +0100 (Wed, 09 Dec 2015)
4 * Revision: 45286
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 //
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 //
75 //
76 //*****************************************************************************
77 typedef enum {
79  PROTOCOLBIT_BLE = 0x02,
83 
84 //*****************************************************************************
85 //
90 //
91 //*****************************************************************************
93 
94 
95 //*****************************************************************************
96 //
101 //
102 //*****************************************************************************
103 __STATIC_INLINE bool
105 {
106  return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_BLE ) != 0 );
107 }
108 
109 //*****************************************************************************
110 //
115 //
116 //*****************************************************************************
117 __STATIC_INLINE bool
119 {
121 }
122 
123 //*****************************************************************************
124 //
129 //
130 //*****************************************************************************
131 __STATIC_INLINE bool
133 {
135 }
136 
137 
138 //*****************************************************************************
139 //
141 //
142 //*****************************************************************************
143 typedef enum {
150 } PackageType_t;
151 
152 //*****************************************************************************
153 //
158 //
159 //*****************************************************************************
161 
162 //*****************************************************************************
163 //
168 //
169 //*****************************************************************************
170 __STATIC_INLINE bool
172 {
173  return ( ChipInfo_GetPackageType() == PACKAGE_4x4 );
174 }
175 
176 //*****************************************************************************
177 //
182 //
183 //*****************************************************************************
184 __STATIC_INLINE bool
186 {
187  return ( ChipInfo_GetPackageType() == PACKAGE_5x5 );
188 }
189 
190 //*****************************************************************************
191 //
196 //
197 //*****************************************************************************
198 __STATIC_INLINE bool
200 {
201  return ( ChipInfo_GetPackageType() == PACKAGE_7x7 );
202 }
203 
204 //*****************************************************************************
205 //
210 //
211 //*****************************************************************************
212 __STATIC_INLINE bool
214 {
215  return ( ChipInfo_GetPackageType() == PACKAGE_WAFER );
216 }
217 
218 //*****************************************************************************
219 //
224 //
225 //*****************************************************************************
226 __STATIC_INLINE bool
228 {
229  return ( ChipInfo_GetPackageType() == PACKAGE_WCSP );
230 }
231 
232 
233 //*****************************************************************************
234 //
239 //*****************************************************************************
240 __STATIC_INLINE uint32_t
242 {
243  // Returns HwRevCode = FCFG1_O_ICEPICK_DEVICE_ID[31:28]
244  return ( HWREG( FCFG1_BASE + FCFG1_O_ICEPICK_DEVICE_ID ) >> 28 );
245 }
246 
247 //*****************************************************************************
248 //
256 //
257 //*****************************************************************************
258 __STATIC_INLINE uint32_t
260 {
261  uint32_t minorRev = (( HWREG( FCFG1_BASE + FCFG1_O_MISC_CONF_1 ) &
264 
265  if ( minorRev >= 0x80 ) {
266  minorRev = 0;
267  }
268 
269  return( minorRev );
270 }
271 
272 
273 //*****************************************************************************
274 //
276 //
277 //*****************************************************************************
278 typedef enum {
285 } ChipFamily_t;
286 
287 //*****************************************************************************
288 //
293 //
294 //*****************************************************************************
295 extern ChipFamily_t ChipInfo_GetChipFamily( void );
296 
297 //*****************************************************************************
298 //
303 //
304 //*****************************************************************************
305 __STATIC_INLINE bool
307 {
308  return ( ChipInfo_GetChipFamily() == FAMILY_CC26xx );
309 }
310 
311 //*****************************************************************************
312 //
317 //
318 //*****************************************************************************
319 __STATIC_INLINE bool
321 {
322  return ( ChipInfo_GetChipFamily() == FAMILY_CC13xx );
323 }
324 
325 //*****************************************************************************
326 //
331 //
332 //*****************************************************************************
333 __STATIC_INLINE bool
335 {
336  return ( ChipInfo_GetChipFamily() == FAMILY_CC26xxR2 );
337 }
338 
339 //*****************************************************************************
340 //
345 //
346 //*****************************************************************************
347 __STATIC_INLINE bool
349 {
351 }
352 
353 //*****************************************************************************
354 //
359 //
360 //*****************************************************************************
361 __STATIC_INLINE bool
363 {
365 }
366 
367 //*****************************************************************************
368 //
370 //
371 //*****************************************************************************
372 typedef enum {
374  HWREV_1_0 = 10,
375  HWREV_2_0 = 20,
376  HWREV_2_1 = 21,
377  HWREV_2_2 = 22,
378  HWREV_2_3 = 23
379 } HwRevision_t;
380 
381 //*****************************************************************************
382 //
387 //
388 //*****************************************************************************
389 extern HwRevision_t ChipInfo_GetHwRevision( void );
390 
391 //*****************************************************************************
392 //
397 //
398 //*****************************************************************************
399 __STATIC_INLINE bool
401 {
402  return ( ChipInfo_GetHwRevision() == HWREV_1_0 );
403 }
404 
405 //*****************************************************************************
406 //
411 //
412 //*****************************************************************************
413 __STATIC_INLINE bool
415 {
416  return ( ChipInfo_GetHwRevision() >= HWREV_2_0 );
417 }
418 
419 //*****************************************************************************
420 //
425 //
426 //*****************************************************************************
427 __STATIC_INLINE bool
429 {
430  return ( ChipInfo_GetHwRevision() == HWREV_2_0 );
431 }
432 
433 //*****************************************************************************
434 //
439 //
440 //*****************************************************************************
441 __STATIC_INLINE bool
443 {
444  return ( ChipInfo_GetHwRevision() == HWREV_2_1 );
445 }
446 
447 //*****************************************************************************
448 //
453 //
454 //*****************************************************************************
455 __STATIC_INLINE bool
457 {
458  return ( ChipInfo_GetHwRevision() == HWREV_2_2 );
459 }
460 
461 //*****************************************************************************
462 //
467 //
468 //*****************************************************************************
469 __STATIC_INLINE bool
471 {
472  return ( ChipInfo_GetHwRevision() >= HWREV_2_2 );
473 }
474 
475 //*****************************************************************************
476 //
481 //
482 //*****************************************************************************
483 __STATIC_INLINE bool
485 {
486  return ( ChipInfo_GetHwRevision() >= HWREV_2_3 );
487 }
488 
489 
490 //*****************************************************************************
491 //
495 //
496 //*****************************************************************************
498 
499 //*****************************************************************************
500 //
501 // Mark the end of the C bindings section for C++ compilers.
502 //
503 //*****************************************************************************
504 #ifdef __cplusplus
505 }
506 #endif
507 
508 #endif // __CHIP_INFO_H__
509 
510 //*****************************************************************************
511 //
515 //
516 //*****************************************************************************
PackageType_t ChipInfo_GetPackageType(void)
Returns package type.
Definition: chipinfo.c:59
static bool ChipInfo_PackageTypeIs5x5(void)
Returns true if this is a 5x5mm chip.
Definition: chipinfo.h:185
static bool ChipInfo_HwRevisionIs_GTEQ_2_2(void)
Returns true if HW revision for this chip is 2.2 or greater.
Definition: chipinfo.h:470
None of the known protocols are supported.
Definition: chipinfo.h:78
static bool ChipInfo_PackageTypeIsWCSP(void)
Returns true if this is a WCSP chip (flip chip).
Definition: chipinfo.h:227
3 means that the chip is a CC26xxAgama family member.
Definition: chipinfo.h:283
HwRevision_t
HW revision enumeration.
Definition: chipinfo.h:372
static bool ChipInfo_ChipFamilyIsCC26xxLizard(void)
Returns true if this chip is member of the CC26xxLizard family.
Definition: chipinfo.h:348
PackageType_t
Package type enumeration.
Definition: chipinfo.h:143
static bool ChipInfo_HwRevisionIs_2_0(void)
Returns true if HW revision for this chip is 2.0.
Definition: chipinfo.h:428
23 means that the chip's HW revision is 2.3
Definition: chipinfo.h:378
static bool ChipInfo_SupportsBLE(void)
Returns true if the chip supports the BLE protocol.
Definition: chipinfo.h:104
static bool ChipInfo_HwRevisionIs_GTEQ_2_0(void)
Returns true if HW revision for this chip is 2.0 or greater.
Definition: chipinfo.h:414
-1 means that the chip's family member is unknown.
Definition: chipinfo.h:279
-1 means that current chip type is unknown.
Definition: chipinfo.h:144
static bool ChipInfo_HwRevisionIs_GTEQ_2_3(void)
Returns true if HW revision for this chip is 2.3 or greater.
Definition: chipinfo.h:484
4 means that this is a WCSP chip (flip chip).
Definition: chipinfo.h:149
Bit[3] set, indicates that proprietary protocols are supported.
Definition: chipinfo.h:81
21 means that the chip's HW revision is 2.1
Definition: chipinfo.h:376
ProtocolBitVector_t ChipInfo_GetSupportedProtocol_BV(void)
Returns bit vector showing supported protocols.
Definition: chipinfo.c:47
void ThisCodeIsBuiltForCC13xxHwRev20AndLater_HaltIfViolated(void)
Verifies that curent chip is built for CC13xx HwRev 2.0 or later and never returns if violated...
Definition: chipinfo.c:169
static bool ChipInfo_PackageTypeIsWAFER(void)
Returns true if this is a wafer sale chip (naked die).
Definition: chipinfo.h:213
static bool ChipInfo_HwRevisionIs_1_0(void)
Returns true if HW revision for this chip is 1.0.
Definition: chipinfo.h:400
static bool ChipInfo_SupportsPROPRIETARY(void)
Returns true if the chip supports propriatary protocols.
Definition: chipinfo.h:132
static bool ChipInfo_ChipFamilyIsCC26xxR2(void)
Returns true if this chip is member of the CC26xxR2 family.
Definition: chipinfo.h:334
Bit[1] set, indicates that Bluetooth Low Energy is supported.
Definition: chipinfo.h:79
4 means that the chip is a CC26xxR2 family (new ROM contents).
Definition: chipinfo.h:284
static bool ChipInfo_ChipFamilyIsCC26xxAgama(void)
Returns true if this chip is member of the CC26xxAgama family.
Definition: chipinfo.h:362
-1 means that the chip's HW revision is unknown.
Definition: chipinfo.h:373
static bool ChipInfo_SupportsIEEE_802_15_4(void)
Returns true if the chip supports the IEEE 802.15.4 protocol.
Definition: chipinfo.h:118
3 means that this is a wafer sale chip (naked die).
Definition: chipinfo.h:148
HwRevision_t ChipInfo_GetHwRevision(void)
Returns chip HW revision.
Definition: chipinfo.c:111
static bool ChipInfo_PackageTypeIs7x7(void)
Returns true if this is a 7x7mm chip.
Definition: chipinfo.h:199
static bool ChipInfo_ChipFamilyIsCC13xx(void)
Returns true if this chip is member of the CC13xx family.
Definition: chipinfo.h:320
20 means that the chip's HW revision is 2.0
Definition: chipinfo.h:375
1 means that this is a 5x5mm chip.
Definition: chipinfo.h:146
static bool ChipInfo_HwRevisionIs_2_2(void)
Returns true if HW revision for this chip is 2.2.
Definition: chipinfo.h:456
22 means that the chip's HW revision is 2.2
Definition: chipinfo.h:377
ChipFamily_t
Chip family enumeration.
Definition: chipinfo.h:278
static bool ChipInfo_ChipFamilyIsCC26xx(void)
Returns true if this chip is member of the CC26xx family.
Definition: chipinfo.h:306
static bool ChipInfo_PackageTypeIs4x4(void)
Returns true if this is a 4x4mm chip.
Definition: chipinfo.h:171
ProtocolBitVector_t
Enumeration identifying the protocols supported.
Definition: chipinfo.h:77
ChipFamily_t ChipInfo_GetChipFamily(void)
Returns chip family member.
Definition: chipinfo.c:82
static bool ChipInfo_HwRevisionIs_2_1(void)
Returns true if HW revision for this chip is 2.1.
Definition: chipinfo.h:442
1 means that the chip is a CC13xx family member.
Definition: chipinfo.h:281
2 means that the chip is a CC26xxLizard family member.
Definition: chipinfo.h:282
static uint32_t ChipInfo_GetDeviceIdHwRevCode(void)
Returns the internal chip HW revision code.
Definition: chipinfo.h:241
Bit[2] set, indicates that IEEE 802.15.4 is supported.
Definition: chipinfo.h:80
10 means that the chip's HW revision is 1.0
Definition: chipinfo.h:374
0 means that this is a 4x4mm chip.
Definition: chipinfo.h:145
2 means that this is a 7x7mm chip.
Definition: chipinfo.h:147
static uint32_t ChipInfo_GetMinorHwRev(void)
Returns minor hardware revision number.
Definition: chipinfo.h:259
0 means that the chip is a CC26xx family member.
Definition: chipinfo.h:280