SLAU292G November 2009 – July 2015
The sources for the DLL are available in the eZ430-Chronos Windows package and can be found in C:\Program Files\Texas Instruments\eZ430-Chronos\Control Center\GUI Sources\DLL.
The eZ430-Chronos Windows DLL has been developed using Microsoft Visual C++ 2008 Express Edition. In order to rebuild the DLL file the Microsoft Visual Studio must be installed, since the registry enumeration code uses MFC functions. If Microsoft Visual Studio is not present, it is still possible to rebuild the DLL, but the "enumser" source code part needs to be removed from the project. Therefore, the BM_GetCOM() function won’t work anymore.
The DLL has two interface sections, one that exports standard C functions, and a second one exporting TCL-compliant functions. These TCL-compliant functions are used by the graphical user interface. Hence, when compiling the DLL, TCL needs to be present in the default directory (C:\Tcl); otherwise, the reference to the TCL libraries (tcl85.lib, tclstub85.lib) is invalid. If the DLL is compiled without the TCL interface, the respective source code file and the references to the TCL libraries must be deleted.
COM Port Management
Prior to any communication, the COM port where the RF access point is connected must be opened. The hardware is powered up immediately after the unit is connected. Some parts of the hardware require a startup time of several hundred milliseconds. As a result, any access to the hardware should not be done within one second after connecting the device.
NOTE
To address COM ports higher than COM9 in Windows, precede the "COMxx" string with the sequence "\\.\".
The COM port is opened with the following function:
bool BM_OpenCOM( char * strPortName,
DWORD dwBaudrate = 115200,
WORD wTimeout = 30,
bool bRTS = false,
bool bDTR = false);
Parameters
strPortName
Name of the COM port (for example, "\\.\COM11").
wTimeout
Time in milliseconds a reply to a command is expected; default value is 30 ms, should not be changed
dwBaudrate
Baudrate for the serial interface; default is 115200 Baud, should not be changed
bRTS
State of RTS line during normal operation; default is false (=GND), should not be changed
bDTR
State of DTR line during normal operation; default is false (=GND), should not be changed
Return Value
Returns true if COM port could be opened, otherwise returns false.
A successfully opened COM port must be closed when quitting the application to release all allocated memory and the port itself.
The COM port is closed with the following function:
void BM_CloseCOM(void);
This function checks the Windows registry for the friendly name "TI CC1111 Low-Power RF to USB CDC Serial Port" or "eZ430-ChronosAP" and returns the COM port number if the device was found.
bool BM_GetCOM(unsigned char& bPortNb);
Parameters
bPortNb
Number of the COM port (for example, „11")
Return Value
Returns true if device was found, otherwise returns false.
After power-up, the hardware is not automatically reset. Use the following function to initialize the RF access point hardware. This function can also be used during normal operation if an error condition was detected.
bool BM_Reset(void);
Return Value
Returns true if RF access point could be initialized successfully and false if the reset failed.
This command returns the current RF access point status.
bool BM_GetStatus(WORD& wStatus);
Parameters
wStatus
Current status of RF access point HW_IDLE, HW_SIMPLICITI_STOPPED, HW_SIMPLICITI_TRYING_TO_LINK, HW_SIMPLICITI_LINKED, HW_BLUEROBIN_STOPPED, HW_BLUEROBIN_TRANSMITTING, HW_ERROR, HW_NO_ERROR, HW_NOT_CONNECTED
Return Value
Returns true if command could be executed and false if the command execution failed.
BlueRobin Functions
This command sets the heart rate value that is transmitted in each BlueRobin packet.
bool BM_BR_SetHeartrate(WORD wHeartrate);
Parameters
wHeartrate
Heart rate in bpm
Return Value
Returns true if command could be executed and false if the command execution failed.
This command sets the transmitter ID for BlueRobin transmission.
bool BM_BR_SetID(DWORD dwID);
Parameters
dwID
24-bit transmitter ID
Return Value
Returns true if command could be executed and false if the command execution failed.
This command reads the transmitter ID for BlueRobin transmission.
bool BM_BR_GetID(DWORD& dwID);
Parameters
dwID
24-bit transmitter ID
Return Value
Returns true if command could be executed and false if the command execution failed.
This command starts the BlueRobin transmission.
bool BM_BR_Start(void);
Return Value
Returns true if command could be executed and false if the command execution failed.
This command stops the BlueRobin transmission.
bool BM_BR_Stop(void);
Return Value
Returns true if command could be executed and false if the command execution failed.
SimpliciTI Functions
This command starts SimpliciTI in acc/ppt mode.
bool BM_SPL_Start(void);
Return Value
Returns true if command could be executed and false if the command execution failed.
This command starts SimpliciTI in sync mode.
bool BM_SYNC_Start(void);
Return Value
Returns true if command could be executed and false if the command execution failed.
This command exits the SimpliciTI stack.
bool BM_SPL_Stop(void);
Return Value
Returns true if command could be executed and false if the command execution failed.
This command reads the received data from the RF access point buffer.
bool BM_SPL_GetData(DWORD& wData);
Parameters
wData
4 byte data (byte3, byte2, byte1, byte0)
byte3 = Acceleration value Z-axis
byte2 = Acceleration value Y-axis
byte1 = Acceleration value X-axis
byte0 = 0x11 → Left mouse click (acc mode)
byte0 = 0x21 → Left mouse double-click (acc mode)
byte0 = 0x31 → Right mouse click (acc mode)
byte0 = 0x12 → Button * (ppt mode)
byte0 = 0x22 → Button # (ppt mode)
byte0 = 0x32 → Button ↑ (ppt mode)
byte0 = 0xFF → Data has been read before
Return Value
Returns true if command could be executed and false if the command execution failed.
This command reads the buffer status during sync mode from the RF access point buffer.
bool BM_SYNC_GetBufferStatus(WORD& wStatus);
Parameters
wStatus
Buffer status
0 = Buffer empty
1 = Data available for download
Return Value
Returns true if command could be executed and false if the command execution failed.
This command reads the buffer content during sync mode.
bool BM_SYNC_ReadBuffer(BYTE * bData);
Parameters
bData
19-byte SimpliciTI data Packet content defined Chronos module sending routine
Return Value
Returns true if command could be executed and false if the command execution failed.
Wireless Update Functions
This command starts SimpliciTI in acc/ppt mode.
BR_COMM_API bool BM_WBSL_Start(void)
Return Value
Returns true if command could be executed and false if the command execution failed.
This command exits the SimpliciTI stack.
BR_COMM_API bool BM_WBSL_Stop(void)
Return Value
Returns true if command could be executed and false if the command execution failed.
This command reads the buffer status during sync mode from the RF access point buffer.
BR_COMM_API bool BM_WBSL_GetStatus(DWORD& wData)
Parameters
dwData
Status
1 = linking
2 = linked
4 = error
Return Value
Returns true if command could be executed and false if the command execution failed.
This command reads the buffer status during sync mode from the RF access point buffer.
BR_COMM_API bool BM_WBSL_Send_Data(BYTE * data, int len, DWORD& dwData)
Parameters
data
Pointer to byte array
len
Array length
dwData
Return value
Return Value
dwData = Length of last transmitted package.
This command reads the buffer status during sync mode from the RF access point buffer.
BR_COMM_API bool BM_WBSL_GetPacketStatus(DWORD& wData)
Return Value
dwData
0x80 = error
0x01 = disabled
0x02 = processing packet
0x04 = send info packet
0x08 = send new data packet