Functions
tlv.c File Reference
#include "driverlib/5xx_6xx/tlv.h"
#include "inc/hw_types.h"
#include "deprecated/CCS/msp430xgeneric.h"
#include "inc/sfr_sys_baseAddress.h"
#include "driverlib/5xx_6xx/debug.h"

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)

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