2020-2021 Sunseeker Telemetry and Lighting System
tlv.h
Go to the documentation of this file.
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 //******************************************************************************
31 struct s_TLV_Die_Record {
32  uint32_t wafer_id;
33  uint16_t die_x_position;
34  uint16_t die_y_position;
35  uint16_t test_results;
36 };
37 
38 struct s_TLV_ADC_Cal_Data {
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 
49 struct s_TLV_Timer_D_Cal_Data {
50  uint16_t TDH0CTL1_64;
51  uint16_t TDH0CTL1_128;
52  uint16_t TDH0CTL1_200;
53  uint16_t TDH0CTL1_256;
54 };
55 
56 struct s_TLV_REF_Cal_Data {
57  uint16_t ref_ref15;
58  uint16_t ref_ref20;
59  uint16_t ref_ref25;
60 };
61 
62 struct s_Peripheral_Memory_Data {
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 //
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 //
243 //
244 //*****************************************************************************
245 extern uint16_t TLV_getDeviceType(void);
246 
247 //*****************************************************************************
248 //
267 //
268 //*****************************************************************************
269 extern uint16_t TLV_getMemory(uint8_t instance);
270 
271 //*****************************************************************************
272 //
371 //
372 //*****************************************************************************
373 extern uint16_t TLV_getPeripheral(uint8_t tag,
374  uint8_t instance);
375 
376 //*****************************************************************************
377 //
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__