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

MSP430_EEM.h

Go to the documentation of this file.
00001 /* 00002 * MSP430_EEM.h 00003 * 00004 * API for accessing EEM functionality of MSP430 library. 00005 * 00006 * Copyright (C) 2004 - 2011 Texas Instruments Incorporated - http://www.ti.com/ 00007 * 00008 * 00009 * Redistribution and use in source and binary forms, with or without 00010 * modification, are permitted provided that the following conditions 00011 * are met: 00012 * 00013 * Redistributions of source code must retain the above copyright 00014 * notice, this list of conditions and the following disclaimer. 00015 * 00016 * Redistributions in binary form must reproduce the above copyright 00017 * notice, this list of conditions and the following disclaimer in the 00018 * documentation and/or other materials provided with the 00019 * distribution. 00020 * 00021 * Neither the name of Texas Instruments Incorporated nor the names of 00022 * its contributors may be used to endorse or promote products derived 00023 * from this software without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00026 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00027 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00028 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00029 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00030 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00031 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00032 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00033 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00034 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00035 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 */ 00037 00098 #ifndef MSP430_EEM_H 00099 #define MSP430_EEM_H 00100 00101 00102 #include <MSP430_Debug.h> 00103 00104 #if defined(__cplusplus) 00105 extern "C" { 00106 #endif 00107 00108 #ifndef MSP430_EEM_TYPES 00109 #define MSP430_EEM_TYPES 00110 00115 #define MAXHANDLE 20 00116 00120 #define MAXTRIGGER 8 00121 00125 #define N_TRACE_POS 8 00126 00130 #define MAX_SEQ_TRIGGER 4 00131 00135 #define MAX_SEQ_STATE 4 00136 00144 typedef struct MESSAGE_ID { 00146 ULONG uiMsgIdSingleStep; 00148 ULONG uiMsgIdBreakpoint; 00150 ULONG uiMsgIdStorage; 00152 ULONG uiMsgIdState; 00154 ULONG uiMsgIdWarning; 00156 ULONG uiMsgIdCPUStopped; 00157 } 00164 MessageID_t; 00165 00166 00168 typedef enum WarningCodes { 00170 WAR_CLR_COMBINE = 0, 00172 WAR_CLR_BP_COMBINE = 1, 00174 WAR_MOD_COMBINE = 2, 00176 WAR_RESET = 3, 00178 WAR_DIS_TR_TRIGGER = 4, 00180 WAR_EN_TR_TRIGGER = 5, 00182 WAR_EEM_THREAD_ACTIVE = 6, 00184 WAR_EEM_CONFLICT = 7 00185 } WarCode_t; 00186 00187 00189 typedef enum BpMode { 00191 BP_CLEAR = 0, 00193 BP_CODE = 1, 00195 BP_RANGE = 2, 00197 BP_COMPLEX = 3 00198 } BpMode_t; 00199 00200 00202 typedef enum BpType { 00204 BP_MAB = 0, 00206 BP_MDB = 1, 00208 BP_REGISTER = 2 00209 } BpType_t; 00210 00240 typedef enum BpAccess { 00242 BP_FETCH = 0, 00244 BP_FETCH_HOLD = 1, 00246 BP_NO_FETCH = 2, 00248 BP_DONT_CARE = 3, 00250 BP_NO_FETCH_READ = 4, 00252 BP_NO_FETCH_WRITE = 5, 00254 BP_READ = 6, 00256 BP_WRITE = 7, 00258 BP_NO_FETCH_NO_DMA = 8, 00260 BP_DMA = 9, 00262 BP_NO_DMA = 10, 00264 BP_WRITE_NO_DMA = 11, 00266 BP_NO_FETCH_READ_NO_DMA = 12, 00268 BP_READ_NO_DMA = 13, 00270 BP_READ_DMA = 14, 00272 BP_WRITE_DMA = 15 00273 } BpAccess_t; 00274 00275 00277 typedef enum BpAction { 00279 BP_NONE = 0, 00281 BP_BRK = 1, 00283 BP_STO = 2, 00285 BP_BRK_STO = 3, 00286 } BpAction_t; 00287 00288 00293 typedef enum BpOperat { 00295 BP_EQUAL = 0, 00297 BP_GREATER = 1, 00299 BP_LOWER = 2, 00301 BP_UNEQUAL = 3, 00302 } BpOperat_t; 00303 00304 00309 typedef enum BpRangeAction { 00311 BP_INSIDE = 0, 00313 BP_OUTSIDE = 1, 00314 } BpRangeAction_t; 00315 00316 00321 typedef enum BpCondition { 00323 BP_NO_COND = 0, 00325 BP_COND = 1, 00326 } BpCondition_t; 00327 00332 typedef struct BREAKPOINT { 00334 BpMode_t bpMode; 00336 LONG lAddrVal; 00338 BpType_t bpType; 00340 LONG lReg; 00342 BpAccess_t bpAccess; 00344 BpAction_t bpAction; 00346 BpOperat_t bpOperat; 00348 LONG lMask; 00350 LONG lRangeEndAdVa; 00352 BpRangeAction_t bpRangeAction; 00354 BpCondition_t bpCondition; 00356 ULONG lCondMdbVal; 00358 BpAccess_t bpCondAccess; 00360 LONG lCondMask; 00362 BpOperat_t bpCondOperat; 00364 WORD wExtCombine; 00365 } 00372 BpParameter_t; 00373 00374 00379 typedef enum CbControl { 00381 CB_SET = 0, 00383 CB_CLEAR = 1, 00384 } CbControl_t; 00385 00386 00387 00388 00390 typedef enum TrControl { 00392 TR_ENABLE = 0, 00394 TR_DISABLE = 1, 00396 TR_RESET = 2, 00397 } TrControl_t; 00398 00400 typedef enum TrMode { 00402 TR_HISTORY = 0, 00404 TR_FUTURE = 1, 00406 TR_SHOT = 2, 00408 TR_COLLECT = 3, 00409 } TrMode_t; 00410 00412 typedef enum TrAction { 00414 TR_FETCH = 0, 00416 TR_ALL_CYCLE = 1, 00417 } TrAction_t; 00418 00423 typedef struct TRACE_CTRL { 00425 TrControl_t trControl; 00427 TrMode_t trMode; 00429 TrAction_t trAction; 00430 } 00431 00438 TrParameter_t; 00439 00446 typedef struct TRACE_BUFFER { 00448 LONG lTrBufMAB; 00450 LONG lTrBufMDB; 00452 WORD wTrBufCNTRL; 00453 } 00454 00460 TraceBuffer_t; 00461 00462 00463 00464 00466 typedef enum VwEnable { 00468 VW_ENABLE = 0, 00470 VW_DISABLE = 1, 00471 } VwEnable_t; 00472 00474 typedef enum VwControl { 00476 VW_SET = 0, 00478 VW_CLEAR = 1, 00479 } VwControl_t; 00480 00482 typedef enum VwDataType { 00484 VW_8 = 0, 00486 VW_16 = 1, 00488 VW_32 = 2, 00489 } VwDataType_t; 00490 00495 typedef struct VARIABLE_WATCH { 00497 VwControl_t vwControl; 00499 ULONG lAddr; 00501 VwDataType_t vwDataType; 00502 } 00508 VwParameter_t; 00509 00510 00515 typedef struct VAR_WATCH_RESOURCES { 00517 WORD vwHandle; 00519 ULONG lAddr; 00521 VwDataType_t vwDataType; 00522 } 00528 VwResources_t; 00529 00530 00532 typedef enum CcControl { 00534 CC_DISABLE = 0, 00536 CC_ENABLE = 1, 00537 } CcControl_t; 00538 00540 typedef enum CcModule { 00542 CC_ALLRUN = 0, 00544 CC_WDT = (1 << 1), 00546 CC_TIMER_A = (1 << 2), 00548 CC_TIMER_B = (1 << 3), 00550 CC_BASIC_TIMER = (1 << 4), 00552 CC_LCD_FREQ = (1 << 5), 00554 CC_TIMER_COUNTER = (1 << 6), 00556 CC_TIMER_PORT = (1 << 7), 00558 CC_USART0 = (1 << 8), 00560 CC_USART1 = (1 << 9), 00562 CC_FLASH_CNTRL = (1 << 10), 00564 CC_ADC = (1 << 11), 00566 CC_ACLK = (1 << 12), 00568 CC_SMCLK = (1 << 13), 00570 CC_MCLK = (1 << 14), 00571 } CcModule_t; 00572 00573 00579 typedef enum CcGeneralCLK { 00581 CC_STP_NONE = 0, 00583 CC_STP_ACLK = (1 << 1), 00585 CC_STP_SMCLK = (1 << 2), 00587 CC_STP_MCLK = (1 << 3), 00589 CC_STP_TACLK = (1 << 5), 00590 } CcGeneralCLK_t; 00591 00596 typedef struct CLOCK_CONTROL { 00598 CcControl_t ccControl; 00600 WORD ccModule; 00602 WORD ccGeneralCLK; 00603 } 00610 CcParameter_t; 00611 00612 00613 00614 00616 typedef enum SeqControl { 00618 SEQ_DISABLE = 0, 00620 SEQ_ENABLE = 1, 00621 } SeqControl_t; 00622 00624 typedef enum SeqState { 00626 SEQ_STATE0 = 0, 00628 SEQ_STATE1 = 1, 00630 SEQ_STATE2 = 2, 00632 SEQ_STATE3 = 3, 00633 } SeqState_t; 00634 00640 typedef struct SEQUENCER { 00642 SeqControl_t seqControl; 00644 WORD wHandleRstTrig; 00646 BpAction_t bpAction; 00647 // State X: 00649 SeqState_t seqNextStateX[MAX_SEQ_STATE]; 00651 WORD wHandleStateX[MAX_SEQ_STATE]; 00653 SeqState_t seqNextStateY[MAX_SEQ_STATE]; 00655 WORD wHandleStateY[MAX_SEQ_STATE]; 00656 } 00662 SeqParameter_t; 00663 00664 00665 00666 //============================================================================== 00667 //============================================================================== 00668 00676 typedef void (* MSP430_EVENTNOTIFY_FUNC) (UINT MsgId, UINT wParam, LONG lParam, LONG clientHandle); 00677 00678 //============================================================================== 00679 #endif /* MSP430_EEM_TYPES */ 00680 00756 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_Init(MSP430_EVENTNOTIFY_FUNC callback, LONG clientHandle, MessageID_t* pMsgIdBuffer); 00757 00788 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetBreakpoint(WORD* pwBpHandle, BpParameter_t* pBpBuffer); 00789 00790 00791 00792 00811 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetBreakpoint(WORD wBpHandle, BpParameter_t* pBpDestBuffer); 00812 00813 00814 00815 00849 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetCombineBreakpoint(CbControl_t CbControl, WORD wCount, WORD* pwCbHandle, WORD* pawBpHandle); 00850 00851 00852 00853 00877 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetCombineBreakpoint(WORD wCbHandle, WORD* pwCount, WORD* pawBpHandle); 00878 00879 00880 00881 00902 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetTrace(TrParameter_t* pTrBuffer); 00903 00904 00905 00906 00924 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetTrace(TrParameter_t* pTrDestBuffer); 00925 00926 00927 00928 00949 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ReadTraceBuffer(TraceBuffer_t* pTraceBuffer); 00950 00951 00952 00975 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ReadTraceData(TraceBuffer_t* pTraceBuffer, ULONG* pulCount); 00976 00977 00978 00991 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_RefreshTraceBuffer(void); 00992 00993 00994 00995 01018 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetVariableWatch(VwEnable_t VwEnable); 01019 01020 01021 01022 01044 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetVariable(WORD* pVwHandle, VwParameter_t* pVwBuffer); 01045 01046 01047 01048 01070 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetVariableWatch(VwEnable_t* pVwEnable, VwResources_t* paVwDestBuffer); 01071 01072 01073 01074 01100 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetClockControl(CcParameter_t* pCcBuffer); 01101 01102 01103 01104 01122 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetClockControl(CcParameter_t* pCcDestBuffer); 01123 01124 01125 01126 01154 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_SetSequencer(SeqParameter_t* pSeqBuffer); 01155 01156 01157 01158 01176 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_GetSequencer(SeqParameter_t* pSeqDestBuffer); 01177 01178 01179 01180 01199 DLL430_SYMBOL STATUS_T WINAPI MSP430_EEM_ReadSequencerState(SeqState_t* pSeqState); 01200 01201 01202 #if defined(__cplusplus) 01203 } 01204 #endif 01205 01206 #endif // MSP430_EEM_H