USBDM  V4.12
USBDM_API.h
Go to the documentation of this file.
1 
31 #ifndef _USBDM_API_H_
32 #define _USBDM_API_H_
33 
34 #if !defined(CPP_DLL_LOCAL)
35  #ifdef _WIN32
36  #define CPP_DLL_EXPORT __declspec(dllexport)
38  #define CPP_DLL_IMPORT __declspec(dllimport)
40  #define CPP_DLL_LOCAL
42  #else
43  #define CPP_DLL_EXPORT __attribute__ ((visibility ("default")))
45  #define CPP_DLL_IMPORT __attribute__ ((visibility ("default")))
47  #define CPP_DLL_LOCAL __attribute__ ((visibility ("hidden")))
49  #endif
50 #endif
51 
52 //==================================================
53 #if defined __cplusplus
54 #define EXTERN_C extern "C"
56 #else
57 #ifndef EXTERN_C
59 #define EXTERN_C
60 #endif
61 #endif
62 
63 #if defined(WIN32)
64  #if !defined (WINAPI)
65  #ifdef __GNUC__
66  #define WINAPI __attribute__((__stdcall__))
67  #else
68  #define WINAPI
69  #endif
70  #endif
71 #endif
72 
73 #ifdef WIN32
74  #ifdef USBDM_DLL_EXPORTS
75  #define USBDM_API EXTERN_C CPP_DLL_EXPORT WINAPI
77  #define OSBDM_API_JM60 EXTERN_C CPP_DLL_EXPORT WINAPI
78  #else
79  #define USBDM_API EXTERN_C CPP_DLL_IMPORT WINAPI
81  #define OSBDM_API_JM60 EXTERN_C CPP_DLL_IMPORT WINAPI
82  #endif
83 #else
84  #ifdef USBDM_DLL_EXPORTS
85  #define USBDM_API EXTERN_C CPP_DLL_EXPORT
87  #define OSBDM_API_JM60 EXTERN_C CPP_DLL_EXPORT
88  #else
89  #define USBDM_API EXTERN_C CPP_DLL_IMPORT
91  #define OSBDM_API_JM60 EXTERN_C CPP_DLL_IMPORT
92  #endif
93 #endif
94 
95 //==================================================
96 
97 #include "USBDM_ErrorMessages.h"
98 #include <stdint.h>
99 #include <stdio.h>
100 
101 #if defined __cplusplus
102  extern "C" {
103 #else
104 #undef bool
105 #define bool char
106 #endif
107 
109 #define USBDM_API_VERSION (0x40A06) // V4.10.6 (in hex xx.xx.xx)
110 
113 typedef enum {
114  BDM_CAP_NONE = (0),
115  BDM_CAP_ALL = (0xFFFF),
116  BDM_CAP_HCS12 = (1<<0),
117  BDM_CAP_RS08 = (1<<1),
119  BDM_CAP_VDDSENSE = (1<<3),
120  BDM_CAP_CFVx = (1<<4),
121  BDM_CAP_HCS08 = (1<<5),
122  BDM_CAP_CFV1 = (1<<6),
123  BDM_CAP_JTAG = (1<<7),
124  BDM_CAP_DSC = (1<<8),
125  BDM_CAP_ARM_JTAG = (1<<9),
126  BDM_CAP_RST = (1<<10),
127  BDM_CAP_PST = (1<<11),
128  BDM_CAP_CDC = (1<<12),
129  BDM_CAP_ARM_SWD = (1<<13),
130  BDM_CAP_S12Z = (1<<14),
132 
133 //==========================================================================================
134 // Targets and visible capabilities supported - related to above but not exactly!
135 // e.g. CAP_HCS12 => CAP_BDM+CAP_RST_IO
136 // CAP_RS08 => CAP_BDM+CAP_FLASH(+CAP_RST_IO)
137 // CAP_HCS08 => CAP_BDM(+CAP_RST_IO)
138 // CAP_CFVx => CAP_JTAG_HW+CAP_CFVx_HW+CAP_RST_IO
139 // CAP_DSC => CAP_JTAG_HW+CAP_RST_IO + s/w routines
140 // CAP_JTAG => CAP_JTAG_HW+CAP_RST_IO
141 // CAP_ARM => CAP_JTAG_HW+CAP_RST_IO
142 // CAP_RST => CAP_RST_IO
143 // TARGET_CAPABILITY
144 //
145 #define CAP_HCS12 (1<<0)
146 #define CAP_RS08 (1<<1)
147 #define CAP_VDDCONTROL (1<<2)
148 #define CAP_VDDSENSE (1<<3)
149 #define CAP_CFVx (1<<4)
150 #define CAP_HCS08 (1<<5)
151 #define CAP_CFV1 (1<<6)
152 #define CAP_JTAG (1<<7)
153 #define CAP_DSC (1<<8)
154 #define CAP_ARM_JTAG (1<<9)
155 #define CAP_RST (1<<10)
156 #define CAP_PST (1<<11)
157 #define CAP_CDC (1<<12)
158 #define CAP_ARM_SWD (1<<13)
159 
160 //===================================================================================
163 typedef enum {
164  T_HC12 = 0,
166  T_HCS08 = 1,
167  T_RS08 = 2,
168  T_CFV1 = 3,
169  T_CFVx = 4,
170  T_JTAG = 5,
171  T_EZFLASH = 6,
174  T_ARM_SWD = 9,
175  T_ARM = 10,
176  T_S12Z = 11,
177  T_LAST = T_S12Z,
178  T_ILLEGAL = 0xFE,
179  T_OFF = 0xFF,
180  T_NONE = 0xFF,
181 } TargetType_t;
182 
185 typedef enum {
186  // One of the following
187  MS_Byte = 1, // Byte (8-bit) access
188  MS_Word = 2, // Word (16-bit) access
189  MS_Long = 4, // Long (32-bit) access
190  // One of the following
191  MS_None = 0<<4, // Memory space unused/undifferentiated
192  MS_Program = 1<<4, // Program memory space (e.g. P: on DSC)
193  MS_Data = 2<<4, // Data memory space (e.g. X: on DSC)
194  MS_Global = 3<<4, // HCS12 Global addresses (Using BDMPPR register)
195  // Fast memory access for HCS08/HCS12 (stopped target, regs. are modified
196  MS_Fast = 1<<7,
197  // Masks for above
198  MS_SIZE = 0x7<<0, // Size
199  MS_SPACE = 0x7<<4, // Memory space
200 
201  // For convenience (DSC)
202  MS_PWord = MS_Word+MS_Program,
203  MS_PLong = MS_Long+MS_Program,
204  MS_XByte = MS_Byte+MS_Data,
205  MS_XWord = MS_Word+MS_Data,
206  MS_XLong = MS_Long+MS_Data,
207 } MemorySpace_t;
208 
211 typedef enum {
212  WAIT = 0,
213  ACKN = 1,
214 } AcknMode_t;
215 
218 typedef enum {
223 } SpeedMode_t;
224 
227 typedef enum {
230 } ResetState_t;
231 
234 typedef enum {
236  RESET_INACTIVE = NO_RESET_ACTIVITY,
238 } ResetMode_t;
239 
242 typedef enum {
246 
249 typedef enum {
255 
258 typedef enum {
262 } AutoConnect_t;
263 
264 //====================================================================================
265 
268 typedef enum {
275 
278 typedef enum {
284 
287 typedef enum {
288  CS_DEFAULT = 0xFF,
291 } ClkSwValues_t;
292 
295 typedef enum { /* type of reset action required */
296  RESET_MODE_MASK = (3<<0),
297  RESET_SPECIAL = (0<<0),
298  RESET_NORMAL = (1<<0),
299 
300  RESET_METHOD_MASK = (7<<2),
301  RESET_ALL = (0<<2),
302  RESET_HARDWARE = (1<<2),
303  RESET_SOFTWARE = (2<<2),
304  RESET_POWER = (3<<2),
305  RESET_VENDOR = (4<<2),
306  RESET_DEFAULT = (7<<2),
307 } TargetMode_t;
308 
309 //=======================================================================
310 //
311 // regNo Parameter values for USBDM_ReadReg()
312 //
313 //=======================================================================
314 
318 typedef enum {
324  HCS12_RegCCR = 0x80,
326 
330 typedef enum {
331  S12Z_RegD0 = 0x0,
332  S12Z_RegD1 = 0x1,
333  S12Z_RegD2 = 0x2,
334  S12Z_RegD3 = 0x3,
335  S12Z_RegD4 = 0x4,
336  S12Z_RegD5 = 0x5,
337  S12Z_RegD6 = 0x6,
338  S12Z_RegD7 = 0x7,
339  S12Z_RegX = 0x8,
340  S12Z_RegY = 0x9,
341  S12Z_RegSP = 0xA,
342  S12Z_RegPC = 0xB,
343  S12Z_RegCCR = 0xC,
345 
348 typedef enum {
349  HCS08_RegPC = 0xB,
350  HCS08_RegSP = 0xF,
351  HCS08_RegHX = 0xC,
355 
358 typedef enum {
360  RS08_RegSPC = 0xF,
361  RS08_RegA = 8,
363 
366 typedef enum {
377  CFV1_RegA2 = 10,
378  CFV1_RegA3 = 11,
379  CFV1_RegA4 = 12,
380  CFV1_RegA5 = 13,
381  CFV1_RegA6 = 14,
382  CFV1_RegA7 = 15,
383  CFV1_RegSP = CFV1_RegA7,
385  // The following are used internally by the BDM and only available
386  // externally from firmware version 4.10.6
387  // Takes advantage of the similarity b/w READ_Rn and READ_DREG
388  CFV1_RegOTHER_A7 = 0xC0|0,
389  CFV1_RegVBR = 0xC0|1,
390  CFV1_RegCPUCR = 0xC0|2,
391  CFV1_RegMACSR = 0xC0|4,
392  CFV1_RegMASK = 0xC0|5,
393  CFV1_RegACC = 0xC0|6,
394  CFV1_RegSR = 0xC0|14,
395  CFV1_RegPC = 0xC0|15,
397 
400 typedef enum {
411  CFVx_RegA2 = 10,
412  CFVx_RegA3 = 11,
413  CFVx_RegA4 = 12,
414  CFVx_RegA5 = 13,
415  CFVx_RegA6 = 14,
416  CFVx_RegA7 = 15,
417  CFVx_RegSP = CFVx_RegA7,
419 
422 typedef enum {
423  ARM_RegR0 = 0,
424  ARM_RegR1 = 1,
425  ARM_RegR2 = 2,
426  ARM_RegR3 = 3,
427  ARM_RegR4 = 4,
428  ARM_RegR5 = 5,
429  ARM_RegR6 = 6,
430  ARM_RegR7 = 7,
431  ARM_RegR8 = 8,
432  ARM_RegR9 = 9,
433  ARM_RegR10 = 10,
434  ARM_RegR11 = 11,
435  ARM_RegR12 = 12,
436  ARM_RegSP = 13,
437  ARM_RegLR = 14,
438  ARM_RegPC = 15,
439  ARM_RegxPSR = 16,
440  ARM_RegMSP = 17,
441  ARM_RegPSP = 18,
442  ARM_RegMISC = 20,
443  //
444  ARM_RegFPSCR = 0x21,
445  ARM_RegFPS0 = 0x40,
446 
448 
451 typedef enum {
457 
460 typedef enum {
464 
467 typedef enum {
471 
475 typedef enum {
476  // Core registers
477  DSC_RegX0,
478  DSC_FirstCoreRegister = DSC_RegX0, // 0
479  DSC_RegY0,
480  DSC_RegY1,
481  DSC_RegA0,
482  DSC_RegA1,
483  DSC_RegA2,
484  DSC_RegB0,
485  DSC_RegB1,
486  DSC_RegB2,
487  DSC_RegC0,
488  DSC_RegC1, // 10
489  DSC_RegC2,
490  DSC_RegD0,
491  DSC_RegD1,
492  DSC_RegD2,
493  DSC_RegOMR,
494  DSC_RegSR,
495  DSC_RegLA,
496  DSC_RegLA2, /* read only */
497  DSC_RegLC,
498  DSC_RegLC2, /* read only */ // 20
499  DSC_RegHWS0,
500  DSC_RegHWS1,
501  DSC_RegSP,
502  DSC_RegN3,
503  DSC_RegM01,
504  DSC_RegN,
505  DSC_RegR0,
506  DSC_RegR1,
507  DSC_RegR2,
508  DSC_RegR3, // 30
509  DSC_RegR4,
510  DSC_RegR5,
511  DSC_RegsHM01,
512  DSC_RegsHN,
513  DSC_RegsHR0,
514  DSC_RegsHR1,
515  DSC_RegPC,
516  DSC_LastCoreRegister = DSC_RegPC, // 37
517  // JTAG registers
518  DSC_RegIDCODE, // JTAG Core IDCODE
519  // ONCE registers
520  DSC_RegOCR, // ONCE Control register
521  DSC_FirstONCERegister = DSC_RegOCR, // 39
522  DSC_RegOSCNTR, // ONCE Instruction Step Counter
523  DSC_RegOSR, // ONCE Status register
524  DSC_RegOPDBR, // ONCE Program Data Bus Register
525  DSC_RegOBASE, // ONCE Peripheral Base Address regitsre
526  DSC_RegOTXRXSR, // ONCE Tx & Rx Status & Control register
527  DSC_RegOTX, // ONCE Transmit register (32-bit)
528  DSC_RegOTX1, // ONCE Transmit register (16-bit)
529  DSC_RegORX, // ONCE Receive register (32-bit)
530  DSC_RegORX1, // ONCE Receive register (16-bit)
531  DSC_RegOTBCR, // ONCE Trace buffer control register
532  DSC_RegOTBPR, // ONCE Trace Buffer Pointer register
533  DSC_RegOTB, // Trace Buffer Register Stages
534  DSC_RegOB0CR, // Breakpoint Unit 0 Control register
535  DSC_RegOB0AR1, // Breakpoint Unit 0 Address register 1
536  DSC_RegOB0AR2, // Breakpoint Unit 0 Address register 2
537  DSC_RegOB0MSK, // Breakpoint Unit 0 Mask register
538  DSC_RegOB0CNTR, // Breakpoint Unit 0 Counter
539  DSC_LastONCERegister = DSC_RegOB0CNTR, // 58
540 
541  DSC_GdiStatus = 0x1001, // Used by stand-alone programmer - dummied
542  DSC_UnknownReg = 0xFFFFFF,
544 
545 //=======================================================================
546 //
547 // regNo Parameter values for USBDM_ReadCReg()
548 //
549 //=======================================================================
550 
553 typedef enum {
560  CFV1_CRegSR = 14,
561  CFV1_CRegPC = 15,
563 
566 typedef enum {
567  CFVx_CRegD0 = 0x80,
568  CFVx_CRegD1,
569  CFVx_CRegD2,
570  CFVx_CRegD3,
571  CFVx_CRegD4,
572  CFVx_CRegD5,
573  CFVx_CRegD6,
574  CFVx_CRegD7,
576  CFVx_CRegA1,
577  CFVx_CRegA2,
578  CFVx_CRegA3,
579  CFVx_CRegA4,
580  CFVx_CRegA5,
581  CFVx_CRegA6,
582  CFVx_CRegUSER_SP,
584  CFVx_CRegVBR = 0x801,
585  CFVx_CRegSR = 0x80E,
586  CFVx_CRegPC = 0x80F,
588  CFV1_CRegRAMBAR = 0xC05,
589  // May be others
591 
601 typedef enum {
602  // AP#0 - Common ARM AHB-AP
603  ARM_CRegAHB_AP_CSW = 0x00000000U,
604  ARM_CRegAHB_AP_TAR = 0x00000004U,
605  ARM_CRegAHB_AP_DRW = 0x0000000CU,
606 
607  ARM_CRegAHB_AP_CFG = 0x000000F4U,
608  ARM_CRegAHB_AP_Base = 0x000000F8U,
609  ARM_CRegAHB_AP_Id = 0x000000FCU,
610 
611  // AP#1 - Kinetis MDM-AP registers
612  ARM_CRegMDM_AP_Status = 0x01000000U,
613  ARM_CRegMDM_AP_Control = 0x01000004U,
614  ARM_CRegMDM_AP_Ident = 0x010000FCU,
616 
617 //=======================================================================
618 //
619 // regNo Parameter values for USBDM_ReadDReg()
620 //
621 //=======================================================================
622 
627 typedef enum {
628  // 8-bit accesses using READ_BD_BYTE
629  HCS12_DRegBDMSTS = (int)0xFF01,
630  HCS12_DRegCCR = (int)0xFF06,
631  HCS12_DRegBDMINR = (int)0xFF07,
632  // Others may be device dependent
634 
637 typedef enum {
640 
643 typedef enum {
646 
650 typedef enum {
651  CFV1_DRegCSR = 0x00,
652  CFV1_DRegXCSR = 0x01,
653  CFV1_DRegCSR2 = 0x02,
654  CFV1_DRegCSR3 = 0x03,
655  CFV1_DRegBAAR = 0x05,
656  CFV1_DRegAATR = 0x06,
657  CFV1_DRegTDR = 0x07,
658  CFV1_DRegPBR0 = 0x08,
659  CFV1_DRegPBMR = 0x09,
660  CFV1_DRegABHR = 0x0C,
661  CFV1_DRegABLR = 0x0D,
662  CFV1_DRegDBR = 0x0E,
663  CFV1_DRegBDMR = 0x0F,
664  CFV1_DRegPBR1 = 0x18,
665  CFV1_DRegPBR2 = 0x1A,
666  CFV1_DRegPBR3 = 0x1B,
667 
668  CFV1_ByteRegs = 0x1000,
673 
676 typedef enum {
677  CFVx_DRegCSR = 0x00,
678  CFVx_DRegBAAR = 0x05,
679  CFVx_DRegAATR = 0x06,
680  CFVx_DRegTDR = 0x07,
681  CFVx_DRegPBR0 = 0x08,
682  CFVx_DRegPBMR = 0x09,
683  CFVx_DRegABHR = 0x0C,
684  CFVx_DRegABLR = 0x0D,
685  CFVx_DRegDBR = 0x0E,
686  CFVx_DRegBDMR = 0x0F,
687  CFVx_DRegPBR1 = 0x18,
688  CFVx_DRegPBR2 = 0x1A,
689  CFVx_DRegPBR3 = 0x1B,
691 
694 typedef enum {
702 
708 
709 //=======================================================================
710 //
711 //=======================================================================
712 
713 
716 typedef struct {
725 } USBDMStatus_t;
726 
727 //=======================================================================
728 //
729 // JTAG Interface
730 //
731 //=======================================================================
732 
735 typedef enum {
741 
742  JTAG_WRITE_0 = 0x00,
743  JTAG_WRITE_1 = 0x80,
745 
749 
750 
752 typedef enum {
753  PIN_BKGD_OFFS = (0),
754  PIN_BKGD = (3<<PIN_BKGD_OFFS),
755  PIN_BKGD_NC = (0<<PIN_BKGD_OFFS),
756  PIN_BKGD_3STATE = (1<<PIN_BKGD_OFFS),
757  PIN_BKGD_LOW = (2<<PIN_BKGD_OFFS),
758  PIN_BKGD_HIGH = (3<<PIN_BKGD_OFFS),
759 
760  PIN_RESET_OFFS = (2),
761  PIN_RESET = (3<<PIN_RESET_OFFS),
762  PIN_RESET_NC = (0<<PIN_RESET_OFFS),
763  PIN_RESET_3STATE = (1<<PIN_RESET_OFFS),
764  PIN_RESET_LOW = (2<<PIN_RESET_OFFS),
765  PIN_RESET_HIGH = (3<<PIN_RESET_OFFS),
766 
767  PIN_TA_OFFS = (4),
768  PIN_TA = (3<<PIN_TA_OFFS),
769  PIN_TA_NC = (0<<PIN_TA_OFFS),
770  PIN_TA_3STATE = (1<<PIN_TA_OFFS),
771  PIN_TA_LOW = (2<<PIN_TA_OFFS),
772 
773  PIN_DE_OFFS = (4),
774  PIN_DE = (3<<PIN_DE_OFFS),
775  PIN_DE_NC = (0<<PIN_DE_OFFS),
776  PIN_DE_3STATE = (1<<PIN_DE_OFFS),
777  PIN_DE_LOW = (2<<PIN_DE_OFFS),
778 
779  PIN_TRST_OFFS = (6),
780  PIN_TRST = (3<<PIN_TRST_OFFS),
781  PIN_TRST_NC = (0<<PIN_TRST_OFFS),
782  PIN_TRST_3STATE = (1<<PIN_TRST_OFFS),
783  PIN_TRST_LOW = (2<<PIN_TRST_OFFS),
784 
785  PIN_BKPT_OFFS = (8),
786  PIN_BKPT = (3<<PIN_BKPT_OFFS),
787  PIN_BKPT_NC = (0<<PIN_BKPT_OFFS),
788  PIN_BKPT_3STATE = (1<<PIN_BKPT_OFFS),
789  PIN_BKPT_LOW = (2<<PIN_BKPT_OFFS),
790 
791  PIN_SWD_OFFS = (10),
792  PIN_SWD = (3<<PIN_SWD_OFFS),
793  PIN_SWD_NC = (0<<PIN_SWD_OFFS),
794  PIN_SWD_3STATE = (1<<PIN_SWD_OFFS),
795  PIN_SWD_LOW = (2<<PIN_SWD_OFFS),
796  PIN_SWD_HIGH = (3<<PIN_SWD_OFFS),
797 
798  PIN_SWCLK_OFFS = (12),
799  PIN_SWCLK = (3<<PIN_SWCLK_OFFS),
800  PIN_SWCLK_NC = (0<<PIN_SWCLK_OFFS),
801  PIN_SWCLK_3STATE = (1<<PIN_SWCLK_OFFS),
802  PIN_SWCLK_LOW = (2<<PIN_SWCLK_OFFS),
803  PIN_SWCLK_HIGH = (3<<PIN_SWCLK_OFFS),
804 
806  PIN_RELEASE = -1,
807 } PinLevelMasks_t ;
808 
813 typedef struct {
814  // Options passed to the BDM
815  int targetVdd;
824  int reserved1[2];
825 
826  // Options used internally by DLL
832  int reserved2[2];
833 } BDM_Options_t;
834 
837 typedef struct {
838  // Options passed to the BDM
839  unsigned size;
846  bool guessSpeed;
852  unsigned powerOffDuration;
854  unsigned resetDuration;
857  unsigned hcs08sbdfrAddress;
859 
862 typedef struct {
863  unsigned char bdmSoftwareVersion;
864  unsigned char bdmHardwareVersion;
865  unsigned char icpSoftwareVersion;
866  unsigned char icpHardwareVersion;
868 
870 typedef struct {
871  unsigned size;
877  unsigned commandBufferSize;
878  unsigned jtagBufferSize;
880 
881 // The following functions are available when in BDM mode
882 //====================================================================
883 //
892 USBDM_API
902 USBDM_API
904 
912 USBDM_API
913 unsigned int USBDM_DLLVersion(void);
914 
919 USBDM_API
920 const char *USBDM_DLLVersionString(void);
921 
928 USBDM_API
929 const char *USBDM_GetErrorString(USBDM_ErrorCode errorCode);
930 
931 //=============================================================================
932 //=============================================================================
933 //=============================================================================
934 // USBDM Device handling
935 
951 USBDM_API
952 USBDM_ErrorCode USBDM_FindDevices(unsigned int *deviceCount);
953 
960 USBDM_API
962 
973 USBDM_API
974 USBDM_ErrorCode USBDM_GetBDMSerialNumber(const char **deviceSerialNumber);
975 
986 USBDM_API
987 USBDM_ErrorCode USBDM_GetBDMDescription(const char **deviceDescription);
988 
1001 USBDM_API
1002 USBDM_ErrorCode USBDM_Open(unsigned char deviceNo);
1003 
1009 USBDM_API
1011 
1029 USBDM_API
1031 
1043 USBDM_API
1045 
1057 USBDM_API
1059 
1070 USBDM_API
1072 
1085 USBDM_API
1087 
1097 USBDM_API
1099 
1109 USBDM_API
1111 
1126 USBDM_API
1128 
1143 USBDM_API
1145 
1155 #if defined __cplusplus
1156 USBDM_API
1157 USBDM_ErrorCode USBDM_ControlPins(unsigned int control, unsigned int *status=0);
1158 #else
1159 USBDM_API
1160 USBDM_ErrorCode USBDM_ControlPins(unsigned int control, unsigned int *status);
1161 #endif
1162 //=============================================================================
1163 //=============================================================================
1164 //=============================================================================
1165 // Target handling
1166 
1182 USBDM_API
1184 
1193 USBDM_API
1194 USBDM_ErrorCode USBDM_Debug(unsigned char *usb_data);
1195 
1203 USBDM_API
1204 USBDM_ErrorCode USBDM_BDMCommand(unsigned int txSize, unsigned int rxSize, unsigned char data[]);
1205 
1213 USBDM_API
1215 
1224 USBDM_API
1226 
1238 USBDM_API
1240 
1247 USBDM_API
1249 
1264 USBDM_API
1265 USBDM_ErrorCode USBDM_SetSpeed( unsigned long frequency);
1266 
1275 USBDM_API
1276 USBDM_ErrorCode USBDM_GetSpeed(unsigned long *frequency /* kHz */);
1277 
1286 USBDM_API
1287 USBDM_ErrorCode USBDM_GetSpeedHz(unsigned long *frequency /* Hz */);
1288 
1306 USBDM_API
1307 USBDM_ErrorCode USBDM_ReadStatusReg(unsigned long *BDMStatusReg);
1308 
1323 USBDM_API
1324 USBDM_ErrorCode USBDM_WriteControlReg(unsigned int value);
1325 
1326 //*****************************************************************************
1327 //*****************************************************************************
1328 //*****************************************************************************
1329 // Target run control
1330 
1343 USBDM_API
1345 
1352 USBDM_API
1354 
1361 USBDM_API
1363 
1370 USBDM_API
1372 
1373 //*****************************************************************************
1374 //*****************************************************************************
1375 //*****************************************************************************
1376 // Target register Read/Write
1377 
1394 USBDM_API
1395 USBDM_ErrorCode USBDM_WriteReg(unsigned int regNo, unsigned long regValue);
1396 
1415 USBDM_API
1416 USBDM_ErrorCode USBDM_ReadReg(unsigned int regNo, unsigned long *regValue);
1417 
1431 USBDM_API
1432 USBDM_ErrorCode USBDM_ReadMultipleRegs(unsigned char regValueBuffer[], unsigned int startRegIndex, unsigned int endRegIndex);
1433 
1451 USBDM_API
1452 USBDM_ErrorCode USBDM_WriteCReg(unsigned int regNo, unsigned long regValue);
1453 
1471 USBDM_API
1472 USBDM_ErrorCode USBDM_ReadCReg(unsigned int regNo, unsigned long *regValue);
1473 
1490 USBDM_API
1491 USBDM_ErrorCode USBDM_WriteDReg(unsigned int regNo, unsigned long regValue);
1492 
1509 USBDM_API
1510 USBDM_ErrorCode USBDM_ReadDReg(unsigned int regNo, unsigned long *regValue);
1511 
1523 USBDM_API
1524 USBDM_ErrorCode USBDM_WriteMemory( unsigned int memorySpace,
1525  unsigned int byteCount,
1526  unsigned int address,
1527  unsigned const char *data);
1528 
1540 USBDM_API
1541 USBDM_ErrorCode USBDM_ReadMemory( unsigned int memorySpace,
1542  unsigned int byteCount,
1543  unsigned int address,
1544  unsigned char *data);
1545 
1546 //*****************************************************************************
1547 //*****************************************************************************
1548 //*****************************************************************************
1549 // JTAG Entry points
1550 //
1551 
1562 USBDM_API
1564 
1578 USBDM_API
1579 USBDM_ErrorCode USBDM_JTAG_SelectShift(unsigned char mode);
1580 
1603 USBDM_API
1604 USBDM_ErrorCode USBDM_JTAG_Write(unsigned char bitCount,
1605  unsigned char exit,
1606  const unsigned char *buffer);
1607 
1628 USBDM_API
1629 USBDM_ErrorCode USBDM_JTAG_Read( unsigned char bitCount,
1630  unsigned char exit,
1631  unsigned char *buffer);
1632 
1655 USBDM_API
1656 USBDM_ErrorCode USBDM_JTAG_ReadWrite( unsigned char bitCount,
1657  unsigned char exit,
1658  const unsigned char *outBuffer,
1659  unsigned char *inBuffer);
1660 
1671 USBDM_API
1672 USBDM_ErrorCode USBDM_JTAG_ExecuteSequence(unsigned char length,
1673  const unsigned char *sequence,
1674  unsigned char inLength,
1675  unsigned char *inBuffer);
1676 
1677 //=====================================================================================================
1678 // Logging
1679 
1682 USBDM_API
1683 FILE *USBDM_GetLogFile(void);
1684 
1687 USBDM_API
1688 void USBDM_SetLogFile(FILE *fp);
1689 
1690 //=====================================================================================================
1691 // ICP functions
1692 
1698 USBDM_API
1699 void USBDM_RebootToICP(void);
1700 
1701 //
1702 // The following functions are available in ICP mode only
1703 //
1704 
1717 USBDM_API
1718 USBDM_ErrorCode USBDM_ICP_Erase( unsigned int addr,
1719  unsigned int count);
1720 
1731 USBDM_API
1732 USBDM_ErrorCode USBDM_ICP_Program( unsigned int addr,
1733  unsigned int count,
1734  unsigned char *data);
1735 
1746 USBDM_API
1747 USBDM_ErrorCode USBDM_ICP_Verify( unsigned int addr,
1748  unsigned int count,
1749  unsigned char *data);
1750 
1760 USBDM_API
1761 void USBDM_ICP_Reboot( void );
1762 
1763 #ifdef __cplusplus
1764 // Only available to C++
1765 
1771 class ProgressDialogue;
1772 
1773 //====================================================================
1783 USBDM_API
1784 void USBDM_ICP_SetCallback(ProgressDialogue *icpCallBack);
1785 
1786 #ifdef COMMANDLINE
1787 void dll_initialize(HINSTANCE _hDLLInst);
1788 void dll_uninitialize(void);
1789 #endif // COMMANDLINE
1790 #endif //__cplusplus
1791 
1792 #if defined __cplusplus
1793  }
1794 #endif
1795 
1796 #endif //_USBDM_API_H_
HCS12_RegD
D reg.
Definition: USBDM_API.h:320
T_ARM_SWD
ARM target using SWD.
Definition: USBDM_API.h:174
CFV1_DRegTDR
TDR.
Definition: USBDM_API.h:657
USBDM_GetBDMSerialNumber
USBDM_API USBDM_ErrorCode USBDM_GetBDMSerialNumber(const char **deviceSerialNumber)
Obtain serial number of the currently opened BDM.
JTAG_ExitActions_t
JTAG_ExitActions_t
Options used with JTAG commands.
Definition: USBDM_API.h:735
USBDM_ExtendedOptions_t::resetDuration
unsigned resetDuration
How long to assert reset (ms)
Definition: USBDM_API.h:854
USBDM_Version_t::bdmSoftwareVersion
unsigned char bdmSoftwareVersion
Version of USBDM Firmware.
Definition: USBDM_API.h:863
CFV1_RegACC
ACC.
Definition: USBDM_API.h:393
HCS08_RegSP
SP reg.
Definition: USBDM_API.h:350
ARM_RegIndexLastCore
Last core reg (20 regs R0..R12,SP,LR,PC,XPSR,MSP,PSP,MISC)
Definition: USBDM_API.h:453
T_RS08
RS08 target.
Definition: USBDM_API.h:167
HCS08_DRegisters_t
HCS08_DRegisters_t
regNo Parameter for USBDM_ReadDReg() with HCS08 target [BKPT reg]
Definition: USBDM_API.h:637
JTAG_SHIFT_IR
Enter SHIFT-IR (from TEST-LOGIC-RESET or RUN-TEST/IDLE)
Definition: USBDM_API.h:747
CFV1_CRegVBR
Vector Base register.
Definition: USBDM_API.h:555
ARM_RegLR
LR.
Definition: USBDM_API.h:437
ARM_CRegAHB_AP_DRW
AHB-AP Data Read/Write register.
Definition: USBDM_API.h:605
CFV1_DRegPBR1
PBR1.
Definition: USBDM_API.h:664
USBDM_ErrorCode
USBDM_ErrorCode
Error codes returned from BDM routines and BDM commands.
Definition: USBDM_ErrorMessages.h:39
PIN_BKGD_3STATE
Set BKGD 3-state.
Definition: USBDM_API.h:756
ARM_DRegABORT
ABORT reg - write only.
Definition: USBDM_API.h:696
JTAG_WRITE_0
Write 0's when reading - combined with above.
Definition: USBDM_API.h:742
CFV1_RegCPUCR
CPUCR.
Definition: USBDM_API.h:390
PIN_TRST_LOW
Set TRST low.
Definition: USBDM_API.h:783
HCS08_RegCCR
CCR reg.
Definition: USBDM_API.h:353
CFV1_CRegMASK
MASK.
Definition: USBDM_API.h:558
USBDM_ExtendedOptions_t::bdmClockSource
ClkSwValues_t bdmClockSource
BDM clock source in target.
Definition: USBDM_API.h:847
ARM_CRegAHB_AP_CSW
AHB-AP Control/Status Word register.
Definition: USBDM_API.h:603
RS08_RegA
A reg.
Definition: USBDM_API.h:361
CFVx_RegD3
D3.
Definition: USBDM_API.h:404
USBDM_GetSpeedHz
USBDM_API USBDM_ErrorCode USBDM_GetSpeedHz(unsigned long *frequency)
Get the BDM communication speed in Hz.
PIN_RESET_HIGH
Status only - Reset high.
Definition: USBDM_API.h:765
T_CFV1
Coldfire Version 1 target.
Definition: USBDM_API.h:168
USBDMStatus_t::halt_state
TargetRunState_t halt_state
CFVx halted (from ALLPST)?
Definition: USBDM_API.h:722
USBDM_GetCommandStatus
USBDM_API USBDM_ErrorCode USBDM_GetCommandStatus(void)
Get status of the last command.
CFV1_RegA2
A2.
Definition: USBDM_API.h:377
CFVx_RegA1
A1.
Definition: USBDM_API.h:410
RS08_Registers_t
RS08_Registers_t
regNo Parameter for USBDM_ReadReg() with RS08 target
Definition: USBDM_API.h:358
PIN_BKPT_3STATE
Set BKPT 3-state.
Definition: USBDM_API.h:788
PIN_SWD_3STATE
Set SWD 3-state.
Definition: USBDM_API.h:794
CFV1_RegD7
D7.
Definition: USBDM_API.h:374
USBDM_Init
USBDM_API USBDM_ErrorCode USBDM_Init(void)
Initialises USB interface.
CFV1_RegA3
A3.
Definition: USBDM_API.h:378
CFVx_DRegABHR
ABHR.
Definition: USBDM_API.h:683
ARM_RegisterIndex_t
ARM_RegisterIndex_t
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with ARM (Kinetis) target
Definition: USBDM_API.h:451
AutoConnect_t
AutoConnect_t
Auto-reconnect options.
Definition: USBDM_API.h:258
CFV1_CRegCPUCR
CPUCR.
Definition: USBDM_API.h:556
BDM_Options_t::leaveTargetPowered
int leaveTargetPowered
Leave target power on exit.
Definition: USBDM_API.h:818
USBDM_bdmInformation_t::BDMhardwareVersion
int BDMhardwareVersion
Hardware version reported by BDM firmware.
Definition: USBDM_API.h:873
USBDM_bdmInformation_t::jtagBufferSize
unsigned jtagBufferSize
Size of JTAG buffer (if supported)
Definition: USBDM_API.h:878
ARM_RegxPSR
xPSR
Definition: USBDM_API.h:439
RS08_DRegisters_t
RS08_DRegisters_t
regNo Parameter for USBDM_ReadDReg() with RS08 target (BKPT)
Definition: USBDM_API.h:643
CFVx_DRegTDR
TDR.
Definition: USBDM_API.h:680
USBDM_bdmInformation_t::ICPsoftwareVersion
int ICPsoftwareVersion
ICP Firmware version.
Definition: USBDM_API.h:874
BDM_TARGET_VDD_OFF
Target Vdd Off.
Definition: USBDM_API.h:269
CS_ALT_CLK
Force ALT clock (CLKSW = 0)
Definition: USBDM_API.h:289
USBDM_GetDefaultExtendedOptions
USBDM_API USBDM_ErrorCode USBDM_GetDefaultExtendedOptions(USBDM_ExtendedOptions_t *bdmOptions)
Get default (target specific) BDM interface options.
USBDM_ExtendedOptions_t::targetVdd
TargetVddSelect_t targetVdd
Target Vdd (off, 3.3V or 5V)
Definition: USBDM_API.h:841
USBDM_WriteReg
USBDM_API USBDM_ErrorCode USBDM_WriteReg(unsigned int regNo, unsigned long regValue)
Write Target Core register.
CFV1_DRegBDMR
DBMR - mask for DBR.
Definition: USBDM_API.h:663
USBDM_GetBdmInformation
USBDM_API USBDM_ErrorCode USBDM_GetBdmInformation(USBDM_bdmInformation_t *info)
Obtains information about the currently open BDM interface.
USBDM_SetSpeed
USBDM_API USBDM_ErrorCode USBDM_SetSpeed(unsigned long frequency)
Sets the BDM communication speed.
S12Z_RegY
Y reg.
Definition: USBDM_API.h:340
CFV1_DRegPBR2
PBR2.
Definition: USBDM_API.h:665
USBDM_ExtendedOptions_t::usePSTSignals
bool usePSTSignals
CFVx, PST Signal monitors.
Definition: USBDM_API.h:851
USBDM_SetTargetVdd
USBDM_API USBDM_ErrorCode USBDM_SetTargetVdd(TargetVddSelect_t targetVdd)
Sets Target Vdd voltage.
USBDM_DLLVersion
USBDM_API unsigned int USBDM_DLLVersion(void)
Get version of the DLL.
ClkSwValues_t
ClkSwValues_t
Target BDM Clock selection.
Definition: USBDM_API.h:287
CFV1_RegD5
D5.
Definition: USBDM_API.h:372
USBDM_ExtendedOptions_t::size
unsigned size
Size of this structure - must be initialised!
Definition: USBDM_API.h:839
HCS12_RegPC
PC reg.
Definition: USBDM_API.h:319
JTAG_STAY_SHIFT
Remain in SHIFT-DR or SHIFT-IR.
Definition: USBDM_API.h:736
ARM_RegIndexFirstCore
First code reg.
Definition: USBDM_API.h:452
PIN_SWCLK
Mask for SWD values (PIN_SWCLK_LOW, PIN_SWCLK_HIGH & PIN_SWCLK_3STATE)
Definition: USBDM_API.h:799
ARM_RegIndexLastFloat
Last float reg (33 regs FPSCR, FPS0..FPS32)
Definition: USBDM_API.h:455
USBDM_JTAG_ExecuteSequence
USBDM_API USBDM_ErrorCode USBDM_JTAG_ExecuteSequence(unsigned char length, const unsigned char *sequence, unsigned char inLength, unsigned char *inBuffer)
Execute JTAG Sequence.
ARM_DRegisters_t
ARM_DRegisters_t
regNo Parameter for USBDM_ReadDReg() with SWD-ARM target
Definition: USBDM_API.h:694
RESET_VENDOR
Vendor special method e.g. using MDM-AP for Kinetis.
Definition: USBDM_API.h:305
CFV1_CRegPC
Program Counter.
Definition: USBDM_API.h:561
S12Z_RegCCR
CCR reg.
Definition: USBDM_API.h:343
CFVx_RegA6
A6.
Definition: USBDM_API.h:415
BDM_Options_t::guessSpeed
int guessSpeed
Guess speed for target w/o ACKN.
Definition: USBDM_API.h:820
USBDM_GetBDMStatus
USBDM_API USBDM_ErrorCode USBDM_GetBDMStatus(USBDMStatus_t *USBDMStatus)
Fills user supplied structure with state of BDM communication channel.
PIN_RELEASE
Release all pins (go to default for current target)
Definition: USBDM_API.h:806
PIN_TA_LOW
Set TA low.
Definition: USBDM_API.h:771
CFV1_DRegPBR0
PBR0.
Definition: USBDM_API.h:658
USBDMStatus_t
State of BDM Communication.
Definition: USBDM_API.h:716
CFVx_RegA7
A7.
Definition: USBDM_API.h:416
PIN_RESET_3STATE
Set Reset 3-state.
Definition: USBDM_API.h:763
USBDM_Open
USBDM_API USBDM_ErrorCode USBDM_Open(unsigned char deviceNo)
Opens a device.
BDM_Options_t
BDM interface options.
Definition: USBDM_API.h:813
S12Z_RegD2
D2 reg.
Definition: USBDM_API.h:333
S12Z_RegD7
D7 reg.
Definition: USBDM_API.h:338
ARM_DRegIDCODE
IDCODE reg - read, SWD-AP only.
Definition: USBDM_API.h:695
BDM_Options_t::cycleVddOnConnect
int cycleVddOnConnect
Cycle target Power if connection problems)
Definition: USBDM_API.h:817
HCS08_DRegBKPT
Breakpoint register.
Definition: USBDM_API.h:638
USBDM_WriteDReg
USBDM_API USBDM_ErrorCode USBDM_WriteDReg(unsigned int regNo, unsigned long regValue)
Write Target Debug register.
CFV1_RegPC
Program Counter.
Definition: USBDM_API.h:395
ResetMode_t
ResetMode_t
Target reset status values.
Definition: USBDM_API.h:234
CFV1_RegisterIndex_t
CFV1_RegisterIndex_t
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with Coldfire V1 target
Definition: USBDM_API.h:460
ARM_CRegMDM_AP_Status
Status register.
Definition: USBDM_API.h:612
BDM_CAP_VDDSENSE
Sensing of target Vdd.
Definition: USBDM_API.h:119
ARM_DRegAPReg2
AP reg #2.
Definition: USBDM_API.h:705
HCS08_Registers_t
HCS08_Registers_t
regNo Parameter for USBDM_ReadReg() with HCS08 target
Definition: USBDM_API.h:348
CFV1_PSTBASE
Start of PST registers, access as CFV1_PSTBASE+n.
Definition: USBDM_API.h:384
PIN_DE_3STATE
Set DE 3-state.
Definition: USBDM_API.h:776
S12Z_RegD4
D4 reg.
Definition: USBDM_API.h:335
CFV1_RegMASK
MASK.
Definition: USBDM_API.h:392
JTAG_WRITE_MASK
Mask for Write actions.
Definition: USBDM_API.h:744
CFV1_CRegACC
ACC.
Definition: USBDM_API.h:559
USBDM_ExtendedOptions_t::hcs08sbdfrAddress
unsigned hcs08sbdfrAddress
Address to use to access SBDFR register.
Definition: USBDM_API.h:857
USBDM_ICP_Erase
USBDM_API USBDM_ErrorCode USBDM_ICP_Erase(unsigned int addr, unsigned int count)
ICP mode - erase BDM Flash memory.
BDM_Options_t::usePSTSignals
int usePSTSignals
CFVx, PST Signal monitors.
Definition: USBDM_API.h:831
CFVx_CRegSR
Status Register.
Definition: USBDM_API.h:585
S12Z_Registers_t
S12Z_Registers_t
regNo Parameter for USBDM_ReadReg() with HCS12 target
Definition: USBDM_API.h:330
CFV1_ByteRegs
Special access to msb.
Definition: USBDM_API.h:668
RESET_METHOD_MASK
Mask for reset type (Hardware/Software/Power)
Definition: USBDM_API.h:300
ARM_RegMSP
Main Stack pointer.
Definition: USBDM_API.h:440
BDM_CAP_RS08
12 V Flash programming supply available (RS08 support)
Definition: USBDM_API.h:117
CFVx_CRegPC
Program Counter.
Definition: USBDM_API.h:586
ARM_CRegAHB_AP_Id
AHB-AP ID Register.
Definition: USBDM_API.h:609
PIN_DE_NC
No change.
Definition: USBDM_API.h:775
JTAG_WRITE_1
Write 1's when reading - combined with above.
Definition: USBDM_API.h:743
BDM_TARGET_VDD_5V
Target Vdd internal 5.0V.
Definition: USBDM_API.h:271
ARM_RegR10
R10.
Definition: USBDM_API.h:433
S12Z_RegD5
D5 reg.
Definition: USBDM_API.h:336
CFVx_RegD6
D6.
Definition: USBDM_API.h:407
S12Z_RegD0
D0 reg.
Definition: USBDM_API.h:331
USBDM_JTAG_Read
USBDM_API USBDM_ErrorCode USBDM_JTAG_Read(unsigned char bitCount, unsigned char exit, unsigned char *buffer)
JTAG - read data from JTAG shift register SHIFT_DR => TMS=Nx0, TDI=0, TDO=NxData (captured)
USBDM_ExtendedOptions_t::resetRecoveryInterval
unsigned resetRecoveryInterval
How long to wait after reset sequence completes (ms)
Definition: USBDM_API.h:856
T_CFVx
Coldfire Version 2,3,4 target.
Definition: USBDM_API.h:169
ARM_Registers_t
ARM_Registers_t
regNo Parameter for ARM_ReadReg() with ARM (Kinetis) target
Definition: USBDM_API.h:422
USBDM_GetSpeed
USBDM_API USBDM_ErrorCode USBDM_GetSpeed(unsigned long *frequency)
Get the BDM communication speed in kHz.
RESET_SPECIAL
Special mode [BDM active, Target halted].
Definition: USBDM_API.h:297
ARM_DRegSELECT
SELECT reg - write only.
Definition: USBDM_API.h:700
SPEED_USER_SUPPLIED
User has specified the speed to use.
Definition: USBDM_API.h:222
USBDM_SetTargetType
USBDM_API USBDM_ErrorCode USBDM_SetTargetType(TargetType_t targetType)
Sets target MCU type.
PIN_TRST_3STATE
Set TRST 3-state.
Definition: USBDM_API.h:782
USBDM_Connect
USBDM_API USBDM_ErrorCode USBDM_Connect(void)
Connects to Target.
CFVx_DRegCSR
CSR.
Definition: USBDM_API.h:677
USBDM_SetLogFile
USBDM_API void USBDM_SetLogFile(FILE *fp)
Set log file for messages.
USBDM_SetExtendedOptions
USBDM_API USBDM_ErrorCode USBDM_SetExtendedOptions(const USBDM_ExtendedOptions_t *newBdmOptions)
Set BDM interface options.
CFV1_DRegDBR
DBR.
Definition: USBDM_API.h:662
CFVx_DRegBDMR
DBMR - mask for DBR.
Definition: USBDM_API.h:686
PIN_TA
Mask for TA signal.
Definition: USBDM_API.h:768
BDM_Options_t::maskInterrupts
int maskInterrupts
Whether to mask interrupts when stepping.
Definition: USBDM_API.h:823
CFV1_RegA6
A6.
Definition: USBDM_API.h:381
ARM_RegMISC
[31:24]=CONTROL,[23:16]=FAULTMASK,[15:8]=BASEPRI,[7:0]=PRIMASK.
Definition: USBDM_API.h:442
CFV1_DRegXCSR
XCSR.
Definition: USBDM_API.h:652
USBDM_Version_t::icpSoftwareVersion
unsigned char icpSoftwareVersion
Version of ICP bootloader Firmware.
Definition: USBDM_API.h:865
PIN_DE
Mask for DE signal.
Definition: USBDM_API.h:774
HCS12_DRegCCR
Definition: USBDM_API.h:630
AUTOCONNECT_NEVER
Only connect explicitly.
Definition: USBDM_API.h:259
BDM_TARGET_VPP_ERROR
Target Vpp ??
Definition: USBDM_API.h:282
PIN_SWD_LOW
Set SWD low.
Definition: USBDM_API.h:795
CFVx_RegisterIndex_t
CFVx_RegisterIndex_t
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with Coldfire Vx target
Definition: USBDM_API.h:467
BDM_CAP_CFVx
Support for CFV 1,2 & 3.
Definition: USBDM_API.h:120
CFV1_CRegSR
Status register.
Definition: USBDM_API.h:560
PIN_BKPT_LOW
Set BKPT low.
Definition: USBDM_API.h:789
PIN_BKPT
Mask for BKPT signal.
Definition: USBDM_API.h:786
BDM_Options_t::autoReconnect
int autoReconnect
Automatically re-connect to target (for speed change)
Definition: USBDM_API.h:819
BDM_CAP_ARM_JTAG
Supports ARM targets via JTAG.
Definition: USBDM_API.h:125
TARGET_HALTED
CFVx target halted (ALLPST == 1)
Definition: USBDM_API.h:244
CFV1_DRegCSR3
CSR3.
Definition: USBDM_API.h:654
CFV1_DRegABLR
ABLR.
Definition: USBDM_API.h:661
USBDM_RebootToICP
USBDM_API void USBDM_RebootToICP(void)
Set BDM for ICP mode & immediately reboots - used in BDM mode only.
USBDMStatus_t::connection_state
SpeedMode_t connection_state
Connection status & speed determination method.
Definition: USBDM_API.h:719
ARM_DRegAPReg0
AP reg #0.
Definition: USBDM_API.h:703
HCS08_RegA
A reg.
Definition: USBDM_API.h:352
USBDM_ReadReg
USBDM_API USBDM_ErrorCode USBDM_ReadReg(unsigned int regNo, unsigned long *regValue)
Read Target Core register.
USBDM_TargetReset
USBDM_API USBDM_ErrorCode USBDM_TargetReset(TargetMode_t target_mode)
Resets the target to normal or special mode.
CFVx_RegD4
D4.
Definition: USBDM_API.h:405
CFVx_Registers_t
CFVx_Registers_t
regNo Parameter for USBDM_ReadReg() with CFVx target
Definition: USBDM_API.h:400
JTAG_EXIT_SHIFT_DR
Exit SHIFT-XX & enter SHIFT-DR w/o crossing RUN-TEST/IDLE.
Definition: USBDM_API.h:738
CFVx_CRegOTHER_SP
Other A7 (not active in target)
Definition: USBDM_API.h:583
CFV1_CRegisters_t
CFV1_CRegisters_t
regNo Parameter for USBDM_ReadCReg() with CFV1 target
Definition: USBDM_API.h:553
USBDM_ExtendedOptions_t::powerOffDuration
unsigned powerOffDuration
How long to remove power (ms)
Definition: USBDM_API.h:852
JTAG_EXIT_IDLE
Exit SHIFT-XX to RUN-TEST/IDLE.
Definition: USBDM_API.h:737
BDM_Options_t::manuallyCycleVdd
int manuallyCycleVdd
Prompt user to manually cycle Vdd on connection problems.
Definition: USBDM_API.h:827
S12Z_RegD1
D1 reg.
Definition: USBDM_API.h:332
CFV1_CRegOTHER_A7
Other A7 (not active in target)
Definition: USBDM_API.h:554
CFV1_DRegCSR2byte
CSR2.msb.
Definition: USBDM_API.h:670
PIN_SWD
Mask for SWD values (PIN_SWD_LOW, PIN_SWD_HIGH & PIN_SWD_3STATE)
Definition: USBDM_API.h:792
USBDM_WriteMemory
USBDM_API USBDM_ErrorCode USBDM_WriteMemory(unsigned int memorySpace, unsigned int byteCount, unsigned int address, unsigned const char *data)
Write data to target memory.
BDM_CAP_PST
Supports PST signal sensing.
Definition: USBDM_API.h:127
ARM_DRegAPReg1
AP reg #1.
Definition: USBDM_API.h:704
PIN_BKGD_HIGH
Set BKGD high.
Definition: USBDM_API.h:758
CFV1_RegD6
D6.
Definition: USBDM_API.h:373
CFVx_DRegBAAR
BAAR.
Definition: USBDM_API.h:678
CFV1_RegD0
D0.
Definition: USBDM_API.h:367
PIN_BKPT_NC
No change.
Definition: USBDM_API.h:787
HCS12_Registers_t
HCS12_Registers_t
regNo Parameter for USBDM_ReadReg() with HCS12 target
Definition: USBDM_API.h:318
PinLevelMasks_t
PinLevelMasks_t
Control signal masks for CMD_USBDM_CONTROL_PIN (USBDM_ControlPins())
Definition: USBDM_API.h:752
BDM_TARGET_VDD_ENABLE
Target Vdd internal at last set level.
Definition: USBDM_API.h:272
USBDM_ICP_Reboot
USBDM_API void USBDM_ICP_Reboot(void)
ICP mode - reboot.
S12Z_RegX
X reg.
Definition: USBDM_API.h:339
BDM_TARGET_VDD_3V3
Target Vdd internal 3.3V.
Definition: USBDM_API.h:270
DSC_Registers_t
DSC_Registers_t
regNo Parameter for DSC_ReadReg() with DSC target DSC Core registers
Definition: USBDM_API.h:475
ARM_DRegAPReg3
AP reg #3.
Definition: USBDM_API.h:706
CFVx_RegA0
A0.
Definition: USBDM_API.h:409
BDM_CAP_S12Z
Supports HCS12Z targets via SWD.
Definition: USBDM_API.h:130
BDM_Options_t::interfaceSpeed
int interfaceSpeed
CFVx/JTAG etc - Interface speed (kHz). .
Definition: USBDM_API.h:829
HCS12_RegX
X reg.
Definition: USBDM_API.h:321
ARM_RegFPSCR
Floating point control register.
Definition: USBDM_API.h:444
CFV1_DRegAATR
AATR.
Definition: USBDM_API.h:656
T_HCS08
HCS08 target.
Definition: USBDM_API.h:166
TargetRunState_t
TargetRunState_t
Target Halt state.
Definition: USBDM_API.h:242
CFVx_DRegPBR2
PBR2.
Definition: USBDM_API.h:688
USBDM_JTAG_ReadWrite
USBDM_API USBDM_ErrorCode USBDM_JTAG_ReadWrite(unsigned char bitCount, unsigned char exit, const unsigned char *outBuffer, unsigned char *inBuffer)
JTAG - read/write data from/to JTAG shift register SHIFT_DR => TMS=Nx0, TDI=0, TDO=NxData (captured)
CFV1_RegD4
D4.
Definition: USBDM_API.h:371
CFVx_RegIndexFirstCore
First code reg.
Definition: USBDM_API.h:468
USBDM_ExtendedOptions_t::interfaceFrequency
unsigned interfaceFrequency
CFVx/JTAG etc - Interface speed (kHz)
Definition: USBDM_API.h:850
CFVx_RegA4
A4.
Definition: USBDM_API.h:413
T_JTAG
JTAG target - TAP is set to RUN-TEST/IDLE.
Definition: USBDM_API.h:170
CFV1_RegD1
D1.
Definition: USBDM_API.h:368
RESET_ALL
Use all reset strategies as appropriate.
Definition: USBDM_API.h:301
RSTO_ACTIVE
RSTO* is currently active [low].
Definition: USBDM_API.h:228
USBDM_FindDevices
USBDM_API USBDM_ErrorCode USBDM_FindDevices(unsigned int *deviceCount)
Find USBDM Devices This function creates an internal list of USBDM devices.
RESET_MODE_MASK
Mask for reset mode (SPECIAL/NORMAL)
Definition: USBDM_API.h:296
ARM_RegR5
R5.
Definition: USBDM_API.h:428
PIN_SWD_HIGH
Set SWD high.
Definition: USBDM_API.h:796
ARM_RegR0
R0.
Definition: USBDM_API.h:423
USBDM_ExtendedOptions_t::leaveTargetPowered
bool leaveTargetPowered
Leave target power on exit.
Definition: USBDM_API.h:844
CFV1_CRegMACSR
MACSR.
Definition: USBDM_API.h:557
CFVx_RegD0
D0.
Definition: USBDM_API.h:401
ARM_RegR3
R3.
Definition: USBDM_API.h:426
USBDM_DLLVersionString
const USBDM_API char * USBDM_DLLVersionString(void)
Get version string for DLL.
BDM_CAP_CFV1
Supports CFV1 targets - inverted when queried.
Definition: USBDM_API.h:122
CFV1_DRegCSR2
CSR2.
Definition: USBDM_API.h:653
CFVx_CRegisters_t
CFVx_CRegisters_t
regNo Parameter for USBDM_ReadCReg() with CFVx target
Definition: USBDM_API.h:566
USBDM_ReadMultipleRegs
USBDM_API USBDM_ErrorCode USBDM_ReadMultipleRegs(unsigned char regValueBuffer[], unsigned int startRegIndex, unsigned int endRegIndex)
Read Multiple Core registers.
PIN_BKGD_LOW
Set BKGD low.
Definition: USBDM_API.h:757
USBDM_ReadCReg
USBDM_API USBDM_ErrorCode USBDM_ReadCReg(unsigned int regNo, unsigned long *regValue)
Read Target Control register.
RESET_SOFTWARE
Use software (BDM commands) reset.
Definition: USBDM_API.h:303
CFV1_RegA5
A5.
Definition: USBDM_API.h:380
USBDM_ExtendedOptions_t::cycleVddOnConnect
bool cycleVddOnConnect
Cycle target Power if connection problems)
Definition: USBDM_API.h:843
HCS12_RegCCR
CCR reg - redirected to USBDM_ReadDReg()
Definition: USBDM_API.h:324
BDM_CAP_HCS08
Supports HCS08 targets - inverted when queried.
Definition: USBDM_API.h:121
ARM_CRegMDM_AP_Ident
Identifier register (should read 0x001C_0000)
Definition: USBDM_API.h:614
CFV1_DRegPBMR
PBMR - mask for PBR0.
Definition: USBDM_API.h:659
USBDM_bdmInformation_t::BDMsoftwareVersion
int BDMsoftwareVersion
BDM Firmware version as 3 bytes (4.10.4 => 0x040A04)
Definition: USBDM_API.h:872
T_ILLEGAL
Used to indicate error in selecting target.
Definition: USBDM_API.h:178
PIN_SWCLK_HIGH
Set SWD high.
Definition: USBDM_API.h:803
BDM_TARGET_VDD_DISABLE
Target Vdd Off but previously set level unchanged.
Definition: USBDM_API.h:273
USBDM_ControlPins
USBDM_API USBDM_ErrorCode USBDM_ControlPins(unsigned int control, unsigned int *status)
Directly manipulate interface levels.
USBDM_API
#define USBDM_API
Importing the DLL.
Definition: USBDM_API.h:90
PIN_SWD_NC
No change.
Definition: USBDM_API.h:793
TargetMode_t
TargetMode_t
Reset mode as used by CMD_USBDM_TARGET_RESET.
Definition: USBDM_API.h:295
ARM_RegR4
R4.
Definition: USBDM_API.h:427
JTAG_SHIFT_DR
Enter SHIFT-DR (from TEST-LOGIC-RESET or RUN-TEST/IDLE)
Definition: USBDM_API.h:746
USBDM_SetOptions
USBDM_API USBDM_ErrorCode USBDM_SetOptions(BDM_Options_t *newBdmOptions)
Set BDM interface options.
BDM_Options_t::miscOptions
int miscOptions
Various misc options.
Definition: USBDM_API.h:830
USBDM_WriteControlReg
USBDM_API USBDM_ErrorCode USBDM_WriteControlReg(unsigned int value)
Write Target Control Register byte.
CFVx_DRegPBR1
PBR1.
Definition: USBDM_API.h:687
RESET_NORMAL
Normal mode [usual reset, Target executes].
Definition: USBDM_API.h:298
HCS12_RegSP
SP reg.
Definition: USBDM_API.h:323
USBDM_bdmInformation_t::commandBufferSize
unsigned commandBufferSize
Size of BDM Communication buffer.
Definition: USBDM_API.h:877
USBDM_Version_t
Structure to hold version information for BDM.
Definition: USBDM_API.h:862
USBDM_ExtendedOptions_t::guessSpeed
bool guessSpeed
Guess speed for target w/o ACKN.
Definition: USBDM_API.h:846
USBDMStatus_t::flash_state
TargetVppSelect_t flash_state
State of Target Vpp.
Definition: USBDM_API.h:724
AcknMode_t
AcknMode_t
Target supports ACKN or uses fixed delay {WAIT} instead.
Definition: USBDM_API.h:211
USBDM_ReadDReg
USBDM_API USBDM_ErrorCode USBDM_ReadDReg(unsigned int regNo, unsigned long *regValue)
Read Target Debug register.
CFV1_RegMACSR
MACSR.
Definition: USBDM_API.h:391
CFV1_RegD3
D3.
Definition: USBDM_API.h:370
AUTOCONNECT_ALWAYS
Reconnect before every command.
Definition: USBDM_API.h:261
S12Z_RegPC
PC reg.
Definition: USBDM_API.h:342
SPEED_GUESSED
Speed determined by trial & error.
Definition: USBDM_API.h:221
PIN_TRST
Mask for TRST signal (not implemented)
Definition: USBDM_API.h:780
CFV1_RegIndexFirstCore
First code reg.
Definition: USBDM_API.h:461
CFV1_RegIndexLastCore
Last core reg (18 regs D0..D7,A0..A7,SR,PC)
Definition: USBDM_API.h:462
ARM_RegFPS0
Floating point +0..+31.
Definition: USBDM_API.h:445
ARM_CRegAHB_AP_TAR
AHB-AP Transfer Address register.
Definition: USBDM_API.h:604
ARM_CRegisters_t
ARM_CRegisters_t
regNo Parameter for USBDM_ReadCReg() with SWD-ARM target
Definition: USBDM_API.h:601
PIN_RESET_LOW
Set Reset low.
Definition: USBDM_API.h:764
BDM_CAP_RST
Control & sensing of RESET.
Definition: USBDM_API.h:126
CFV1_DRegXCSRbyte
XCSR.msb.
Definition: USBDM_API.h:669
USBDM_bdmInformation_t::ICPhardwareVersion
int ICPhardwareVersion
Hardware version reported by ICP firmware.
Definition: USBDM_API.h:875
CFV1_RegD2
D2.
Definition: USBDM_API.h:369
CFV1_RegA1
A1.
Definition: USBDM_API.h:376
JTAG_EXIT_SHIFT_IR
Exit SHIFT-XX & enter SHIFT-IR w/o crossing RUN-TEST/IDLE.
Definition: USBDM_API.h:739
T_HCS12
HC12 or HCS12 target.
Definition: USBDM_API.h:165
ARM_RegR12
R12.
Definition: USBDM_API.h:435
BDM_Options_t::useAltBDMClock
int useAltBDMClock
Use alternative BDM clock source in target.
Definition: USBDM_API.h:821
RSTO_INACTIVE
RSTO* is currently inactive [high].
Definition: USBDM_API.h:229
ARM_RegR6
R6.
Definition: USBDM_API.h:429
SPEED_NO_INFO
Not connected.
Definition: USBDM_API.h:219
ARM_DRegRDBUFF
RDBUFF reg - read only.
Definition: USBDM_API.h:701
USBDM_GetBDMDescription
USBDM_API USBDM_ErrorCode USBDM_GetBDMDescription(const char **deviceDescription)
Obtain description of the currently opened BDM.
USBDM_Exit
USBDM_API USBDM_ErrorCode USBDM_Exit(void)
Clean up.
USBDM_ReadStatusReg
USBDM_API USBDM_ErrorCode USBDM_ReadStatusReg(unsigned long *BDMStatusReg)
Reads Target Status register byte.
CFV1_DRegCSR3byte
CSR3.msb.
Definition: USBDM_API.h:671
CFVx_DRegisters_t
CFVx_DRegisters_t
regNo Parameter for USBDM_ReadDReg() with CFV1 target
Definition: USBDM_API.h:676
CFVx_CRegD0
D0-D7.
Definition: USBDM_API.h:567
BDM_TARGET_VDD_NONE
Target Vdd not detected.
Definition: USBDM_API.h:250
RESET_DETECTED
Reset since last polled.
Definition: USBDM_API.h:237
CFV1_RegOTHER_A7
Other A7 (not active in target)
Definition: USBDM_API.h:388
USBDM_SetTargetVpp
USBDM_API USBDM_ErrorCode USBDM_SetTargetVpp(TargetVppSelect_t targetVpp)
Sets Target programming voltage.
PIN_BKGD_NC
No change.
Definition: USBDM_API.h:755
USBDM_ICP_Verify
USBDM_API USBDM_ErrorCode USBDM_ICP_Verify(unsigned int addr, unsigned int count, unsigned char *data)
ICP mode - verify BDM Flash memory.
BDM_TARGET_VDD_EXT
Target Vdd external.
Definition: USBDM_API.h:251
TargetVddSelect_t
TargetVddSelect_t
Internal Target Voltage supply selection.
Definition: USBDM_API.h:268
CFVx_DRegPBR0
PBR0.
Definition: USBDM_API.h:681
JTAG_EXIT_ACTION_MASK
Mask for Exit actions.
Definition: USBDM_API.h:740
SpeedMode_t
SpeedMode_t
Target speed selection.
Definition: USBDM_API.h:218
ARM_CRegMDM_AP_Control
Control register.
Definition: USBDM_API.h:613
USBDM_Version_t::icpHardwareVersion
unsigned char icpHardwareVersion
Version of Hardware (reported by ICP code)
Definition: USBDM_API.h:866
WAIT
Use WAIT (delay) instead.
Definition: USBDM_API.h:212
BDM_Options_t::cycleVddOnReset
int cycleVddOnReset
Cycle target Power when resetting.
Definition: USBDM_API.h:816
USBDM_Debug
USBDM_API USBDM_ErrorCode USBDM_Debug(unsigned char *usb_data)
Execute debug command (various, see DebugSubCommands)
TargetVppSelect_t
TargetVppSelect_t
Internal Programming Voltage supply selection.
Definition: USBDM_API.h:278
CFVx_RegA3
A3.
Definition: USBDM_API.h:412
USBDM_bdmInformation_t::size
unsigned size
Size of this structure.
Definition: USBDM_API.h:871
ARM_RegR9
R9.
Definition: USBDM_API.h:432
CFV1_DRegABHR
ABHR.
Definition: USBDM_API.h:660
CFVx_RegD5
D5.
Definition: USBDM_API.h:406
USBDM_GetVersion
USBDM_API USBDM_ErrorCode USBDM_GetVersion(USBDM_Version_t *version)
Gets BDM software version and type of hardware.
CFVx_RegA5
A5.
Definition: USBDM_API.h:414
BDM_TARGET_VDD_ERR
Target Vdd error.
Definition: USBDM_API.h:253
PIN_NOCHANGE
No change to pins (used to get pin status)
Definition: USBDM_API.h:805
CFV1_RegA7
A7.
Definition: USBDM_API.h:382
CFV1_RegA0
A0.
Definition: USBDM_API.h:375
T_ARM
ARM target using either SWD (preferred) or JTAG as supported.
Definition: USBDM_API.h:175
USBDM_JTAG_SelectShift
USBDM_API USBDM_ErrorCode USBDM_JTAG_SelectShift(unsigned char mode)
JTAG - move the TAP to SHIFT-DR or SHIFT-IR state SHIFT_DR => TMS=100, TDI=0 (Actually TMS=0000_0100)...
USBDM_ExtendedOptions_t::maskInterrupts
bool maskInterrupts
Whether to mask interrupts when stepping.
Definition: USBDM_API.h:849
USBDMStatus_t::reset_state
ResetState_t reset_state
Current target RST0 state.
Definition: USBDM_API.h:720
CFVx_CRegA0
A0-A7.
Definition: USBDM_API.h:575
PIN_SWCLK_NC
No change.
Definition: USBDM_API.h:800
CFV1_RegA4
A4.
Definition: USBDM_API.h:379
PIN_SWCLK_3STATE
Set SWD 3-state.
Definition: USBDM_API.h:801
USBDM_WriteCReg
USBDM_API USBDM_ErrorCode USBDM_WriteCReg(unsigned int regNo, unsigned long regValue)
Write Target Control register.
CFVx_DRegABLR
ABLR.
Definition: USBDM_API.h:684
TargetType_t
TargetType_t
Target microcontroller types.
Definition: USBDM_API.h:163
S12Z_RegD6
D6 reg.
Definition: USBDM_API.h:337
HardwareCapabilities_t
HardwareCapabilities_t
Capabilities of the hardware.
Definition: USBDM_API.h:113
HCS12_DRegisters_t
HCS12_DRegisters_t
regNo Parameter for USBDM_ReadDReg() with HCS12 target [BD Space]
Definition: USBDM_API.h:627
CS_DEFAULT
Use default clock selection (don't modify target's reset default)
Definition: USBDM_API.h:288
CFV1_DRegisters_t
CFV1_DRegisters_t
regNo Parameter for USBDM_ReadDReg() with CFV1 target
Definition: USBDM_API.h:650
HCS12_DRegBDMSTS
Definition: USBDM_API.h:629
HCS12_RegY
Y reg.
Definition: USBDM_API.h:322
ARM_DRegRESEND
RESEND reg - read only.
Definition: USBDM_API.h:699
USBDM_bdmInformation_t
Structure describing characteristics of currently open BDM.
Definition: USBDM_API.h:870
PIN_DE_LOW
Set DE low.
Definition: USBDM_API.h:777
USBDM_BDMCommand
USBDM_API USBDM_ErrorCode USBDM_BDMCommand(unsigned int txSize, unsigned int rxSize, unsigned char data[])
RESET_HARDWARE
Use hardware RESET pin reset.
Definition: USBDM_API.h:302
ARM_RegPC
PC (Debug return address)
Definition: USBDM_API.h:438
S12Z_RegSP
SP reg.
Definition: USBDM_API.h:341
CFV1_RegSR
Status register.
Definition: USBDM_API.h:394
USBDM_ErrorMessages.h
USBDM error codes.
ARM_RegR11
R11.
Definition: USBDM_API.h:434
PIN_TA_3STATE
Set TA 3-state.
Definition: USBDM_API.h:770
T_MC56F80xx
JTAG target with MC56F80xx optimised subroutines.
Definition: USBDM_API.h:172
USBDM_ExtendedOptions_t::powerOnRecoveryInterval
unsigned powerOnRecoveryInterval
How long to wait after power enabled (ms)
Definition: USBDM_API.h:853
AUTOCONNECT_STATUS
Reconnect on USBDM_ReadStatusReg()
Definition: USBDM_API.h:260
PIN_SWCLK_LOW
Set SWD low.
Definition: USBDM_API.h:802
BDM_Options_t::useResetSignal
int useResetSignal
Whether to use RESET signal on BDM interface.
Definition: USBDM_API.h:822
NO_RESET_ACTIVITY
No reset activity since last polled.
Definition: USBDM_API.h:235
BDM_CAP_DSC
Supports DSC targets.
Definition: USBDM_API.h:124
RESET_DEFAULT
Use target specific default method.
Definition: USBDM_API.h:306
USBDM_GetErrorString
const USBDM_API char * USBDM_GetErrorString(USBDM_ErrorCode errorCode)
Gets string describing a USBDM error code.
BDM_TARGET_VPP_OFF
Target Vpp Off.
Definition: USBDM_API.h:279
USBDM_GetExtendedOptions
USBDM_API USBDM_ErrorCode USBDM_GetExtendedOptions(USBDM_ExtendedOptions_t *currentBdmOptions)
Get BDM interface options.
CFV1_DRegBAAR
BAAR.
Definition: USBDM_API.h:655
CFVx_RegA2
A2.
Definition: USBDM_API.h:411
RESET_POWER
Cycle power.
Definition: USBDM_API.h:304
ARM_DRegCONTROL
CONTROL reg - write only.
Definition: USBDM_API.h:698
USBDM_GetCapabilities
USBDM_API USBDM_ErrorCode USBDM_GetCapabilities(HardwareCapabilities_t *capabilities)
Obtains the Capability vector from the BDM interface.
HCS08_RegPC
PC reg.
Definition: USBDM_API.h:349
ACKN
Target supports ACKN feature and it is enabled.
Definition: USBDM_API.h:213
ARM_RegR8
R8.
Definition: USBDM_API.h:431
PIN_RESET
Mask for RESET values (PIN_RESET_LOW & PIN_RESET_3STATE)
Definition: USBDM_API.h:761
ARM_RegPSP
Process Stack pointer.
Definition: USBDM_API.h:441
CFVx_DRegDBR
DBR.
Definition: USBDM_API.h:685
CFV1_CRegFLASHBAR
Flash Base register.
Definition: USBDM_API.h:587
BDM_TARGET_VDD_INT
Target Vdd internal.
Definition: USBDM_API.h:252
USBDMStatus_t::power_state
TargetVddState_t power_state
Target has power?
Definition: USBDM_API.h:723
ARM_DRegSTATUS
STATUS reg - read only.
Definition: USBDM_API.h:697
USBDM_Close
USBDM_API USBDM_ErrorCode USBDM_Close(void)
Closes currently open device.
ARM_RegR2
R2.
Definition: USBDM_API.h:425
USBDM_ExtendedOptions_t::resetReleaseInterval
unsigned resetReleaseInterval
How long to wait after reset release to release other signals (ms)
Definition: USBDM_API.h:855
BDM_Options_t::derivative_type
int derivative_type
RS08 Derivative.
Definition: USBDM_API.h:828
ARM_RegR7
R7.
Definition: USBDM_API.h:430
ARM_CRegAHB_AP_CFG
AHB-AP Config register.
Definition: USBDM_API.h:607
BDM_TARGET_VPP_STANDBY
Target Vpp Standby (Inverter on, Vpp off)
Definition: USBDM_API.h:280
USBDM_ExtendedOptions_t::cycleVddOnReset
bool cycleVddOnReset
Cycle target Power when resetting.
Definition: USBDM_API.h:842
CFVx_DRegPBMR
PBMR - mask for PBR0.
Definition: USBDM_API.h:682
T_EZFLASH
EzPort Flash interface (SPI?)
Definition: USBDM_API.h:171
USBDM_bdmInformation_t::capabilities
HardwareCapabilities_t capabilities
BDM Capabilities.
Definition: USBDM_API.h:876
CFV1_Registers_t
CFV1_Registers_t
regNo Parameter for USBDM_ReadReg() with CFV1 target
Definition: USBDM_API.h:366
CFVx_CRegVBR
Vector Base register.
Definition: USBDM_API.h:584
CFVx_RegIndexLastCore
Last core reg (18 regs D0..D7,A0..A7,SR,PC)
Definition: USBDM_API.h:469
CFVx_RegD7
D7.
Definition: USBDM_API.h:408
T_HC12
HC12 or HCS12 target.
Definition: USBDM_API.h:164
BDM_CAP_ARM_SWD
Supports ARM targets via SWD.
Definition: USBDM_API.h:129
HCS08_RegHX
HX reg.
Definition: USBDM_API.h:351
T_S12Z
S12Z target.
Definition: USBDM_API.h:176
RS08_RegSPC
Shadow PC.
Definition: USBDM_API.h:360
USBDMStatus_t::ackn_state
AcknMode_t ackn_state
Supports ACKN ?
Definition: USBDM_API.h:718
BDM_CAP_HCS12
Supports HCS12.
Definition: USBDM_API.h:116
CFVx_DRegPBR3
PBR3.
Definition: USBDM_API.h:689
USBDM_JTAG_Write
USBDM_API USBDM_ErrorCode USBDM_JTAG_Write(unsigned char bitCount, unsigned char exit, const unsigned char *buffer)
JTAG - write data to JTAG shift register STAY_SHIFT => TMS=Nx0, TDI=NxData EXIT_SHIFT_DR => TMS=Nx0,...
CFVx_DRegAATR
AATR.
Definition: USBDM_API.h:679
PIN_RESET_NC
No change.
Definition: USBDM_API.h:762
TARGET_RUNNING
CFVx target running (ALLPST == 0)
Definition: USBDM_API.h:243
USBDM_JTAG_Reset
USBDM_API USBDM_ErrorCode USBDM_JTAG_Reset(void)
JTAG - Moves the TAP to TEST-LOGIC-RESET state TMS=11111, TDI=00000 or similar.
SPEED_SYNC
Speed determined by SYNC.
Definition: USBDM_API.h:220
USBDM_GetLogFile
USBDM_API FILE * USBDM_GetLogFile(void)
Get current log file for messages.
USBDM_ExtendedOptions_t::useResetSignal
bool useResetSignal
Whether to use RESET signal on BDM interface.
Definition: USBDM_API.h:848
ARM_RegSP
SP.
Definition: USBDM_API.h:436
CFV1_DRegCSR
CSR.
Definition: USBDM_API.h:651
USBDM_ExtendedOptions_t::targetType
TargetType_t targetType
Target type.
Definition: USBDM_API.h:840
CFV1_CRegRAMBAR
RAM Base register.
Definition: USBDM_API.h:588
USBDM_Version_t::bdmHardwareVersion
unsigned char bdmHardwareVersion
Version of USBDM Hardware.
Definition: USBDM_API.h:864
CFV1_RegVBR
Vector Base register.
Definition: USBDM_API.h:389
USBDM_TargetStep
USBDM_API USBDM_ErrorCode USBDM_TargetStep(void)
Steps over a single target instruction.
S12Z_RegD3
D3 reg.
Definition: USBDM_API.h:334
USBDM_TargetHalt
USBDM_API USBDM_ErrorCode USBDM_TargetHalt(void)
Brings the target into active background mode.
BDM_CAP_CDC
Supports CDC Serial over USB interface.
Definition: USBDM_API.h:128
ARM_RegR1
R1.
Definition: USBDM_API.h:424
PIN_TA_NC
No change.
Definition: USBDM_API.h:769
USBDM_ExtendedOptions_t::autoReconnect
AutoConnect_t autoReconnect
Automatically re-connect to target (for speed change)
Definition: USBDM_API.h:845
USBDMStatus_t::reset_recent
ResetMode_t reset_recent
Target reset recently?
Definition: USBDM_API.h:721
CFVx_RegD2
D2.
Definition: USBDM_API.h:403
T_ARM_JTAG
ARM target using JTAG.
Definition: USBDM_API.h:173
MemorySpace_t
MemorySpace_t
Memory space indicator - includes element size.
Definition: USBDM_API.h:185
CFVx_RegD1
D1.
Definition: USBDM_API.h:402
ARM_RegIndexFirstFloat
First float register.
Definition: USBDM_API.h:454
USBDMStatus_t::target_type
TargetType_t target_type
Type of target (HCS12, HCS08 etc)
Definition: USBDM_API.h:717
CS_NORMAL_CLK
Force Normal clock (CLKSW = 1)
Definition: USBDM_API.h:290
USBDM_ICP_Program
USBDM_API USBDM_ErrorCode USBDM_ICP_Program(unsigned int addr, unsigned int count, unsigned char *data)
ICP mode - program BDM Flash memory.
USBDM_TargetGo
USBDM_API USBDM_ErrorCode USBDM_TargetGo(void)
Starts target execution from current PC address.
PIN_BKGD
Mask for BKGD values (PIN_BKGD_LOW, PIN_BKGD_HIGH & PIN_BKGD_3STATE)
Definition: USBDM_API.h:754
T_OFF
Turn off interface (no target)
Definition: USBDM_API.h:179
PIN_TRST_NC
No change.
Definition: USBDM_API.h:781
USBDM_ExtendedOptions_t
BDM interface options.
Definition: USBDM_API.h:837
ResetState_t
ResetState_t
Target RSTO state.
Definition: USBDM_API.h:227
USBDM_ReadMemory
USBDM_API USBDM_ErrorCode USBDM_ReadMemory(unsigned int memorySpace, unsigned int byteCount, unsigned int address, unsigned char *data)
Read data from target memory.
RS08_RegCCR_PC
Combined CCR/PC register.
Definition: USBDM_API.h:359
BDM_Options_t::targetVdd
int targetVdd
Target Vdd (off, 3.3V or 5V)
Definition: USBDM_API.h:815
CFV1_DRegPBR3
PBR3.
Definition: USBDM_API.h:666
HCS12_DRegBDMINR
Definition: USBDM_API.h:631
BDM_CAP_VDDCONTROL
Control over target Vdd.
Definition: USBDM_API.h:118
BDM_CAP_JTAG
Supports JTAG targets.
Definition: USBDM_API.h:123
BDM_TARGET_VPP_ON
Target Vpp On.
Definition: USBDM_API.h:281
RS08_DRegBKPT
Breakpoint register.
Definition: USBDM_API.h:644
USBDM_BasicConnect
USBDM_API USBDM_ErrorCode USBDM_BasicConnect(void)
Does basic connect to target.
USBDM_ReleaseDevices
USBDM_API USBDM_ErrorCode USBDM_ReleaseDevices(void)
Release USBDM Device list.
TargetVddState_t
TargetVddState_t
Target Voltage supply state.
Definition: USBDM_API.h:249
ARM_CRegAHB_AP_Base
AHB-AP IDebug base address register.
Definition: USBDM_API.h:608