MSP430 DLL API Documentation  3.9.1.2
Classes | Typedefs | Enumerations | Functions
MSP430_EEM.h File Reference

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

Go to the source code of this file.

Classes

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  CLOCK_CONTROL2
 
struct  SEQUENCER
 Sequencer parameter structure: The data structure contains the configuration settings of the sequencer. To select no trigger provide zero as handle. More...
 
struct  CycleCounterConfig_t
 Cycle counter parameter structure: The data structure contains the configuration settings for a cycle counter. More...
 

Typedefs

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. More...
 
typedef enum WarningCodes WarCode_t
 WarCode_t contains the warning codes that are sent as an event. More...
 
typedef enum BpMode BpMode_t
 BpMode_t gives the supported modes for a breakpoint. Used inside the BREAKPOINT structure. More...
 
typedef enum BpType BpType_t
 BpType_t gives the supported types for a breakpoint. Used inside the BREAKPOINT structure. More...
 
typedef enum BpAccess BpAccess_t
 BpAccess_t gives the supported access modes for a breakpoint. Used inside the BREAKPOINT structure. More...
 
typedef enum BpAction BpAction_t
 BpAction_t gives the supported actions for a breakpoint. Used inside the BREAKPOINT structure. More...
 
typedef enum BpOperat BpOperat_t
 BpOperat_t gives the supported comparison operators for a breakpoint. Used inside the BREAKPOINT structure. More...
 
typedef enum BpRangeAction BpRangeAction_t
 BpRangeAction_t gives the supported range control for a range breakpoint. Used inside the BREAKPOINT structure. More...
 
typedef enum BpCondition BpCondition_t
 BpCondition_t gives the exist condition for a complex breakpoint. Used inside the BREAKPOINT structure. More...
 
typedef enum BpConditionValSize BpConditionValSize_t
 BpConditionValSize_t defines the data size of the value to be matched. Used inside the BREAKPOINT structure. More...
 
typedef struct BREAKPOINT BpParameter_t
 The breakpoint structure contains the settings which are required to set, modify or clear a breakpoint. More...
 
typedef enum CbControl CbControl_t
 CbControl_t gives the supported control options for a combined breakpoint. Used in MSP430_EEM_SetCombineBreakpoint() More...
 
typedef enum TrControl TrControl_t
 Trace: Control. More...
 
typedef enum TrMode TrMode_t
 Trace: Mode. More...
 
typedef enum TrAction TrAction_t
 Trace: Action (ignored for collect data mode) More...
 
typedef struct TRACE_CTRL TrParameter_t
 Trace parameter structure: The data structure contains the configuration settings of the EEM trace function. More...
 
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. More...
 
typedef enum VwEnable VwEnable_t
 Variable watch: Enable. More...
 
typedef enum VwControl VwControl_t
 Variable watch: Control. More...
 
typedef enum VwDataType VwDataType_t
 Variable watch: Data type of the variable (ignored for VW_CLEAR) More...
 
typedef struct VARIABLE_WATCH VwParameter_t
 Variable watch parameter structure: The data structure contains the settings of one variable. More...
 
typedef struct VAR_WATCH_RESOURCES VwResources_t
 Variable watch resource structure: The data structure contains the resources of one variable trigger. More...
 
typedef enum CcControl CcControl_t
 Clock control: Extended emulation. More...
 
typedef enum CcModule CcModule_t
 Clock control: Clock for selected modules switch off (logic AND operation) (only for extended clock control, else ignored) More...
 
typedef enum CcGeneralCLK CcGeneralCLK_t
 Clock control: Switch general clock off (logic AND operation) More...
 
typedef struct CLOCK_CONTROL CcParameter_t
 Clock control parameter structure: The data structure contains the settings of the clock control features. More...
 
typedef struct CLOCK_CONTROL2 CcParameter2_t
 The type CcParameter2_t is used by the functions: More...
 
typedef enum SeqControl SeqControl_t
 Sequencer: Control. More...
 
typedef enum SeqState SeqState_t
 Sequencer: Select next state when selected trigger occurs. More...
 
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. More...
 
typedef void(* MSP430_EVENTNOTIFY_FUNC )(uint32_t MsgId, uint32_t wParam, int32_t lParam, int32_t 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(). More...
 

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,
  BP_SOFTWARE = 4
}
 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,
  BP_READ_WRITE = 16
}
 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,
  BP_CC = 4
}
 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  BpConditionValSize {
  BP_VALUE_SIZE_8_BIT = 0,
  BP_VALUE_SIZE_16_BIT = 1,
  BP_VALUE_SIZE_32_BIT = 2
}
 BpConditionValSize_t defines the data size of the value to be matched. 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...
 
enum  CycleCounterMode_t {
  CYC_MODE_BASIC = 0x0,
  CYC_MODE_ADVANCED = 0x1
}
 Cycle counter operation mode. More...
 
enum  CycleCounterCountMode_t {
  CYC_COUNT_STOPPED = 0x0,
  CYC_COUNT_ON_REACTION = 0x1,
  CYC_COUNT_ON_IFCLK = 0x2,
  CYC_COUNT_ON_FETCH = 0x4,
  CYC_COUNT_ON_ALL_BUS = 0x5,
  CYC_COUNT_ON_CPU_BUS = 0x6,
  CYC_COUNT_ON_DMA_BUS = 0x7
}
 Cycle counter count mode. More...
 
enum  CycleCounterStartMode_t {
  CYC_START_ON_RELEASE = 0x0,
  CYC_START_ON_REACTION = 0x1,
  CYC_START_ON_COUNTER = 0x2,
  CYC_START_IMMEDIATELY = 0x3
}
 Cycle counter start mode. More...
 
enum  CycleCounterStopMode_t {
  CYC_STOP_ON_DBG_HALT = 0x0,
  CYC_STOP_ON_REACTION = 0x1,
  CYC_STOP_ON_COUNTER = 0x2,
  CYC_STOP_NO_EVENT = 0x3
}
 Cycle counter stop mode. More...
 
enum  CycleCounterClearMode_t {
  CYC_CLEAR_NO_EVENT = 0x0,
  CYC_CLEAR_ON_REACTION = 0x1,
  CYC_CLEAR_ON_COUNTER = 0x2
}
 Cycler counter clear mode. More...
 

Functions

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_Init (MSP430_EVENTNOTIFY_FUNC callback, int32_t clientHandle, const MessageID_t *pMsgIdBuffer)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetBreakpoint (uint16_t *pwBpHandle, const BpParameter_t *pBpBuffer)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetBreakpoint (uint16_t wBpHandle, BpParameter_t *pBpDestBuffer)
 This function reads back the settings of a breakpoint. No change or other action on the breakpoint is performed. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetCombineBreakpoint (CbControl_t CbControl, uint16_t wCount, uint16_t *pwCbHandle, const uint16_t *pawBpHandle)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetCombineBreakpoint (uint16_t wCbHandle, uint16_t *pwCount, uint16_t *pawBpHandle)
 This function reads back the number and list of combined breakpoints. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetTrace (const TrParameter_t *pTrBuffer)
 
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. More...
 
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. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ReadTraceData (TraceBuffer_t *pTraceBuffer, uint32_t *pulCount)
 This function reads the content of the Trace Buffer of the EEM. No change or other action on the trace is performed. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_RefreshTraceBuffer (void)
 This function will reset the trace and clear the content of the Trace Buffer of the EEM. More...
 
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. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetVariable (uint16_t *pVwHandle, const VwParameter_t *pVwBuffer)
 
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. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetClockControl (const CcParameter_t *pCcBuffer)
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetClockControl2 (const CcParameter2_t *pCcBuffer)
 
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. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetClockControl2 (CcParameter2_t *pCcDestBuffer)
 This function reads back the settings of the clock control. No change or other action on the settings is performed. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetSequencer (const SeqParameter_t *pSeqBuffer)
 
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. More...
 
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. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetCycleCounterMode (CycleCounterMode_t mode)
 Configures the global cycle counter operation mode. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ConfigureCycleCounter (uint32_t wCounter, CycleCounterConfig_t pCycConfig)
 Set configuration for a cycle counter. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ReadCycleCounterValue (uint32_t wCounter, uint64_t *value)
 Read current counter value. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_WriteCycleCounterValue (uint32_t wCounter, uint64_t value)
 Set counter value. More...
 
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ResetCycleCounter (uint32_t wCounter)
 Reset counter value to 0. More...
 

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
         - EEM Hardware Resource Management
         - Caller notifying mechanism using Windows Message Queues
           (Replaced by alternate callback mechanism since version 2.1.2.0)
         - Autonom detection of state changes (e.g. breakpoint hit, single step complete)
Attention
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:

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(int32_t 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.

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.

BpConditionValSize_t defines the data size of the value to be matched. 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(uint16_t* pwBpHandle, BpParameter_t* pBpBuffer) and as a destination parameter to the function MSP430_EEM_GetBreakpoint(uint16_t 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:

  • MSP430_EEM_SetTrace(TrParameter_t* pTrBuffer) as a source buffer
  • MSP430_EEM_SetTrace(TrParameter_t* pTrDestBuffer) as a destination buffer for the trace settings.
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:

  • MSP430_EEM_SetVariable(uint16_t* pVwHandle, VwParameter_t* pVwBuffer) as a source buffer for the variable watch settings.

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(VwEnable_t* 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)

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:

The type CcParameter2_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)(uint32_t MsgId, uint32_t wParam, int32_t lParam, int32_t 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

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

Enumerator
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.

Enumerator
BP_CLEAR 

Clear breakpoint.

BP_CODE 

Set code breakpoint.

BP_RANGE 

Set range breakpoint.

BP_COMPLEX 

Set complex breakpoint.

BP_SOFTWARE 

Set software breakpoint.

enum BpType

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

Enumerator
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
Enumerator
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.

BP_READ_WRITE 

Reasd & Write.

enum BpAction

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

Enumerator
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.

BP_CC 

Cycle counter.

enum BpOperat

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

Enumerator
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.

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

Enumerator
BP_INSIDE 

Inside range.

BP_OUTSIDE 

Outside range.

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

Enumerator
BP_NO_COND 

No condition available.

BP_COND 

Condition available.

BpConditionValSize_t defines the data size of the value to be matched. Used inside the BREAKPOINT structure.

Enumerator
BP_VALUE_SIZE_8_BIT 
BP_VALUE_SIZE_16_BIT 
BP_VALUE_SIZE_32_BIT 
enum CbControl

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

Enumerator
CB_SET 

Combines two or several available breakpoints.

CB_CLEAR 

Clears existing combination of two or several breakpoints.

enum TrControl

Trace: Control.

Enumerator
TR_ENABLE 

Enable state storage.

TR_DISABLE 

Disable state storage.

TR_RESET 

Reset state storage.

enum TrMode

Trace: Mode.

Enumerator
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)

Enumerator
TR_FETCH 

Trace information only at instruction Fetch.

TR_ALL_CYCLE 

Trace information on all MCLK clocks.

enum VwEnable

Variable watch: Enable.

Enumerator
VW_ENABLE 

Enable the variable watch function.

VW_DISABLE 

Disable the variable watch function.

enum VwControl

Variable watch: Control.

Enumerator
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)

Enumerator
VW_8 

Byte.

VW_16 

Word.

VW_32 

Long.

enum CcControl

Clock control: Extended emulation.

Enumerator
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)

Enumerator
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.

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
Enumerator
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.

Enumerator
SEQ_DISABLE 

Disable sequencer state machine.

SEQ_ENABLE 

Enable sequencer state machine.

enum SeqState

Sequencer: Select next state when selected trigger occurs.

Enumerator
SEQ_STATE0 

Switch in state 0.

SEQ_STATE1 

Switch in state 1.

SEQ_STATE2 

Switch in state 2.

SEQ_STATE3 

Switch in state 3.

Cycle counter operation mode.

Enumerator
CYC_MODE_BASIC 

Basic mode (default): counter 0 is reserved for legacy behavior.

CYC_MODE_ADVANCED 

Advanced mode: counter 0 is available for manual configuration.

Cycle counter count mode.

Enumerator
CYC_COUNT_STOPPED 

Counter is stopped.

CYC_COUNT_ON_REACTION 

Count on cycle counter trigger reaction (only counter 1)

CYC_COUNT_ON_IFCLK 

Count on all IFCLKs (used and unused by CPU or DMA)

CYC_COUNT_ON_FETCH 

Count on instruction fetch.

CYC_COUNT_ON_ALL_BUS 

Count on all bus cycles (CPU or DMA)

CYC_COUNT_ON_CPU_BUS 

Count on CPU bus cycles.

CYC_COUNT_ON_DMA_BUS 

Count on DMA bus cycles.

Cycle counter start mode.

Enumerator
CYC_START_ON_RELEASE 

Start counter when released from debug halt.

CYC_START_ON_REACTION 

Start counter on counter trigger reaction (only counter 1)

CYC_START_ON_COUNTER 

Start when other counter starts (only targets with 2 counters)

CYC_START_IMMEDIATELY 

Start counter immediately.

Cycle counter stop mode.

Enumerator
CYC_STOP_ON_DBG_HALT 

Stop counter on debug halt.

CYC_STOP_ON_REACTION 

Stop counter on counter trigger reaction (only counter 1)

CYC_STOP_ON_COUNTER 

Stop counter when other counter stops (only targets with 2 counters)

CYC_STOP_NO_EVENT 

Never stop counter.

Cycler counter clear mode.

Enumerator
CYC_CLEAR_NO_EVENT 

Never automatically reset counter.

CYC_CLEAR_ON_REACTION 

Reset counter on counter trigger reaction (only counter 1)

CYC_CLEAR_ON_COUNTER 

Reset counter when other counter automatically resets (only targets with 2 counters)

Function Documentation

DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_Init ( MSP430_EVENTNOTIFY_FUNC  callback,
int32_t  clientHandle,
const MessageID_t pMsgIdBuffer 
)
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetBreakpoint ( uint16_t *  pwBpHandle,
const BpParameter_t pBpBuffer 
)
STATUS_T WINAPI MSP430_EEM_GetBreakpoint ( uint16_t  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
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetCombineBreakpoint ( CbControl_t  CbControl,
uint16_t  wCount,
uint16_t *  pwCbHandle,
const uint16_t *  pawBpHandle 
)
STATUS_T WINAPI MSP430_EEM_GetCombineBreakpoint ( uint16_t  wCbHandle,
uint16_t *  pwCount,
uint16_t *  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
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetTrace ( const TrParameter_t pTrBuffer)
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,
uint32_t *  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 will reset the trace and clear the content of the Trace Buffer of the EEM.

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 was reset.
STATUS_ERROR: The trace was not reset.
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
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetVariable ( uint16_t *  pVwHandle,
const VwParameter_t pVwBuffer 
)
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
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetClockControl ( const CcParameter_t pCcBuffer)
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetClockControl2 ( const CcParameter2_t pCcBuffer)
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_GetClockControl2 ( CcParameter2_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
DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetSequencer ( const SeqParameter_t pSeqBuffer)
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
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
STATUS_T WINAPI MSP430_EEM_SetCycleCounterMode ( CycleCounterMode_t  mode)

Configures the global cycle counter operation mode.

Note
MSP430_EEM_Init() must have been called prior to this function
Parameters
mode,:CYC_MODE_BASIC or CYC_MODE_ADVANCED (see CycleCounterMode_t).
Returns
STATUS_OK: The cycle counter mode was changed.
STATUS_ERROR: The cycle counter mode was not changed.
Error codes:
NO_DEVICE_ERR FEATURE_NOT_SUPPORTED PARAMETER_ERR
STATUS_T WINAPI MSP430_EEM_ConfigureCycleCounter ( uint32_t  wCounter,
CycleCounterConfig_t  pCycConfig 
)

Set configuration for a cycle counter.

Note
MSP430_EEM_Init() must have been called prior to this function
Parameters
wCounter,:counter to configure (0 for first counter, 1 for second counter if available).
pCycConfig,:configuration settings for the counter
Returns
STATUS_OK: The cycle counter was configured.
STATUS_ERROR: The cycle counter was not configured.
Error codes:
NO_DEVICE_ERR CYCLE_COUNTER_CONFLICT PARAMETER_ERR EEM_NOT_ACCESSIBLE
STATUS_T WINAPI MSP430_EEM_ReadCycleCounterValue ( uint32_t  wCounter,
uint64_t *  value 
)

Read current counter value.

Note
MSP430_EEM_Init() must have been called prior to this function
Parameters
wCounter,:counter to read (0 for first counter, 1 for second counter if available).
value,:pointer to an unsigned 64bit variable that the value will be written to.
Returns
STATUS_OK: The cycle counter value is stored in value.
STATUS_ERROR: The cycle counter value is not stored in value.
Error codes:
NO_DEVICE_ERR CYCLE_COUNTER_CONFLICT PARAMETER_ERR EEM_NOT_ACCESSIBLE
STATUS_T WINAPI MSP430_EEM_WriteCycleCounterValue ( uint32_t  wCounter,
uint64_t  value 
)

Set counter value.

Note
MSP430_EEM_Init() must have been called prior to this function
Parameters
wCounter,:counter to set (0 for first counter, 1 for second counter if available).
value,:value that the counter will be set to.
Returns
STATUS_OK: The cycle counter value was set.
STATUS_ERROR: The cycle counter value was not set.
Error codes:
NO_DEVICE_ERR CYCLE_COUNTER_CONFLICT EEM_NOT_ACCESSIBLE
STATUS_T WINAPI MSP430_EEM_ResetCycleCounter ( uint32_t  wCounter)

Reset counter value to 0.

Note
MSP430_EEM_Init() must have been called prior to this function
Parameters
wCounter,:counter to reset (0 for first counter, 1 for second counter if available).
Returns
STATUS_OK: The cycle counter was reset.
STATUS_ERROR: The cycle counter was not reset.
Error codes:
NO_DEVICE_ERR CYCLE_COUNTER_CONFLICT EEM_NOT_ACCESSIBLE