MSP430™CapTIvateSoftwareLibraryAPIGuide 1_70_00_03

Macros | Functions
CAPT_Interface

This is the high-level communications interface module. More...

## Macros
#define | __CAPT_NO_INTERFACE__ (0)
| def CAPT_NO_INTERFACE disables the communications module. More...
#define | __CAPT_UART_INTERFACE__ (1)
#define | __CAPT_BULKI2C_INTERFACE__ (2)
#define | __CAPT_REGISTERI2C_INTERFACE__ (3)
#define | CAPT_TRANSMIT_BUFFER_SIZE (48)
#define | CAPT_QUEUE_BUFFER_SIZE (256)
| def CAPT_QUEUE_BUFFER_SIZE defines the size of the receive queue buffer. More...
#define | CAPT_I2C_RECEIVE_BUFFER_SIZE (32)
| def CAPT_REGISTER_I2C_BUFFER_SIZE defines the size of the I2C Rx buffer. More...
#define | CAPT_I2C_REGISTER_RW_BUFFER_SIZE (32)
#define | I2CSLAVE__REQ_POUT (P1OUT)
#define | I2CSLAVE__REQ_PDIR (P1DIR)
#define | I2CSLAVE__REQ_MASK (BIT1)

## Functions
void | CAPT_initCommInterface (tCaptivateApplication *pApp)
bool | CAPT_writeElementData (uint8_t ui8SensorID)
bool | CAPT_writeSensorData (uint8_t ui8SensorID)
bool | CAPT_writeGeneralPurposeData (uint16_t *pData, uint8_t ui8Cnt)
bool | CAPT_writeString (const char *pSrcString)
bool | CAPT_writeTrackPadSensorData (uint8_t ui8SensorID)
bool | CAPT_writeTrackPadSensorStatus (uint8_t ui8SensorID)
bool | CAPT_checkForInboundPacket (void)
bool | CAPT_checkForRecalibrationRequest (void)

## Detailed Description

This is the high-level communications interface module.

CAPT_CommConfig.h This file configures the Captivate COMM stack.

Version
  VERSION Released on RELEASE_DATE

These functions provide the interfaces between the application level, protocol layer, and the low-level serial interface.

Version
  VERSION Released on RELEASE_DATE

## Macro Definition Documentation

## § __CAPT_NO_INTERFACE__

#define __CAPT_NO_INTERFACE__ (0)

def CAPT_NO_INTERFACE disables the communications module.

def CAPT_UART_INTERFACE sets the interface to UART. def CAPT_BULKI2C_INTERFACE sets the interface to I2C Bulk. def CAPT_REGISTERI2C_INTERFACE sets the interface to I2C Register.

## § __CAPT_UART_INTERFACE__

#define __CAPT_UART_INTERFACE__ (1)

## § __CAPT_BULKI2C_INTERFACE__

#define __CAPT_BULKI2C_INTERFACE__ (2)

## § __CAPT_REGISTERI2C_INTERFACE__

#define __CAPT_REGISTERI2C_INTERFACE__ (3)

## § CAPT_TRANSMIT_BUFFER_SIZE

#define CAPT_TRANSMIT_BUFFER_SIZE (48)

def CAPT_TRANSMIT_BUFFER_SIZE defines the size of the transmit buffer. Note that 2x this size will be allocated, since ping-pong buffering is used. This should be at least 2x the size of the largest packet, to allow for byte stuffing.

## § CAPT_QUEUE_BUFFER_SIZE

#define CAPT_QUEUE_BUFFER_SIZE (256)

def CAPT_QUEUE_BUFFER_SIZE defines the size of the receive queue buffer.

## § CAPT_I2C_RECEIVE_BUFFER_SIZE

#define CAPT_I2C_RECEIVE_BUFFER_SIZE (32)

def CAPT_REGISTER_I2C_BUFFER_SIZE defines the size of the I2C Rx buffer.

## § CAPT_I2C_REGISTER_RW_BUFFER_SIZE

#define CAPT_I2C_REGISTER_RW_BUFFER_SIZE (32)

def CAPT_I2C_REGISTER_RW_BUFFER_SIZE defines the size of the I2C register mode working buffer.

## § I2CSLAVE__REQ_POUT

#define I2CSLAVE__REQ_POUT (P1OUT)

## § I2CSLAVE__REQ_PDIR

#define I2CSLAVE__REQ_PDIR (P1DIR)

## § I2CSLAVE__REQ_MASK

#define I2CSLAVE__REQ_MASK (BIT1)

## Function Documentation

## § CAPT_initCommInterface()

void CAPT_initCommInterface | ( | tCaptivateApplication * | pApp | ) |

Initialize TL communications as a whole. This API will start the low-level serial driver.

Parameters

  pApp | is a pointer to the application to link to

Returns
  none

Referenced by CAPT_initUI().

## § CAPT_writeElementData()

bool CAPT_writeElementData | ( | uint8_t | ui8SensorID | ) |

Transmit all element data for a given sensor.

Parameters

  ui8SensorID | indicates which sensor's data to transmit.

Returns
  true if data transmitting, else false.

Referenced by CAPT_updateUI().

## § CAPT_writeSensorData()

bool CAPT_writeSensorData | ( | uint8_t | ui8SensorID | ) |

Transmit all sensor-specific data for a given sensor.

Parameters

  ui8SensorID | indicates which sensor's data to transmit.

Returns
  true if data transmitting, else false.

Referenced by CAPT_updateUI().

## § CAPT_writeGeneralPurposeData()

bool CAPT_writeGeneralPurposeData | ( | uint16_t * | pData,
|  | uint8_t | ui8Cnt
| ) |  |

Transmit generic, unsigned integer formatted data for logging or plotting.

Parameters

  pData | is a pointer to the data to send.
  ui8Cnt | is the number of entries pointed to by pData; the max is 29.

Returns
  true if data transmitting, else false.

## § CAPT_writeString()

bool CAPT_writeString | ( | const char * | pSrcString | ) |

Transmit a C string.

Parameters

  pSrcString | is a pointer to the first character of the string to send. The string must be null terminated.

Returns
  true if data transmitting, else false.

## § CAPT_writeTrackPadSensorData()

bool CAPT_writeTrackPadSensorData | ( | uint8_t | ui8SensorID | ) |

Transmit TrackPad specific X,Y position and Gesture data.

Parameters

  ui8SensorID | indicates which sensor's data to transmit.

Returns
  true if data transmitting, else false.

Referenced by CAPT_updateUI().

## § CAPT_writeTrackPadSensorStatus()

bool CAPT_writeTrackPadSensorStatus | ( | uint8_t | ui8SensorID | ) |

Transmit TrackPad sensor status.

Parameters

  ui8SensorID | indicates which sensor's data to transmit.

Returns
  true if data transmitting, else false.

Referenced by CAPT_updateUI().

## § CAPT_checkForInboundPacket()

bool CAPT_checkForInboundPacket | ( | void |  | ) |

Call into the protocol layer to determine if any parameter packets have been received. THis API should be called periodically in the background by the application layer.

Parameters
  none

Returns
  true if packet received, else false.

## § CAPT_checkForRecalibrationRequest()

bool CAPT_checkForRecalibrationRequest | ( | void |  | ) |

Check if a sensor re-calibration was requested by the host.

Parameters
  none

Returns
  true if re-cal required, else false

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