MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.21.00.08
 All Data Structures Functions Variables Modules Pages
tlv.h
1 //*****************************************************************************
2 //
3 // tlv.h - Driver for the TLV Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_TLV_H__
8 #define __MSP430WARE_TLV_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_TLV__
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include "inc/hw_memmap.h"
26 //******************************************************************************
27 //
28 // TLV Data Types
29 //
30 //******************************************************************************
32  uint32_t wafer_id;
33  uint16_t die_x_position;
34  uint16_t die_y_position;
35  uint16_t test_results;
36 };
37 
39  uint16_t adc_gain_factor;
40  int16_t adc_offset;
41  uint16_t adc_ref15_30_temp;
42  uint16_t adc_ref15_85_temp;
43  uint16_t adc_ref20_30_temp;
44  uint16_t adc_ref20_85_temp;
45  uint16_t adc_ref25_30_temp;
46  uint16_t adc_ref25_85_temp;
47 };
48 
50  uint16_t TDH0CTL1_64;
51  uint16_t TDH0CTL1_128;
52  uint16_t TDH0CTL1_200;
53  uint16_t TDH0CTL1_256;
54 };
55 
57  uint16_t ref_ref15;
58  uint16_t ref_ref20;
59  uint16_t ref_ref25;
60 };
61 
63  uint16_t memory_1;
64  uint16_t memory_2;
65  uint16_t memory_3;
66  uint16_t memory_4;
67 };
68 
69 //*****************************************************************************
70 //
71 // The following are values that can be passed to the tag parameter for
72 // functions: TLV_getInfo().
73 //
74 //*****************************************************************************
75 #define TLV_TAG_LDTAG TLV_LDTAG
76 #define TLV_TAG_PDTAG TLV_PDTAG
77 #define TLV_TAG_Reserved3 TLV_Reserved3
78 #define TLV_TAG_Reserved4 TLV_Reserved4
79 #define TLV_TAG_BLANK TLV_BLANK
80 #define TLV_TAG_Reserved6 TLV_Reserved6
81 #define TLV_TAG_Reserved7 TLV_Reserved7
82 #define TLV_TAG_TAGEND TLV_TAGEND
83 #define TLV_TAG_TAGEXT TLV_TAGEXT
84 #define TLV_TAG_TIMER_D_CAL TLV_TIMERDCAL
85 #define TLV_DEVICE_ID_0 0x1A04
86 #define TLV_DEVICE_ID_1 0x1A05
87 #define TLV_TAG_DIERECORD TLV_DIERECORD
88 #define TLV_TAG_ADCCAL TLV_ADCCAL
89 #define TLV_TAG_ADC12CAL TLV_ADC12CAL
90 #define TLV_TAG_ADC10CAL TLV_ADC10CAL
91 #define TLV_TAG_REFCAL TLV_REFCAL
92 #define TLV_TAG_CTSD16CAL 0x1D
93 
94 //*****************************************************************************
95 //
96 // The following are values that can be passed to the tag parameter for
97 // functions: TLV_getPeripheral().
98 //
99 //*****************************************************************************
100 #define TLV_PID_NO_MODULE (0x00)
101 #define TLV_PID_PORTMAPPING (0x10)
102 #define TLV_PID_MSP430CPUXV2 (0x23)
103 #define TLV_PID_JTAG (0x09)
104 #define TLV_PID_SBW (0x0F)
105 #define TLV_PID_EEM_XS (0x02)
106 #define TLV_PID_EEM_S (0x03)
107 #define TLV_PID_EEM_M (0x04)
108 #define TLV_PID_EEM_L (0x05)
109 #define TLV_PID_PMM (0x30)
110 #define TLV_PID_PMM_FR (0x32)
111 #define TLV_PID_FCTL (0x39)
112 #define TLV_PID_CRC16 (0x3C)
113 #define TLV_PID_CRC16_RB (0x3D)
114 #define TLV_PID_WDT_A (0x40)
115 #define TLV_PID_SFR (0x41)
116 #define TLV_PID_SYS (0x42)
117 #define TLV_PID_RAMCTL (0x44)
118 #define TLV_PID_DMA_1 (0x46)
119 #define TLV_PID_DMA_3 (0x47)
120 #define TLV_PID_UCS (0x48)
121 #define TLV_PID_DMA_6 (0x4A)
122 #define TLV_PID_DMA_2 (0x4B)
123 #define TLV_PID_PORT1_2 (0x51)
124 #define TLV_PID_PORT3_4 (0x52)
125 #define TLV_PID_PORT5_6 (0x53)
126 #define TLV_PID_PORT7_8 (0x54)
127 #define TLV_PID_PORT9_10 (0x55)
128 #define TLV_PID_PORT11_12 (0x56)
129 #define TLV_PID_PORTU (0x5E)
130 #define TLV_PID_PORTJ (0x5F)
131 #define TLV_PID_TA2 (0x60)
132 #define TLV_PID_TA3 (0x61)
133 #define TLV_PID_TA5 (0x62)
134 #define TLV_PID_TA7 (0x63)
135 #define TLV_PID_TB3 (0x65)
136 #define TLV_PID_TB5 (0x66)
137 #define TLV_PID_TB7 (0x67)
138 #define TLV_PID_RTC (0x68)
139 #define TLV_PID_BT_RTC (0x69)
140 #define TLV_PID_BBS (0x6A)
141 #define TLV_PID_RTC_B (0x6B)
142 #define TLV_PID_TD2 (0x6C)
143 #define TLV_PID_TD3 (0x6D)
144 #define TLV_PID_TD5 (0x6E)
145 #define TLV_PID_TD7 (0x6F)
146 #define TLV_PID_TEC (0x70)
147 #define TLV_PID_RTC_C (0x71)
148 #define TLV_PID_AES (0x80)
149 #define TLV_PID_MPY16 (0x84)
150 #define TLV_PID_MPY32 (0x85)
151 #define TLV_PID_MPU (0x86)
152 #define TLV_PID_USCI_AB (0x90)
153 #define TLV_PID_USCI_A (0x91)
154 #define TLV_PID_USCI_B (0x92)
155 #define TLV_PID_EUSCI_A (0x94)
156 #define TLV_PID_EUSCI_B (0x95)
157 #define TLV_PID_REF (0xA0)
158 #define TLV_PID_COMP_B (0xA8)
159 #define TLV_PID_COMP_D (0xA9)
160 #define TLV_PID_USB (0x98)
161 #define TLV_PID_LCD_B (0xB1)
162 #define TLV_PID_LCD_C (0xB2)
163 #define TLV_PID_DAC12_A (0xC0)
164 #define TLV_PID_SD16_B_1 (0xC8)
165 #define TLV_PID_SD16_B_2 (0xC9)
166 #define TLV_PID_SD16_B_3 (0xCA)
167 #define TLV_PID_SD16_B_4 (0xCB)
168 #define TLV_PID_SD16_B_5 (0xCC)
169 #define TLV_PID_SD16_B_6 (0xCD)
170 #define TLV_PID_SD16_B_7 (0xCE)
171 #define TLV_PID_SD16_B_8 (0xCF)
172 #define TLV_PID_ADC12_A (0xD1)
173 #define TLV_PID_ADC10_A (0xD3)
174 #define TLV_PID_ADC10_B (0xD4)
175 #define TLV_PID_SD16_A (0xD8)
176 #define TLV_PID_TI_BSL (0xFC)
177 
178 //*****************************************************************************
179 //
180 // Prototypes for the APIs.
181 //
182 //*****************************************************************************
183 
184 //*****************************************************************************
185 //
186 //! \brief Gets TLV Info
187 //!
188 //! The TLV structure uses a tag or base address to identify segments of the
189 //! table where information is stored. Some examples of TLV tags are Peripheral
190 //! Descriptor, Interrupts, Info Block and Die Record. This function retrieves
191 //! the value of a tag and the length of the tag.
192 //!
193 //! \param tag represents the tag for which the information needs to be
194 //! retrieved.
195 //! Valid values are:
196 //! - \b TLV_TAG_LDTAG
197 //! - \b TLV_TAG_PDTAG
198 //! - \b TLV_TAG_Reserved3
199 //! - \b TLV_TAG_Reserved4
200 //! - \b TLV_TAG_BLANK
201 //! - \b TLV_TAG_Reserved6
202 //! - \b TLV_TAG_Reserved7
203 //! - \b TLV_TAG_TAGEND
204 //! - \b TLV_TAG_TAGEXT
205 //! - \b TLV_TAG_TIMER_D_CAL
206 //! - \b TLV_DEVICE_ID_0
207 //! - \b TLV_DEVICE_ID_1
208 //! - \b TLV_TAG_DIERECORD
209 //! - \b TLV_TAG_ADCCAL
210 //! - \b TLV_TAG_ADC12CAL
211 //! - \b TLV_TAG_ADC10CAL
212 //! - \b TLV_TAG_REFCAL
213 //! - \b TLV_TAG_CTSD16CAL
214 //! \param instance In some cases a specific tag may have more than one
215 //! instance. For example there may be multiple instances of timer
216 //! calibration data present under a single Timer Cal tag. This variable
217 //! specifies the instance for which information is to be retrieved (0,
218 //! 1, etc.). When only one instance exists; 0 is passed.
219 //! \param length Acts as a return through indirect reference. The function
220 //! retrieves the value of the TLV tag length. This value is pointed to
221 //! by *length and can be used by the application level once the
222 //! function is called. If the specified tag is not found then the
223 //! pointer is null 0.
224 //! \param data_address acts as a return through indirect reference. Once the
225 //! function is called data_address points to the pointer that holds the
226 //! value retrieved from the specified TLV tag. If the specified tag is
227 //! not found then the pointer is null 0.
228 //!
229 //! \return None
230 //
231 //*****************************************************************************
232 extern void TLV_getInfo(uint8_t tag,
233  uint8_t instance,
234  uint8_t *length,
235  uint16_t **data_address);
236 
237 //*****************************************************************************
238 //
239 //! \brief Retrieves the unique device ID from the TLV structure.
240 //!
241 //!
242 //! \return The device ID is returned as type uint16_t.
243 //
244 //*****************************************************************************
245 extern uint16_t TLV_getDeviceType(void);
246 
247 //*****************************************************************************
248 //
249 //! \brief Gets memory information
250 //!
251 //! The Peripheral Descriptor tag is split into two portions a list of the
252 //! available flash memory blocks followed by a list of available peripherals.
253 //! This function is used to parse through the first portion and calculate the
254 //! total flash memory available in a device. The typical usage is to call the
255 //! TLV_getMemory which returns a non-zero value until the entire memory list
256 //! has been parsed. When a zero is returned, it indicates that all the memory
257 //! blocks have been counted and the next address holds the beginning of the
258 //! device peripheral list.
259 //!
260 //! \param instance In some cases a specific tag may have more than one
261 //! instance. This variable specifies the instance for which information
262 //! is to be retrieved (0, 1 etc). When only one instance exists; 0 is
263 //! passed.
264 //!
265 //! \return The returned value is zero if the end of the memory list is
266 //! reached.
267 //
268 //*****************************************************************************
269 extern uint16_t TLV_getMemory(uint8_t instance);
270 
271 //*****************************************************************************
272 //
273 //! \brief Gets peripheral information from the TLV
274 //!
275 //! he Peripheral Descriptor tag is split into two portions a list of the
276 //! available flash memory blocks followed by a list of available peripherals.
277 //! This function is used to parse through the second portion and can be used
278 //! to check if a specific peripheral is present in a device. The function
279 //! calls TLV_getPeripheral() recursively until the end of the memory list and
280 //! consequently the beginning of the peripheral list is reached. <
281 //!
282 //! \param tag represents represents the tag for a specific peripheral for
283 //! which the information needs to be retrieved. In the header file tlv.
284 //! h specific peripheral tags are pre-defined, for example USCIA_B and
285 //! TA0 are defined as TLV_PID_USCI_AB and TLV_PID_TA2 respectively.
286 //! Valid values are:
287 //! - \b TLV_PID_NO_MODULE - No Module
288 //! - \b TLV_PID_PORTMAPPING - Port Mapping
289 //! - \b TLV_PID_MSP430CPUXV2 - MSP430CPUXV2
290 //! - \b TLV_PID_JTAG - JTAG
291 //! - \b TLV_PID_SBW - SBW
292 //! - \b TLV_PID_EEM_XS - EEM X-Small
293 //! - \b TLV_PID_EEM_S - EEM Small
294 //! - \b TLV_PID_EEM_M - EEM Medium
295 //! - \b TLV_PID_EEM_L - EEM Large
296 //! - \b TLV_PID_PMM - PMM
297 //! - \b TLV_PID_PMM_FR - PMM FRAM
298 //! - \b TLV_PID_FCTL - Flash
299 //! - \b TLV_PID_CRC16 - CRC16
300 //! - \b TLV_PID_CRC16_RB - CRC16 Reverse
301 //! - \b TLV_PID_WDT_A - WDT_A
302 //! - \b TLV_PID_SFR - SFR
303 //! - \b TLV_PID_SYS - SYS
304 //! - \b TLV_PID_RAMCTL - RAMCTL
305 //! - \b TLV_PID_DMA_1 - DMA 1
306 //! - \b TLV_PID_DMA_3 - DMA 3
307 //! - \b TLV_PID_UCS - UCS
308 //! - \b TLV_PID_DMA_6 - DMA 6
309 //! - \b TLV_PID_DMA_2 - DMA 2
310 //! - \b TLV_PID_PORT1_2 - Port 1 + 2 / A
311 //! - \b TLV_PID_PORT3_4 - Port 3 + 4 / B
312 //! - \b TLV_PID_PORT5_6 - Port 5 + 6 / C
313 //! - \b TLV_PID_PORT7_8 - Port 7 + 8 / D
314 //! - \b TLV_PID_PORT9_10 - Port 9 + 10 / E
315 //! - \b TLV_PID_PORT11_12 - Port 11 + 12 / F
316 //! - \b TLV_PID_PORTU - Port U
317 //! - \b TLV_PID_PORTJ - Port J
318 //! - \b TLV_PID_TA2 - Timer A2
319 //! - \b TLV_PID_TA3 - Timer A1
320 //! - \b TLV_PID_TA5 - Timer A5
321 //! - \b TLV_PID_TA7 - Timer A7
322 //! - \b TLV_PID_TB3 - Timer B3
323 //! - \b TLV_PID_TB5 - Timer B5
324 //! - \b TLV_PID_TB7 - Timer B7
325 //! - \b TLV_PID_RTC - RTC
326 //! - \b TLV_PID_BT_RTC - BT + RTC
327 //! - \b TLV_PID_BBS - Battery Backup Switch
328 //! - \b TLV_PID_RTC_B - RTC_B
329 //! - \b TLV_PID_TD2 - Timer D2
330 //! - \b TLV_PID_TD3 - Timer D1
331 //! - \b TLV_PID_TD5 - Timer D5
332 //! - \b TLV_PID_TD7 - Timer D7
333 //! - \b TLV_PID_TEC - Timer Event Control
334 //! - \b TLV_PID_RTC_C - RTC_C
335 //! - \b TLV_PID_AES - AES
336 //! - \b TLV_PID_MPY16 - MPY16
337 //! - \b TLV_PID_MPY32 - MPY32
338 //! - \b TLV_PID_MPU - MPU
339 //! - \b TLV_PID_USCI_AB - USCI_AB
340 //! - \b TLV_PID_USCI_A - USCI_A
341 //! - \b TLV_PID_USCI_B - USCI_B
342 //! - \b TLV_PID_EUSCI_A - eUSCI_A
343 //! - \b TLV_PID_EUSCI_B - eUSCI_B
344 //! - \b TLV_PID_REF - Shared Reference
345 //! - \b TLV_PID_COMP_B - COMP_B
346 //! - \b TLV_PID_COMP_D - COMP_D
347 //! - \b TLV_PID_USB - USB
348 //! - \b TLV_PID_LCD_B - LCD_B
349 //! - \b TLV_PID_LCD_C - LCD_C
350 //! - \b TLV_PID_DAC12_A - DAC12_A
351 //! - \b TLV_PID_SD16_B_1 - SD16_B 1 Channel
352 //! - \b TLV_PID_SD16_B_2 - SD16_B 2 Channel
353 //! - \b TLV_PID_SD16_B_3 - SD16_B 3 Channel
354 //! - \b TLV_PID_SD16_B_4 - SD16_B 4 Channel
355 //! - \b TLV_PID_SD16_B_5 - SD16_B 5 Channel
356 //! - \b TLV_PID_SD16_B_6 - SD16_B 6 Channel
357 //! - \b TLV_PID_SD16_B_7 - SD16_B 7 Channel
358 //! - \b TLV_PID_SD16_B_8 - SD16_B 8 Channel
359 //! - \b TLV_PID_ADC12_A - ADC12_A
360 //! - \b TLV_PID_ADC10_A - ADC10_A
361 //! - \b TLV_PID_ADC10_B - ADC10_B
362 //! - \b TLV_PID_SD16_A - SD16_A
363 //! - \b TLV_PID_TI_BSL - BSL
364 //! \param instance In some cases a specific tag may have more than one
365 //! instance. For example a device may have more than a single USCI
366 //! module, each of which is defined by an instance number 0, 1, 2, etc.
367 //! When only one instance exists; 0 is passed.
368 //!
369 //! \return The returned value is zero if the specified tag value (peripheral)
370 //! is not available in the device.
371 //
372 //*****************************************************************************
373 extern uint16_t TLV_getPeripheral(uint8_t tag,
374  uint8_t instance);
375 
376 //*****************************************************************************
377 //
378 //! \brief Get interrupt information from the TLV
379 //!
380 //! This function is used to retrieve information on available interrupt
381 //! vectors. It allows the user to check if a specific interrupt vector is
382 //! defined in a given device.
383 //!
384 //! \param tag represents the tag for the interrupt vector. Interrupt vector
385 //! tags number from 0 to N depending on the number of available
386 //! interrupts. Refer to the device datasheet for a list of available
387 //! interrupts.
388 //!
389 //! \return The returned value is zero is the specified interrupt vector is not
390 //! defined.
391 //
392 //*****************************************************************************
393 extern uint8_t TLV_getInterrupt(uint8_t tag);
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
405 #endif // __MSP430WARE_TLV_H__
void TLV_getInfo(uint8_t tag, uint8_t instance, uint8_t *length, uint16_t **data_address)
Gets TLV Info.
Definition: tlv.c:21
Definition: tlv.h:56
uint16_t TLV_getDeviceType(void)
Retrieves the unique device ID from the TLV structure.
Definition: tlv.c:61
Definition: tlv.h:49
uint16_t TLV_getPeripheral(uint8_t tag, uint8_t instance)
Gets peripheral information from the TLV.
Definition: tlv.c:100
uint8_t TLV_getInterrupt(uint8_t tag)
Get interrupt information from the TLV.
Definition: tlv.c:155
Definition: tlv.h:62
Definition: tlv.h:31
uint16_t TLV_getMemory(uint8_t instance)
Gets memory information.
Definition: tlv.c:68
Definition: tlv.h:38

Copyright 2015, Texas Instruments Incorporated