MSP430™CapTIvateSoftwareLibraryAPIGuide 1_70_00_03

Data Structures | Macros | Typedefs | Enumerations | Functions
CAPT_Protocol

Packet generator and interpretor for CapTIvate™ protocol. More...

## Data Structures
struct | tTLProtocolProcessingVariables
union | tParameterPacket

## Macros
#define | TL_PROTOCOL_SYNC (0x55)
| CapTIvate™ Protocol Control Bytes. More...
#define | TL_PROTOCOL_BLANK (0xAA)
#define | TL_PROTOCOL_READ (0x00)
#define | TL_PROTOCOL_WRITE (0x01)
#define | TL_SENSOR_PACKET_CMD (0x00)
#define | TL_CYCLE_PACKET_CMD (0x01)
#define | TL_TRACKPAD_PACKET_CMD (0x02)
#define | TL_GENERAL_PURPOSE_PACKET_CMD (0x10)
#define | TL_STRING_PACKET_CMD (0x3E)
#define | TL_PARAM_CMD_GENERIC_MASK (0x80)
#define | TL_PARAM_CMD_SLIDER_WHEEL_MASK (0x90)
#define | TL_PARAM_CMD_TP_MASK (0xA0)
#define | TL_PARAM_CMD_DYCAL_MASK (0xB0)
#define | TL_PARAM_CMD_CTRL_MASK (0xC0)
#define | TL_PARAM_CMD_SPECIAL_MASK (0xD0)
#define | TL_PARAM_CMD_INVALID_MASK (0xF0)
#define | TL_PARAM_CMD_TRACKPADFILTEREN (0x60)
#define | TL_PARAM_CMD_TRACKPADFILTERBETA (0x61)
#define | TL_PARAM_CMD_BETATOPSPEED (0x63)
#define | TL_PARAM_CMD_BETABOTTOMSPEED (0x64)
#define | TL_PARAM_CMD_LOWERBETA (0x65)
#define | TL_PARAM_CMD_TRACKPADFILTERTYPE (0x66)
#define | TL_PARAM_CMD_RESOLUTION_X (0x67)
#define | TL_PARAM_CMD_RESOLUTION_Y (0x68)
#define | TL_PARAM_CMD_LOWERTRIM_X (0x69)
#define | TL_PARAM_CMD_UPPERTRIM_X (0x6A)
#define | TL_PARAM_CMD_LOWERTRIM_Y (0x6B)
#define | TL_PARAM_CMD_UPPERTRIM_Y (0x6C)
#define | TL_PARAM_CMD_CENTERTRIM_X (0x6D)
#define | TL_PARAM_CMD_CENTERTRIM_Y (0x6E)
#define | TL_PARAM_CMD_CIRCLERADIUS (0x6F)
#define | TL_PARAM_CMD_TAPTIME_MIN (0x70)
#define | TL_PARAM_CMD_TAPTIME_MAX (0x71)
#define | TL_PARAM_CMD_SWIPETIME_MAX (0x72)
#define | TL_PARAM_CMD_DBLTAPTIME_MAX (0x73)
#define | TL_PARAM_CMD_TAPHOLDTIME_MIN (0x74)
#define | TL_PARAM_CMD_SWIPEDISTANCE_MIN (0x75)
#define | TL_PARAM_CMD_DBLTAPENABLE (0x76)
#define | TL_PARAM_CMD_SWIPEENABLE (0x77)
#define | TL_PARAM_CMD_CIRCLEENABLE (0x78)
#define | TL_PARAM_CMD_ENDTRACKPAD (0x7F)
#define | TL_PARAM_CMD_CONVERSIONGAIN (0x80)
#define | TL_PARAM_CMD_CONVERSIONCOUNT (0x81)
#define | TL_PARAM_CMD_PROX_THRESH (0x82)
#define | TL_PARAM_CMD_TOUCH_THRESH (0x83)
#define | TL_PARAM_CMD_PROX_DBIN (0x84)
#define | TL_PARAM_CMD_PROX_DBOUT (0x85)
#define | TL_PARAM_CMD_TOUCH_DBIN (0x86)
#define | TL_PARAM_CMD_TOUCH_DBOUT (0x87)
#define | TL_PARAM_CMD_TIMEOUT (0x88)
#define | TL_PARAM_CMD_COUNTFILTEN (0x89)
#define | TL_PARAM_CMD_COUNTFILTBETA (0x8A)
#define | TL_PARAM_CMD_LTAFILTBETA (0x8B)
#define | TL_PARAM_CMD_LTAFILTERHALT (0x8C)
#define | TL_PARAM_CMD_DRIFTRECALENABLE (0x8D)
#define | TL_PARAM_CMD_FORCERECALIBRATE (0x8E)
#define | TL_PARAM_CMD_BIAS_CURRENT (0x8F)
#define | TL_PARAM_CMD_CS_DISCHARGE (0x95)
#define | TL_PARAM_CMD_MODENABLE (0x96)
#define | TL_PARAM_CMD_FREQDIV (0x97)
#define | TL_PARAM_CMD_CPLEN (0x98)
#define | TL_PARAM_CMD_TPLEN (0x99)
#define | TL_PARAM_CMD_ERROR_THRESH (0x9A)
#define | TL_PARAM_CMD_NEG_TOUCH_THRESH (0x9B)
#define | TL_PARAM_CMD_IDLE_STATE (0x9C)
#define | TL_PARAM_CMD_INPUT_SYNC (0x9D)
#define | TL_PARAM_CMD_TIMER_SYNC (0x9E)
#define | TL_PARAM_CMD_LPMCTRL (0x9F)
#define | TL_PARAM_CMD_LTA_SENSOR_PTHALT (0xA0)
#define | TL_PARAM_CMD_LTA_ELEMENT_PTHALT (0xA1)
#define | TL_PARAM_CMD_COARSE_GAIN_RATIO (0xA2)
#define | TL_PARAM_CMD_FINE_GAIN_RATIO (0xA3)
#define | TL_PARAM_CMD_OFFSET_SUBTRACTION (0xA4)
#define | TL_PARAM_CMD_OFFSET_SCALE (0xD0)
#define | TL_PARAM_CMD_OFFSET_LEVEL (0xD1)
#define | TL_PARAM_CMD_SLIDER_FILTEREN (0x90)
#define | TL_PARAM_CMD_SLIDER_FILTERBETA (0x91)
#define | TL_PARAM_CMD_SLIDER_RES (0x92)
#define | TL_PARAM_CMD_SLIDER_LTRIM (0x93)
#define | TL_PARAM_CMD_SLIDER_UTRIM (0x94)
#define | TL_PARAM_CMD_CTRL_ELEMENTTXEN (0xC0)
#define | TL_PARAM_CMD_CTRL_SENSORTXEN (0xC1)
#define | TL_PARAM_CMD_CTRL_REPORTRATE_ACTIVE (0xC2)
#define | TL_PARAM_CMD_CTRL_REPORTRATE_AUTO (0xC3)
#define | TL_PARAM_CMD_CTRL_WAKEINTERVAL_AUTO (0xC4)
#define | TL_PARAM_CMD_CTRL_TIMEOUT_ACTIVE (0xC5)
#define | TL_PCKT_SERIAL_OVRHD_LENGTH (0x03)
| CapTIvate™ Protocol Length Bytes. More...
#define | TL_PCKT_CHKSUM_LENGTH (0x02)
#define | TL_CYCLE_STATE_OFFSET (0x06)
#define | TL_CYCLE_STATE_LEN (0x03)
#define | TL_CYCLE_LEN_PER_ELEMENT (0x04)
#define | TL_CYCLE_OVRHD_LEN (0x06)
#define | TL_SENSOR_PACKET_LENGTH (0x0B)
#define | TL_PARAMETER_PACKET_LENGTH (0x0C)
#define | TL_PARAMETER_DATA_LENGTH (0x07)
#define | TL_GENERAL_PURPOSE_MAX_CNT (0x1D)
#define | TL_STRING_MAX_CNT (0x3A)
#define | TL_PCKT_CMD_FIELD (0x03)
| CapTIvate™ Protocol Field Offsets. More...
#define | TL_SENSOR_PCKT_ID_FIELD (0x04)
#define | TL_CYCLE_PCKT_ID_FIELD (0x04)
#define | TL_CYCLE_PCKT_CYCLE_FIELD (0x05)
#define | TL_PARAM_PCKT_RW_FIELD (0x04)
#define | TL_PARAM_PCKT_ID_FIELD (0x05)
#define | TL_TRACKPAD_PACKET_BASE_LENGTH (0x09)
| Low level protocol packet builder for trackpad. More...

## Typedefs
typedef uint8_t | tTLParameterAccessResult

## Enumerations
enum | { eInvalidSensor = 0x00, eInvalidCmd = 0x01, eValidCmd = 0x02, eValidCmdWithReCalibrate = 0x03 }

## Functions
tTLParameterAccessResult | CAPT_accessTrackPadSensorParameter (tSensor **sensorArray, tParameterPacket *pPacket)
| Access a special CapTIvate™ TL structure variable for a TrackPad sensor. More...
uint16_t | CAPT_getCyclePacket (tSensor **sensorArray, uint8_t ui8SensorID, uint8_t ui8Cycle, uint8_t *pBuffer)
uint16_t | CAPT_getSensorPacket (tSensor **sensorArray, uint8_t ui8SensorID, uint8_t *pBuffer)
uint16_t | CAPT_getGeneralPurposePacket (uint16_t *pData, uint8_t ui8Cnt, uint8_t *pBuffer)
uint16_t | CAPT_getStringPacket (const char *pSrcString, uint8_t *pBuffer)
uint16_t | CAPT_getTrackPadPacket (tSensor *pSensor, uint8_t ui8SensorID, uint8_t *pBuffer)
uint16_t | CAPT_getTrackPadSensorStatusPacket (tSensor **sensorArray, uint8_t ui8SensorID, uint8_t *pBuffer)
uint16_t | CAPT_getChecksum (const uint8_t *pBuffer, const uint16_t ui16Length)
| This API calculate the checksum of a byte buffer of given length. More...
bool | CAPT_verifyChecksum (const uint8_t *pBuffer, const uint16_t ui16Length, const uint16_t ui16Checksum)
| This API verifies the checksum of a byte buffer of given length. More...
uint16_t | CAPT_stuffSyncBytes (uint8_t *pBuffer, uint16_t ui16Length)
bool | CAPT_processReceivedData (tByteQueue *pReceiveQueue, tParameterPacket *pPacket, tTLProtocolProcessingVariables *pVariables)
tTLParameterAccessResult | CAPT_accessSensorParameter (tSensor **sensorArray, tParameterPacket *pPacket)
tTLParameterAccessResult | CAPT_accessSpecialSensorParameter (tSensor **sensorArray, tParameterPacket *pPacket)

## Detailed Description

Packet generator and interpretor for CapTIvate™ protocol.

Version
  VERSION Released on RELEASE_DATE

## Macro Definition Documentation

## § TL_PROTOCOL_SYNC

#define TL_PROTOCOL_SYNC (0x55)

CapTIvate™ Protocol Control Bytes.

def TL_PROTOCOL_SYNC defines the CapTIvate™ protocol sync byte def TL_PROTOCOL_BLANK defines a blanking byte. This can be anything other than the sync byte. def TL_PROTOCOL_READ defines the CapTIvate™ protocol read flag def TL_PROTOCOL_WRITE defines the CapTIvate™ protocol write flag

## § TL_PROTOCOL_BLANK

#define TL_PROTOCOL_BLANK (0xAA)

## § TL_PROTOCOL_READ

#define TL_PROTOCOL_READ (0x00)

## § TL_PROTOCOL_WRITE

#define TL_PROTOCOL_WRITE (0x01)

## § TL_SENSOR_PACKET_CMD

#define TL_SENSOR_PACKET_CMD (0x00)

## § TL_CYCLE_PACKET_CMD

#define TL_CYCLE_PACKET_CMD (0x01)

## § TL_TRACKPAD_PACKET_CMD

#define TL_TRACKPAD_PACKET_CMD (0x02)

## § TL_GENERAL_PURPOSE_PACKET_CMD

#define TL_GENERAL_PURPOSE_PACKET_CMD (0x10)

## § TL_STRING_PACKET_CMD

#define TL_STRING_PACKET_CMD (0x3E)

## § TL_PARAM_CMD_GENERIC_MASK

#define TL_PARAM_CMD_GENERIC_MASK (0x80)

## § TL_PARAM_CMD_SLIDER_WHEEL_MASK

#define TL_PARAM_CMD_SLIDER_WHEEL_MASK (0x90)

## § TL_PARAM_CMD_TP_MASK

#define TL_PARAM_CMD_TP_MASK (0xA0)

## § TL_PARAM_CMD_DYCAL_MASK

#define TL_PARAM_CMD_DYCAL_MASK (0xB0)

## § TL_PARAM_CMD_CTRL_MASK

#define TL_PARAM_CMD_CTRL_MASK (0xC0)

## § TL_PARAM_CMD_SPECIAL_MASK

#define TL_PARAM_CMD_SPECIAL_MASK (0xD0)

## § TL_PARAM_CMD_INVALID_MASK

#define TL_PARAM_CMD_INVALID_MASK (0xF0)

## § TL_PARAM_CMD_TRACKPADFILTEREN

#define TL_PARAM_CMD_TRACKPADFILTEREN (0x60)

## § TL_PARAM_CMD_TRACKPADFILTERBETA

#define TL_PARAM_CMD_TRACKPADFILTERBETA (0x61)

## § TL_PARAM_CMD_BETATOPSPEED

#define TL_PARAM_CMD_BETATOPSPEED (0x63)

## § TL_PARAM_CMD_BETABOTTOMSPEED

#define TL_PARAM_CMD_BETABOTTOMSPEED (0x64)

## § TL_PARAM_CMD_LOWERBETA

#define TL_PARAM_CMD_LOWERBETA (0x65)

## § TL_PARAM_CMD_TRACKPADFILTERTYPE

#define TL_PARAM_CMD_TRACKPADFILTERTYPE (0x66)

## § TL_PARAM_CMD_RESOLUTION_X

#define TL_PARAM_CMD_RESOLUTION_X (0x67)

## § TL_PARAM_CMD_RESOLUTION_Y

#define TL_PARAM_CMD_RESOLUTION_Y (0x68)

## § TL_PARAM_CMD_LOWERTRIM_X

#define TL_PARAM_CMD_LOWERTRIM_X (0x69)

## § TL_PARAM_CMD_UPPERTRIM_X

#define TL_PARAM_CMD_UPPERTRIM_X (0x6A)

## § TL_PARAM_CMD_LOWERTRIM_Y

#define TL_PARAM_CMD_LOWERTRIM_Y (0x6B)

## § TL_PARAM_CMD_UPPERTRIM_Y

#define TL_PARAM_CMD_UPPERTRIM_Y (0x6C)

## § TL_PARAM_CMD_CENTERTRIM_X

#define TL_PARAM_CMD_CENTERTRIM_X (0x6D)

## § TL_PARAM_CMD_CENTERTRIM_Y

#define TL_PARAM_CMD_CENTERTRIM_Y (0x6E)

## § TL_PARAM_CMD_CIRCLERADIUS

#define TL_PARAM_CMD_CIRCLERADIUS (0x6F)

## § TL_PARAM_CMD_TAPTIME_MIN

#define TL_PARAM_CMD_TAPTIME_MIN (0x70)

## § TL_PARAM_CMD_TAPTIME_MAX

#define TL_PARAM_CMD_TAPTIME_MAX (0x71)

## § TL_PARAM_CMD_SWIPETIME_MAX

#define TL_PARAM_CMD_SWIPETIME_MAX (0x72)

## § TL_PARAM_CMD_DBLTAPTIME_MAX

#define TL_PARAM_CMD_DBLTAPTIME_MAX (0x73)

## § TL_PARAM_CMD_TAPHOLDTIME_MIN

#define TL_PARAM_CMD_TAPHOLDTIME_MIN (0x74)

## § TL_PARAM_CMD_SWIPEDISTANCE_MIN

#define TL_PARAM_CMD_SWIPEDISTANCE_MIN (0x75)

## § TL_PARAM_CMD_DBLTAPENABLE

#define TL_PARAM_CMD_DBLTAPENABLE (0x76)

## § TL_PARAM_CMD_SWIPEENABLE

#define TL_PARAM_CMD_SWIPEENABLE (0x77)

## § TL_PARAM_CMD_CIRCLEENABLE

#define TL_PARAM_CMD_CIRCLEENABLE (0x78)

## § TL_PARAM_CMD_ENDTRACKPAD

#define TL_PARAM_CMD_ENDTRACKPAD (0x7F)

## § TL_PARAM_CMD_CONVERSIONGAIN

#define TL_PARAM_CMD_CONVERSIONGAIN (0x80)

## § TL_PARAM_CMD_CONVERSIONCOUNT

#define TL_PARAM_CMD_CONVERSIONCOUNT (0x81)

## § TL_PARAM_CMD_PROX_THRESH

#define TL_PARAM_CMD_PROX_THRESH (0x82)

## § TL_PARAM_CMD_TOUCH_THRESH

#define TL_PARAM_CMD_TOUCH_THRESH (0x83)

## § TL_PARAM_CMD_PROX_DBIN

#define TL_PARAM_CMD_PROX_DBIN (0x84)

## § TL_PARAM_CMD_PROX_DBOUT

#define TL_PARAM_CMD_PROX_DBOUT (0x85)

## § TL_PARAM_CMD_TOUCH_DBIN

#define TL_PARAM_CMD_TOUCH_DBIN (0x86)

## § TL_PARAM_CMD_TOUCH_DBOUT

#define TL_PARAM_CMD_TOUCH_DBOUT (0x87)

## § TL_PARAM_CMD_TIMEOUT

#define TL_PARAM_CMD_TIMEOUT (0x88)

## § TL_PARAM_CMD_COUNTFILTEN

#define TL_PARAM_CMD_COUNTFILTEN (0x89)

## § TL_PARAM_CMD_COUNTFILTBETA

#define TL_PARAM_CMD_COUNTFILTBETA (0x8A)

## § TL_PARAM_CMD_LTAFILTBETA

#define TL_PARAM_CMD_LTAFILTBETA (0x8B)

## § TL_PARAM_CMD_LTAFILTERHALT

#define TL_PARAM_CMD_LTAFILTERHALT (0x8C)

## § TL_PARAM_CMD_DRIFTRECALENABLE

#define TL_PARAM_CMD_DRIFTRECALENABLE (0x8D)

## § TL_PARAM_CMD_FORCERECALIBRATE

#define TL_PARAM_CMD_FORCERECALIBRATE (0x8E)

## § TL_PARAM_CMD_BIAS_CURRENT

#define TL_PARAM_CMD_BIAS_CURRENT (0x8F)

## § TL_PARAM_CMD_CS_DISCHARGE

#define TL_PARAM_CMD_CS_DISCHARGE (0x95)

## § TL_PARAM_CMD_MODENABLE

#define TL_PARAM_CMD_MODENABLE (0x96)

## § TL_PARAM_CMD_FREQDIV

#define TL_PARAM_CMD_FREQDIV (0x97)

## § TL_PARAM_CMD_CPLEN

#define TL_PARAM_CMD_CPLEN (0x98)

## § TL_PARAM_CMD_TPLEN

#define TL_PARAM_CMD_TPLEN (0x99)

## § TL_PARAM_CMD_ERROR_THRESH

#define TL_PARAM_CMD_ERROR_THRESH (0x9A)

## § TL_PARAM_CMD_NEG_TOUCH_THRESH

#define TL_PARAM_CMD_NEG_TOUCH_THRESH (0x9B)

## § TL_PARAM_CMD_IDLE_STATE

#define TL_PARAM_CMD_IDLE_STATE (0x9C)

## § TL_PARAM_CMD_INPUT_SYNC

#define TL_PARAM_CMD_INPUT_SYNC (0x9D)

## § TL_PARAM_CMD_TIMER_SYNC

#define TL_PARAM_CMD_TIMER_SYNC (0x9E)

## § TL_PARAM_CMD_LPMCTRL

#define TL_PARAM_CMD_LPMCTRL (0x9F)

## § TL_PARAM_CMD_LTA_SENSOR_PTHALT

#define TL_PARAM_CMD_LTA_SENSOR_PTHALT (0xA0)

## § TL_PARAM_CMD_LTA_ELEMENT_PTHALT

#define TL_PARAM_CMD_LTA_ELEMENT_PTHALT (0xA1)

## § TL_PARAM_CMD_COARSE_GAIN_RATIO

#define TL_PARAM_CMD_COARSE_GAIN_RATIO (0xA2)

## § TL_PARAM_CMD_FINE_GAIN_RATIO

#define TL_PARAM_CMD_FINE_GAIN_RATIO (0xA3)

## § TL_PARAM_CMD_OFFSET_SUBTRACTION

#define TL_PARAM_CMD_OFFSET_SUBTRACTION (0xA4)

## § TL_PARAM_CMD_OFFSET_SCALE

#define TL_PARAM_CMD_OFFSET_SCALE (0xD0)

## § TL_PARAM_CMD_OFFSET_LEVEL

#define TL_PARAM_CMD_OFFSET_LEVEL (0xD1)

## § TL_PARAM_CMD_SLIDER_FILTEREN

#define TL_PARAM_CMD_SLIDER_FILTEREN (0x90)

## § TL_PARAM_CMD_SLIDER_FILTERBETA

#define TL_PARAM_CMD_SLIDER_FILTERBETA (0x91)

## § TL_PARAM_CMD_SLIDER_RES

#define TL_PARAM_CMD_SLIDER_RES (0x92)

## § TL_PARAM_CMD_SLIDER_LTRIM

#define TL_PARAM_CMD_SLIDER_LTRIM (0x93)

## § TL_PARAM_CMD_SLIDER_UTRIM

#define TL_PARAM_CMD_SLIDER_UTRIM (0x94)

## § TL_PARAM_CMD_CTRL_ELEMENTTXEN

#define TL_PARAM_CMD_CTRL_ELEMENTTXEN (0xC0)

## § TL_PARAM_CMD_CTRL_SENSORTXEN

#define TL_PARAM_CMD_CTRL_SENSORTXEN (0xC1)

## § TL_PARAM_CMD_CTRL_REPORTRATE_ACTIVE

#define TL_PARAM_CMD_CTRL_REPORTRATE_ACTIVE (0xC2)

## § TL_PARAM_CMD_CTRL_REPORTRATE_AUTO

#define TL_PARAM_CMD_CTRL_REPORTRATE_AUTO (0xC3)

## § TL_PARAM_CMD_CTRL_WAKEINTERVAL_AUTO

#define TL_PARAM_CMD_CTRL_WAKEINTERVAL_AUTO (0xC4)

## § TL_PARAM_CMD_CTRL_TIMEOUT_ACTIVE

#define TL_PARAM_CMD_CTRL_TIMEOUT_ACTIVE (0xC5)

## § TL_PCKT_SERIAL_OVRHD_LENGTH

#define TL_PCKT_SERIAL_OVRHD_LENGTH (0x03)

CapTIvate™ Protocol Length Bytes.

def TL_PCKT_SERIAL_OVRHD_LENGTH specifies the serial overhead length. this includes the sync, blank, and length bytes (3). def TL_PCKT_CHKSUM_LENGTH defines the length of the checksum in bytes. def TL_CYCLE_STATE_OFFSET specifies the position of the state bytes in the real-time cycle data packet. def TL_CYCLE_STATE_LEN specifies the length of the state bytes in the real-time cycle data packet. def TL_CYCLE_LEN_PER_ELEMENT specifies the variable length component of the cycle packet (TL_CYCLE_LEN_PER_ELEMENT required per element). def TL_CYCLE_OVRHD_LEN defines the length of the cycle packet overhead. def TL_SENSOR_PACKET_LENGTH defines the length of the real-time sensor data packet def TL_PARAMETER_PACKET_LENGTH defines the length of the parameter packet def TL_PARAMETER_DATA_LENGTH defines the length of the data field in the parameter packet. def TL_GENERAL_PURPOSE_MAX_CNT defines the general purpose packet max data variable count def TL_STRING_MAX_CNT defines the string packet max byte count

## § TL_PCKT_CHKSUM_LENGTH

#define TL_PCKT_CHKSUM_LENGTH (0x02)

## § TL_CYCLE_STATE_OFFSET

#define TL_CYCLE_STATE_OFFSET (0x06)

## § TL_CYCLE_STATE_LEN

#define TL_CYCLE_STATE_LEN (0x03)

## § TL_CYCLE_LEN_PER_ELEMENT

#define TL_CYCLE_LEN_PER_ELEMENT (0x04)

## § TL_CYCLE_OVRHD_LEN

#define TL_CYCLE_OVRHD_LEN (0x06)

## § TL_SENSOR_PACKET_LENGTH

#define TL_SENSOR_PACKET_LENGTH (0x0B)

## § TL_PARAMETER_PACKET_LENGTH

#define TL_PARAMETER_PACKET_LENGTH (0x0C)

## § TL_PARAMETER_DATA_LENGTH

#define TL_PARAMETER_DATA_LENGTH (0x07)

## § TL_GENERAL_PURPOSE_MAX_CNT

#define TL_GENERAL_PURPOSE_MAX_CNT (0x1D)

## § TL_STRING_MAX_CNT

#define TL_STRING_MAX_CNT (0x3A)

## § TL_PCKT_CMD_FIELD

#define TL_PCKT_CMD_FIELD (0x03)

CapTIvate™ Protocol Field Offsets.

def TL_PCKT_CMD_FIELD is the packet offset of the command field. def TL_SENSOR_PCKT_ID_FIELD is the sensor packet offset of the ID field. def TL_CYCLE_PCKT_ID_FIELD is te cycle packet offset of the sensor ID field. def TL_CYCLE_PCKT_CYCLE_FIELD is the cycle packet offset of the cycle ID field. def TL_PARAM_PCKT_RW_FIELD is the parameter packet offset of the RW field. def TL_PARAM_PCKT_ID_FIELD is the parameter packet offset of the ID field.

## § TL_SENSOR_PCKT_ID_FIELD

#define TL_SENSOR_PCKT_ID_FIELD (0x04)

## § TL_CYCLE_PCKT_ID_FIELD

#define TL_CYCLE_PCKT_ID_FIELD (0x04)

## § TL_CYCLE_PCKT_CYCLE_FIELD

#define TL_CYCLE_PCKT_CYCLE_FIELD (0x05)

## § TL_PARAM_PCKT_RW_FIELD

#define TL_PARAM_PCKT_RW_FIELD (0x04)

## § TL_PARAM_PCKT_ID_FIELD

#define TL_PARAM_PCKT_ID_FIELD (0x05)

## § TL_TRACKPAD_PACKET_BASE_LENGTH

#define TL_TRACKPAD_PACKET_BASE_LENGTH (0x09)

Low level protocol packet builder for trackpad.

This function assembles trackpad packet The packet format is: CMD command byte SENSOR_ID sensor ID MAX_TOUCHES # touches supported (MAX = 1 for now) GESTURE gesture type X_POS_LSB first touch x-y X_POS_MSB Y_POS_LSB Y_POS_MSB X_POS_LSB second touch x-y X_POS_MSB Y_POS_LSB Y_POS_MSB ......... repeat for each supported touch

Parameters

  pSensor | is pointer to sensor structure
  ui8SensorID | is sensor's index in sensor table - see CAPT_UserConfig.c
  pBuffer | is pointer to buffer where packet will be placed

Returns
  None

## Typedef Documentation

## § tTLParameterAccessResult

typedef uint8_t tTLParameterAccessResult

## Enumeration Type Documentation

## § anonymous enum

anonymous enum

typedef tTLParameterAccessResult is a return type for the TL_Protocol_accessParameter API. It indicates to the application whether an incoming parameter packet was valid, invald, or requires the re-calibration of a sensor.

Enumerator
eInvalidSensor |
eInvalidCmd |
eValidCmd |
eValidCmdWithReCalibrate |

## Function Documentation

## § CAPT_accessTrackPadSensorParameter()

tTLParameterAccessResult CAPT_accessTrackPadSensorParameter | ( | tSensor ** | sensorArray,
|  | tParameterPacket * | pPacket
| ) |  |

Access a special CapTIvate™ TL structure variable for a TrackPad sensor.

Parameters

  sensorArray | is a pointer to the global array of sensor pointers.
  pPacket | is a pointer to the parameter packet containing the parameter to access.

Returns
  a tTLParameterAccessResult enumeration indicating whether the packet had a valid or invalid parameter, and whether a sensor re-calibration is required.

## § CAPT_getCyclePacket()

uint16_t CAPT_getCyclePacket | ( | tSensor ** | sensorArray,
|  | uint8_t | ui8SensorID,
|  | uint8_t | ui8Cycle,
|  | uint8_t * | pBuffer
| ) |  |

This API will build a packet to send one time cycle's worth of element information, conforming to the CapTIvate™ protocol. Information sent includes element touch/prox state, current count, and current LTA.

Parameters

  sensorArray | is a pointer to the global array of sensor pointers.
  ui8SensorID | indicates the ID of the sensor to build a packet for
  ui8Cycle | indicates the cycle in the sensor of interest
  pBuffer | is a pointer to buffer to place the packet in.

Returns
  the length of the packet that was build if a valid sensor was found, else 0.

## § CAPT_getSensorPacket()

uint16_t CAPT_getSensorPacket | ( | tSensor ** | sensorArray,
|  | uint8_t | ui8SensorID,
|  | uint8_t * | pBuffer
| ) |  |

This API will build a packet to send sensor state information, conforming to the CapTIvate™ protocol. Information sent includes dominant button, slider position, global sensor prox/prev touch

Parameters

  sensorArray | is a pointer to the global array of sensor pointers.
  ui8SensorID | indicates the ID of the sensor to build a packet for
  pBuffer | is a pointer to buffer to place the packet in.

Returns
  the length of the packet that was build if a valid sensor was found, else 0.

## § CAPT_getGeneralPurposePacket()

uint16_t CAPT_getGeneralPurposePacket | ( | uint16_t * | pData,
|  | uint8_t | ui8Cnt,
|  | uint8_t * | pBuffer
| ) |  |

This API will build a packet to send generic unsigned integers, conforming to the CapTIvate™ protocol. Up to 29 entries may be sent.

Parameters

  pData | is a pointer to the data to send.
  ui8Cnt | indicates the number of integers pointed to by pData.
  pBuffer | is a pointer to buffer to place the packet in.

Returns
  the length of the packet that was build if valid parameters were found, else 0.

## § CAPT_getStringPacket()

uint16_t CAPT_getStringPacket | ( | const char * | pSrcString,
|  | uint8_t * | pBuffer
| ) |  |

This API will build a packet to send a C character string, conforming to the CapTIvate™ protocol. Strings up to 58 characters are allowed in this protocol.

Parameters

  pSrcString | is the string to transmit.
  pBuffer | is a pointer to buffer to place the packet in.

Returns
  the length of the packet that was build if valid parameters were found, else 0.

## § CAPT_getTrackPadPacket()

uint16_t CAPT_getTrackPadPacket | ( | tSensor * | pSensor,
|  | uint8_t | ui8SensorID,
|  | uint8_t * | pBuffer
| ) |  |

This API will build a packet to send TrackPad sensor position and gesture information, conforming to the CapTIvate™ protocol. Information sent includes X,Y position and Gesture

Parameters

  sensorArray | is a pointer to the global array of sensor pointers.
  ui8SensorID | indicates the ID of the sensor to build a packet for
  pBuffer | is a pointer to buffer to place the packet in.

Returns
  the length of the packet that was build if a valid sensor was found, else 0.

## § CAPT_getTrackPadSensorStatusPacket()

uint16_t CAPT_getTrackPadSensorStatusPacket | ( | tSensor ** | sensorArray,
|  | uint8_t | ui8SensorID,
|  | uint8_t * | pBuffer
| ) |  |

This API will build a packet to send TrackPad sensor status information, conforming to the CapTIvate™ protocol. Information sent includes sensor status

Parameters

  sensorArray | is a pointer to the global array of sensor pointers.
  ui8SensorID | indicates the ID of the sensor to build a packet for
  pBuffer | is a pointer to buffer to place the packet in.

Returns
  the length of the packet that was build if a valid sensor was found, else 0.

## § CAPT_getChecksum()

uint16_t CAPT_getChecksum | ( | const uint8_t * | pBuffer,
|  | const uint16_t | ui16Length
| ) |  |

This API calculate the checksum of a byte buffer of given length.

Parameters

  pBuffer | is a pointer to buffer of bytes to calculate from.
  ui16Length | indicates the number of valid bytes in the buffer.

Returns
  the checksum of the buffer.

## § CAPT_verifyChecksum()

bool CAPT_verifyChecksum | ( | const uint8_t * | pBuffer,
|  | const uint16_t | ui16Length,
|  | const uint16_t | ui16Checksum
| ) |  |

This API verifies the checksum of a byte buffer of given length.

Parameters

  pBuffer | is a pointer to buffer of bytes to verify.
  ui16Length | indicates the number of valid bytes in the buffer.
  ui16Checksum | is the expected checksum to verify against.

Returns
  true of the checksum is valid, else false.

## § CAPT_stuffSyncBytes()

uint16_t CAPT_stuffSyncBytes | ( | uint8_t * | pBuffer,
|  | uint16_t | ui16Length
| ) |  |

This API parses a buffer and inserts stuffed bytes at each occurrence of the sync byte in the buffer, except the first position.

Parameters

  pBuffer | is a pointer to buffer of bytes to parse.
  ui16Length | indicates the number of valid bytes in the buffer.

Returns
  the new length of the buffer

## § CAPT_processReceivedData()

bool CAPT_processReceivedData | ( | tByteQueue * | pReceiveQueue,
|  | tParameterPacket * | pPacket,
|  | tTLProtocolProcessingVariables * | pVariables
| ) |  |

Parse incoming bytes from the low level serial driver, and identify valid CapTIvate™ packets to be processed. Stuffed bytes are removed here.

Parameters

  pReceiveQueue | is a pointer to the queue to pull incoming bytes from
  pPacket | is a pointer to the parameter packet to fill
  pVariables | is a pointer to the processing variable structure.

Returns
  true if a valid CapTIvate™ packet was found, else false.

## § CAPT_accessSensorParameter()

tTLParameterAccessResult CAPT_accessSensorParameter | ( | tSensor ** | sensorArray,
|  | tParameterPacket * | pPacket
| ) |  |

Access a CapTIvate™ TL structure variable for a given capacitive touch panel.

Parameters

  sensorArray | is a pointer to the global array of sensor pointers.
  pPacket | is a pointer to the parameter packet containing the parameter to access.

Returns
  a tTLParameterAccessResult enumeration indicating whether the packet had a valid or invalid parameter, and whether a sensor re-calibration is required.

## § CAPT_accessSpecialSensorParameter()

tTLParameterAccessResult CAPT_accessSpecialSensorParameter | ( | tSensor ** | sensorArray,
|  | tParameterPacket * | pPacket
| ) |  |

Access a special CapTIvate™ TL structure variable for a given capacitive touch panel.

Parameters

  sensorArray | is a pointer to the global array of sensor pointers.
  pPacket | is a pointer to the parameter packet containing the parameter to access.

Returns
  a tTLParameterAccessResult enumeration indicating whether the packet had a valid or invalid parameter, and whether a sensor re-calibration is required.

© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale