1 /******************************************************************************
2 * Filename: chipinfo.h
3 *
4 * Description: Collection of functions returning chip information.
5 *
6 * Copyright (c) 2015 - 2022, Texas Instruments Incorporated
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1) Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2) Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 ******************************************************************************/
36
37 //*****************************************************************************
38 //
39 //! \addtogroup system_control_group
40 //! @{
41 //! \addtogroup ChipInfo
42 //! @{
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 //
68 // Support for DriverLib in ROM:
69 // This section renames all functions that are not "static inline", so that
70 // calling these functions will default to implementation in flash. At the end
71 // of this file a second renaming will change the defaults to implementation in
72 // ROM for available functions.
73 //
74 // To force use of the implementation in flash, e.g. for debugging:
75 // - Globally: Define DRIVERLIB_NOROM at project level
76 // - Per function: Use prefix "NOROM_" when calling the function
77 //
78 //*****************************************************************************
79 #if !defined(DOXYGEN)
80 #define ChipInfo_GetSupportedProtocol_BV NOROM_ChipInfo_GetSupportedProtocol_BV
81 #define ChipInfo_GetPackageType NOROM_ChipInfo_GetPackageType
82 #define ChipInfo_GetChipType NOROM_ChipInfo_GetChipType
83 #define ChipInfo_GetChipFamily NOROM_ChipInfo_GetChipFamily
84 #define ChipInfo_GetHwRevision NOROM_ChipInfo_GetHwRevision
85 #define ThisLibraryIsFor_CC13x2x7_CC26x2x7_HaltIfViolated NOROM_ThisLibraryIsFor_CC13x2x7_CC26x2x7_HaltIfViolated
86 #endif
87
88
89 //*****************************************************************************
90 //
91 //! \brief Enumeration identifying the protocols supported.
92 //!
93 //! \note
94 //! This is a bit vector enumeration that indicates supported protocols.
95 //! E.g: 0x06 means that the chip supports both BLE and IEEE 802.15.4
96 //
97 //*****************************************************************************
98 typedef enum {
99 PROTOCOL_Unknown = 0 , //!< None of the known protocols are supported.
100 PROTOCOLBIT_BLE = 0x02, //!< Bit[1] set, indicates that Bluetooth Low Energy is supported.
101 PROTOCOLBIT_IEEE_802_15_4 = 0x04, //!< Bit[2] set, indicates that IEEE 802.15.4 is supported.
102 PROTOCOLBIT_Proprietary = 0x08 //!< Bit[3] set, indicates that proprietary protocols are supported.
103 } ProtocolBitVector_t;
104
105 //*****************************************************************************
106 //
107 //! \brief Returns bit vector showing supported protocols.
108 //!
109 //! \return
110 //! Returns \ref ProtocolBitVector_t which is a bit vector indicating supported protocols.
111 //
112 //*****************************************************************************
113 extern ProtocolBitVector_t ChipInfo_GetSupportedProtocol_BV( void );
114
115 //*****************************************************************************
116 //
117 //! \brief Returns true if the chip supports the BLE protocol.
118 //!
119 //! \return
120 //! Returns \c true if supporting the BLE protocol, \c false otherwise.
121 //
122 //*****************************************************************************
123 __STATIC_INLINE bool
ChipInfo_SupportsBLE(void)124 ChipInfo_SupportsBLE( void )
125 {
126 return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_BLE ) != 0 );
127 }
128
129 //*****************************************************************************
130 //
131 //! \brief Returns true if the chip supports the IEEE 802.15.4 protocol.
132 //!
133 //! \return
134 //! Returns \c true if supporting the IEEE 802.15.4 protocol, \c false otherwise.
135 //
136 //*****************************************************************************
137 __STATIC_INLINE bool
ChipInfo_SupportsIEEE_802_15_4(void)138 ChipInfo_SupportsIEEE_802_15_4( void )
139 {
140 return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_IEEE_802_15_4 ) != 0 );
141 }
142
143 //*****************************************************************************
144 //
145 //! \brief Returns true if the chip supports proprietary protocols.
146 //!
147 //! \return
148 //! Returns \c true if supporting proprietary protocols, \c false otherwise.
149 //
150 //*****************************************************************************
151 __STATIC_INLINE bool
ChipInfo_SupportsPROPRIETARY(void)152 ChipInfo_SupportsPROPRIETARY( void )
153 {
154 return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_Proprietary ) != 0 );
155 }
156
157 //*****************************************************************************
158 //
159 //! \brief Package type enumeration
160 //!
161 //! \note
162 //! Packages available for a specific device are shown in the device datasheet.
163 //
164 //*****************************************************************************
165 typedef enum {
166 PACKAGE_Unknown = -1, //!< -1 means that current package type is unknown.
167 PACKAGE_4x4 = 0, //!< 0 means that this is a 4x4 mm QFN (RHB) package.
168 PACKAGE_5x5 = 1, //!< 1 means that this is a 5x5 mm package.
169 PACKAGE_7x7 = 2, //!< 2 means that this is a 7x7 mm QFN (RGZ) package.
170 PACKAGE_WAFER = 3, //!< 3 means that this is a wafer sale package (naked die).
171 PACKAGE_WCSP = 4, //!< 4 means that this is a 2.7x2.7 mm WCSP (YFV).
172 PACKAGE_7x7_Q1 = 5, //!< 5 means that this is a 7x7 mm QFN package with Wettable Flanks.
173 PACKAGE_7x7_SIP = 6 //!< 6 means that this is a 7x7 mm SiP module (Sytem in Package).
174 } PackageType_t;
175
176 //*****************************************************************************
177 //
178 //! \brief Returns package type.
179 //!
180 //! \return
181 //! Returns \ref PackageType_t
182 //
183 //*****************************************************************************
184 extern PackageType_t ChipInfo_GetPackageType( void );
185
186 //*****************************************************************************
187 //
188 //! \brief Returns true if this is a 4x4mm chip.
189 //!
190 //! \return
191 //! Returns \c true if this is a 4x4mm chip, \c false otherwise.
192 //
193 //*****************************************************************************
194 __STATIC_INLINE bool
ChipInfo_PackageTypeIs4x4(void)195 ChipInfo_PackageTypeIs4x4( void )
196 {
197 return ( ChipInfo_GetPackageType() == PACKAGE_4x4 );
198 }
199
200 //*****************************************************************************
201 //
202 //! \brief Returns true if this is a 5x5mm chip.
203 //!
204 //! \return
205 //! Returns \c true if this is a 5x5mm chip, \c false otherwise.
206 //
207 //*****************************************************************************
208 __STATIC_INLINE bool
ChipInfo_PackageTypeIs5x5(void)209 ChipInfo_PackageTypeIs5x5( void )
210 {
211 return ( ChipInfo_GetPackageType() == PACKAGE_5x5 );
212 }
213
214 //*****************************************************************************
215 //
216 //! \brief Returns true if this is a 7x7mm chip.
217 //!
218 //! \return
219 //! Returns \c true if this is a 7x7mm chip, \c false otherwise.
220 //
221 //*****************************************************************************
222 __STATIC_INLINE bool
ChipInfo_PackageTypeIs7x7(void)223 ChipInfo_PackageTypeIs7x7( void )
224 {
225 return ( ChipInfo_GetPackageType() == PACKAGE_7x7 );
226 }
227
228 //*****************************************************************************
229 //
230 //! \brief Returns true if this is a wafer sale chip (naked die).
231 //!
232 //! \return
233 //! Returns \c true if this is a wafer sale chip, \c false otherwise.
234 //
235 //*****************************************************************************
236 __STATIC_INLINE bool
ChipInfo_PackageTypeIsWAFER(void)237 ChipInfo_PackageTypeIsWAFER( void )
238 {
239 return ( ChipInfo_GetPackageType() == PACKAGE_WAFER );
240 }
241
242 //*****************************************************************************
243 //
244 //! \brief Returns true if this is a WCSP chip (flip chip).
245 //!
246 //! \return
247 //! Returns \c true if this is a WCSP chip, \c false otherwise.
248 //
249 //*****************************************************************************
250 __STATIC_INLINE bool
ChipInfo_PackageTypeIsWCSP(void)251 ChipInfo_PackageTypeIsWCSP( void )
252 {
253 return ( ChipInfo_GetPackageType() == PACKAGE_WCSP );
254 }
255
256 //*****************************************************************************
257 //
258 //! \brief Returns true if this is a 7x7 Q1 chip.
259 //!
260 //! \return
261 //! Returns \c true if this is a 7x7 Q1 chip, \c false otherwise.
262 //
263 //*****************************************************************************
264 __STATIC_INLINE bool
ChipInfo_PackageTypeIs7x7Q1(void)265 ChipInfo_PackageTypeIs7x7Q1( void )
266 {
267 return ( ChipInfo_GetPackageType() == PACKAGE_7x7_Q1 );
268 }
269
270 //*****************************************************************************
271 //
272 //! \brief Returns the internal chip HW revision code.
273 //!
274 //! \return
275 //! Returns the internal chip HW revision code (in range 0-15)
276 //*****************************************************************************
277 __STATIC_INLINE uint32_t
ChipInfo_GetDeviceIdHwRevCode(void)278 ChipInfo_GetDeviceIdHwRevCode( void )
279 {
280 // Returns HwRevCode = FCFG1_O_ICEPICK_DEVICE_ID[31:28]
281 return ( HWREG( FCFG1_BASE + FCFG1_O_ICEPICK_DEVICE_ID ) >> 28 );
282 }
283
284 //*****************************************************************************
285 //
286 //! \brief Returns minor hardware revision number
287 //!
288 //! The minor revision number is set to 0 for the first market released chip
289 //! and thereafter incremented by 1 for each minor hardware change.
290 //!
291 //! \return
292 //! Returns the minor hardware revision number (in range 0-127)
293 //
294 //*****************************************************************************
295 __STATIC_INLINE uint32_t
ChipInfo_GetMinorHwRev(void)296 ChipInfo_GetMinorHwRev( void )
297 {
298 uint32_t minorRev = (( HWREG( FCFG1_BASE + FCFG1_O_MISC_CONF_1 ) &
299 FCFG1_MISC_CONF_1_DEVICE_MINOR_REV_M ) >>
300 FCFG1_MISC_CONF_1_DEVICE_MINOR_REV_S ) ;
301
302 if ( minorRev >= 0x80 ) {
303 minorRev = 0;
304 }
305
306 return( minorRev );
307 }
308
309 //*****************************************************************************
310 //
311 //! \brief Returns the 32 bits USER_ID field
312 //!
313 //! How to decode the USER_ID filed is described in the Technical Reference Manual (TRM)
314 //!
315 //! \return
316 //! Returns the 32 bits USER_ID field
317 //
318 //*****************************************************************************
319 __STATIC_INLINE uint32_t
ChipInfo_GetUserId(void)320 ChipInfo_GetUserId( void )
321 {
322 return ( HWREG( FCFG1_BASE + FCFG1_O_USER_ID ));
323 }
324
325 //*****************************************************************************
326 //
327 //! \brief Chip type enumeration
328 //
329 //*****************************************************************************
330 typedef enum {
331 CHIP_TYPE_Unknown = -1, //!< -1 means that the chip type is unknown.
332 CHIP_TYPE_CC1310 = 0, //!< 0 means that this is a CC1310 chip.
333 CHIP_TYPE_CC1350 = 1, //!< 1 means that this is a CC1350 chip.
334 CHIP_TYPE_CC2620 = 2, //!< 2 means that this is a CC2620 chip.
335 CHIP_TYPE_CC2630 = 3, //!< 3 means that this is a CC2630 chip.
336 CHIP_TYPE_CC2640 = 4, //!< 4 means that this is a CC2640 chip.
337 CHIP_TYPE_CC2650 = 5, //!< 5 means that this is a CC2650 chip.
338 CHIP_TYPE_CUSTOM_0 = 6, //!< 6 means that this is a CUSTOM_0 chip.
339 CHIP_TYPE_CUSTOM_1 = 7, //!< 7 means that this is a CUSTOM_1 chip.
340 CHIP_TYPE_CC2640R2 = 8, //!< 8 means that this is a CC2640R2 chip.
341 CHIP_TYPE_CC2642 = 9, //!< 9 means that this is a CC2642 chip.
342 CHIP_TYPE_unused0 = 10, //!< 10 unused value
343 CHIP_TYPE_CC2652 = 11, //!< 11 means that this is a CC2652 chip.
344 CHIP_TYPE_CC1312 = 12, //!< 12 means that this is a CC1312 chip.
345 CHIP_TYPE_CC1352 = 13, //!< 13 means that this is a CC1352 chip.
346 CHIP_TYPE_CC1352P = 14, //!< 14 means that this is a CC1352P chip.
347 CHIP_TYPE_CC2652P = 15, //!< 15 means that this is a CC2652P chip.
348 CHIP_TYPE_CC2652RB = 16, //!< 16 means that this is a CC2652RB chip.
349 CHIP_TYPE_CC2652PB = 17, //!< 17 means that this is a CC2652PB chip.
350 CHIP_TYPE_CC1311R3 = 18, //!< 18 means that this is a CC1311R3 chip.
351 CHIP_TYPE_CC1311P3 = 19, //!< 19 means that this is a CC1311P3 chip.
352 CHIP_TYPE_CC2651R3 = 20, //!< 20 means that this is a CC2651R3 chip.
353 CHIP_TYPE_CC2651P3 = 21, //!< 21 means that this is a CC2651P3 chip.
354 CHIP_TYPE_CC2641R3 = 22, //!< 22 means that this is a CC2641R3 chip.
355 CHIP_TYPE_CC1312R7 = 23, //!< 23 means that this is a CC1312R7 chip.
356 CHIP_TYPE_unused1 = 24, //!< 24 unused value
357 CHIP_TYPE_CC1352R7 = 25, //!< 25 means that this is a CC1352R7 chip.
358 CHIP_TYPE_CC1352P7 = 26, //!< 26 means that this is a CC1352P7 chip.
359 CHIP_TYPE_CC2652R7 = 27, //!< 27 means that this is a CC2652R7 chip.
360 CHIP_TYPE_CC2652P7 = 28, //!< 28 means that this is a CC2652P7 chip.
361 CHIP_TYPE_unused2 = 29, //!< 29 unused value
362 CHIP_TYPE_CC2672R3 = 37, //!< 37 means that this is a CC2672R3 chip.
363 CHIP_TYPE_CC2672P3 = 38, //!< 38 means that this is a CC2672P3 chip.
364 } ChipType_t;
365
366 //*****************************************************************************
367 //
368 //! \brief Returns chip type.
369 //!
370 //! \return
371 //! Returns \ref ChipType_t
372 //
373 //*****************************************************************************
374 extern ChipType_t ChipInfo_GetChipType( void );
375
376 //*****************************************************************************
377 //
378 //! \brief Chip family enumeration
379 //
380 //*****************************************************************************
381 typedef enum {
382 FAMILY_Unknown = -1, //!< -1 means that the chip's family member is unknown.
383 FAMILY_CC26x0 = 0, //!< 0 means that the chip is a CC26x0 family member.
384 FAMILY_CC13x0 = 1, //!< 1 means that the chip is a CC13x0 family member.
385 FAMILY_CC13x1_CC26x1 = 2, //!< 2 means that the chip is a CC13x1, CC26x1 family member.
386 FAMILY_CC26x0R2 = 3, //!< 3 means that the chip is a CC26x0R2 family (new ROM contents).
387 FAMILY_CC13x2_CC26x2 = 4, //!< 4 means that the chip is a CC13x2, CC26x2 family member.
388 FAMILY_CC13x2x7_CC26x2x7 = 5, //!< 5 means that the chip is a CC13x2x7, CC26x2x7 family member.
389 } ChipFamily_t;
390
391 //*****************************************************************************
392 //
393 //! \brief Returns chip family member.
394 //!
395 //! \return
396 //! Returns \ref ChipFamily_t
397 //
398 //*****************************************************************************
399 extern ChipFamily_t ChipInfo_GetChipFamily( void );
400
401 //*****************************************************************************
402 //
403 // Options for the define THIS_DRIVERLIB_BUILD
404 //
405 //*****************************************************************************
406 #define DRIVERLIB_BUILD_CC26X0 0 //!< 0 is the driverlib build ID for the cc26x0 driverlib.
407 #define DRIVERLIB_BUILD_CC13X0 1 //!< 1 is the driverlib build ID for the cc13x0 driverlib.
408 #define DRIVERLIB_BUILD_CC13X1_CC26X1 2 //!< 2 is the driverlib build ID for the cc13x1_cc26x1 driverlib.
409 #define DRIVERLIB_BUILD_CC26X0R2 3 //!< 3 is the driverlib build ID for the cc26x0r2 driverlib.
410 #define DRIVERLIB_BUILD_CC13X2_CC26X2 4 //!< 4 is the driverlib build ID for the cc13x2_cc26x2 driverlib.
411 #define DRIVERLIB_BUILD_CC13X2X7_CC26X2X7 5 //!< 5 is the driverlib build ID for the cc13x2x7_cc26x2x7 driverlib.
412
413 //*****************************************************************************
414 //
415 //! \brief Define THIS_DRIVERLIB_BUILD, identifying current driverlib build ID.
416 //!
417 //! This driverlib build identifier can be useful for compile time checking/optimization (supporting C preprocessor expressions).
418 //
419 //*****************************************************************************
420 #define THIS_DRIVERLIB_BUILD DRIVERLIB_BUILD_CC13X2X7_CC26X2X7
421
422 //*****************************************************************************
423 //
424 //! \brief Returns true if this chip is member of the CC13x0 family.
425 //!
426 //! \return
427 //! Returns \c true if this chip is member of the CC13x0 family, \c false otherwise.
428 //
429 //*****************************************************************************
430 __STATIC_INLINE bool
ChipInfo_ChipFamilyIs_CC13x0(void)431 ChipInfo_ChipFamilyIs_CC13x0( void )
432 {
433 return ( ChipInfo_GetChipFamily() == FAMILY_CC13x0 );
434 }
435
436 //*****************************************************************************
437 //
438 //! \brief Returns true if this chip is member of the CC26x0 family.
439 //!
440 //! \return
441 //! Returns \c true if this chip is member of the CC26x0 family, \c false otherwise.
442 //
443 //*****************************************************************************
444 __STATIC_INLINE bool
ChipInfo_ChipFamilyIs_CC26x0(void)445 ChipInfo_ChipFamilyIs_CC26x0( void )
446 {
447 return ( ChipInfo_GetChipFamily() == FAMILY_CC26x0 );
448 }
449
450 //*****************************************************************************
451 //
452 //! \brief Returns true if this chip is member of the CC26x0R2 family.
453 //!
454 //! \return
455 //! Returns \c true if this chip is member of the CC26x0R2 family, \c false otherwise.
456 //
457 //*****************************************************************************
458 __STATIC_INLINE bool
ChipInfo_ChipFamilyIs_CC26x0R2(void)459 ChipInfo_ChipFamilyIs_CC26x0R2( void )
460 {
461 return ( ChipInfo_GetChipFamily() == FAMILY_CC26x0R2 );
462 }
463
464 //*****************************************************************************
465 //
466 //! \brief Returns true if this chip is member of the CC13x1, CC26x1 family.
467 //!
468 //! \return
469 //! Returns \c true if this chip is member of the CC13x1, CC26x1 family, \c false otherwise.
470 //
471 //*****************************************************************************
472 __STATIC_INLINE bool
ChipInfo_ChipFamilyIs_CC13x1_CC26x1(void)473 ChipInfo_ChipFamilyIs_CC13x1_CC26x1( void )
474 {
475 return ( ChipInfo_GetChipFamily() == FAMILY_CC13x1_CC26x1 );
476 }
477
478 //*****************************************************************************
479 //
480 //! \brief Returns true if this chip is member of the CC13x2, CC26x2 family.
481 //!
482 //! \return
483 //! Returns \c true if this chip is member of the CC13x2, CC26x2 family, \c false otherwise.
484 //
485 //*****************************************************************************
486 __STATIC_INLINE bool
ChipInfo_ChipFamilyIs_CC13x2_CC26x2(void)487 ChipInfo_ChipFamilyIs_CC13x2_CC26x2( void )
488 {
489 return ( ChipInfo_GetChipFamily() == FAMILY_CC13x2_CC26x2 );
490 }
491
492 //*****************************************************************************
493 //
494 //! \brief Returns true if this chip is member of the CC13x2x7, CC26x2x7 family.
495 //!
496 //! \return
497 //! Returns \c true if this chip is member of the CC13x2x7, CC26x2x7 family, \c false otherwise.
498 //
499 //*****************************************************************************
500 __STATIC_INLINE bool
ChipInfo_ChipFamilyIs_CC13x2x7_CC26x2x7(void)501 ChipInfo_ChipFamilyIs_CC13x2x7_CC26x2x7( void )
502 {
503 return ( ChipInfo_GetChipFamily() == FAMILY_CC13x2x7_CC26x2x7 );
504 }
505
506 //*****************************************************************************
507 //
508 //! \brief HW revision enumeration.
509 //
510 //*****************************************************************************
511 typedef enum {
512 HWREV_Unknown = -1, //!< -1 means that the chip's HW revision is unknown.
513 HWREV_1_0 = 10, //!< 10 means that the chip's HW revision is 1.0
514 HWREV_1_1 = 11, //!< 11 means that the chip's HW revision is 1.1
515 HWREV_2_0 = 20, //!< 20 means that the chip's HW revision is 2.0
516 HWREV_2_1 = 21, //!< 21 means that the chip's HW revision is 2.1
517 HWREV_2_2 = 22, //!< 22 means that the chip's HW revision is 2.2
518 HWREV_2_3 = 23, //!< 23 means that the chip's HW revision is 2.3
519 HWREV_2_4 = 24, //!< 24 means that the chip's HW revision is 2.4
520 HWREV_3_0 = 30 //!< 30 means that the chip's HW revision is 3.0
521 } HwRevision_t;
522
523 //*****************************************************************************
524 //
525 //! \brief Returns chip HW revision.
526 //!
527 //! \return
528 //! Returns \ref HwRevision_t
529 //
530 //*****************************************************************************
531 extern HwRevision_t ChipInfo_GetHwRevision( void );
532
533 //*****************************************************************************
534 //
535 //! \brief Returns true if HW revision for this chip is 1.0.
536 //!
537 //! \return
538 //! Returns \c true if HW revision for this chip is 1.0, \c false otherwise.
539 //
540 //*****************************************************************************
541 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_1_0(void)542 ChipInfo_HwRevisionIs_1_0( void )
543 {
544 return ( ChipInfo_GetHwRevision() == HWREV_1_0 );
545 }
546
547 //*****************************************************************************
548 //
549 //! \brief Returns true if HW revision for this chip is 2.0.
550 //!
551 //! \return
552 //! Returns \c true if HW revision for this chip is 2.0, \c false otherwise.
553 //
554 //*****************************************************************************
555 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_2_0(void)556 ChipInfo_HwRevisionIs_2_0( void )
557 {
558 return ( ChipInfo_GetHwRevision() == HWREV_2_0 );
559 }
560
561 //*****************************************************************************
562 //
563 //! \brief Returns true if HW revision for this chip is 2.0 or greater.
564 //!
565 //! \return
566 //! Returns \c true if HW revision for this chip is 2.0 or greater, \c false otherwise.
567 //
568 //*****************************************************************************
569 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_GTEQ_2_0(void)570 ChipInfo_HwRevisionIs_GTEQ_2_0( void )
571 {
572 return ( ChipInfo_GetHwRevision() >= HWREV_2_0 );
573 }
574
575 //*****************************************************************************
576 //
577 //! \brief Returns true if HW revision for this chip is 2.1.
578 //!
579 //! \return
580 //! Returns \c true if HW revision for this chip is 2.1, \c false otherwise.
581 //
582 //*****************************************************************************
583 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_2_1(void)584 ChipInfo_HwRevisionIs_2_1( void )
585 {
586 return ( ChipInfo_GetHwRevision() == HWREV_2_1 );
587 }
588
589 //*****************************************************************************
590 //
591 //! \brief Returns true if HW revision for this chip is 2.1 or greater.
592 //!
593 //! \return
594 //! Returns \c true if HW revision for this chip is 2.1 or greater, \c false otherwise.
595 //
596 //*****************************************************************************
597 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_GTEQ_2_1(void)598 ChipInfo_HwRevisionIs_GTEQ_2_1( void )
599 {
600 return ( ChipInfo_GetHwRevision() >= HWREV_2_1 );
601 }
602
603 //*****************************************************************************
604 //
605 //! \brief Returns true if HW revision for this chip is 2.2.
606 //!
607 //! \return
608 //! Returns \c true if HW revision for this chip is 2.2, \c false otherwise.
609 //
610 //*****************************************************************************
611 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_2_2(void)612 ChipInfo_HwRevisionIs_2_2( void )
613 {
614 return ( ChipInfo_GetHwRevision() == HWREV_2_2 );
615 }
616
617 //*****************************************************************************
618 //
619 //! \brief Returns true if HW revision for this chip is 2.2 or greater.
620 //!
621 //! \return
622 //! Returns \c true if HW revision for this chip is 2.2 or greater, \c false otherwise.
623 //
624 //*****************************************************************************
625 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_GTEQ_2_2(void)626 ChipInfo_HwRevisionIs_GTEQ_2_2( void )
627 {
628 return ( ChipInfo_GetHwRevision() >= HWREV_2_2 );
629 }
630
631 //*****************************************************************************
632 //
633 //! \brief Returns true if HW revision for this chip is 2.3 or greater.
634 //!
635 //! \return
636 //! Returns \c true if HW revision for this chip is 2.3 or greater, \c false otherwise.
637 //
638 //*****************************************************************************
639 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_GTEQ_2_3(void)640 ChipInfo_HwRevisionIs_GTEQ_2_3( void )
641 {
642 return ( ChipInfo_GetHwRevision() >= HWREV_2_3 );
643 }
644
645 //*****************************************************************************
646 //
647 //! \brief Returns true if HW revision for this chip is 2.4 or greater.
648 //!
649 //! \return
650 //! Returns \c true if HW revision for this chip is 2.4 or greater, \c false otherwise.
651 //
652 //*****************************************************************************
653 __STATIC_INLINE bool
ChipInfo_HwRevisionIs_GTEQ_2_4(void)654 ChipInfo_HwRevisionIs_GTEQ_2_4( void )
655 {
656 return ( ChipInfo_GetHwRevision() >= HWREV_2_4 );
657 }
658
659 //*****************************************************************************
660 //
661 //! \brief Verifies that current chip is CC13x2x7 or CC26x2x7 and never returns if violated.
662 //!
663 //! \return None
664 //
665 //*****************************************************************************
666 extern void ThisLibraryIsFor_CC13x2x7_CC26x2x7_HaltIfViolated( void );
667
668 //*****************************************************************************
669 //
670 // Support for DriverLib in ROM:
671 // Redirect to implementation in ROM when available.
672 //
673 //*****************************************************************************
674 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
675 #include "../driverlib/rom.h"
676 #ifdef ROM_ChipInfo_GetSupportedProtocol_BV
677 #undef ChipInfo_GetSupportedProtocol_BV
678 #define ChipInfo_GetSupportedProtocol_BV ROM_ChipInfo_GetSupportedProtocol_BV
679 #endif
680 #ifdef ROM_ChipInfo_GetPackageType
681 #undef ChipInfo_GetPackageType
682 #define ChipInfo_GetPackageType ROM_ChipInfo_GetPackageType
683 #endif
684 #ifdef ROM_ChipInfo_GetChipType
685 #undef ChipInfo_GetChipType
686 #define ChipInfo_GetChipType ROM_ChipInfo_GetChipType
687 #endif
688 #ifdef ROM_ChipInfo_GetChipFamily
689 #undef ChipInfo_GetChipFamily
690 #define ChipInfo_GetChipFamily ROM_ChipInfo_GetChipFamily
691 #endif
692 #ifdef ROM_ChipInfo_GetHwRevision
693 #undef ChipInfo_GetHwRevision
694 #define ChipInfo_GetHwRevision ROM_ChipInfo_GetHwRevision
695 #endif
696 #ifdef ROM_ThisLibraryIsFor_CC13x2x7_CC26x2x7_HaltIfViolated
697 #undef ThisLibraryIsFor_CC13x2x7_CC26x2x7_HaltIfViolated
698 #define ThisLibraryIsFor_CC13x2x7_CC26x2x7_HaltIfViolated ROM_ThisLibraryIsFor_CC13x2x7_CC26x2x7_HaltIfViolated
699 #endif
700 #endif
701
702 //*****************************************************************************
703 //
704 // Mark the end of the C bindings section for C++ compilers.
705 //
706 //*****************************************************************************
707 #ifdef __cplusplus
708 }
709 #endif
710
711 #endif // __CHIP_INFO_H__
712
713 //*****************************************************************************
714 //
715 //! Close the Doxygen group.
716 //! @}
717 //! @}
718 //
719 //*****************************************************************************
720