MSPM0G1X0X_G3X0X Driver Library  1.10.01.05
dl_factoryregion.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!****************************************************************************
33  * @file dl_factoryregion.h
34  * @brief Factory Region Driver Library
35  * @defgroup FACTORYREGION Factory Region (FACTORYREGION)
36  *
37  * @anchor ti_dl_dl_factoryregion_Overview
38  * # Overview
39  *
40  * <hr>
41  ******************************************************************************
42  */
46 #ifndef ti_dl_dl_factoryregion__include
47 #define ti_dl_dl_factoryregion__include
48 
49 #include <stdbool.h>
50 #include <stdint.h>
51 
52 #include <ti/devices/msp/msp.h>
53 #include <ti/driverlib/dl_common.h>
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 /* clang-format off */
60 
61 /* clang-format on */
62 
68 __STATIC_INLINE uint16_t DL_FactoryRegion_getMAINFlashSize(void)
69 {
70  return (
71  FACTORYREGION->SRAMFLASH & FACTORYREGION_SRAMFLASH_MAINFLASH_SZ_MASK);
72 }
73 
79 __STATIC_INLINE uint16_t DL_FactoryRegion_getSRAMFlashSize(void)
80 {
81  return (
82  (FACTORYREGION->SRAMFLASH & FACTORYREGION_SRAMFLASH_SRAM_SZ_MASK) >>
83  FACTORYREGION_SRAMFLASH_SRAM_SZ_OFS);
84 }
85 
91 __STATIC_INLINE uint8_t DL_FactoryRegion_getDATAFlashSize(void)
92 {
93  return ((FACTORYREGION->SRAMFLASH &
94  FACTORYREGION_SRAMFLASH_DATAFLASH_SZ_MASK) >>
95  FACTORYREGION_SRAMFLASH_DATAFLASH_SZ_OFS);
96 }
97 
103 __STATIC_INLINE uint8_t DL_FactoryRegion_getNumBanks(void)
104 {
105  return (((FACTORYREGION->SRAMFLASH &
106  FACTORYREGION_SRAMFLASH_MAINNUMBANKS_MASK) >>
107  FACTORYREGION_SRAMFLASH_MAINNUMBANKS_OFS) +
108  (uint8_t) 1);
109 }
110 
116 __STATIC_INLINE uint32_t DL_FactoryRegion_getTraceID(void)
117 {
118  return (FACTORYREGION->TRACEID & FACTORYREGION_TRACEID_DATA_MASK);
119 }
120 
126 __STATIC_INLINE uint16_t DL_FactoryRegion_getManufacturerCode(void)
127 {
128  return (
129  (FACTORYREGION->DEVICEID & FACTORYREGION_DEVICEID_MANUFACTURER_MASK) >>
130  FACTORYREGION_DEVICEID_MANUFACTURER_OFS);
131 }
132 
138 __STATIC_INLINE uint16_t DL_FactoryRegion_getPartNumber(void)
139 {
140  return ((FACTORYREGION->DEVICEID & FACTORYREGION_DEVICEID_PARTNUM_MASK) >>
141  FACTORYREGION_DEVICEID_PARTNUM_OFS);
142 }
143 
149 __STATIC_INLINE uint8_t DL_FactoryRegion_getVersion(void)
150 {
151  return ((FACTORYREGION->DEVICEID & FACTORYREGION_DEVICEID_VERSION_MASK) >>
152  FACTORYREGION_DEVICEID_VERSION_OFS);
153 }
154 
160 __STATIC_INLINE uint16_t DL_FactoryRegion_getUserIDPart(void)
161 {
162  return ((FACTORYREGION->USERID & FACTORYREGION_USERID_PART_MASK) >>
163  FACTORYREGION_USERID_PART_OFS);
164 }
165 
171 __STATIC_INLINE uint8_t DL_FactoryRegion_getUserIDVariant(void)
172 {
173  return ((FACTORYREGION->USERID & FACTORYREGION_USERID_VARIANT_MASK) >>
174  FACTORYREGION_USERID_VARIANT_OFS);
175 }
176 
187 __STATIC_INLINE uint8_t DL_FactoryRegion_getUserIDMinorRev(void)
188 {
189  return ((FACTORYREGION->USERID & FACTORYREGION_USERID_MINORREV_MASK) >>
190  FACTORYREGION_USERID_MINORREV_OFS);
191 }
192 
202 __STATIC_INLINE uint8_t DL_FactoryRegion_getUserIDMajorRev(void)
203 {
204  return ((FACTORYREGION->USERID & FACTORYREGION_USERID_MAJORREV_MASK) >>
205  FACTORYREGION_USERID_MAJORREV_OFS);
206 }
207 
213 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinUARTRXDPad(void)
214 {
215  return ((FACTORYREGION->BSLPIN_UART &
216  FACTORYREGION_BSLPIN_UART_UART_RXD_PAD_MASK) >>
217  FACTORYREGION_BSLPIN_UART_UART_RXD_PAD_OFS);
218 }
219 
225 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinUARTRXDFunction(void)
226 {
227  return ((FACTORYREGION->BSLPIN_UART &
228  FACTORYREGION_BSLPIN_UART_UART_RXD_PF_MASK) >>
229  FACTORYREGION_BSLPIN_UART_UART_RXD_PF_OFS);
230 }
231 
237 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinUARTTXDPad(void)
238 {
239  return ((FACTORYREGION->BSLPIN_UART &
240  FACTORYREGION_BSLPIN_UART_UART_TXD_PAD_MASK) >>
241  FACTORYREGION_BSLPIN_UART_UART_TXD_PAD_OFS);
242 }
243 
249 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinUARTTXDFunction(void)
250 {
251  return ((FACTORYREGION->BSLPIN_UART &
252  FACTORYREGION_BSLPIN_UART_UART_TXD_PF_MASK) >>
253  FACTORYREGION_BSLPIN_UART_UART_TXD_PF_OFS);
254 }
255 
261 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinI2CSDAPad(void)
262 {
263  return ((FACTORYREGION->BSLPIN_I2C &
264  FACTORYREGION_BSLPIN_I2C_I2C_SDA_PAD_MASK) >>
265  FACTORYREGION_BSLPIN_I2C_I2C_SDA_PAD_OFS);
266 }
267 
273 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinI2CSDAFunction(void)
274 {
275  return ((FACTORYREGION->BSLPIN_I2C &
276  FACTORYREGION_BSLPIN_I2C_I2C_SDA_PF_MASK) >>
277  FACTORYREGION_BSLPIN_I2C_I2C_SDA_PF_OFS);
278 }
279 
285 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinI2CSCLPad(void)
286 {
287  return ((FACTORYREGION->BSLPIN_I2C &
288  FACTORYREGION_BSLPIN_I2C_I2C_SCL_PAD_MASK) >>
289  FACTORYREGION_BSLPIN_I2C_I2C_SCL_PAD_OFS);
290 }
291 
297 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinI2CSCLFunction(void)
298 {
299  return ((FACTORYREGION->BSLPIN_I2C &
300  FACTORYREGION_BSLPIN_I2C_I2C_SCL_PF_MASK) >>
301  FACTORYREGION_BSLPIN_I2C_I2C_SCL_PF_OFS);
302 }
303 
309 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinInvokeGPIOLevel(void)
310 {
311  return ((FACTORYREGION->BSLPIN_INVOKE &
312  FACTORYREGION_BSLPIN_INVOKE_GPIO_LEVEL_MASK) >>
313  FACTORYREGION_BSLPIN_INVOKE_GPIO_LEVEL_OFS);
314 }
315 
321 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinInvokeGPIOPin(void)
322 {
323  return ((FACTORYREGION->BSLPIN_INVOKE &
324  FACTORYREGION_BSLPIN_INVOKE_GPIO_PIN_SEL_MASK) >>
325  FACTORYREGION_BSLPIN_INVOKE_GPIO_PIN_SEL_OFS);
326 }
327 
333 __STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinInvokeGPIOPModule(void)
334 {
335  return ((FACTORYREGION->BSLPIN_INVOKE &
336  FACTORYREGION_BSLPIN_INVOKE_GPIO_REG_SEL_MASK) >>
337  FACTORYREGION_BSLPIN_INVOKE_GPIO_REG_SEL_OFS);
338 }
339 
346 {
347  return ((FACTORYREGION->BSLPIN_INVOKE &
348  FACTORYREGION_BSLPIN_INVOKE_BSL_PAD_MASK) >>
349  FACTORYREGION_BSLPIN_INVOKE_BSL_PAD_OFS);
350 }
351 
357 __STATIC_INLINE uint32_t DL_FactoryRegion_getTemperatureVoltage(void)
358 {
359  return (
360  (FACTORYREGION->TEMP_SENSE0 & FACTORYREGION_TEMP_SENSE0_DATA_MASK) >>
361  FACTORYREGION_TEMP_SENSE0_DATA_OFS);
362 }
363 
371 __STATIC_INLINE uint32_t DL_FactoryRegion_getBOOTCRCData(void)
372 {
373  return ((FACTORYREGION->BOOTCRC & FACTORYREGION_BOOTCRC_DATA_MASK) >>
374  FACTORYREGION_BOOTCRC_DATA_OFS);
375 }
376 
377 #ifdef __cplusplus
378 }
379 #endif
380 
381 #endif /* ti_dl_dl_factoryregion__include */
382 
__STATIC_INLINE uint8_t DL_FactoryRegion_getUserIDMajorRev(void)
Get the value that preserves compatibility with lesser majorrev values.
Definition: dl_factoryregion.h:202
__STATIC_INLINE uint8_t DL_FactoryRegion_getUserIDVariant(void)
Get the bit pattern identifying a variant of a part.
Definition: dl_factoryregion.h:171
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinUARTTXDFunction(void)
Get the UART TXD Pin function selection value used by BSL.
Definition: dl_factoryregion.h:249
__STATIC_INLINE uint16_t DL_FactoryRegion_getManufacturerCode(void)
Get JEDEC bank and company code.
Definition: dl_factoryregion.h:126
DriverLib Common APIs.
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinI2CSDAPad(void)
Get the I2C SDA Pin used by BSL.
Definition: dl_factoryregion.h:261
__STATIC_INLINE uint8_t DL_FactoryRegion_getNumBanks(void)
Get the number of Flash banks on the device.
Definition: dl_factoryregion.h:103
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinUARTRXDFunction(void)
Get the UART RXD Pin function selection value used by BSL.
Definition: dl_factoryregion.h:225
__STATIC_INLINE uint8_t DL_FactoryRegion_getUserIDMinorRev(void)
Get the value that preserves compatibility with lesser minorrev values.
Definition: dl_factoryregion.h:187
__STATIC_INLINE uint16_t DL_FactoryRegion_getMAINFlashSize(void)
Get the size of the MAIN Flash region.
Definition: dl_factoryregion.h:68
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinI2CSCLFunction(void)
Get the I2C SCL Pin function selection value used by BSL.
Definition: dl_factoryregion.h:297
__STATIC_INLINE uint16_t DL_FactoryRegion_getPartNumber(void)
Get the part number of the device.
Definition: dl_factoryregion.h:138
__STATIC_INLINE uint32_t DL_FactoryRegion_getBOOTCRCData(void)
Get the BOOTCRC value.
Definition: dl_factoryregion.h:371
__STATIC_INLINE uint16_t DL_FactoryRegion_getUserIDPart(void)
Get the bit pattern identifying the part.
Definition: dl_factoryregion.h:160
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinInvokeGPIOPModule(void)
Get the GPIO module selection used by BSL pin invocation.
Definition: dl_factoryregion.h:333
__STATIC_INLINE uint8_t DL_FactoryRegion_getDATAFlashSize(void)
Get the size of the DATA Flash region.
Definition: dl_factoryregion.h:91
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinI2CSCLPad(void)
Get the I2C SCL Pin used by BSL.
Definition: dl_factoryregion.h:285
__STATIC_INLINE uint32_t DL_FactoryRegion_getTemperatureVoltage(void)
Get the ADC conversion results of temperature sensor output voltage.
Definition: dl_factoryregion.h:357
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinInvokeGPIOLevel(void)
Get the GPIO level used by BSL pin invocation.
Definition: dl_factoryregion.h:309
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinI2CSDAFunction(void)
Get the I2C SDA Pin function selection value used by BSL.
Definition: dl_factoryregion.h:273
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinInvokeGPIOPModulePad(void)
Get the BSL invocation pin number.
Definition: dl_factoryregion.h:345
__STATIC_INLINE uint32_t DL_FactoryRegion_getTraceID(void)
Get the trace ID of the device.
Definition: dl_factoryregion.h:116
__STATIC_INLINE uint16_t DL_FactoryRegion_getSRAMFlashSize(void)
Get the size of the SRAM Flash region.
Definition: dl_factoryregion.h:79
__STATIC_INLINE uint8_t DL_FactoryRegion_getVersion(void)
Get the version of the device.
Definition: dl_factoryregion.h:149
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinInvokeGPIOPin(void)
Get the GPIO Pin selection value used by BSL pin invocation.
Definition: dl_factoryregion.h:321
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinUARTRXDPad(void)
Get the UART RXD PIN used by BSL.
Definition: dl_factoryregion.h:213
__STATIC_INLINE uint8_t DL_FactoryRegion_getBSLPinUARTTXDPad(void)
Get the UART TXD PIN used by BSL.
Definition: dl_factoryregion.h:237
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale