MSP430 DriverLib for MSP430i2xx Devices  2.91.13.01
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 //*****************************************************************************
26 //
27 // The following are values that can be passed to the tag parameter for
28 // functions: TLV_getInfo().
29 //
30 //*****************************************************************************
31 #define TLV_CHECKSUM (0x40 | TLV_CHKSUM_L)
32 #define TLV_TAG_DIE_RECORD (TLV_DIE_RECORD_TAG)
33 #define TLV_LENGTH_DIE_RECORD (TLV_DIE_RECORD_LEN)
34 #define TLV_WAFER_LOT_ID (0x80 | TLV_LOT_WAFER_ID)
35 #define TLV_DIE_X_POSITION (0x40 | TLV_DIE_X_POS)
36 #define TLV_DIE_Y_POSITION (0x40 | TLV_DIE_Y_POS)
37 #define TLV_TEST_RESULTS (0x40 | TLV_DIE_TEST_RESULTS)
38 #define TLV_REF_CALIBRATION_TAG (TLV_REF_TAG)
39 #define TLV_REF_CALIBRATION_LENGTH (TLV_REF_LEN)
40 #define TLV_REF_CALIBRATION_REFCAL1 (TLV_CAL_REFCAL1)
41 #define TLV_REF_CALIBRATION_REFCAL0 (TLV_CAL_REFCAL0)
42 #define TLV_DCO_CALIBRATION_TAG (TLV_DCO_TAG)
43 #define TLV_DCO_CALIBRATION_LENGTH (TLV_DCO_LEN)
44 #define TLV_DCO_CALIBRATION_CSIRFCAL (TLV_CAL_CSIRFCAL)
45 #define TLV_DCO_CALIBRATION_CSIRTCAL (TLV_CAL_CSIRTCAL)
46 #define TLV_DCO_CALIBRATION_CSERFCAL (TLV_CAL_CSERFCAL)
47 #define TLV_DCO_CALIBRATION_CSERTCAL (TLV_CAL_CSERTCAL)
48 #define TLV_SD24_CALIBRATION_TAG (TLV_SD24_TAG)
49 #define TLV_SD24_CALIBRATION_LENGTH (TLV_SD24_LEN)
50 #define TLV_SD24_CALIBRATION_SD24TRIM (TLV_CAL_SD24TRIM)
51 
52 //*****************************************************************************
53 //
54 // Prototypes for the APIs.
55 //
56 //*****************************************************************************
57 
58 //*****************************************************************************
59 //
60 //! \brief Gets TLV Info
61 //!
62 //! The TLV structure uses a tag or base address to identify segments of the
63 //! table where information is stored. This can be used to retrieve calibration
64 //! constants for the device or find out more information about the device.
65 //! This function retrieves the address of a tag and the length of the tag
66 //! request. Please check the device datasheet for tags available on your
67 //! device.
68 //!
69 //! \param tag represents the tag for which the information needs to be
70 //! retrieved.
71 //! Valid values are:
72 //! - \b TLV_CHECKSUM
73 //! - \b TLV_TAG_DIE_RECORD
74 //! - \b TLV_LENGTH_DIE_RECORD
75 //! - \b TLV_WAFER_LOT_ID
76 //! - \b TLV_DIE_X_POSITION
77 //! - \b TLV_DIE_Y_POSITION
78 //! - \b TLV_TEST_RESULTS
79 //! - \b TLV_REF_CALIBRATION_TAG
80 //! - \b TLV_REF_CALIBRATION_LENGTH
81 //! - \b TLV_REF_CALIBRATION_REFCAL1
82 //! - \b TLV_REF_CALIBRATION_REFCAL0
83 //! - \b TLV_DCO_CALIBRATION_TAG
84 //! - \b TLV_DCO_CALIBRATION_LENGTH
85 //! - \b TLV_DCO_CALIBRATION_CSIRFCAL
86 //! - \b TLV_DCO_CALIBRATION_CSIRTCAL
87 //! - \b TLV_DCO_CALIBRATION_CSERFCAL
88 //! - \b TLV_DCO_CALIBRATION_CSERTCAL
89 //! - \b TLV_SD24_CALIBRATION_TAG
90 //! - \b TLV_SD24_CALIBRATION_LENGTH
91 //! - \b TLV_SD24_CALIBRATION_SD24TRIM
92 //! \param length Acts as a return through indirect reference. The function
93 //! retrieves the value of the TLV tag length. This value is pointed to
94 //! by *length and can be used by the application level once the
95 //! function is called.
96 //! \param data_address acts as a return through indirect reference. Once the
97 //! function is called data_address points to the pointer that holds the
98 //! value retrieved from the specified TLV tag.
99 //!
100 //! \return None
101 //
102 //*****************************************************************************
103 extern void TLV_getInfo(uint8_t tag,
104  uint8_t *length,
105  uint16_t **data_address);
106 
107 //*****************************************************************************
108 //
109 //! \brief Performs checksum check on TLV
110 //!
111 //! The 2's complement checksum is calculated on the data stored in the TLV. If
112 //! the calculated checksum is equal to the checksum stored in the TLV then the
113 //! user knows that the TLV has not been corrupted. This API can be used after
114 //! a BOR before writing configuration constants to the appropriate registers.
115 //!
116 //!
117 //! \return true if checksum of TLV matches value stored in TLV, false
118 //! otherwise
119 //
120 //*****************************************************************************
121 extern bool TLV_performChecksumCheck(void);
122 
123 //*****************************************************************************
124 //
125 // Mark the end of the C bindings section for C++ compilers.
126 //
127 //*****************************************************************************
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif
133 #endif // __MSP430WARE_TLV_H__
void TLV_getInfo(uint8_t tag, uint8_t *length, uint16_t **data_address)
Gets TLV Info.
Definition: tlv.c:21
bool TLV_performChecksumCheck(void)
Performs checksum check on TLV.
Definition: tlv.c:34

Copyright 2020, Texas Instruments Incorporated