Main Page | Data Structures | File List | Data Fields | Globals

MSP430_FET.h File Reference


Detailed Description

This file contains the DLL function headers and definitions to maintain the MSP-FET430UIF (TI USB FET) hardware and firmware.

Project:
MSP-FET430UIF (TI USB FET) Maintenance API
Developed using:
MS Visual C++ 2003/2010
Supported API calls:

Go to the source code of this file.

Typedefs

typedef void(* DLL430_FET_NOTIFY_FUNC )(UINT MsgId, ULONG wParam, ULONG lParam, LONG clientHandle)
 Type definition for a callback function which could handle notify messages sent by the DLL to the calling application during USB FET firmware update. A handle to the callback function is passed to the DLL by calling MSP430_FET_FwUpdate(). See enumeration UPDATE_STATUS_MESSAGES for details on possible notify messages.

typedef enum UPDATE_STATUS_MESSAGES UPDATE_STATUS_MESSAGES_t
 Status messages during USB FET firmware update.


Enumerations

enum  UPDATE_STATUS_MESSAGES {
  BL_INIT = 0,
  BL_ERASE_INT_VECTORS = 1,
  BL_ERASE_FIRMWARE = 2,
  BL_PROGRAM_FIRMWARE = 3,
  BL_DATA_BLOCK_PROGRAMMED = 4,
  BL_EXIT = 5,
  BL_UPDATE_DONE = 6,
  BL_UPDATE_ERROR = 7,
  BL_WAIT_FOR_TIMEOUT = 8
}
 Status messages during USB FET firmware update. More...


Functions

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_SelfTest (LONG count, BYTE *buffer)
 Call the hardware self test function of the USB JTAG adaptor.

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_SetSignals (LONG SigMask, LONG SigState)
 This function is only meant for testing.

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_Reset (void)
 Perform a reset of the USB JTAG adaptor's firmware.

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_I2C (LONG address, CHAR *buffer, LONG count, LONG rw)
 Read and write to EEPROM via I2C.

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_EnterBootloader (void)
 Enter the bootloader.

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_ExitBootloader (void)
 Exit the bootloader.

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_GetFwVersion (LONG *version)
 Returns the version number of the MSP430-FET430UIF USB FET firmware.

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_GetHwVersion (BYTE **version, LONG *count)
 Returns the version number of the MSP430-FET430UIF USB FET hardware.

DLL430_SYMBOL STATUS_T WINAPI MSP430_FET_FwUpdate (CHAR *lpszFileName, DLL430_FET_NOTIFY_FUNC callback, LONG clientHandle)
 Synchronizes the firmware version of the MSP-FET430UIF (TI USB FET) with the version of the Dll.


Typedef Documentation

typedef void(* DLL430_FET_NOTIFY_FUNC)(UINT MsgId, ULONG wParam, ULONG lParam, LONG clientHandle)
 

Type definition for a callback function which could handle notify messages sent by the DLL to the calling application during USB FET firmware update. A handle to the callback function is passed to the DLL by calling MSP430_FET_FwUpdate(). See enumeration UPDATE_STATUS_MESSAGES for details on possible notify messages.

typedef enum UPDATE_STATUS_MESSAGES UPDATE_STATUS_MESSAGES_t
 

Status messages during USB FET firmware update.


Enumeration Type Documentation

enum UPDATE_STATUS_MESSAGES
 

Status messages during USB FET firmware update.

Enumeration values:
BL_INIT  Initializing Update Bootloader
BL_ERASE_INT_VECTORS  Erasing mapped interrupt vectors
BL_ERASE_FIRMWARE  Erasing firmware memory section
BL_PROGRAM_FIRMWARE  Program new firmware
BL_DATA_BLOCK_PROGRAMMED  One data block of the new firmware was successfully programmed
BL_EXIT  Exit Update Bootlader and reboot firmware
BL_UPDATE_DONE  Update was successfully finished
BL_UPDATE_ERROR  An error occured during firmware update
BL_WAIT_FOR_TIMEOUT  An error occured during firmware update


Function Documentation

STATUS_T MSP430_FET_SelfTest LONG  count,
BYTE *  buffer
 

Call the hardware self test function of the USB JTAG adaptor.

Note:
1. MSP430_Initialize() must have been called prior to calling this function.
Parameters:
count: size of the buffer in bytes.
buffer: pointer to a memory buffer of at least count bytes.
Returns:
STATUS_OK: Hardware self test was executed successfully.
STATUS_ERROR: Hardware self test was not executed successfully.
Error codes:
COMM_ERR
SELFTEST_ERR

STATUS_T MSP430_FET_SetSignals LONG  SigMask,
LONG  SigState
 

This function is only meant for testing.

Note:
1. Not supported by MSP430.DLL v3
Parameters:
SigMask: mask of which signal to set/reset.
SigState: mask of the corresponding signal states.
Returns:
STATUS_OK: Signals were set/reset.
STATUS_ERROR: Signals were not set/reset.
Error codes:
COMM_ERR

STATUS_T MSP430_FET_Reset void   ) 
 

Perform a reset of the USB JTAG adaptor's firmware.

Note:
1. Not supported by MSP430.DLL v3

2. MSP430_Initialize() must have been called prior to calling this function.

Returns:
STATUS_OK: Firmware reset was performed.
STATUS_ERROR: Firmware reset was not performed.
Error codes:
COMM_ERR

STATUS_T MSP430_FET_I2C LONG  address,
CHAR *  buffer,
LONG  count,
LONG  rw
 

Read and write to EEPROM via I2C.

Note:
1. Not supported by MSP430.DLL v3

2. MSP430_Initialize() must have been called prior to calling this function.

Parameters:
address: The starting address of the EEPROM memory to be read or written.
buffer: The buffer into which EEPROM memory is read, or from which EEPROM memory is written.
count: The number of bytes of EEPROM memory read or written.
rw: Specify a read (READ) or write (WRITE) operation.
Returns:
STATUS_OK: The EEPROM operation encountered no errors.
STATUS_ERROR: The EEPROM operation encountered errors.
Error codes:
COMM_ERR

STATUS_T MSP430_FET_EnterBootloader void   ) 
 

Enter the bootloader.

Note:
1. Not supported by MSP430.DLL v3

2. MSP430_Initialize() must have been called prior to calling this function.

Returns:
STATUS_OK: The bootloader is active.
STATUS_ERROR: The bootloader could not be entered.
Error codes:
COMM_ERR

STATUS_T MSP430_FET_ExitBootloader void   ) 
 

Exit the bootloader.

Note:
1. Not supported by MSP430.DLL v3

2. MSP430_Initialize() must have been called prior to calling this function.

Returns:
STATUS_OK: The firmware is active.
STATUS_ERROR: Could not exit the bootloader.
Error codes:
COMM_ERR

STATUS_T MSP430_FET_GetFwVersion LONG *  version  ) 
 

Returns the version number of the MSP430-FET430UIF USB FET firmware.

Note:
1. MSP430_Initialize() must have been called prior to calling this function.
Parameters:
version: The version number of the MSP430-FET430UIF firmware is returned.
Returns:
STATUS_OK: Firmware version was returned.
STATUS_ERROR: Firmware version was NOT returned.
Error codes:
COMM_ERR
INTERFACE_SUPPORT_ERR
INTERNAL_ERR

STATUS_T WINAPI MSP430_FET_GetHwVersion BYTE **  version,
LONG *  count
 

Returns the version number of the MSP430-FET430UIF USB FET hardware.

Note:
1. MSP430_Initialize() must have been called prior to calling this function.
Parameters:
version: Pointer to version number buffer of the MSP430-FET430UIF is returned.
count: Number of valid bytes in the version number buffer is returned.
Desription of the Dll's internal hardware version buffer. The hardware revision of the MSP430-FET430UIF is retrieved internally by calling MSP430_Initialize(). MSP430 DLL stores the hardware revision number in a byte array. On calling MSP430_FET_GetHwVersion() a pointer to the internal buffer as well as the number of valid bytes in the buffer are returned. Current buffer implementation: [0] // designator letter: 'U' for USB FET, 'E' for eZ430 demo tool [1] // unused [2] // minor version number [3] // major version number

Returns:
STATUS_OK: Hardware version was returned.
STATUS_ERROR: Hardware version was NOT returned.
Error codes:
COMM_ERR
PARAMETER_ERR
INTERNAL_ERR
INTERFACE_SUPPORT_ERR

STATUS_T MSP430_FET_FwUpdate CHAR *  lpszFileName,
DLL430_FET_NOTIFY_FUNC  callback,
LONG  clientHandle
 

Synchronizes the firmware version of the MSP-FET430UIF (TI USB FET) with the version of the Dll.

Note:
1. MSP430_Initialize() must have been called prior to calling this function.

2. When calling MSP430_FET_FwUpdate() in response the MSP430_Initialize() returning a version of -3, the file CDC.log must exist in the directory of the executed binary and the content must be the string "True" without a newline. This file signals that a CDC driver is installed and prevents the update from making the MSP-FET430UIF unusable.

3. The actual firmware update of the MSP-FET430UIF might require a long time to finish. Therefore a callback mechanism was implemented to report back status information to the calling application during update operation.

4. Please have a look at the provided example application (UifUpdate) on how to apply this function!!!

Parameters:
lpszFileName: Pointer to a file of TI TXT or INTEL HEX format. It is recommended to call MSP430_FET_FwUpdate() with paramter lpszFileName set to NULL. In that case an internally stored firmware image will be used by MSP430.dll to perform the update. By following this recommondation you make sure that the MSP-FET430UIF interface gets updated with the correct firmware matching version number and features of the currently used MSP430.dll Library.
callback: Pointer to a callback function of the type DLL430_FET_NOTIFY_FUNC that might handle notify messages send by the DLL during firmware update. This parameter can be set to NULL if one does not want to use the callback mechanism.
clientHandle: Handle of the calling application. Can be set to FALSE in case the callback mechanism is not applied and parameter callback is set to NULL.
Returns:
STATUS_OK: Firmware update was done successfully.
STATUS_ERROR: Errors occured during firmware update.
Error codes:
COMM_ERR