54 #ifndef BSP430_UTILITY_TLV_H
55 #define BSP430_UTILITY_TLV_H
65 #ifndef configBSP430_TLV
66 #define configBSP430_TLV 0
77 #if defined(BSP430_DOXYGEN) || defined(configBSP430_TLV)
78 #define BSP430_TLV (configBSP430_TLV - 0)
144 #define BSP430_TLV_IS_5XX defined(__MSP430_HAS_MSP430XV2_CPU__)
149 #if defined(BSP430_DOXYGEN) || (BSP430_TLV_IS_5XX - 0)
161 #define BSP430_TLV_NEXT_ENTRY(ep_) ((sBSP430tlvEntry *)(sizeof(sBSP430tlvEntry) + (ep_)->len + (unsigned char *)(ep_)))
170 #if defined(BSP430_DOXYGEN) || (BSP430_TLV_IS_5XX - 0)
171 #define BSP430_TLV_ENTRY_IS_ADC(ep_) ((TLV_ADC10CAL == (ep_)->tag) || (TLV_ADC12CAL == (ep_)->tag))
173 #define BSP430_TLV_ENTRY_IS_ADC(ep_) ((TAG_DCO_30 != (ep_)->tag) && (TAG_EMPTY != (ep_)->tag))
176 #if defined(BSP430_DOXYGEN) || (BSP430_TLV_IS_5XX - 0)
180 #define TLV_LDTAG (0x01)
183 #define TLV_PDTAG (0x02)
186 #define TLV_BLANK (0x05)
188 #ifndef TLV_DIERECORD
189 #define TLV_DIERECORD (0x08)
192 #define TLV_ADC12CAL (0x11)
195 #define TLV_REFCAL (0x12)
198 #define TLV_ADC10CAL (0x13)
201 #define TLV_TAGEXT (0xFE)
253 typedef struct sBSP430tlvBSL {
255 unsigned char bsl_com_if;
256 unsigned char bsl_cif_config[1];
262 #if defined(BSP430_DOXYGEN) || ! (BSP430_TLV_IS_5XX - 0)
266 #define TAG_DCO_30 (0x01)
269 #define TAG_EMPTY (0xFE)
315 #if defined(BSP430_DOXYGEN) || (BSP430_TLV_IS_5XX - 0)
317 #define BSP430_TLV_TABLE_DATA_OFFSET 4
320 #define BSP430_TLV_TABLE_PREFIX_LENGTH 8
330 #define TLV_START (BSP430_TLV_TABLE_PREFIX_LENGTH + *(const unsigned int *)0x0FF4)
338 #define TLV_END (TLV_START - BSP430_TLV_TABLE_PREFIX_LENGTH + (4 << ((const sBSP430tlvTable *)BSP430_TLV_TABLE_START)->info_len_lg2) - 1)
341 #define BSP430_TLV_TABLE_DATA_OFFSET 2
342 #define BSP430_TLV_TABLE_PREFIX_LENGTH 2
343 #define TLV_START 0x10C2
344 #define TLV_END 0x10FF
352 #define BSP430_TLV_TABLE_START ((const unsigned char *)TLV_START - BSP430_TLV_TABLE_PREFIX_LENGTH)
359 #define BSP430_TLV_TABLE_IS_VALID() \
360 (((const sBSP430tlvTable *)BSP430_TLV_TABLE_START)->crc \
361 == uiBSP430tlvChecksum(BSP430_TLV_TABLE_START + BSP430_TLV_TABLE_DATA_OFFSET, \
362 (1 + (const unsigned char *)TLV_END) - (BSP430_TLV_TABLE_START + BSP430_TLV_TABLE_DATA_OFFSET)))
unsigned char caldco_8MHz
Definition: tlv.h:284
unsigned char len
Definition: tlv.h:88
struct sBSP430tlvDIERECORD sBSP430tlvDIERECORD
unsigned int cal_adc_15t30
Definition: tlv.h:306
unsigned int die_x_position
Definition: tlv.h:212
unsigned int words[1]
Definition: tlv.h:128
sBSP430tlvEntry hdr
Definition: tlv.h:302
unsigned int cal_adc_20vref_factor
Definition: tlv.h:224
struct sBSP430tlvDCO sBSP430tlvDCO
unsigned int cal_adc_20t85
Definition: tlv.h:244
unsigned int device_id
Definition: tlv.h:121
unsigned int crc
Definition: tlv.h:119
struct sBPS430tlvADC sBSP430tlvADC
Common header included by all BSP430 leaf headers.
sBSP430tlvEntry hdr
Definition: tlv.h:279
unsigned int crc
Definition: tlv.h:96
unsigned char calbc1_16MHz
Definition: tlv.h:281
unsigned char info_len_lg2
Definition: tlv.h:113
unsigned int cal_adc_gain_factor
Definition: tlv.h:303
unsigned int words[1]
Definition: tlv.h:99
unsigned int cal_adc_15vref_factor
Definition: tlv.h:223
struct sBSP430tlvTable2xx sBSP430tlvTable2xx
unsigned int die_y_position
Definition: tlv.h:213
unsigned char calbc1_1MHz
Definition: tlv.h:287
struct sBSP430tlvREFCAL sBSP430tlvREFCAL
unsigned char caldco_16MHz
Definition: tlv.h:280
unsigned char caldco_12MHz
Definition: tlv.h:282
unsigned int test_results
Definition: tlv.h:214
unsigned int cal_adc_25t30
Definition: tlv.h:309
unsigned char hardware_revision
Definition: tlv.h:125
unsigned int cal_adc_25t85
Definition: tlv.h:246
unsigned int cal_adc_25t85
Definition: tlv.h:310
sBSP430tlvEntry hdr
Definition: tlv.h:222
unsigned int cal_adc_gain_factor
Definition: tlv.h:239
unsigned char crc_len_lg2
Definition: tlv.h:116
sBSP430tlvEntry entry
Definition: tlv.h:130
unsigned char firmware_revision
Definition: tlv.h:123
unsigned char tag
Definition: tlv.h:85
struct sBSP430tlvEntry sBSP430tlvEntry
unsigned int cal_adc_offset
Definition: tlv.h:304
unsigned int uiBSP430tlvChecksum(const unsigned char *data, size_t len)
unsigned int cal_adc_20t30
Definition: tlv.h:243
unsigned int cal_adc_15t85
Definition: tlv.h:307
unsigned int cal_adc_15t30
Definition: tlv.h:241
unsigned long lot_id
Definition: tlv.h:211
sBSP430tlvEntry entry
Definition: tlv.h:101
struct sBPS430tlvADCCAL sBSP430tlvADCCAL
unsigned char calbc1_12MHz
Definition: tlv.h:283
sBSP430tlvEntry hdr
Definition: tlv.h:238
unsigned int cal_adc_15t85
Definition: tlv.h:242
struct sBSP430tlvTable5xx sBSP430tlvTable5xx
unsigned int cal_adc_offset
Definition: tlv.h:240
unsigned int cal_adc_25t30
Definition: tlv.h:245
unsigned int cal_adc_15vref_factor
Definition: tlv.h:305
unsigned int cal_adc_25vref_factor
Definition: tlv.h:225
unsigned int cal_adc_25vref_factor
Definition: tlv.h:308
unsigned char caldco_1MHz
Definition: tlv.h:286
sBSP430tlvTable5xx sBSP430tlvTable
Definition: tlv.h:150
sBSP430tlvEntry hdr
Definition: tlv.h:210
unsigned char calbc1_8MHz
Definition: tlv.h:285