Data Structures | Defines | Functions
tlv.h File Reference

Go to the source code of this file.

Data Structures

struct  s_TLV_Die_Record
struct  s_TLV_ADC_Cal_Data
struct  s_TLV_Timer_D_Cal_Data
struct  s_TLV_REF_Cal_Data
struct  s_Peripheral_Memory_Data

Defines

#define __MSP430_HAS_TLV__
#define TLV_TAG_LDTAG   TLV_LDTAG
#define TLV_TAG_PDTAG   TLV_PDTAG
#define TLV_TAG_Reserved3   TLV_Reserved3
#define TLV_TAG_Reserved4   TLV_Reserved4
#define TLV_TAG_BLANK   TLV_BLANK
#define TLV_TAG_Reserved6   TLV_Reserved6
#define TLV_TAG_Reserved7   TLV_Reserved7
#define TLV_TAG_DIERECORD   TLV_DIERECORD
#define TLV_TAG_ADCCAL   TLV_ADCCAL
#define TLV_TAG_ADC12CAL   TLV_ADC12CAL
#define TLV_TAG_ADC10CAL   TLV_ADC10CAL
#define TLV_TAG_REFCAL   TLV_REFCAL
#define TLV_TAG_TIMER_D_CAL   TLV_TIMERDCAL
#define TLV_TIMER_D_CAL   TLV_TIMERDCAL
#define TLV_TAG_TAGEXT   TLV_TAGEXT
#define TLV_TAG_TAGEND   TLV_TAGEND
#define TLV_PID_NO_MODULE   (0x00)
#define TLV_PID_PORTMAPPING   (0x10)
#define TLV_PID_MSP430CPUXV2   (0x23)
#define TLV_PID_JTAG   (0x09)
#define TLV_PID_SBW   (0x0F)
#define TLV_PID_EEM_XS   (0x02)
#define TLV_PID_EEM_S   (0x03)
#define TLV_PID_EEM_M   (0x04)
#define TLV_PID_EEM_L   (0x05)
#define TLV_PID_PMM   (0x30)
#define TLV_PID_PMM_FR   (0x32)
#define TLV_PID_FCTL   (0x39)
#define TLV_PID_CRC16   (0x3C)
#define TLV_PID_CRC16_RB   (0x3D)
#define TLV_PID_WDT_A   (0x40)
#define TLV_PID_SFR   (0x41)
#define TLV_PID_SYS   (0x42)
#define TLV_PID_RAMCTL   (0x44)
#define TLV_PID_DMA_1   (0x46)
#define TLV_PID_DMA_3   (0x47)
#define TLV_PID_UCS   (0x48)
#define TLV_PID_DMA_6   (0x4A)
#define TLV_PID_DMA_2   (0x4B)
#define TLV_PID_PORT1_2   (0x51)
#define TLV_PID_PORT3_4   (0x52)
#define TLV_PID_PORT5_6   (0x53)
#define TLV_PID_PORT7_8   (0x54)
#define TLV_PID_PORT9_10   (0x55)
#define TLV_PID_PORT11_12   (0x56)
#define TLV_PID_PORTU   (0x5E)
#define TLV_PID_PORTJ   (0x5F)
#define TLV_PID_TA2   (0x60)
#define TLV_PID_TA3   (0x61)
#define TLV_PID_TA5   (0x62)
#define TLV_PID_TA7   (0x63)
#define TLV_PID_TB3   (0x65)
#define TLV_PID_TB5   (0x66)
#define TLV_PID_TB7   (0x67)
#define TLV_PID_RTC   (0x68)
#define TLV_PID_BT_RTC   (0x69)
#define TLV_PID_BBS   (0x6A)
#define TLV_PID_RTC_B   (0x6B)
#define TLV_PID_TD2   (0x6C)
#define TLV_PID_TD3   (0x6D)
#define TLV_PID_TD5   (0x6E)
#define TLV_PID_TD7   (0x6F)
#define TLV_PID_TEC   (0x70)
#define TLV_PID_RTC_C   (0x71)
#define TLV_PID_AES   (0x80)
#define TLV_PID_MPY16   (0x84)
#define TLV_PID_MPY32   (0x85)
#define TLV_PID_MPU   (0x86)
#define TLV_PID_USCI_AB   (0x90)
#define TLV_PID_USCI_A   (0x91)
#define TLV_PID_USCI_B   (0x92)
#define TLV_PID_EUSCI_A   (0x94)
#define TLV_PID_EUSCI_B   (0x95)
#define TLV_PID_REF   (0xA0)
#define TLV_PID_COMP_B   (0xA8)
#define TLV_PID_COMP_D   (0xA9)
#define TLV_PID_USB   (0x98)
#define TLV_PID_LCD_B   (0xB1)
#define TLV_PID_LCD_C   (0xB2)
#define TLV_PID_DAC12_A   (0xC0)
#define TLV_PID_SD16_B_1   (0xC8)
#define TLV_PID_SD16_B_2   (0xC9)
#define TLV_PID_SD16_B_3   (0xCA)
#define TLV_PID_SD16_B_4   (0xCB)
#define TLV_PID_SD16_B_5   (0xCC)
#define TLV_PID_SD16_B_6   (0xCD)
#define TLV_PID_SD16_B_7   (0xCE)
#define TLV_PID_SD16_B_8   (0xCF)
#define TLV_PID_ADC12_A   (0xD1)
#define TLV_PID_ADC10_A   (0xD3)
#define TLV_PID_ADC10_B   (0xD4)
#define TLV_PID_SD16_A   (0xD8)
#define TLV_PID_TI_BSL   (0xFC)
#define DEVICE_ID_0   (0x1A04)
#define DEVICE_ID_1   (0x1A05)

Functions

void TLV_getInfo (unsigned char tag, unsigned char instance, unsigned char *length, unsigned int **data_address)
unsigned int TLV_getDeviceType ()
unsigned int TLV_getMemory (unsigned char instance)
unsigned int TLV_getPeripheral (unsigned char tag, unsigned char instance)
unsigned char TLV_getInterrupt (unsigned char tag)

Define Documentation

#define __MSP430_HAS_TLV__
#define TLV_TAG_LDTAG   TLV_LDTAG
#define TLV_TAG_PDTAG   TLV_PDTAG
#define TLV_TAG_Reserved3   TLV_Reserved3
#define TLV_TAG_Reserved4   TLV_Reserved4
#define TLV_TAG_BLANK   TLV_BLANK
#define TLV_TAG_Reserved6   TLV_Reserved6
#define TLV_TAG_Reserved7   TLV_Reserved7
#define TLV_TAG_DIERECORD   TLV_DIERECORD
#define TLV_TAG_ADCCAL   TLV_ADCCAL
#define TLV_TAG_ADC12CAL   TLV_ADC12CAL
#define TLV_TAG_ADC10CAL   TLV_ADC10CAL
#define TLV_TAG_REFCAL   TLV_REFCAL
#define TLV_TAG_TIMER_D_CAL   TLV_TIMERDCAL
#define TLV_TIMER_D_CAL   TLV_TIMERDCAL
#define TLV_TAG_TAGEXT   TLV_TAGEXT
#define TLV_TAG_TAGEND   TLV_TAGEND
#define TLV_PID_NO_MODULE   (0x00)
#define TLV_PID_PORTMAPPING   (0x10)
#define TLV_PID_MSP430CPUXV2   (0x23)
#define TLV_PID_JTAG   (0x09)
#define TLV_PID_SBW   (0x0F)
#define TLV_PID_EEM_XS   (0x02)
#define TLV_PID_EEM_S   (0x03)
#define TLV_PID_EEM_M   (0x04)
#define TLV_PID_EEM_L   (0x05)
#define TLV_PID_PMM   (0x30)
#define TLV_PID_PMM_FR   (0x32)
#define TLV_PID_FCTL   (0x39)
#define TLV_PID_CRC16   (0x3C)
#define TLV_PID_CRC16_RB   (0x3D)
#define TLV_PID_WDT_A   (0x40)
#define TLV_PID_SFR   (0x41)
#define TLV_PID_SYS   (0x42)
#define TLV_PID_RAMCTL   (0x44)
#define TLV_PID_DMA_1   (0x46)
#define TLV_PID_DMA_3   (0x47)
#define TLV_PID_UCS   (0x48)
#define TLV_PID_DMA_6   (0x4A)
#define TLV_PID_DMA_2   (0x4B)
#define TLV_PID_PORT1_2   (0x51)
#define TLV_PID_PORT3_4   (0x52)
#define TLV_PID_PORT5_6   (0x53)
#define TLV_PID_PORT7_8   (0x54)
#define TLV_PID_PORT9_10   (0x55)
#define TLV_PID_PORT11_12   (0x56)
#define TLV_PID_PORTU   (0x5E)
#define TLV_PID_PORTJ   (0x5F)
#define TLV_PID_TA2   (0x60)
#define TLV_PID_TA3   (0x61)
#define TLV_PID_TA5   (0x62)
#define TLV_PID_TA7   (0x63)
#define TLV_PID_TB3   (0x65)
#define TLV_PID_TB5   (0x66)
#define TLV_PID_TB7   (0x67)
#define TLV_PID_RTC   (0x68)
#define TLV_PID_BT_RTC   (0x69)
#define TLV_PID_BBS   (0x6A)
#define TLV_PID_RTC_B   (0x6B)
#define TLV_PID_TD2   (0x6C)
#define TLV_PID_TD3   (0x6D)
#define TLV_PID_TD5   (0x6E)
#define TLV_PID_TD7   (0x6F)
#define TLV_PID_TEC   (0x70)
#define TLV_PID_RTC_C   (0x71)
#define TLV_PID_AES   (0x80)
#define TLV_PID_MPY16   (0x84)
#define TLV_PID_MPY32   (0x85)
#define TLV_PID_MPU   (0x86)
#define TLV_PID_USCI_AB   (0x90)
#define TLV_PID_USCI_A   (0x91)
#define TLV_PID_USCI_B   (0x92)
#define TLV_PID_EUSCI_A   (0x94)
#define TLV_PID_EUSCI_B   (0x95)
#define TLV_PID_REF   (0xA0)
#define TLV_PID_COMP_B   (0xA8)
#define TLV_PID_COMP_D   (0xA9)
#define TLV_PID_USB   (0x98)
#define TLV_PID_LCD_B   (0xB1)
#define TLV_PID_LCD_C   (0xB2)
#define TLV_PID_DAC12_A   (0xC0)
#define TLV_PID_SD16_B_1   (0xC8)
#define TLV_PID_SD16_B_2   (0xC9)
#define TLV_PID_SD16_B_3   (0xCA)
#define TLV_PID_SD16_B_4   (0xCB)
#define TLV_PID_SD16_B_5   (0xCC)
#define TLV_PID_SD16_B_6   (0xCD)
#define TLV_PID_SD16_B_7   (0xCE)
#define TLV_PID_SD16_B_8   (0xCF)
#define TLV_PID_ADC12_A   (0xD1)
#define TLV_PID_ADC10_A   (0xD3)
#define TLV_PID_ADC10_B   (0xD4)
#define TLV_PID_SD16_A   (0xD8)
#define TLV_PID_TI_BSL   (0xFC)
#define DEVICE_ID_0   (0x1A04)

Referenced by TLV_getDeviceType().

#define DEVICE_ID_1   (0x1A05)

Function Documentation

void TLV_getInfo ( unsigned char  tag,
unsigned char  instance,
unsigned char *  length,
unsigned int **  data_address 
)

The TLV structure uses a tag or base address to identify segments of the table where information is stored. Some examples of TLV tags are Peripheral Descriptor, Interrupts, Info Block and Die Record. This function retrieves the value of a tag and the length of the tag.

Parameters:
tagrepresents the tag for which the information needs to be retrieved. Various tags such as ADC (TLV_TAG_ADCCAL), Peripheral Descriptor (TLV_TAG_PDTAG) are defined in the tlv.h file.
instance- In some cases a specific tag may have more than one instance. For example there may be multiple instances of timer calibration data present under a single Timer Cal tag. This variable specifies the instance for which information is to be retrieved (0, 1, etc.). When only one instance exists; 0 is passed.
*lengthacts as a return through indirect reference. The function retrieves the value of the TLV tag length. This value is pointed to by length and can be used by the application level once the function is called. If the specified tag is not found then the pointer is null 0.
**data_addressacts as a return through indirect reference. Once the function is called data_address points to the pointer that holds the values retrieved from the specified TLV tag. If the specified tag is not found then the pointer is null 0.
Returns:
None

Referenced by TimerD_configureHighResGeneratorInFreeRunningMode(), TLV_getInterrupt(), TLV_getMemory(), and TLV_getPeripheral().

unsigned int TLV_getDeviceType ( )

Retrieves the unique device ID from the TLV structure.

Parameters:
None
Returns:
The device ID is returned as type unsigned int.

References DEVICE_ID_0.

unsigned int TLV_getMemory ( unsigned char  instance)

The Peripheral Descriptor tag is split into two portions a list of the available flash memory blocks followed by a list of available peripherals. This function is used to parse through the first portion and calculate the total flash memory available in a device. The typical usage is to call the TLV_getMemory which returns a non-zero value until the entire memory list has been parsed. When a zero is returned, it indicates that all the memory blocks have been counted and the next address holds the beginning of the device peripheral list.

Parameters:
instanceIn some cases a specific tag may have more than one instance. This variable specifies the instance for which information is to be retrieved (0, 1 etc). When only one instance exists; 0 is passed.
Returns:
The returned value is zero if the end of the memory list is reached.

References TLV_getInfo().

Referenced by TLV_getInterrupt(), and TLV_getPeripheral().

unsigned int TLV_getPeripheral ( unsigned char  tag,
unsigned char  instance 
)

The Peripheral Descriptor tag is split into two portions a list of the available flash memory blocks followed by a list of available peripherals. This function is used to parse through the second portion and can be used to check if a specific peripheral is present in a device. The function calls TLV_getPeripheral() recursively until the end of the memory list and consequently the beginning of the peripheral list is reached.

Parameters:
tagrepresents represents the tag for a specific peripheral for which the information needs to be retrieved. In the header file tlv.h specific peripheral tags are pre-defined, for example USCIA_B and TA0 are defined as TLV_PID_USCI_AB and TLV_PID_TA2 respectively.
instance- In some cases a specific tag may have more than one instance. For example a device may have more than a single USCI module, each of which is defined by an instance number 0, 1, 2, etc. When only one instance exists; 0 is passed.
Returns:
The returned value is zero if the specified tag value (peripheral) is not available in the device.

References TLV_getInfo(), and TLV_getMemory().

unsigned char TLV_getInterrupt ( unsigned char  tag)

This function is used to retrieve information on available interrupt vectors. It allows the user to check if a specific interrupt vector is defined in a given device.

Parameters:
tagrepresents the tag for the interrupt vector. Interrupt vector tags number from 0 to N depending on the number of available interrupts. Refer to the device datasheet for a list of available interrupts.
Returns:
The returned value is zero is the specified interrupt vector is not defined.

References TLV_getInfo(), and TLV_getMemory().


Copyright 2012, Texas Instruments Incorporated