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

MSP430_EEM.h File Reference


Detailed Description

This file contains the Application Programming Interface (API) to access the Enhanced Emulation Module (EEM) of a MSP430 device using the MSP430.DLL.

The DLL provides the following functionalities

Attention:
Since the DLL manages all the available HW resources itself it is not permitted to mix the old EEM API (EEM_Open(), EEM_Read(), EEM_Write()) with the functions provided via this header file. The old EEM API functions are only available for compatibility reasons. It is up to the caller to make use of the new or the old API. As soon as the new EEM API is initialized by MSP430_EEM_Init() functions of the old API are executed but will post a warning message as unexpected exceptions might occure. Integration support from Texas Instruments will only be given for the new API provided via this header file. Following functions MUST NOT be called any longer when EEM API is used:
Project:
MSP430 Enhanced Emulation Module (EEM) API
Developed using:
MS Visual C++ 2003/2010
Supported API calls:

Go to the source code of this file.

Data Structures

struct  MESSAGE_ID
 Event message identification structure: This structure contains the message identifications for the different event messages sent by the DLL. Events are sent by the DLL to inform the caller of a change of state (e.g. breakpoint hit) or to provide data to the caller. More...

struct  BREAKPOINT
 The breakpoint structure contains the settings which are required to set, modify or clear a breakpoint. More...

struct  TRACE_CTRL
 Trace parameter structure: The data structure contains the configuration settings of the EEM trace function. More...

struct  TRACE_BUFFER
 Trace buffer readout structure: The data structure is a copy of one position of the hardware trace buffer. They consist of data in a 40 bit buffer. The 40 bits are divided in 16 bit MAB, 16 bit MDB and 8 bit control signals. More...

struct  VARIABLE_WATCH
 Variable watch parameter structure: The data structure contains the settings of one variable. More...

struct  VAR_WATCH_RESOURCES
 Variable watch resource structure: The data structure contains the resources of one variable trigger. More...

struct  CLOCK_CONTROL
 Clock control parameter structure: The data structure contains the settings of the clock control features. More...

struct  SEQUENCER
 Sequencer parameter structure: The data structure contains the configuration settings of the sequencer. To select no trigger provide zero as handle. More...


Typedefs

typedef MESSAGE_ID MessageID_t
 Event message identification structure: This structure contains the message identifications for the different event messages sent by the DLL. Events are sent by the DLL to inform the caller of a change of state (e.g. breakpoint hit) or to provide data to the caller The type MessageID_t enables the caller of the function MSP430_EEM_Init(LONG lhWnd, MessageID_t* pMsgIdBuffer) to set dedicated message IDs for the different events. Using Windows user events normaly start at WM_USER (please refer to MSDN help).

typedef enum WarningCodes WarCode_t
 WarCode_t contains the warning codes that are sent as an event.

typedef enum BpMode BpMode_t
 BpMode_t gives the supported modes for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpType BpType_t
 BpType_t gives the supported types for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpAccess BpAccess_t
 BpAccess_t gives the supported access modes for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpAction BpAction_t
 BpAction_t gives the supported actions for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpOperat BpOperat_t
 BpOperat_t gives the supported comparison operators for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpRangeAction BpRangeAction_t
 BpRangeAction_t gives the supported range control for a range breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpCondition BpCondition_t
 BpCondition_t gives the exist condition for a complex breakpoint. Used inside the BREAKPOINT structure.

typedef BREAKPOINT BpParameter_t
 The breakpoint structure contains the settings which are required to set, modify or clear a breakpoint. The type BpParameter_t is used as a source parameter to the function MSP430_EEM_SetBreakpoint(WORD* pwBpHandle, BpParameter_t* pBpBuffer) and as a destination parameter to the function MSP430_EEM_GetBreakpoint(WORD wBpHandle, BpParameter_t* pBpDestBuffer).

typedef enum CbControl CbControl_t
 CbControl_t gives the supported control options for a combined breakpoint. Used in MSP430_EEM_SetCombineBreakpoint().

typedef enum TrControl TrControl_t
 Trace: Control.

typedef enum TrMode TrMode_t
 Trace: Mode.

typedef enum TrAction TrAction_t
 Trace: Action (ignored for collect data mode).

typedef TRACE_CTRL TrParameter_t
 Trace parameter structure: The data structure contains the configuration settings of the EEM trace function. The type TrParameter_t is used by the functions:

typedef TRACE_BUFFER TraceBuffer_t
 Trace buffer readout structure: The data structure is a copy of one position of the hardware trace buffer. They consist of data in a 40 bit buffer. The 40 bits are divided in 16 bit MAB, 16 bit MDB and 8 bit control signals. The type TraceBuffer_t is used by the function:

typedef enum VwEnable VwEnable_t
 Variable watch: Enable.

typedef enum VwControl VwControl_t
 Variable watch: Control.

typedef enum VwDataType VwDataType_t
 Variable watch: Data type of the variable (ignored for VW_CLEAR).

typedef VARIABLE_WATCH VwParameter_t
 Variable watch parameter structure: The data structure contains the settings of one variable. The type VwParameter_t is used by the function:

typedef VAR_WATCH_RESOURCES VwResources_t
 Variable watch resource structure: The data structure contains the resources of one variable trigger. The type VwResources_t is used as a array of 8 by the function:
  • MSP430_EEM_GetVariableWatch(BOOL* pbVwEnable, VwResouces_t* paVwDestBuffer) as a destination buffer for the variable watch settings.


typedef enum CcControl CcControl_t
 Clock control: Extended emulation.

typedef enum CcModule CcModule_t
 Clock control: Clock for selected modules switch off (logic AND operation) (only for extended clock control, else ignored).

typedef enum CcGeneralCLK CcGeneralCLK_t
 Clock control: Switch general clock off (logic AND operation).

typedef CLOCK_CONTROL CcParameter_t
 Clock control parameter structure: The data structure contains the settings of the clock control features. The type CcParameter_t is used by the functions:

typedef enum SeqControl SeqControl_t
 Sequencer: Control.

typedef enum SeqState SeqState_t
 Sequencer: Select next state when selected trigger occurs.

typedef SEQUENCER SeqParameter_t
 Sequencer parameter structure: The data structure contains the configuration settings of the sequencer. To select no trigger provide zero as handle. The type SeqParameter_t is used by the functions:

typedef void(* MSP430_EVENTNOTIFY_FUNC )(UINT MsgId, UINT wParam, LONG lParam, LONG clientHandle)
 Type definition for a callback function which must be available in the application which calls the MSP430.dll. The callback function handles notify events which are sent from the DLL to the calling application. A handle to the callback function is passed to the DLL by calling MSP430_EEM_Init().


Enumerations

enum  WarningCodes {
  WAR_CLR_COMBINE = 0,
  WAR_CLR_BP_COMBINE = 1,
  WAR_MOD_COMBINE = 2,
  WAR_RESET = 3,
  WAR_DIS_TR_TRIGGER = 4,
  WAR_EN_TR_TRIGGER = 5,
  WAR_EEM_THREAD_ACTIVE = 6,
  WAR_EEM_CONFLICT = 7
}
 WarCode_t contains the warning codes that are sent as an event. More...

enum  BpMode {
  BP_CLEAR = 0,
  BP_CODE = 1,
  BP_RANGE = 2,
  BP_COMPLEX = 3
}
 BpMode_t gives the supported modes for a breakpoint. Used inside the BREAKPOINT structure. More...

enum  BpType {
  BP_MAB = 0,
  BP_MDB = 1,
  BP_REGISTER = 2
}
 BpType_t gives the supported types for a breakpoint. Used inside the BREAKPOINT structure. More...

enum  BpAccess {
  BP_FETCH = 0,
  BP_FETCH_HOLD = 1,
  BP_NO_FETCH = 2,
  BP_DONT_CARE = 3,
  BP_NO_FETCH_READ = 4,
  BP_NO_FETCH_WRITE = 5,
  BP_READ = 6,
  BP_WRITE = 7,
  BP_NO_FETCH_NO_DMA = 8,
  BP_DMA = 9,
  BP_NO_DMA = 10,
  BP_WRITE_NO_DMA = 11,
  BP_NO_FETCH_READ_NO_DMA = 12,
  BP_READ_NO_DMA = 13,
  BP_READ_DMA = 14,
  BP_WRITE_DMA = 15
}
 BpAccess_t gives the supported access modes for a breakpoint. Used inside the BREAKPOINT structure. More...

enum  BpAction {
  BP_NONE = 0,
  BP_BRK = 1,
  BP_STO = 2,
  BP_BRK_STO = 3
}
 BpAction_t gives the supported actions for a breakpoint. Used inside the BREAKPOINT structure. More...

enum  BpOperat {
  BP_EQUAL = 0,
  BP_GREATER = 1,
  BP_LOWER = 2,
  BP_UNEQUAL = 3
}
 BpOperat_t gives the supported comparison operators for a breakpoint. Used inside the BREAKPOINT structure. More...

enum  BpRangeAction {
  BP_INSIDE = 0,
  BP_OUTSIDE = 1
}
 BpRangeAction_t gives the supported range control for a range breakpoint. Used inside the BREAKPOINT structure. More...

enum  BpCondition {
  BP_NO_COND = 0,
  BP_COND = 1
}
 BpCondition_t gives the exist condition for a complex breakpoint. Used inside the BREAKPOINT structure. More...

enum  CbControl {
  CB_SET = 0,
  CB_CLEAR = 1
}
 CbControl_t gives the supported control options for a combined breakpoint. Used in MSP430_EEM_SetCombineBreakpoint(). More...

enum  TrControl {
  TR_ENABLE = 0,
  TR_DISABLE = 1,
  TR_RESET = 2
}
 Trace: Control. More...

enum  TrMode {
  TR_HISTORY = 0,
  TR_FUTURE = 1,
  TR_SHOT = 2,
  TR_COLLECT = 3
}
 Trace: Mode. More...

enum  TrAction {
  TR_FETCH = 0,
  TR_ALL_CYCLE = 1
}
 Trace: Action (ignored for collect data mode). More...

enum  VwEnable {
  VW_ENABLE = 0,
  VW_DISABLE = 1
}
 Variable watch: Enable. More...

enum  VwControl {
  VW_SET = 0,
  VW_CLEAR = 1
}
 Variable watch: Control. More...

enum  VwDataType {
  VW_8 = 0,
  VW_16 = 1,
  VW_32 = 2
}
 Variable watch: Data type of the variable (ignored for VW_CLEAR). More...

enum  CcControl {
  CC_DISABLE = 0,
  CC_ENABLE = 1
}
 Clock control: Extended emulation. More...

enum  CcModule {
  CC_ALLRUN = 0,
  CC_WDT = (1 << 1),
  CC_TIMER_A = (1 << 2),
  CC_TIMER_B = (1 << 3),
  CC_BASIC_TIMER = (1 << 4),
  CC_LCD_FREQ = (1 << 5),
  CC_TIMER_COUNTER = (1 << 6),
  CC_TIMER_PORT = (1 << 7),
  CC_USART0 = (1 << 8),
  CC_USART1 = (1 << 9),
  CC_FLASH_CNTRL = (1 << 10),
  CC_ADC = (1 << 11),
  CC_ACLK = (1 << 12),
  CC_SMCLK = (1 << 13),
  CC_MCLK = (1 << 14)
}
 Clock control: Clock for selected modules switch off (logic AND operation) (only for extended clock control, else ignored). More...

enum  CcGeneralCLK {
  CC_STP_NONE = 0,
  CC_STP_ACLK = (1 << 1),
  CC_STP_SMCLK = (1 << 2),
  CC_STP_MCLK = (1 << 3),
  CC_STP_TACLK = (1 << 5)
}
 Clock control: Switch general clock off (logic AND operation). More...

enum  SeqControl {
  SEQ_DISABLE = 0,
  SEQ_ENABLE = 1
}
 Sequencer: Control. More...

enum  SeqState {
  SEQ_STATE0 = 0,
  SEQ_STATE1 = 1,
  SEQ_STATE2 = 2,
  SEQ_STATE3 = 3
}
 Sequencer: Select next state when selected trigger occurs. More...


Functions

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_Init (MSP430_EVENTNOTIFY_FUNC callback, LONG clientHandle, MessageID_t *pMsgIdBuffer)
 Initialisation to enable and use the functionality of the Enhanced Emulation Module (EEM). This function resets and intitializes the EEM.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetBreakpoint (WORD *pwBpHandle, BpParameter_t *pBpBuffer)
 This function is used to set, modify or clear breakpoints. A breakpoint handle is returned via the pointer pBpHandle. Is a cleared or modified breakpoint combined the combinations are updated and a warning message with the warning code and the combination handle will be sent.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetBreakpoint (WORD wBpHandle, BpParameter_t *pBpDestBuffer)
 This function reads back the settings of a breakpoint. No change or other action on the breakpoint is performed.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetCombineBreakpoint (CbControl_t CbControl, WORD wCount, WORD *pwCbHandle, WORD *pawBpHandle)
 This function sets or clears combinations of breakpoints. The parameter wCount includes the number of breakpoints to combine or clear. The breakpoint handles are delivered via the pointer pwBpHandle.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetCombineBreakpoint (WORD wCbHandle, WORD *pwCount, WORD *pawBpHandle)
 This function reads back the number and list of combined breakpoints.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetTrace (TrParameter_t *pTrBuffer)
 This function configures the EEM state storage feature to trace the selected information into the internal Trace buffer which has a depth of 8x40 bit (F449).

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetTrace (TrParameter_t *pTrDestBuffer)
 This function reads back the settings of a Trace Configuration Register. No change or other action on the trace is performed.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ReadTraceBuffer (TraceBuffer_t *pTraceBuffer)
 This function reads the content of the Trace Buffer of the EEM. No change or other action on the trace is performed.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ReadTraceData (TraceBuffer_t *pTraceBuffer, ULONG *pulCount)
 This function reads the content of the Trace Buffer of the EEM. No change or other action on the trace is performed.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_RefreshTraceBuffer (void)
 This function refreshes the content of the Trace Buffer of the EEM. No change or other action on the trace is performed.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetVariableWatch (VwEnable_t VwEnable)
 This function configures the EEM State Storage Module to work as a Real Time Monitor for a variable.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetVariable (WORD *pVwHandle, VwParameter_t *pVwBuffer)
 This function sets one variable to watch.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetVariableWatch (VwEnable_t *pVwEnable, VwResources_t *paVwDestBuffer)
 This function reads back the settings and the resources of the variable watch configuration.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetClockControl (CcParameter_t *pCcBuffer)
 This function configures the Clock Control settings of the EEM at emulation stop. It is possible to control the general clock signals (MCLK, SMCLK, ACLK) and the clock signals on extern pins. For devices with the extended clock control it is possible to control the clock for each module.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetClockControl (CcParameter_t *pCcDestBuffer)
 This function reads back the settings of the clock control. No change or other action on the settings is performed.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetSequencer (SeqParameter_t *pSeqBuffer)
 This function will be used to configure the trigger sequencer feature. When disabling the sequencer all further parameters will be ignored. For each state two of four different sequencer triggers can be set as condition to switch to two selectable states. To select no trigger provide zero as handle. The action trigger must be provided.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetSequencer (SeqParameter_t *pSeqDestBuffer)
 This function reads back the settings of the sequencer configuration. No change or other action on the sequencer is performed.

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ReadSequencerState (SeqState_t *pSeqState)
 Read out the state of the sequencer and store the result in the passed destination buffer.


Typedef Documentation

typedef struct MESSAGE_ID MessageID_t
 

Event message identification structure: This structure contains the message identifications for the different event messages sent by the DLL. Events are sent by the DLL to inform the caller of a change of state (e.g. breakpoint hit) or to provide data to the caller The type MessageID_t enables the caller of the function MSP430_EEM_Init(LONG lhWnd, MessageID_t* pMsgIdBuffer) to set dedicated message IDs for the different events. Using Windows user events normaly start at WM_USER (please refer to MSDN help).

typedef enum WarningCodes WarCode_t
 

WarCode_t contains the warning codes that are sent as an event.

typedef enum BpMode BpMode_t
 

BpMode_t gives the supported modes for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpType BpType_t
 

BpType_t gives the supported types for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpAccess BpAccess_t
 

BpAccess_t gives the supported access modes for a breakpoint. Used inside the BREAKPOINT structure.

The following table shows the relation of the access mode to the signals Fetch, R/W and DMA.

Fetch | R/W | DMA BP_FETCH: Instuction fetch 1 | (R) | (0) BP_FETCH_HOLD: Instruction fetch hold 1 | (R) | (0) BP_NO_FETCH: No instruction fetch 0 | X | X 1 | X | 1 BP_DONT_CARE: Don't care X | X | X BP_NO_FETCH_READ: No intruction fetch & read 0 | R | X 1 | R | 1 BP_NO_FETCH_WRITE: No instruction fetch & write X | W | X BP_READ: Read X | R | X BP_WRITE: Write X | W | X BP_NO_FETCH_NO_DMA: No intruction fetch & no DMA access 0 | X | 0 BP_DMA: DMA access (read or write) X | X | 1 BP_NO_DMA: No DMA access X | X | 0 BP_WRITE_NO_DMA: Write & no DMA access X | W | 0 BP_NO_FETCH_READ_NO_DMA: No instruction fetch & read & no DMA access 0 | R | 0 BP_READ_NO_DMA: Read & no DMA access X | R | 0 BP_READ_DMA: Read & DMA access X | R | 1 BP_WRITE_DMA: Write & DMA access X | W | 1

typedef enum BpAction BpAction_t
 

BpAction_t gives the supported actions for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpOperat BpOperat_t
 

BpOperat_t gives the supported comparison operators for a breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpRangeAction BpRangeAction_t
 

BpRangeAction_t gives the supported range control for a range breakpoint. Used inside the BREAKPOINT structure.

typedef enum BpCondition BpCondition_t
 

BpCondition_t gives the exist condition for a complex breakpoint. Used inside the BREAKPOINT structure.

typedef struct BREAKPOINT BpParameter_t
 

The breakpoint structure contains the settings which are required to set, modify or clear a breakpoint. The type BpParameter_t is used as a source parameter to the function MSP430_EEM_SetBreakpoint(WORD* pwBpHandle, BpParameter_t* pBpBuffer) and as a destination parameter to the function MSP430_EEM_GetBreakpoint(WORD wBpHandle, BpParameter_t* pBpDestBuffer).

typedef enum CbControl CbControl_t
 

CbControl_t gives the supported control options for a combined breakpoint. Used in MSP430_EEM_SetCombineBreakpoint().

typedef enum TrControl TrControl_t
 

Trace: Control.

typedef enum TrMode TrMode_t
 

Trace: Mode.

typedef enum TrAction TrAction_t
 

Trace: Action (ignored for collect data mode).

typedef struct TRACE_CTRL TrParameter_t
 

Trace parameter structure: The data structure contains the configuration settings of the EEM trace function. The type TrParameter_t is used by the functions:

typedef struct TRACE_BUFFER TraceBuffer_t
 

Trace buffer readout structure: The data structure is a copy of one position of the hardware trace buffer. They consist of data in a 40 bit buffer. The 40 bits are divided in 16 bit MAB, 16 bit MDB and 8 bit control signals. The type TraceBuffer_t is used by the function:

typedef enum VwEnable VwEnable_t
 

Variable watch: Enable.

typedef enum VwControl VwControl_t
 

Variable watch: Control.

typedef enum VwDataType VwDataType_t
 

Variable watch: Data type of the variable (ignored for VW_CLEAR).

typedef struct VARIABLE_WATCH VwParameter_t
 

Variable watch parameter structure: The data structure contains the settings of one variable. The type VwParameter_t is used by the function:

typedef struct VAR_WATCH_RESOURCES VwResources_t
 

Variable watch resource structure: The data structure contains the resources of one variable trigger. The type VwResources_t is used as a array of 8 by the function:

  • MSP430_EEM_GetVariableWatch(BOOL* pbVwEnable, VwResouces_t* paVwDestBuffer) as a destination buffer for the variable watch settings.

typedef enum CcControl CcControl_t
 

Clock control: Extended emulation.

typedef enum CcModule CcModule_t
 

Clock control: Clock for selected modules switch off (logic AND operation) (only for extended clock control, else ignored).

typedef enum CcGeneralCLK CcGeneralCLK_t
 

Clock control: Switch general clock off (logic AND operation).

Note:
This function does influence the module clock control.
If the general clock is not stop it could not be stopped at the module

typedef struct CLOCK_CONTROL CcParameter_t
 

Clock control parameter structure: The data structure contains the settings of the clock control features. The type CcParameter_t is used by the functions:

typedef enum SeqControl SeqControl_t
 

Sequencer: Control.

typedef enum SeqState SeqState_t
 

Sequencer: Select next state when selected trigger occurs.

typedef struct SEQUENCER SeqParameter_t
 

Sequencer parameter structure: The data structure contains the configuration settings of the sequencer. To select no trigger provide zero as handle. The type SeqParameter_t is used by the functions:

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

Type definition for a callback function which must be available in the application which calls the MSP430.dll. The callback function handles notify events which are sent from the DLL to the calling application. A handle to the callback function is passed to the DLL by calling MSP430_EEM_Init().


Enumeration Type Documentation

enum WarningCodes
 

WarCode_t contains the warning codes that are sent as an event.

Enumeration values:
WAR_CLR_COMBINE  Combination removed.
WAR_CLR_BP_COMBINE  Breakpoint removed from combination.
WAR_MOD_COMBINE  Properties of combination changed.
WAR_RESET  Reset device.
WAR_DIS_TR_TRIGGER  Trace trigger action is disabled and stored.
WAR_EN_TR_TRIGGER  Stored trace trigger action is enabled.
WAR_EEM_THREAD_ACTIVE  Polling thread is active - function call not allowed at the moment.
WAR_EEM_CONFLICT  forbidden old API call

enum BpMode
 

BpMode_t gives the supported modes for a breakpoint. Used inside the BREAKPOINT structure.

Enumeration values:
BP_CLEAR  Clear breakpoint.
BP_CODE  Set code breakpoint.
BP_RANGE  Set range breakpoint.
BP_COMPLEX  Set complex breakpoint.

enum BpType
 

BpType_t gives the supported types for a breakpoint. Used inside the BREAKPOINT structure.

Enumeration values:
BP_MAB  Set MAB breakpoint.
BP_MDB  Set MDB breakpoint.
BP_REGISTER  Set register breakpoint.

enum BpAccess
 

BpAccess_t gives the supported access modes for a breakpoint. Used inside the BREAKPOINT structure.

The following table shows the relation of the access mode to the signals Fetch, R/W and DMA.

Fetch | R/W | DMA BP_FETCH: Instuction fetch 1 | (R) | (0) BP_FETCH_HOLD: Instruction fetch hold 1 | (R) | (0) BP_NO_FETCH: No instruction fetch 0 | X | X 1 | X | 1 BP_DONT_CARE: Don't care X | X | X BP_NO_FETCH_READ: No intruction fetch & read 0 | R | X 1 | R | 1 BP_NO_FETCH_WRITE: No instruction fetch & write X | W | X BP_READ: Read X | R | X BP_WRITE: Write X | W | X BP_NO_FETCH_NO_DMA: No intruction fetch & no DMA access 0 | X | 0 BP_DMA: DMA access (read or write) X | X | 1 BP_NO_DMA: No DMA access X | X | 0 BP_WRITE_NO_DMA: Write & no DMA access X | W | 0 BP_NO_FETCH_READ_NO_DMA: No instruction fetch & read & no DMA access 0 | R | 0 BP_READ_NO_DMA: Read & no DMA access X | R | 0 BP_READ_DMA: Read & DMA access X | R | 1 BP_WRITE_DMA: Write & DMA access X | W | 1
Enumeration values:
BP_FETCH  Instuction fetch.
BP_FETCH_HOLD  Instruction fetch & hold trigger.
BP_NO_FETCH  No instruction fetch.
BP_DONT_CARE  Don't care.
BP_NO_FETCH_READ  No intruction fetch & read.
BP_NO_FETCH_WRITE  No instruction fetch & write.
BP_READ  Read.
BP_WRITE  Write.
BP_NO_FETCH_NO_DMA  No intruction fetch & no DMA access.
BP_DMA  DMA access (read or write).
BP_NO_DMA  No DMA access.
BP_WRITE_NO_DMA  Write & no DMA access.
BP_NO_FETCH_READ_NO_DMA  No instruction fetch & read & no DMA access.
BP_READ_NO_DMA  Read & no DMA access.
BP_READ_DMA  Read & DMA access.
BP_WRITE_DMA  Write & DMA access.

enum BpAction
 

BpAction_t gives the supported actions for a breakpoint. Used inside the BREAKPOINT structure.

Enumeration values:
BP_NONE  No action on trigger (necessary for sequencer mechanism).
BP_BRK  Break on trigger.
BP_STO  Trigger state storage (trace mechnism) on trigger.
BP_BRK_STO  Break and trigger state storage on trigger.

enum BpOperat
 

BpOperat_t gives the supported comparison operators for a breakpoint. Used inside the BREAKPOINT structure.

Enumeration values:
BP_EQUAL  Address/value equal MAB/MDB.
BP_GREATER  Address/value greater MAB/MDB.
BP_LOWER  Address/value lower MAB/MDB.
BP_UNEQUAL  Address/value unequal MAB/MDB.

enum BpRangeAction
 

BpRangeAction_t gives the supported range control for a range breakpoint. Used inside the BREAKPOINT structure.

Enumeration values:
BP_INSIDE  Inside range.
BP_OUTSIDE  Outside range.

enum BpCondition
 

BpCondition_t gives the exist condition for a complex breakpoint. Used inside the BREAKPOINT structure.

Enumeration values:
BP_NO_COND  No condition available.
BP_COND  Condition available.

enum CbControl
 

CbControl_t gives the supported control options for a combined breakpoint. Used in MSP430_EEM_SetCombineBreakpoint().

Enumeration values:
CB_SET  Combines two or several available breakpoints.
CB_CLEAR  Clears existing combination of two or several breakpoints.

enum TrControl
 

Trace: Control.

Enumeration values:
TR_ENABLE  Enable state storage.
TR_DISABLE  Disable state storage.
TR_RESET  Reset state storage.

enum TrMode
 

Trace: Mode.

Enumeration values:
TR_HISTORY  Trigger stops the Trace.
TR_FUTURE  Trigger starts the Trace - stops if buffer is full.
TR_SHOT  Start immediately - stops if buffer is full.
TR_COLLECT  Collect data only at trigger event - stops if buffer is full.

enum TrAction
 

Trace: Action (ignored for collect data mode).

Enumeration values:
TR_FETCH  Trace information only at instruction Fetch.
TR_ALL_CYCLE  Trace information on all MCLK clocks.

enum VwEnable
 

Variable watch: Enable.

Enumeration values:
VW_ENABLE  Enable the variable watch function.
VW_DISABLE  Disable the variable watch function.

enum VwControl
 

Variable watch: Control.

Enumeration values:
VW_SET  Set a variable to watch.
VW_CLEAR  Clear a watched variable.

enum VwDataType
 

Variable watch: Data type of the variable (ignored for VW_CLEAR).

Enumeration values:
VW_8  Byte.
VW_16  Word.
VW_32  Long.

enum CcControl
 

Clock control: Extended emulation.

Enumeration values:
CC_DISABLE  Disable.
CC_ENABLE  Enable.

enum CcModule
 

Clock control: Clock for selected modules switch off (logic AND operation) (only for extended clock control, else ignored).

Enumeration values:
CC_ALLRUN  All module clocks are running on emualtion halt.
CC_WDT  Stop clock for Watch Dog Timer on emualtion halt.
CC_TIMER_A  Stop clock for TimerA on emualtion halt.
CC_TIMER_B  Stop clock for TimerB on emualtion halt.
CC_BASIC_TIMER  Stop clock for Basic Timer on emualtion halt.
CC_LCD_FREQ  Stop clock for LCD frequency on emualtion halt.
CC_TIMER_COUNTER  Stop clock for 8 bit Timer/Counter on emualtion halt.
CC_TIMER_PORT  Stop clock for Timer Port on emualtion halt.
CC_USART0  Stop clock for USART0 on emualtion halt.
CC_USART1  Stop clock for USART1 on emualtion halt.
CC_FLASH_CNTRL  Stop clock for Flash Control on emualtion halt.
CC_ADC  Stop clock for ADC on emualtion halt.
CC_ACLK  Stop ACLK on extern pin on emualtion halt.
CC_SMCLK  Stop SMCLK on extern pin on emualtion halt.
CC_MCLK  Stop MCLK on extern pin on emualtion halt.

enum CcGeneralCLK
 

Clock control: Switch general clock off (logic AND operation).

Note:
This function does influence the module clock control.
If the general clock is not stop it could not be stopped at the module
Enumeration values:
CC_STP_NONE  All general clocks running on emulation halt.
CC_STP_ACLK  Stop ACLK on emulation halt.
CC_STP_SMCLK  Stop SMCLK on emulation halt.
CC_STP_MCLK  Stop MCLK on emulation halt (not for extended clock control).
CC_STP_TACLK  Stop TACLK on emulation halt (only for standard clock control).

enum SeqControl
 

Sequencer: Control.

Enumeration values:
SEQ_DISABLE  Disable sequencer state machine.
SEQ_ENABLE  Enable sequencer state machine.

enum SeqState
 

Sequencer: Select next state when selected trigger occurs.

Enumeration values:
SEQ_STATE0  Switch in state 0.
SEQ_STATE1  Switch in state 1.
SEQ_STATE2  Switch in state 2.
SEQ_STATE3  Switch in state 3.


Function Documentation

STATUS_T WINAPI MSP430_EEM_Init MSP430_EVENTNOTIFY_FUNC  callback,
LONG  clientHandle,
MessageID_t pMsgIdBuffer
 

Initialisation to enable and use the functionality of the Enhanced Emulation Module (EEM). This function resets and intitializes the EEM.

Note:
1. MSP430_OpenDevice() has to be called prior to this function

2. This function initializes the EEM API. By calling this function you are no longer allowed to call the following functions of the old EEM API:

  • MSP430_Breakpoint()
  • MSP430_EEM_Open()
  • MSP430_EEM_Read_Register()
  • MSP430_EEM_Read_Register_Test()
  • MSP430_EEM_Write_Register()
    The following functions can still be used with restrictions (see function documentation for details):
  • MSP430_State()
  • MSP430_Configure()
    All of these functions will post an according warning message.
Parameters:
callback: Pointer to the callback function of the calling application. (see type definition MSP430_EVENTNOTIFY_FUNC)
clientHandle: A handle to the calling application.
pMsgIdBuffer: Pointer to buffer of event message identifications (MessageID_t).
Sample Client Code: a) Client’s callback function static LONG my_handle; void MY_MSP430_EVENTNOTIFY_FUNC( UINT MsgId, UINT wParam, LONG lParam, LONG clientHandle) { if(clientHandle == my_handle) { switch(MsgId) { // client’s handling code } } } b) Client’s main int main(int argc, char** argv) { // do msp430 init MessageID_t MsgIds; pMSP430DLL->MSP430_EEM_Init( MY_MSP430_EVENTNOTIFY_FUNC, my_handle, &MsgIds); // do msp430 operations return 0; }

Returns:
STATUS_OK: EEM initialized

STATUS_ERROR: EEM not initialized

Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
EEM_INIT_ERR
THREAD_ERR

STATUS_T WINAPI MSP430_EEM_SetBreakpoint WORD *  pwBpHandle,
BpParameter_t pBpBuffer
 

This function is used to set, modify or clear breakpoints. A breakpoint handle is returned via the pointer pBpHandle. Is a cleared or modified breakpoint combined the combinations are updated and a warning message with the warning code and the combination handle will be sent.

Note:
MSP430_EEM_Init() have to be called prior to this function

A breakpoint with instruction fetch access set on odd address N will be set on even address N-1.

Parameters:
pwBpHandle: Pointer to the assigned breakpoint handle (return parameter). The assigned handle is an arbitrary selected name of the breakpoint. To set a combination the value pointed to (breakpoint handle) must be zero. In case of clearing or modifying a breakpoint the handle of the breakpoint has to be provided here. If a cleared or modified breakpoint is combined with another breakpoint the combination will be updated or removed.
pBpBuffer: Pointer to breakpoint parameters (BREAKPOINT).
Returns:
STATUS_OK: breakpoint configured or cleared

STATUS_ERROR: breakpoint configured or cleared error

Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
PARAMETER_ERR
BREAKPOINT_ERR
CLR_SEQ_TRIGGER

STATUS_T WINAPI MSP430_EEM_GetBreakpoint WORD  wBpHandle,
BpParameter_t pBpDestBuffer
 

This function reads back the settings of a breakpoint. No change or other action on the breakpoint is performed.

Note:
Observe the size of the destination buffer as a type of the structure BREAKPOINT

MSP430_EEM_Init() must have been called prior to this function

Parameters:
wBpHandle: Handle of the breakpoint to read back
pBpDestBuffer: Pointer of the destination structure (BREAKPOINT)
Returns:
STATUS_OK: breakpoint settings provided

STATUS_ERROR: breakpoint settings not provided.

Error codes:
PARAMETER_ERR

STATUS_T WINAPI MSP430_EEM_SetCombineBreakpoint CbControl_t  CbControl,
WORD  wCount,
WORD *  pwCbHandle,
WORD *  pawBpHandle
 

This function sets or clears combinations of breakpoints. The parameter wCount includes the number of breakpoints to combine or clear. The breakpoint handles are delivered via the pointer pwBpHandle.

Note:
MSP430_EEM_Init() must have been called prior to this function
Parameters:
CbControl: Set/clear breakpoint combination (see enumeration CbControl)
wCount: Number of breakpoints to combine (ignored for clear combination)
pwCbHandle: Pointer to the assigned combination handle (return parameter). The assigned handle is an arbitrary selected name of the combination. To set a combination the value pointed to (combine handle) must be zero. In case of clearing or modifying a combination the handle of the combination has to be provided here.
pawBpHandle: Pointer to array that includes the breakpoint handles to set a combination and in case of clearing a combination the handles of the combined breakpoints will be returned here. To set a breakpoint combination the hardware resources and with it the action of the first breakpoint handle in the list on pwBpHandle are used. So this breakpoint can't be used as a separate and independent breakpoint unlike the following breakpoints that are provided in the list on pwBpHandle.
Returns:
STATUS_OK: breakpoints combined/combination cleared

STATUS_ERROR: breakpoints combined/combination cleared error

Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
PARAMETER_ERR
CLR_SEQ_TRIGGER
SET_SEQ_TRIGGER

STATUS_T WINAPI MSP430_EEM_GetCombineBreakpoint WORD  wCbHandle,
WORD *  pwCount,
WORD *  pawBpHandle
 

This function reads back the number and list of combined breakpoints.

Note:
Observe the size of the destination buffers

MSP430_EEM_Init() has to be called prior to this function

Parameters:
wCbHandle: Handle of the combined breakpoint to read back
pwCount: Pointer to the number of breakpoints that are combined with the breakpoint
pawBpHandle: The address of the dynamic destination buffer in which the handle list of combined breakpoints will be stored.
Returns:
STATUS_OK: combine configuration read out

STATUS_ERROR: combine configuration read out error

Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
INTERNAL_ERR

STATUS_T WINAPI MSP430_EEM_SetTrace TrParameter_t pTrBuffer  ) 
 

This function configures the EEM state storage feature to trace the selected information into the internal Trace buffer which has a depth of 8x40 bit (F449).

Note:
MSP430_EEM_Init() must have been called prior to this function
Parameters:
pTrBuffer: Pointer to the source buffer (Type of structure TRACE).
Returns:
STATUS_OK: The state storage control register has been configured.

STATUS_ERROR: The state storage control register has not been configured.

Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
PARAMETER_ERR
RESOURCE_ERR
INTERNAL_ERR

STATUS_T WINAPI MSP430_EEM_GetTrace TrParameter_t pTrDestBuffer  ) 
 

This function reads back the settings of a Trace Configuration Register. No change or other action on the trace is performed.

Note:
Observe the size of the destination buffer as a type of the structure TRACE

MSP430_EEM_Init() must have been called prior to this function

Parameters:
pTrDestBuffer: Pointer to the destination structure (Type of structure TRACE).
Returns:
STATUS_OK: The state storage settings have been returned.

STATUS_ERROR: The state storage settings have not been returned,

Error codes:
PARAMETER_ERR

STATUS_T WINAPI MSP430_EEM_ReadTraceBuffer TraceBuffer_t pTraceBuffer  ) 
 

This function reads the content of the Trace Buffer of the EEM. No change or other action on the trace is performed.

Note:
Observe the size of the destination buffer as a type of the structure TRACE_BUFFER

MSP430_EEM_Init() must have been called prior to this function

Parameters:
pTraceBuffer: Pointer to the destination buffer (8 x 40 bit) (Type of structure TRACE_BUFFER).
Returns:
STATUS_OK: The trace buffer was read out.

STATUS_ERROR: The trace buffer was not read out.

Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
STATE_STOR_ERR
READ_TRACE_ERR

STATUS_T WINAPI MSP430_EEM_ReadTraceData TraceBuffer_t pTraceBuffer,
ULONG *  pulCount
 

This function reads the content of the Trace Buffer of the EEM. No change or other action on the trace is performed.

Note:
MSP430_EEM_Init() must have been called prior to this function

The DLL v2 will always write 8 entries and expect pulCount to be >= 8

Parameters:
pTraceBuffer: Pointer to the destination buffer (array of structure TRACE_BUFFER).
pulCount: In: number of allocated elements in the passed buffer Out: number of actually written elements
Returns:
STATUS_OK: The trace buffer was read out.

STATUS_ERROR: The trace buffer was not read out.

Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
STATE_STOR_ERR
READ_TRACE_ERR

STATUS_T WINAPI MSP430_EEM_RefreshTraceBuffer void   ) 
 

This function refreshes the content of the Trace Buffer of the EEM. No change or other action on the trace is performed.

Note:
MSP430_EEM_Init() must have been called prior to this function

The trace function must have been enabled prior to this function

Returns:
STATUS_OK: The trace buffer was refreshed.

STATUS_ERROR: The trace buffer was not refreshed.

STATUS_T WINAPI MSP430_EEM_SetVariableWatch VwEnable_t  VwEnable  ) 
 

This function configures the EEM State Storage Module to work as a Real Time Monitor for a variable.

Note:
MSP430_EEM_Init() must have been called prior to this function
Parameters:
VwEnable: Enable the variable watch function if TRUE and the trace function is disabled, else disable.
Returns:
STATUS_OK: The variable watch function has been enabled/disabled.

STATUS_ERROR: The variable watch function has not been enabled/disabled.

Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
STATE_STOR_ERR
PARAMETER_ERR
RESOURCE_ERR
VAR_WATCH_EN_ERR

STATUS_T WINAPI MSP430_EEM_SetVariable WORD *  pVwHandle,
VwParameter_t pVwBuffer
 

This function sets one variable to watch.

Note:
MSP430_EEM_Init() must have been called prior to this function

The variable watch function must be enabled.

Parameters:
pVwHandle: Address of the assigned variable trigger handle if the variable will be set. To clear the variable trigger handle must be provided.
pVwBuffer: Pointer to the source buffer (Type of structure VARIABLE_WATCH).
Returns:
STATUS_OK: The variable trigger has been set/clear.

STATUS_ERROR: The variable trigger has not been set/clear.

Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
VAR_WATCH_EN_ERR
INTERNAL_ERR

STATUS_T WINAPI MSP430_EEM_GetVariableWatch VwEnable_t pVwEnable,
VwResources_t paVwDestBuffer
 

This function reads back the settings and the resources of the variable watch configuration.

Note:
Observe the size of the destination buffer as an array of the number of MAB/MDB triggerblocks from type of the structure VAR_WATCH_RESOURCES

MSP430_EEM_Init() must have been called prior to this function

Parameters:
pVwEnable: Pointer to the destination buffer that includes the state of the variable watch function.
paVwDestBuffer: Pointer to an array of the destination buffer that includes the resources of the variable triggers (Type of structure VAR_WATCH_RESOURCES).
Returns:
STATUS_OK: The configuration of the variable watch function has been returned.

STATUS_ERROR: The configuration of the variable watch function has not been returned.

Error codes:
PARAMETER_ERR
NO_DEVICE_ERR

STATUS_T WINAPI MSP430_EEM_SetClockControl CcParameter_t pCcBuffer  ) 
 

This function configures the Clock Control settings of the EEM at emulation stop. It is possible to control the general clock signals (MCLK, SMCLK, ACLK) and the clock signals on extern pins. For devices with the extended clock control it is possible to control the clock for each module.

Note:
MSP430_EEM_Init() must have been called prior to this function

For devices with standard clock control the parameter pCcBuffer->ccModule must be zero

The device will be reset after applying the new settings

Parameters:
pCcBuffer: Pointer to the source buffer (Type of structure CLOCK_CONTROL).
Returns:
STATUS_OK: The clock signals have been configured.

STATUS_ERROR: The clock signals have not been configured.

Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
PARAMETER_ERR
INTERNAL_ERR
RESET_ERR

STATUS_T WINAPI MSP430_EEM_GetClockControl CcParameter_t pCcDestBuffer  ) 
 

This function reads back the settings of the clock control. No change or other action on the settings is performed.

Note:
Observe the size of the destination buffer as a type of the structure CLOCK_CONTROL

MSP430_EEM_Init() must have been called prior to this function

Parameters:
pCcDestBuffer: Pointer to the destination buffer (Type of structure CLOCK_CONTROL).
Returns:
STATUS_OK: The clock control settings have been returned.

STATUS_ERROR: The clock control settings have not been returned.

Error codes:
PARAMETER_ERR

STATUS_T WINAPI MSP430_EEM_SetSequencer SeqParameter_t pSeqBuffer  ) 
 

This function will be used to configure the trigger sequencer feature. When disabling the sequencer all further parameters will be ignored. For each state two of four different sequencer triggers can be set as condition to switch to two selectable states. To select no trigger provide zero as handle. The action trigger must be provided.

Note:
MSP430_EEM_Init() must have been called prior to this function

MSP430_EEM_Open() will be called if required.

Use only 4 different breakpoints as trigger for switching in the next state. More resources not to be available.

Parameters:
pSeqBuffer: Pointer to the source buffer (Type of structure SEQUENCER).
Returns:
STATUS_OK: The sequencer has been configured.

STATUS_ERROR: The sequencer has not been configured.

Error codes:
DEVICE_UNKNOWN_ERR
NO_DEVICE_ERR
PARAMETER_ERR
RESOURCE_ERR
SEQUENCER_ERR
INTERNAL_ERR

STATUS_T WINAPI MSP430_EEM_GetSequencer SeqParameter_t pSeqDestBuffer  ) 
 

This function reads back the settings of the sequencer configuration. No change or other action on the sequencer is performed.

Note:
Observe the size of the destination buffer as a type of the structure SEQUENCER

MSP430_EEM_Init() must have been called prior to this function

Parameters:
pSeqDestBuffer: Pointer to the destination buffer (Type of structure SEQUENCER).
Returns:
STATUS_OK: The sequencer settings have been returned.

STATUS_ERROR: The sequencer settings have not been returned.

Error codes:
PARAMETER_ERR

STATUS_T WINAPI MSP430_EEM_ReadSequencerState SeqState_t pSeqState  ) 
 

Read out the state of the sequencer and store the result in the passed destination buffer.

Note:
MSP430_EEM_Init() must have been called prior to this function

MSP430_EEM_Open() will be called if required.

Parameters:
pSeqState: Pointer to the destination buffer (see enumeration of SeqState).
Returns:
STATUS_OK: The state of the sequencer was read out.

STATUS_ERROR: The state of the sequencer was not read out.

Error codes:
PARAMETER_ERR
NO_DEVICE_ERR
SEQ_ENABLE_ERR