CC26xx Driver Library |

- Main Page
- Related Pages
- CC26xx APIs
- Register Descriptions
- Online Resources

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 {
76 PROTOCOL_Unknown = 0 ,
77 PROTOCOLBIT_BLE = 0x02,
78 PROTOCOLBIT_IEEE_802_15_4 = 0x04,
79 PROTOCOLBIT_Proprietary = 0x08
80 } ProtocolBitVector_t;
81
82 //*****************************************************************************
83 //
88 //
89 //*****************************************************************************
90 extern ProtocolBitVector_t ChipInfo_GetSupportedProtocol_BV( void );
91
92
93 //*****************************************************************************
94 //
99 //
100 //*****************************************************************************
101 __STATIC_INLINE bool
102 ChipInfo_SupportsBLE( void )
103 {
104 return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_BLE ) != 0 );
105 }
106
107 //*****************************************************************************
108 //
113 //
114 //*****************************************************************************
115 __STATIC_INLINE bool
116 ChipInfo_SupportsIEEE_802_15_4( void )
117 {
118 return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_IEEE_802_15_4 ) != 0 );
119 }
120
121 //*****************************************************************************
122 //
127 //
128 //*****************************************************************************
129 __STATIC_INLINE bool
130 ChipInfo_SupportsPROPRIETARY( void )
131 {
132 return (( ChipInfo_GetSupportedProtocol_BV() & PROTOCOLBIT_Proprietary ) != 0 );
133 }
134
135
136 //*****************************************************************************
137 //
139 //
140 //*****************************************************************************
141 typedef enum {
142 PACKAGE_Unknown = -1,
143 PACKAGE_4x4 = 0,
144 PACKAGE_5x5 = 1,
145 PACKAGE_7x7 = 2
146 } PackageType_t;
147
148 //*****************************************************************************
149 //
154 //
155 //*****************************************************************************
156 extern PackageType_t ChipInfo_GetPackageType( void );
157
158 //*****************************************************************************
159 //
164 //
165 //*****************************************************************************
166 __STATIC_INLINE bool
167 ChipInfo_PackageTypeIs4x4( void )
168 {
169 return ( ChipInfo_GetPackageType() == PACKAGE_4x4 );
170 }
171
172 //*****************************************************************************
173 //
178 //
179 //*****************************************************************************
180 __STATIC_INLINE bool
181 ChipInfo_PackageTypeIs5x5( void )
182 {
183 return ( ChipInfo_GetPackageType() == PACKAGE_5x5 );
184 }
185
186 //*****************************************************************************
187 //
192 //
193 //*****************************************************************************
194 __STATIC_INLINE bool
195 ChipInfo_PackageTypeIs7x7( void )
196 {
197 return ( ChipInfo_GetPackageType() == PACKAGE_7x7 );
198 }
199
200
201 //*****************************************************************************
202 //
207 //*****************************************************************************
208 __STATIC_INLINE uint32_t
209 ChipInfo_GetDeviceIdHwRevCode( void )
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 {
222 FAMILY_Unknown = -1,
223 FAMILY_CC26xx = 0,
224 FAMILY_CC13xx = 1
225 } ChipFamily_t;
226
227 //*****************************************************************************
228 //
233 //
234 //*****************************************************************************
235 extern ChipFamily_t ChipInfo_GetChipFamily( void );
236
237 //*****************************************************************************
238 //
243 //
244 //*****************************************************************************
245 __STATIC_INLINE bool
246 ChipInfo_ChipFamilyIsCC26xx( void )
247 {
248 return ( ChipInfo_GetChipFamily() == FAMILY_CC26xx );
249 }
250
251 //*****************************************************************************
252 //
257 //
258 //*****************************************************************************
259 __STATIC_INLINE bool
260 ChipInfo_ChipFamilyIsCC13xx( void )
261 {
262 return ( ChipInfo_GetChipFamily() == FAMILY_CC13xx );
263 }
264
265 //*****************************************************************************
266 //
268 //
269 //*****************************************************************************
270 typedef enum {
271 HWREV_Unknown = -1,
272 HWREV_1_0 = 0,
273 HWREV_2_0 = 1,
274 HWREV_2_1 = 2,
275 HWREV_2_2 = 3
276 } HwRevision_t;
277
278 //*****************************************************************************
279 //
284 //
285 //*****************************************************************************
286 extern HwRevision_t ChipInfo_GetHwRevision( void );
287
288 //*****************************************************************************
289 //
294 //
295 //*****************************************************************************
296 __STATIC_INLINE bool
297 ChipInfo_HwRevisionIs_1_0( void )
298 {
299 return ( ChipInfo_GetHwRevision() == HWREV_1_0 );
300 }
301
302 //*****************************************************************************
303 //
308 //
309 //*****************************************************************************
310 __STATIC_INLINE bool
311 ChipInfo_HwRevisionIs_GTEQ_2_0( void )
312 {
313 return ( ChipInfo_GetHwRevision() >= HWREV_2_0 );
314 }
315
316 //*****************************************************************************
317 //
322 //
323 //*****************************************************************************
324 __STATIC_INLINE bool
325 ChipInfo_HwRevisionIs_2_0( void )
326 {
327 return ( ChipInfo_GetHwRevision() == HWREV_2_0 );
328 }
329
330 //*****************************************************************************
331 //
336 //
337 //*****************************************************************************
338 __STATIC_INLINE bool
339 ChipInfo_HwRevisionIs_2_1( void )
340 {
341 return ( ChipInfo_GetHwRevision() == HWREV_2_1 );
342 }
343
344 //*****************************************************************************
345 //
350 //
351 //*****************************************************************************
352 __STATIC_INLINE bool
353 ChipInfo_HwRevisionIs_2_2( void )
354 {
355 return ( ChipInfo_GetHwRevision() == HWREV_2_2 );
356 }
357
358 //*****************************************************************************
359 //
364 //
365 //*****************************************************************************
366 __STATIC_INLINE bool
367 ChipInfo_HwRevisionIs_GTEQ_2_2( void )
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 //*****************************************************************************
391 extern void ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated( void );
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 //*****************************************************************************
ChipInfo_HwRevisionIs_1_0
__STATIC_INLINE bool ChipInfo_HwRevisionIs_1_0(void)
Returns true if HW revision for this chip is 1.0.
Definition: chipinfo.h:297
ChipInfo_GetPackageType
PackageType_t ChipInfo_GetPackageType(void)
Returns package type.
Definition: chipinfo.c:67
PROTOCOL_Unknown
None of the known protocols are supported.
Definition: chipinfo.h:76
HwRevision_t
HwRevision_t
HW revision enumeration.
Definition: chipinfo.h:270
ChipInfo_HwRevisionIs_GTEQ_2_2
__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
PackageType_t
Package type enumeration.
Definition: chipinfo.h:141
ChipInfo_SupportsPROPRIETARY
__STATIC_INLINE bool ChipInfo_SupportsPROPRIETARY(void)
Returns true if the chip supports propriatary protocols.
Definition: chipinfo.h:130
ChipInfo_PackageTypeIs4x4
__STATIC_INLINE bool ChipInfo_PackageTypeIs4x4(void)
Returns true if this is a 4x4mm chip.
Definition: chipinfo.h:167
FAMILY_Unknown
Chip family member is unknown.
Definition: chipinfo.h:222
PACKAGE_Unknown
Current chip type is unknown.
Definition: chipinfo.h:142
PROTOCOLBIT_Proprietary
Bit[3] set, indicates that proprietary protocols are supported.
Definition: chipinfo.h:79
HWREV_2_1
This chip's HW revision is 2.1.
Definition: chipinfo.h:274
ChipInfo_GetSupportedProtocol_BV
ProtocolBitVector_t ChipInfo_GetSupportedProtocol_BV(void)
Returns bit vector showing supported protocols.
Definition: chipinfo.c:56
ThisCodeIsBuiltForCC26xxHwRev22AndLater_HaltIfViolated
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
ChipInfo_PackageTypeIs7x7
__STATIC_INLINE bool ChipInfo_PackageTypeIs7x7(void)
Returns true if this is a 7x7mm chip.
Definition: chipinfo.h:195
ChipInfo_HwRevisionIs_2_0
__STATIC_INLINE bool ChipInfo_HwRevisionIs_2_0(void)
Returns true if HW revision for this chip is 2.0.
Definition: chipinfo.h:325
PROTOCOLBIT_BLE
Bit[1] set, indicates that Bluetooth Low Energy is supported.
Definition: chipinfo.h:77
ChipInfo_HwRevisionIs_2_2
__STATIC_INLINE bool ChipInfo_HwRevisionIs_2_2(void)
Returns true if HW revision for this chip is 2.2.
Definition: chipinfo.h:353
ChipInfo_SupportsBLE
__STATIC_INLINE bool ChipInfo_SupportsBLE(void)
Returns true if the chip supports the BLE protocol.
Definition: chipinfo.h:102
HWREV_Unknown
Chip HW revision is unknown.
Definition: chipinfo.h:271
ChipInfo_GetHwRevision
HwRevision_t ChipInfo_GetHwRevision(void)
Returns chip HW revision.
Definition: chipinfo.c:111
ChipInfo_HwRevisionIs_GTEQ_2_0
__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
HWREV_2_0
This chip's HW revision is 2.0.
Definition: chipinfo.h:273
PACKAGE_5x5
This is a 5x5mm chip.
Definition: chipinfo.h:144
ChipInfo_SupportsIEEE_802_15_4
__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
HWREV_2_2
This chip's HW revision is 2.2.
Definition: chipinfo.h:275
ChipFamily_t
ChipFamily_t
Chip family enumeration.
Definition: chipinfo.h:221
ChipInfo_PackageTypeIs5x5
__STATIC_INLINE bool ChipInfo_PackageTypeIs5x5(void)
Returns true if this is a 5x5mm chip.
Definition: chipinfo.h:181
ProtocolBitVector_t
ProtocolBitVector_t
Enumeration identifying the protocols supported.
Definition: chipinfo.h:75
ChipInfo_ChipFamilyIsCC26xx
__STATIC_INLINE bool ChipInfo_ChipFamilyIsCC26xx(void)
Returns true if this chip is member of the CC26xx family.
Definition: chipinfo.h:246
ChipInfo_GetChipFamily
ChipFamily_t ChipInfo_GetChipFamily(void)
Returns chip family member.
Definition: chipinfo.c:90
ChipInfo_GetDeviceIdHwRevCode
__STATIC_INLINE uint32_t ChipInfo_GetDeviceIdHwRevCode(void)
Returns the internal chip HW revision code.
Definition: chipinfo.h:209
ChipInfo_ChipFamilyIsCC13xx
__STATIC_INLINE bool ChipInfo_ChipFamilyIsCC13xx(void)
Returns true if this chip is member of the CC13xx family.
Definition: chipinfo.h:260
ChipInfo_HwRevisionIs_2_1
__STATIC_INLINE bool ChipInfo_HwRevisionIs_2_1(void)
Returns true if HW revision for this chip is 2.1.
Definition: chipinfo.h:339
FAMILY_CC13xx
This chip is a CC13xx family member.
Definition: chipinfo.h:224
PROTOCOLBIT_IEEE_802_15_4
Bit[2] set, indicates that IEEE 802.15.4 is supported.
Definition: chipinfo.h:78
HWREV_1_0
This chip's HW revision is 1.0.
Definition: chipinfo.h:272
PACKAGE_4x4
This is a 4x4mm chip.
Definition: chipinfo.h:143
PACKAGE_7x7
This is a 7x7mm chip.
Definition: chipinfo.h:145
FAMILY_CC26xx
This chip is a CC26xx family member.
Definition: chipinfo.h:223