MSP430 DLL API Documentation
3.9.1.2
|
This file contains the Application Programming Interface (API) to access an MSP430 microcontroller via JTAG using the MSP430.DLL. This file contains the DLL function headers and definitions. More...
Go to the source code of this file.
Classes | |
union | DEVICE_T |
Device information structure. More... | |
Typedefs | |
typedef int32_t | STATUS_T |
this is the definition for the DLL functions return value More... | |
typedef enum STATUS_CODE | STATUS_CODE_t |
Status codes of the DLL functions. More... | |
typedef union DEVICE_T | DEVICE_T_t |
Device information structure. More... | |
typedef enum CPU_ARCH_TYPE | CPU_ARCH_TYPE_t |
typedef enum TARGET_ARCHITECTURE | TARGET_ARCHITECTURE_t |
typedef enum READ_WRITE | READ_WRITE_t |
typedef enum ENABLE_DISABLE | ENABLE_DISABLE_t |
typedef enum RESET_METHOD | RESET_METHOD_t |
Device reset methods. More... | |
typedef enum ERASE_TYPE | ERASE_TYPE_t |
FLASH erase type. More... | |
typedef enum CONFIG_MODE | CONFIG_MODE_t |
Configurations to set with MSP430_Configure. More... | |
typedef enum INTERFACE_TYPE | INTERFACE_TYPE_t |
Configurations values for CONFIG_MODE INTERFACE_MODE. More... | |
typedef enum INTERFACE_SPEED | INTERFACE_SPEED_t |
Configurations values for CONFIG_MODE INTERFACE_SPEED. More... | |
typedef enum FILE_TYPE | FILE_TYPE_t |
File types. More... | |
typedef enum ERROR_CODE | ERROR_CODE_t |
typedef enum SYSTEM_EVENT_MSP | SYSTEM_EVENT_MSP_t |
typedef void(* | SYSTEM_NOTIFY_CALLBACK )(SYSTEM_EVENT_MSP_t MySystemEvent) |
Functions | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_SET_SYSTEM_NOTIFY_CALLBACK (SYSTEM_NOTIFY_CALLBACK parSystemNotifyCallback) |
Initialize the SYSTEM NOTIFYCALLBACK. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_SetTargetArchitecture (TARGET_ARCHITECTURE_t architecture) |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_LoadDeviceDb (const char *file) |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_ClearDeviceDb () |
Remove all loaded devices from the device database. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_Initialize (const char *port, int32_t *version) |
Initialize the interface. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_Close (int32_t vccOff) |
Close the interface. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_GetJtagID (int32_t *JtagId) |
Deprecated. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_GetFoundDevice (uint8_t *FoundDevice, int32_t count) |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_OpenDevice (const char *Device, const char *Password, int32_t PwLength, int32_t DeviceCode, int32_t setId) |
Identify the device, and compare the found device to the expected device. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_Device (int32_t localDeviceId, uint8_t *buffer, int32_t count) |
Obtain the device information. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_Configure (int32_t mode, int32_t value) |
Configure the mode(s) of the device and/or the software. Possible configuration modes are covered by the enum CONFIG_MODE. See notes for details of different modes to be configured. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_VCC (int32_t voltage) |
Set the device Vcc pin to voltage/1000 volts. The USB JTAG adaptor also checks if external power is supplied to the traget device. If an external voltage is detected MSP430_VCC() returns STATUS_ERROR and one of the corresponding error codes. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_GetCurVCCT (int32_t *voltage) |
Report back the current voltage supplied to the target device. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_GetExtVoltage (int32_t *voltage, int32_t *state) |
Detect if external voltage is supplied to the target device. Report back the value of an external voltage as well as an corresponding state. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_Reset (int32_t method, int32_t execute, int32_t releaseJTAG) |
Reset the device using the specified method(s). Optionally start device execution, and release the JTAG control signals. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_Erase (int32_t type, int32_t address, int32_t length) |
Erase the device FLASH/FRAM memory. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_Memory (int32_t address, uint8_t *buffer, int32_t count, int32_t rw) |
Read and write the device memory. "Device memory" includes the Special Function Registers (i.e., peripheral registers), RAM, Information (FLASH/FRAM) memory, Bootstrap Loader memory (BLS) and Main (FLASH/FRAM) memory. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_Secure (void) |
The device is secured (i.e., the JTAG security fuse is blown). MSP-FET430UIF USB JTAG adaptor >>> DOES <<< support this feature. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_ReadOutFile (int32_t wStart, int32_t wLength, const char *lpszFileName, int32_t iFileType) |
Read the specified range of device memory, and write it to the specified file. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_ProgramFile (const char *File, int32_t eraseType, int32_t verifyMem) |
The contents of the specified file are input, and then written to the device. The device is optionally erased prior to being written. The device is optionally verified after being written. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_VerifyFile (const char *File) |
Compare the MSP430 memory and the contents of the specified file. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_VerifyMem (int32_t StartAddr, int32_t Length, const uint8_t *DataArray) |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_EraseCheck (int32_t StartAddr, int32_t Length) |
Verify that the specified memory range is erased. More... | |
DLL430_SYMBOL int32_t WINAPI | MSP430_Error_Number (void) |
Determine the number of the error when a MSP430_xxx() function returns STATUS_ERROR. More... | |
DLL430_SYMBOL const char *WINAPI | MSP430_Error_String (int32_t errorNumber) |
Determine the string associated with errorNumber. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_GetNumberOfUsbIfs (int32_t *Number) |
Returns the number of MSP-FET430UIF USB FETs connected to the PC system. More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_GetNameOfUsbIf (int32_t Idx, char **Name, int32_t *Status) |
Get the name of a Virtual Com Port (VCP), Human Interface Device (HID) or Communication Device Class (CDC) device index assigned to a certain MSP-FET430UIF USB FET. Also the status of the MSP-FET430UIF is returned (ENABLE/DISABLE). More... | |
DLL430_SYMBOL STATUS_T WINAPI | MSP430_GetInterface_Type (enum INTERFACE_TYPE *type) |
Determine the type of interface for the connection to the device. More... | |
This file contains the Application Programming Interface (API) to access an MSP430 microcontroller via JTAG using the MSP430.DLL. This file contains the DLL function headers and definitions.
The MSP430.DLL provides the following functionalities: - Initialize a selected JTAG interface (FET) - Setting target's supply voltage - Identifing a device - Programming/Erasing the identified device - Program/Erase check of device memory
typedef int32_t STATUS_T |
this is the definition for the DLL functions return value
typedef enum STATUS_CODE STATUS_CODE_t |
Status codes of the DLL functions.
typedef union DEVICE_T DEVICE_T_t |
Device information structure.
typedef enum CPU_ARCH_TYPE CPU_ARCH_TYPE_t |
typedef enum TARGET_ARCHITECTURE TARGET_ARCHITECTURE_t |
typedef enum READ_WRITE READ_WRITE_t |
typedef enum ENABLE_DISABLE ENABLE_DISABLE_t |
typedef enum RESET_METHOD RESET_METHOD_t |
Device reset methods.
typedef enum ERASE_TYPE ERASE_TYPE_t |
FLASH erase type.
typedef enum CONFIG_MODE CONFIG_MODE_t |
Configurations to set with MSP430_Configure.
typedef enum INTERFACE_TYPE INTERFACE_TYPE_t |
Configurations values for CONFIG_MODE INTERFACE_MODE.
typedef enum INTERFACE_SPEED INTERFACE_SPEED_t |
Configurations values for CONFIG_MODE INTERFACE_SPEED.
typedef enum FILE_TYPE FILE_TYPE_t |
File types.
typedef enum ERROR_CODE ERROR_CODE_t |
typedef enum SYSTEM_EVENT_MSP SYSTEM_EVENT_MSP_t |
typedef void(* SYSTEM_NOTIFY_CALLBACK)(SYSTEM_EVENT_MSP_t MySystemEvent) |
enum STATUS_CODE |
enum CPU_ARCH_TYPE |
enum TARGET_ARCHITECTURE |
enum READ_WRITE |
enum ENABLE_DISABLE |
enum RESET_METHOD |
Device reset methods.
enum ERASE_TYPE |
FLASH erase type.
enum CONFIG_MODE |
Configurations to set with MSP430_Configure.
Enumerator | |
---|---|
VERIFICATION_MODE |
Verify data downloaded to FLASH memories |
EMULATION_MODE |
4xx emulation mode |
LOCKED_FLASH_ACCESS |
Allows Locked Info Mem Segment A access (if set to '1') |
EDT_TRACE_MODE |
Trace mode in EDT file format |
INTERFACE_MODE |
Configure interface protocol: JTAG or Spy-bi-Wire (see enum INTERFACE_TYPE) |
SET_MDB_BEFORE_RUN |
Configure a value that will be placed on the devices' MemoryDataBus right before the device gets released from JTAG. Used for Software Breakpoints. |
RAM_PRESERVE_MODE |
Configure whether RAM content should be preserved/restored in MSP430_Erase() and MSP430_Memory() or not. RAM_PRESERVE_MODE is set to ENABLE by default. Usage Example for initial flash programming: (1) MSP430_Configure(RAM_PRESERVE_MODE, DISABLE); (2) MSP430_Erase(ERASE_ALL,..,..); (3) MSP430_Memory(..., ..., ..., WRITE ); (4) MSP430_Memory(..., ..., ..., READ ); ..... Flash Programming/Download finished (n) MSP430_Configure(RAM_PRESERVE_MODE, ENABLE); |
UNLOCK_BSL_MODE |
Configure the DLL to allow read/write/erase access to the 5xx Bootstrap Loader (BSL) memory segments. |
DEVICE_CODE | |
WRITE_EXTERNAL_MEMORY | |
DEBUG_LPM_X | |
SET_INTERFACE_SPEED | |
TOTAL_ERASE_DEVICE | |
ET_CURRENTDRIVE_FINE | |
SOFTWARE_BREAKPOINTS |
enum INTERFACE_TYPE |
Configurations values for CONFIG_MODE INTERFACE_MODE.
enum INTERFACE_SPEED |
enum FILE_TYPE |
enum ERROR_CODE |
enum SYSTEM_EVENT_MSP |
STATUS_T WINAPI MSP430_SET_SYSTEM_NOTIFY_CALLBACK | ( | SYSTEM_NOTIFY_CALLBACK | parSystemNotifyCallback) |
Initialize the SYSTEM NOTIFYCALLBACK.
parSystemNotifyCallback,: | To initialize the system notify callback an instance of the enum SYSTEM_EVENT_MSP must be provided to the set function. |
DLL430_SYMBOL STATUS_T WINAPI MSP430_SetTargetArchitecture | ( | TARGET_ARCHITECTURE_t | architecture) |
DLL430_SYMBOL STATUS_T WINAPI MSP430_LoadDeviceDb | ( | const char * | file) |
STATUS_T MSP430_ClearDeviceDb | ( | ) |
Remove all loaded devices from the device database.
STATUS_T MSP430_Initialize | ( | const char * | port, |
int32_t * | version | ||
) |
Initialize the interface.
port,: | Interface port reference (application specific).
|
version,: | The version number of the MSP430 DLL is returned (if version is not NULL). A value of -1 or -3 reports a version conflict between the Dll and USB FET f/w. In that case please refer to MSP430_FET_FwUpdate() on how to update the firmware of the MSP-FET430UIF. |
STATUS_T MSP430_Close | ( | int32_t | vccOff) |
Close the interface.
vccOff,: | Turn off the device Vcc (0 volts) if TRUE. |
STATUS_T MSP430_GetJtagID | ( | int32_t * | JtagId) |
Deprecated.
DLL430_SYMBOL STATUS_T WINAPI MSP430_GetFoundDevice | ( | uint8_t * | FoundDevice, |
int32_t | count | ||
) |
STATUS_T WINAPI MSP430_OpenDevice | ( | const char * | Device, |
const char * | Password, | ||
int32_t | PwLength, | ||
int32_t | DeviceCode, | ||
int32_t | setId | ||
) |
Identify the device, and compare the found device to the expected device.
Device,: | Device, which should be initialized |
Password,: | JTAG password to access JTAG |
PwLength,: | Password length in WORDS |
DeviceCode,: | Activation code for devices. Example: L092 or C092 |
setId,: | If setId is not DEVICE_UNKNOWN, the device is set to setId. Otherwise the device is determined. |
STATUS_T MSP430_Device | ( | int32_t | localDeviceId, |
uint8_t * | buffer, | ||
int32_t | count | ||
) |
Obtain the device information.
localDeviceId,: | An index (from zero) used to specify the device. |
buffer,: | A pointer to a buffer where the device identity and information is stored. See DEVICE_T for details. |
count,: | The number of bytes to return in the buffer (i.e., the buffer size). Must be at least sizeof(DEVICE_T) |
STATUS_T MSP430_Configure | ( | int32_t | mode, |
int32_t | value | ||
) |
Configure the mode(s) of the device and/or the software. Possible configuration modes are covered by the enum CONFIG_MODE. See notes for details of different modes to be configured.
mode,: | Mode (enum CONFIG_MODE) to be configured. See notes above for details. |
value,: | Mode value. |
STATUS_T MSP430_VCC | ( | int32_t | voltage) |
Set the device Vcc pin to voltage/1000 volts.
The USB JTAG adaptor also checks if external power is supplied to the traget device. If an external voltage is detected MSP430_VCC() returns STATUS_ERROR and one of the corresponding error codes.
voltage,: | The device Vcc pin is set to voltage/1000 volts. |
STATUS_T MSP430_GetCurVCCT | ( | int32_t * | voltage) |
Report back the current voltage supplied to the target device.
voltage,: | The current voltage supplied to the device. |
STATUS_T MSP430_GetExtVoltage | ( | int32_t * | voltage, |
int32_t * | state | ||
) |
Detect if external voltage is supplied to the target device. Report back the value of an external voltage as well as an corresponding state.
voltage,: | The current external voltage. |
state,: | External voltage can have one of the following states:
|
STATUS_T MSP430_Reset | ( | int32_t | method, |
int32_t | execute, | ||
int32_t | releaseJTAG | ||
) |
Reset the device using the specified method(s). Optionally start device execution, and release the JTAG control signals.
method,: | The bit mask specifying the method(s) to use to reset the device:
|
execute,: | Start device execution (when TRUE). |
releaseJTAG,: | Release the JTAG control signals (when TRUE). execute must be TRUE. |
STATUS_T MSP430_Erase | ( | int32_t | type, |
int32_t | address, | ||
int32_t | length | ||
) |
Erase the device FLASH/FRAM memory.
type,: | The type parameter specifies what should be erased.
|
address,: | Starting address of erase check operation. Must be word aligned. |
length,: | Length of erase check operation (even number of bytes). |
STATUS_T MSP430_Memory | ( | int32_t | address, |
uint8_t * | buffer, | ||
int32_t | count, | ||
int32_t | rw | ||
) |
Read and write the device memory. "Device memory" includes the Special Function Registers (i.e., peripheral registers), RAM, Information (FLASH/FRAM) memory, Bootstrap Loader memory (BLS) and Main (FLASH/FRAM) memory.
address,: | The starting address of the device memory to be read or written. |
buffer,: | The buffer into which device memory is read, or from which device memory is written. |
count,: | The number of bytes of device memory read or written. |
rw,: | Specify a read (READ) or write (WRITE) operation. |
STATUS_T MSP430_Secure | ( | void | ) |
The device is secured (i.e., the JTAG security fuse is blown).
MSP-FET430UIF USB JTAG adaptor >>> DOES <<< support this feature.
STATUS_T MSP430_ReadOutFile | ( | int32_t | wStart, |
int32_t | wLength, | ||
const char * | lpszFileName, | ||
int32_t | iFileType | ||
) |
Read the specified range of device memory, and write it to the specified file.
wStart,: | The starting address of the device memory to read. |
wLength,: | The length of the device memory to read (even number of bytes). |
lpszFileName,: | Pointer to the filename into which the read device memory is written. |
iFileType,: | The type of the file into which the read device memory is written:
|
STATUS_T MSP430_ProgramFile | ( | const char * | File, |
int32_t | eraseType, | ||
int32_t | verifyMem | ||
) |
The contents of the specified file are input, and then written to the device. The device is optionally erased prior to being written. The device is optionally verified after being written.
File,: | Pointer to filename. |
eraseType,: | Type of device erasure:
|
verifyMem,: | Verify the device if TRUE. |
STATUS_T MSP430_VerifyFile | ( | const char * | File) |
Compare the MSP430 memory and the contents of the specified file.
File,: | Pointer to filename. |
DLL430_SYMBOL STATUS_T WINAPI MSP430_VerifyMem | ( | int32_t | StartAddr, |
int32_t | Length, | ||
const uint8_t * | DataArray | ||
) |
STATUS_T MSP430_EraseCheck | ( | int32_t | StartAddr, |
int32_t | Length | ||
) |
Verify that the specified memory range is erased.
StartAddr,: | Start address of memory to be verified (must be even). |
Length,: | Number of BYTEs to be verified (must be even). |
STATUS_T MSP430_Error_Number | ( | void | ) |
Determine the number of the error when a MSP430_xxx() function returns STATUS_ERROR.
const char * MSP430_Error_String | ( | int32_t | errorNumber) |
Determine the string associated with errorNumber.
errorNumber,: | Error number. |
STATUS_T MSP430_GetNumberOfUsbIfs | ( | int32_t * | Number) |
Returns the number of MSP-FET430UIF USB FETs connected to the PC system.
Number,: | Return parameter. Number of MSP-FET430UIFs connected. |
STATUS_T MSP430_GetNameOfUsbIf | ( | int32_t | Idx, |
char ** | Name, | ||
int32_t * | Status | ||
) |
Get the name of a Virtual Com Port (VCP), Human Interface Device (HID) or Communication Device Class (CDC) device index assigned to a certain MSP-FET430UIF USB FET. Also the status of the MSP-FET430UIF is returned (ENABLE/DISABLE).
Idx,: | Zero based index to the name of a certain MSP-FET430UIF. Must be a value between 0 and 'number' returned by MSP430_GetNumberOfUsbIfs(); |
Name,: | Pointer to the MSP-FET430UIF's name string. |
Status,: | Status of the MSP-FET430UIF,
|
STATUS_T MSP430_GetInterface_Type | ( | enum INTERFACE_TYPE * | type) |
Determine the type of interface for the connection to the device.