USBDM
V4.12
|
Header file for USBDM_API.c. More...
Go to the source code of this file.
Classes | |
struct | USBDMStatus_t |
State of BDM Communication. More... | |
struct | BDM_Options_t |
BDM interface options. More... | |
struct | USBDM_ExtendedOptions_t |
BDM interface options. More... | |
struct | USBDM_Version_t |
Structure to hold version information for BDM. More... | |
struct | USBDM_bdmInformation_t |
Structure describing characteristics of currently open BDM. More... | |
Macros | |
#define | CPP_DLL_EXPORT __attribute__ ((visibility ("default"))) |
Functions exported from a library. | |
#define | CPP_DLL_IMPORT __attribute__ ((visibility ("default"))) |
Functions imported from a library. | |
#define | CPP_DLL_LOCAL __attribute__ ((visibility ("hidden"))) |
Functions local to a library. | |
#define | EXTERN_C |
Usual C interface for C. | |
#define | USBDM_API EXTERN_C CPP_DLL_IMPORT |
Importing the DLL. | |
#define | bool char |
Define bool for C to be consistent with C++! | |
#define | USBDM_API_VERSION (0x40A06) |
USBDM Version this header describes. | |
#define | CAP_HCS12 (1<<0) |
Supports HCS12 targets. | |
#define | CAP_RS08 (1<<1) |
Supports RS08 targets. | |
#define | CAP_VDDCONTROL (1<<2) |
Control over target Vdd. | |
#define | CAP_VDDSENSE (1<<3) |
Sensing of target Vdd. | |
#define | CAP_CFVx (1<<4) |
Supports CFVx. | |
#define | CAP_HCS08 (1<<5) |
Supports HCS08 targets - inverted when queried. | |
#define | CAP_CFV1 (1<<6) |
Supports CFV1 targets - inverted when queried. | |
#define | CAP_JTAG (1<<7) |
Supports JTAG targets. | |
#define | CAP_DSC (1<<8) |
Supports DSC targets. | |
#define | CAP_ARM_JTAG (1<<9) |
Supports ARM targets via JTAG. | |
#define | CAP_RST (1<<10) |
Control & sensing of RESET. | |
#define | CAP_PST (1<<11) |
Supports PST signal sensing. | |
#define | CAP_CDC (1<<12) |
Supports CDC Serial over USB interface. | |
#define | CAP_ARM_SWD (1<<13) |
Supports ARM targets via SWD. | |
Enumerations | |
enum | HardwareCapabilities_t { , BDM_CAP_HCS12 = (1<<0), BDM_CAP_RS08 = (1<<1), BDM_CAP_VDDCONTROL = (1<<2), BDM_CAP_VDDSENSE = (1<<3), BDM_CAP_CFVx = (1<<4), BDM_CAP_HCS08 = (1<<5), BDM_CAP_CFV1 = (1<<6), BDM_CAP_JTAG = (1<<7), BDM_CAP_DSC = (1<<8), BDM_CAP_ARM_JTAG = (1<<9), BDM_CAP_RST = (1<<10), BDM_CAP_PST = (1<<11), BDM_CAP_CDC = (1<<12), BDM_CAP_ARM_SWD = (1<<13), BDM_CAP_S12Z = (1<<14) } |
Capabilities of the hardware. More... | |
enum | TargetType_t { T_HC12 = 0, T_HCS12 = T_HC12, T_HCS08 = 1, T_RS08 = 2, T_CFV1 = 3, T_CFVx = 4, T_JTAG = 5, T_EZFLASH = 6, T_MC56F80xx = 7, T_ARM_JTAG = 8, T_ARM_SWD = 9, T_ARM = 10, T_S12Z = 11 , T_ILLEGAL = 0xFE, T_OFF = 0xFF } |
Target microcontroller types. More... | |
enum | MemorySpace_t |
Memory space indicator - includes element size. | |
enum | AcknMode_t { WAIT = 0, ACKN = 1 } |
Target supports ACKN or uses fixed delay {WAIT} instead. More... | |
enum | SpeedMode_t { SPEED_NO_INFO = 0, SPEED_SYNC = 1, SPEED_GUESSED = 2, SPEED_USER_SUPPLIED = 3 } |
Target speed selection. More... | |
enum | ResetState_t { RSTO_ACTIVE =0, RSTO_INACTIVE =1 } |
Target RSTO state. More... | |
enum | ResetMode_t { NO_RESET_ACTIVITY = 0 , RESET_DETECTED = 1 } |
Target reset status values. More... | |
enum | TargetRunState_t { TARGET_RUNNING = 0, TARGET_HALTED = 1 } |
Target Halt state. More... | |
enum | TargetVddState_t { BDM_TARGET_VDD_NONE = 0, BDM_TARGET_VDD_EXT = 1, BDM_TARGET_VDD_INT = 2, BDM_TARGET_VDD_ERR = 3 } |
Target Voltage supply state. More... | |
enum | AutoConnect_t { AUTOCONNECT_NEVER = 0, AUTOCONNECT_STATUS = 1, AUTOCONNECT_ALWAYS = 2 } |
Auto-reconnect options. More... | |
enum | TargetVddSelect_t { BDM_TARGET_VDD_OFF = 0, BDM_TARGET_VDD_3V3 = 1, BDM_TARGET_VDD_5V = 2, BDM_TARGET_VDD_ENABLE = 0x10, BDM_TARGET_VDD_DISABLE = 0x11 } |
Internal Target Voltage supply selection. More... | |
enum | TargetVppSelect_t { BDM_TARGET_VPP_OFF = 0, BDM_TARGET_VPP_STANDBY = 1, BDM_TARGET_VPP_ON = 2, BDM_TARGET_VPP_ERROR = 3 } |
Internal Programming Voltage supply selection. More... | |
enum | ClkSwValues_t { CS_DEFAULT = 0xFF, CS_ALT_CLK = 0, CS_NORMAL_CLK = 1 } |
Target BDM Clock selection. More... | |
enum | TargetMode_t { RESET_MODE_MASK = (3<<0), RESET_SPECIAL = (0<<0), RESET_NORMAL = (1<<0), RESET_METHOD_MASK = (7<<2), RESET_ALL = (0<<2), RESET_HARDWARE = (1<<2), RESET_SOFTWARE = (2<<2), RESET_POWER = (3<<2), RESET_VENDOR = (4<<2), RESET_DEFAULT = (7<<2) } |
Reset mode as used by CMD_USBDM_TARGET_RESET. More... | |
enum | HCS12_Registers_t { HCS12_RegPC = 3, HCS12_RegD = 4, HCS12_RegX = 5, HCS12_RegY = 6, HCS12_RegSP = 7, HCS12_RegCCR = 0x80 } |
regNo Parameter for USBDM_ReadReg() with HCS12 target More... | |
enum | S12Z_Registers_t { S12Z_RegD0 = 0x0, S12Z_RegD1 = 0x1, S12Z_RegD2 = 0x2, S12Z_RegD3 = 0x3, S12Z_RegD4 = 0x4, S12Z_RegD5 = 0x5, S12Z_RegD6 = 0x6, S12Z_RegD7 = 0x7, S12Z_RegX = 0x8, S12Z_RegY = 0x9, S12Z_RegSP = 0xA, S12Z_RegPC = 0xB, S12Z_RegCCR = 0xC } |
regNo Parameter for USBDM_ReadReg() with HCS12 target More... | |
enum | HCS08_Registers_t { HCS08_RegPC = 0xB, HCS08_RegSP = 0xF, HCS08_RegHX = 0xC, HCS08_RegA = 8, HCS08_RegCCR = 9 } |
regNo Parameter for USBDM_ReadReg() with HCS08 target More... | |
enum | RS08_Registers_t { RS08_RegCCR_PC = 0xB, RS08_RegSPC = 0xF, RS08_RegA = 8 } |
regNo Parameter for USBDM_ReadReg() with RS08 target More... | |
enum | CFV1_Registers_t { CFV1_RegD0 = 0, CFV1_RegD1 = 1, CFV1_RegD2 = 2, CFV1_RegD3 = 3, CFV1_RegD4 = 4, CFV1_RegD5 = 5, CFV1_RegD6 = 6, CFV1_RegD7 = 7, CFV1_RegA0 = 8, CFV1_RegA1 = 9, CFV1_RegA2 = 10, CFV1_RegA3 = 11, CFV1_RegA4 = 12, CFV1_RegA5 = 13, CFV1_RegA6 = 14, CFV1_RegA7 = 15 , CFV1_PSTBASE = 16, CFV1_RegOTHER_A7 = 0xC0|0, CFV1_RegVBR = 0xC0|1, CFV1_RegCPUCR = 0xC0|2, CFV1_RegMACSR = 0xC0|4, CFV1_RegMASK = 0xC0|5, CFV1_RegACC = 0xC0|6, CFV1_RegSR = 0xC0|14, CFV1_RegPC = 0xC0|15 } |
regNo Parameter for USBDM_ReadReg() with CFV1 target More... | |
enum | CFVx_Registers_t { CFVx_RegD0 = 0, CFVx_RegD1 = 1, CFVx_RegD2 = 2, CFVx_RegD3 = 3, CFVx_RegD4 = 4, CFVx_RegD5 = 5, CFVx_RegD6 = 6, CFVx_RegD7 = 7, CFVx_RegA0 = 8, CFVx_RegA1 = 9, CFVx_RegA2 = 10, CFVx_RegA3 = 11, CFVx_RegA4 = 12, CFVx_RegA5 = 13, CFVx_RegA6 = 14, CFVx_RegA7 = 15 } |
regNo Parameter for USBDM_ReadReg() with CFVx target More... | |
enum | ARM_Registers_t { ARM_RegR0 = 0, ARM_RegR1 = 1, ARM_RegR2 = 2, ARM_RegR3 = 3, ARM_RegR4 = 4, ARM_RegR5 = 5, ARM_RegR6 = 6, ARM_RegR7 = 7, ARM_RegR8 = 8, ARM_RegR9 = 9, ARM_RegR10 = 10, ARM_RegR11 = 11, ARM_RegR12 = 12, ARM_RegSP = 13, ARM_RegLR = 14, ARM_RegPC = 15, ARM_RegxPSR = 16, ARM_RegMSP = 17, ARM_RegPSP = 18, ARM_RegMISC = 20, ARM_RegFPSCR = 0x21, ARM_RegFPS0 = 0x40 } |
regNo Parameter for ARM_ReadReg() with ARM (Kinetis) target More... | |
enum | ARM_RegisterIndex_t { ARM_RegIndexFirstCore = 0, ARM_RegIndexLastCore = ARM_RegIndexFirstCore+19, ARM_RegIndexFirstFloat = 20, ARM_RegIndexLastFloat = ARM_RegIndexFirstFloat+32 } |
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with ARM (Kinetis) target More... | |
enum | CFV1_RegisterIndex_t { CFV1_RegIndexFirstCore = 0, CFV1_RegIndexLastCore = CFV1_RegIndexFirstCore+17 } |
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with Coldfire V1 target More... | |
enum | CFVx_RegisterIndex_t { CFVx_RegIndexFirstCore = 0, CFVx_RegIndexLastCore = CFV1_RegIndexFirstCore+17 } |
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with Coldfire Vx target More... | |
enum | DSC_Registers_t |
regNo Parameter for DSC_ReadReg() with DSC target DSC Core registers | |
enum | CFV1_CRegisters_t { CFV1_CRegOTHER_A7 = 0, CFV1_CRegVBR = 1, CFV1_CRegCPUCR = 2, CFV1_CRegMACSR = 4, CFV1_CRegMASK = 5, CFV1_CRegACC = 6, CFV1_CRegSR = 14, CFV1_CRegPC = 15 } |
regNo Parameter for USBDM_ReadCReg() with CFV1 target More... | |
enum | CFVx_CRegisters_t { CFVx_CRegD0 = 0x80 , CFVx_CRegA0 , CFVx_CRegOTHER_SP = 0x800, CFVx_CRegVBR = 0x801, CFVx_CRegSR = 0x80E, CFVx_CRegPC = 0x80F, CFV1_CRegFLASHBAR = 0xC04, CFV1_CRegRAMBAR = 0xC05 } |
regNo Parameter for USBDM_ReadCReg() with CFVx target More... | |
enum | ARM_CRegisters_t { ARM_CRegAHB_AP_CSW = 0x00000000U, ARM_CRegAHB_AP_TAR = 0x00000004U, ARM_CRegAHB_AP_DRW = 0x0000000CU, ARM_CRegAHB_AP_CFG = 0x000000F4U, ARM_CRegAHB_AP_Base = 0x000000F8U, ARM_CRegAHB_AP_Id = 0x000000FCU, ARM_CRegMDM_AP_Status = 0x01000000U, ARM_CRegMDM_AP_Control = 0x01000004U, ARM_CRegMDM_AP_Ident = 0x010000FCU } |
regNo Parameter for USBDM_ReadCReg() with SWD-ARM target More... | |
enum | HCS12_DRegisters_t { HCS12_DRegBDMSTS = (int)0xFF01, HCS12_DRegCCR = (int)0xFF06, HCS12_DRegBDMINR = (int)0xFF07 } |
regNo Parameter for USBDM_ReadDReg() with HCS12 target [BD Space] More... | |
enum | HCS08_DRegisters_t { HCS08_DRegBKPT = 0x0 } |
regNo Parameter for USBDM_ReadDReg() with HCS08 target [BKPT reg] More... | |
enum | RS08_DRegisters_t { RS08_DRegBKPT = 0x0 } |
regNo Parameter for USBDM_ReadDReg() with RS08 target (BKPT) More... | |
enum | CFV1_DRegisters_t { CFV1_DRegCSR = 0x00, CFV1_DRegXCSR = 0x01, CFV1_DRegCSR2 = 0x02, CFV1_DRegCSR3 = 0x03, CFV1_DRegBAAR = 0x05, CFV1_DRegAATR = 0x06, CFV1_DRegTDR = 0x07, CFV1_DRegPBR0 = 0x08, CFV1_DRegPBMR = 0x09, CFV1_DRegABHR = 0x0C, CFV1_DRegABLR = 0x0D, CFV1_DRegDBR = 0x0E, CFV1_DRegBDMR = 0x0F, CFV1_DRegPBR1 = 0x18, CFV1_DRegPBR2 = 0x1A, CFV1_DRegPBR3 = 0x1B, CFV1_ByteRegs = 0x1000, CFV1_DRegXCSRbyte = CFV1_ByteRegs+CFV1_DRegXCSR, CFV1_DRegCSR2byte = CFV1_ByteRegs+CFV1_DRegCSR2, CFV1_DRegCSR3byte = CFV1_ByteRegs+CFV1_DRegCSR3 } |
regNo Parameter for USBDM_ReadDReg() with CFV1 target More... | |
enum | CFVx_DRegisters_t { CFVx_DRegCSR = 0x00, CFVx_DRegBAAR = 0x05, CFVx_DRegAATR = 0x06, CFVx_DRegTDR = 0x07, CFVx_DRegPBR0 = 0x08, CFVx_DRegPBMR = 0x09, CFVx_DRegABHR = 0x0C, CFVx_DRegABLR = 0x0D, CFVx_DRegDBR = 0x0E, CFVx_DRegBDMR = 0x0F, CFVx_DRegPBR1 = 0x18, CFVx_DRegPBR2 = 0x1A, CFVx_DRegPBR3 = 0x1B } |
regNo Parameter for USBDM_ReadDReg() with CFV1 target More... | |
enum | ARM_DRegisters_t { ARM_DRegIDCODE = 0, ARM_DRegABORT = 0, ARM_DRegSTATUS = 1, ARM_DRegCONTROL = 1, ARM_DRegRESEND = 2, ARM_DRegSELECT = 2, ARM_DRegRDBUFF = 3, ARM_DRegAPReg0 = 4, ARM_DRegAPReg1 = 5, ARM_DRegAPReg2 = 6, ARM_DRegAPReg3 = 7 } |
regNo Parameter for USBDM_ReadDReg() with SWD-ARM target More... | |
enum | JTAG_ExitActions_t { JTAG_STAY_SHIFT = 0, JTAG_EXIT_IDLE = 1, JTAG_EXIT_SHIFT_DR = 2, JTAG_EXIT_SHIFT_IR = 3, JTAG_EXIT_ACTION_MASK = 0x3, JTAG_WRITE_0 = 0x00, JTAG_WRITE_1 = 0x80, JTAG_WRITE_MASK = 0x80, JTAG_SHIFT_DR = 0, JTAG_SHIFT_IR = 1 } |
Options used with JTAG commands. More... | |
enum | PinLevelMasks_t { , PIN_BKGD = (3<<PIN_BKGD_OFFS), PIN_BKGD_NC = (0<<PIN_BKGD_OFFS), PIN_BKGD_3STATE = (1<<PIN_BKGD_OFFS), PIN_BKGD_LOW = (2<<PIN_BKGD_OFFS), PIN_BKGD_HIGH = (3<<PIN_BKGD_OFFS) , PIN_RESET = (3<<PIN_RESET_OFFS), PIN_RESET_NC = (0<<PIN_RESET_OFFS), PIN_RESET_3STATE = (1<<PIN_RESET_OFFS), PIN_RESET_LOW = (2<<PIN_RESET_OFFS), PIN_RESET_HIGH = (3<<PIN_RESET_OFFS) , PIN_TA = (3<<PIN_TA_OFFS), PIN_TA_NC = (0<<PIN_TA_OFFS), PIN_TA_3STATE = (1<<PIN_TA_OFFS), PIN_TA_LOW = (2<<PIN_TA_OFFS) , PIN_DE = (3<<PIN_DE_OFFS), PIN_DE_NC = (0<<PIN_DE_OFFS), PIN_DE_3STATE = (1<<PIN_DE_OFFS), PIN_DE_LOW = (2<<PIN_DE_OFFS) , PIN_TRST = (3<<PIN_TRST_OFFS), PIN_TRST_NC = (0<<PIN_TRST_OFFS), PIN_TRST_3STATE = (1<<PIN_TRST_OFFS), PIN_TRST_LOW = (2<<PIN_TRST_OFFS) , PIN_BKPT = (3<<PIN_BKPT_OFFS), PIN_BKPT_NC = (0<<PIN_BKPT_OFFS), PIN_BKPT_3STATE = (1<<PIN_BKPT_OFFS), PIN_BKPT_LOW = (2<<PIN_BKPT_OFFS) , PIN_SWD = (3<<PIN_SWD_OFFS), PIN_SWD_NC = (0<<PIN_SWD_OFFS), PIN_SWD_3STATE = (1<<PIN_SWD_OFFS), PIN_SWD_LOW = (2<<PIN_SWD_OFFS), PIN_SWD_HIGH = (3<<PIN_SWD_OFFS) , PIN_SWCLK = (3<<PIN_SWCLK_OFFS), PIN_SWCLK_NC = (0<<PIN_SWCLK_OFFS), PIN_SWCLK_3STATE = (1<<PIN_SWCLK_OFFS), PIN_SWCLK_LOW = (2<<PIN_SWCLK_OFFS), PIN_SWCLK_HIGH = (3<<PIN_SWCLK_OFFS), PIN_NOCHANGE = 0, PIN_RELEASE = -1 } |
Control signal masks for CMD_USBDM_CONTROL_PIN (USBDM_ControlPins()) More... | |
Functions | |
USBDM_API USBDM_ErrorCode | USBDM_Init (void) |
Initialises USB interface. More... | |
USBDM_API USBDM_ErrorCode | USBDM_Exit (void) |
Clean up. More... | |
USBDM_API unsigned int | USBDM_DLLVersion (void) |
Get version of the DLL. More... | |
const USBDM_API char * | USBDM_DLLVersionString (void) |
Get version string for DLL. More... | |
const USBDM_API char * | USBDM_GetErrorString (USBDM_ErrorCode errorCode) |
Gets string describing a USBDM error code. More... | |
USBDM_API USBDM_ErrorCode | USBDM_FindDevices (unsigned int *deviceCount) |
Find USBDM Devices This function creates an internal list of USBDM devices. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ReleaseDevices (void) |
Release USBDM Device list. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetBDMSerialNumber (const char **deviceSerialNumber) |
Obtain serial number of the currently opened BDM. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetBDMDescription (const char **deviceDescription) |
Obtain description of the currently opened BDM. More... | |
USBDM_API USBDM_ErrorCode | USBDM_Open (unsigned char deviceNo) |
Opens a device. More... | |
USBDM_API USBDM_ErrorCode | USBDM_Close (void) |
Closes currently open device. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetVersion (USBDM_Version_t *version) |
Gets BDM software version and type of hardware. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetCapabilities (HardwareCapabilities_t *capabilities) |
Obtains the Capability vector from the BDM interface. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetBdmInformation (USBDM_bdmInformation_t *info) |
Obtains information about the currently open BDM interface. More... | |
USBDM_API USBDM_ErrorCode | USBDM_SetOptions (BDM_Options_t *newBdmOptions) |
Set BDM interface options. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetDefaultExtendedOptions (USBDM_ExtendedOptions_t *bdmOptions) |
Get default (target specific) BDM interface options. More... | |
USBDM_API USBDM_ErrorCode | USBDM_SetExtendedOptions (const USBDM_ExtendedOptions_t *newBdmOptions) |
Set BDM interface options. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetExtendedOptions (USBDM_ExtendedOptions_t *currentBdmOptions) |
Get BDM interface options. More... | |
USBDM_API USBDM_ErrorCode | USBDM_SetTargetVdd (TargetVddSelect_t targetVdd) |
Sets Target Vdd voltage. More... | |
USBDM_API USBDM_ErrorCode | USBDM_SetTargetVpp (TargetVppSelect_t targetVpp) |
Sets Target programming voltage. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ControlPins (unsigned int control, unsigned int *status) |
Directly manipulate interface levels. More... | |
USBDM_API USBDM_ErrorCode | USBDM_SetTargetType (TargetType_t targetType) |
Sets target MCU type. More... | |
USBDM_API USBDM_ErrorCode | USBDM_Debug (unsigned char *usb_data) |
Execute debug command (various, see DebugSubCommands) More... | |
USBDM_API USBDM_ErrorCode | USBDM_BDMCommand (unsigned int txSize, unsigned int rxSize, unsigned char data[]) |
USBDM_API USBDM_ErrorCode | USBDM_GetCommandStatus (void) |
Get status of the last command. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetBDMStatus (USBDMStatus_t *USBDMStatus) |
Fills user supplied structure with state of BDM communication channel. More... | |
USBDM_API USBDM_ErrorCode | USBDM_Connect (void) |
Connects to Target. More... | |
USBDM_API USBDM_ErrorCode | USBDM_BasicConnect (void) |
Does basic connect to target. More... | |
USBDM_API USBDM_ErrorCode | USBDM_SetSpeed (unsigned long frequency) |
Sets the BDM communication speed. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetSpeed (unsigned long *frequency) |
Get the BDM communication speed in kHz. More... | |
USBDM_API USBDM_ErrorCode | USBDM_GetSpeedHz (unsigned long *frequency) |
Get the BDM communication speed in Hz. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ReadStatusReg (unsigned long *BDMStatusReg) |
Reads Target Status register byte. More... | |
USBDM_API USBDM_ErrorCode | USBDM_WriteControlReg (unsigned int value) |
Write Target Control Register byte. More... | |
USBDM_API USBDM_ErrorCode | USBDM_TargetReset (TargetMode_t target_mode) |
Resets the target to normal or special mode. More... | |
USBDM_API USBDM_ErrorCode | USBDM_TargetStep (void) |
Steps over a single target instruction. More... | |
USBDM_API USBDM_ErrorCode | USBDM_TargetGo (void) |
Starts target execution from current PC address. More... | |
USBDM_API USBDM_ErrorCode | USBDM_TargetHalt (void) |
Brings the target into active background mode. More... | |
USBDM_API USBDM_ErrorCode | USBDM_WriteReg (unsigned int regNo, unsigned long regValue) |
Write Target Core register. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ReadReg (unsigned int regNo, unsigned long *regValue) |
Read Target Core register. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ReadMultipleRegs (unsigned char regValueBuffer[], unsigned int startRegIndex, unsigned int endRegIndex) |
Read Multiple Core registers. More... | |
USBDM_API USBDM_ErrorCode | USBDM_WriteCReg (unsigned int regNo, unsigned long regValue) |
Write Target Control register. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ReadCReg (unsigned int regNo, unsigned long *regValue) |
Read Target Control register. More... | |
USBDM_API USBDM_ErrorCode | USBDM_WriteDReg (unsigned int regNo, unsigned long regValue) |
Write Target Debug register. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ReadDReg (unsigned int regNo, unsigned long *regValue) |
Read Target Debug register. More... | |
USBDM_API USBDM_ErrorCode | USBDM_WriteMemory (unsigned int memorySpace, unsigned int byteCount, unsigned int address, unsigned const char *data) |
Write data to target memory. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ReadMemory (unsigned int memorySpace, unsigned int byteCount, unsigned int address, unsigned char *data) |
Read data from target memory. More... | |
USBDM_API USBDM_ErrorCode | USBDM_JTAG_Reset (void) |
JTAG - Moves the TAP to TEST-LOGIC-RESET state TMS=11111, TDI=00000 or similar. More... | |
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) SHIFT_IR => TMS=1100, TDI=0 (Actually TMS=0000_1100) More... | |
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,11100 TDI=NxData,00000 EXIT_SHIFT_IR => TMS=Nx0,111100 TDI=NxData,000000 EXIT_IDLE => TMS=Nx0,10 TDI=NxData,00. More... | |
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) More... | |
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) More... | |
USBDM_API USBDM_ErrorCode | USBDM_JTAG_ExecuteSequence (unsigned char length, const unsigned char *sequence, unsigned char inLength, unsigned char *inBuffer) |
Execute JTAG Sequence. More... | |
USBDM_API FILE * | USBDM_GetLogFile (void) |
Get current log file for messages. | |
USBDM_API void | USBDM_SetLogFile (FILE *fp) |
Set log file for messages. | |
USBDM_API void | USBDM_RebootToICP (void) |
Set BDM for ICP mode & immediately reboots - used in BDM mode only. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ICP_Erase (unsigned int addr, unsigned int count) |
ICP mode - erase BDM Flash memory. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ICP_Program (unsigned int addr, unsigned int count, unsigned char *data) |
ICP mode - program BDM Flash memory. More... | |
USBDM_API USBDM_ErrorCode | USBDM_ICP_Verify (unsigned int addr, unsigned int count, unsigned char *data) |
ICP mode - verify BDM Flash memory. More... | |
USBDM_API void | USBDM_ICP_Reboot (void) |
ICP mode - reboot. More... | |
Header file for USBDM_API.c.
Copyright (C) 2010 Peter O'Donoghue Based on material from OSBDM-JM60 Target Interface Software Package Copyright (C) 2009 Freescale This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Change History +==================================================================== | May 2010 | Created +====================================================================
Definition in file USBDM_API.h.
enum AcknMode_t |
Target supports ACKN or uses fixed delay {WAIT} instead.
Enumerator | |
---|---|
WAIT | Use WAIT (delay) instead. |
ACKN | Target supports ACKN feature and it is enabled. |
Definition at line 211 of file USBDM_API.h.
enum ARM_CRegisters_t |
regNo Parameter for USBDM_ReadCReg() with SWD-ARM target
The regNo is actually a AP bus address as follows:
Definition at line 601 of file USBDM_API.h.
enum ARM_DRegisters_t |
regNo Parameter for USBDM_ReadDReg() with SWD-ARM target
Definition at line 694 of file USBDM_API.h.
enum ARM_RegisterIndex_t |
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with ARM (Kinetis) target
Definition at line 451 of file USBDM_API.h.
enum ARM_Registers_t |
regNo Parameter for ARM_ReadReg() with ARM (Kinetis) target
Definition at line 422 of file USBDM_API.h.
enum AutoConnect_t |
Auto-reconnect options.
Enumerator | |
---|---|
AUTOCONNECT_NEVER | Only connect explicitly. |
AUTOCONNECT_STATUS | Reconnect on USBDM_ReadStatusReg() |
AUTOCONNECT_ALWAYS | Reconnect before every command. |
Definition at line 258 of file USBDM_API.h.
enum CFV1_CRegisters_t |
regNo Parameter for USBDM_ReadCReg() with CFV1 target
Definition at line 553 of file USBDM_API.h.
enum CFV1_DRegisters_t |
regNo Parameter for USBDM_ReadDReg() with CFV1 target
Definition at line 650 of file USBDM_API.h.
enum CFV1_RegisterIndex_t |
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with Coldfire V1 target
Enumerator | |
---|---|
CFV1_RegIndexFirstCore | First code reg. |
CFV1_RegIndexLastCore | Last core reg (18 regs D0..D7,A0..A7,SR,PC) |
Definition at line 460 of file USBDM_API.h.
enum CFV1_Registers_t |
regNo Parameter for USBDM_ReadReg() with CFV1 target
Definition at line 366 of file USBDM_API.h.
enum CFVx_CRegisters_t |
regNo Parameter for USBDM_ReadCReg() with CFVx target
Definition at line 566 of file USBDM_API.h.
enum CFVx_DRegisters_t |
regNo Parameter for USBDM_ReadDReg() with CFV1 target
Definition at line 676 of file USBDM_API.h.
enum CFVx_RegisterIndex_t |
startRegIndex, endRegIndex Parameters for USBDM_ReadMultipleRegs() with Coldfire Vx target
Enumerator | |
---|---|
CFVx_RegIndexFirstCore | First code reg. |
CFVx_RegIndexLastCore | Last core reg (18 regs D0..D7,A0..A7,SR,PC) |
Definition at line 467 of file USBDM_API.h.
enum CFVx_Registers_t |
regNo Parameter for USBDM_ReadReg() with CFVx target
Definition at line 400 of file USBDM_API.h.
enum ClkSwValues_t |
Target BDM Clock selection.
Enumerator | |
---|---|
CS_DEFAULT | Use default clock selection (don't modify target's reset default) |
CS_ALT_CLK | Force ALT clock (CLKSW = 0) |
CS_NORMAL_CLK | Force Normal clock (CLKSW = 1) |
Definition at line 287 of file USBDM_API.h.
Capabilities of the hardware.
Definition at line 113 of file USBDM_API.h.
enum HCS08_DRegisters_t |
regNo Parameter for USBDM_ReadDReg() with HCS08 target [BKPT reg]
Enumerator | |
---|---|
HCS08_DRegBKPT | Breakpoint register. |
Definition at line 637 of file USBDM_API.h.
enum HCS08_Registers_t |
regNo Parameter for USBDM_ReadReg() with HCS08 target
Enumerator | |
---|---|
HCS08_RegPC | PC reg. |
HCS08_RegSP | SP reg. |
HCS08_RegHX | HX reg. |
HCS08_RegA | A reg. |
HCS08_RegCCR | CCR reg. |
Definition at line 348 of file USBDM_API.h.
enum HCS12_DRegisters_t |
regNo Parameter for USBDM_ReadDReg() with HCS12 target [BD Space]
Enumerator | |
---|---|
HCS12_DRegBDMSTS |
|
HCS12_DRegCCR |
|
HCS12_DRegBDMINR |
|
Definition at line 627 of file USBDM_API.h.
enum HCS12_Registers_t |
regNo Parameter for USBDM_ReadReg() with HCS12 target
Enumerator | |
---|---|
HCS12_RegPC | PC reg. |
HCS12_RegD | D reg. |
HCS12_RegX | X reg. |
HCS12_RegY | Y reg. |
HCS12_RegSP | SP reg. |
HCS12_RegCCR | CCR reg - redirected to USBDM_ReadDReg() |
Definition at line 318 of file USBDM_API.h.
enum JTAG_ExitActions_t |
Options used with JTAG commands.
Definition at line 735 of file USBDM_API.h.
enum PinLevelMasks_t |
Control signal masks for CMD_USBDM_CONTROL_PIN (USBDM_ControlPins())
Definition at line 752 of file USBDM_API.h.
enum ResetMode_t |
Target reset status values.
Enumerator | |
---|---|
NO_RESET_ACTIVITY | No reset activity since last polled. |
RESET_DETECTED | Reset since last polled. |
Definition at line 234 of file USBDM_API.h.
enum ResetState_t |
Target RSTO state.
Enumerator | |
---|---|
RSTO_ACTIVE | RSTO* is currently active [low]. |
RSTO_INACTIVE | RSTO* is currently inactive [high]. |
Definition at line 227 of file USBDM_API.h.
enum RS08_DRegisters_t |
regNo Parameter for USBDM_ReadDReg() with RS08 target (BKPT)
Enumerator | |
---|---|
RS08_DRegBKPT | Breakpoint register. |
Definition at line 643 of file USBDM_API.h.
enum RS08_Registers_t |
regNo Parameter for USBDM_ReadReg() with RS08 target
Enumerator | |
---|---|
RS08_RegCCR_PC | Combined CCR/PC register. |
RS08_RegSPC | Shadow PC. |
RS08_RegA | A reg. |
Definition at line 358 of file USBDM_API.h.
enum S12Z_Registers_t |
regNo Parameter for USBDM_ReadReg() with HCS12 target
Definition at line 330 of file USBDM_API.h.
enum SpeedMode_t |
Target speed selection.
Enumerator | |
---|---|
SPEED_NO_INFO | Not connected. |
SPEED_SYNC | Speed determined by SYNC. |
SPEED_GUESSED | Speed determined by trial & error. |
SPEED_USER_SUPPLIED | User has specified the speed to use. |
Definition at line 218 of file USBDM_API.h.
enum TargetMode_t |
Reset mode as used by CMD_USBDM_TARGET_RESET.
Definition at line 295 of file USBDM_API.h.
enum TargetRunState_t |
Target Halt state.
Enumerator | |
---|---|
TARGET_RUNNING | CFVx target running (ALLPST == 0) |
TARGET_HALTED | CFVx target halted (ALLPST == 1) |
Definition at line 242 of file USBDM_API.h.
enum TargetType_t |
Target microcontroller types.
Definition at line 163 of file USBDM_API.h.
enum TargetVddSelect_t |
Internal Target Voltage supply selection.
Definition at line 268 of file USBDM_API.h.
enum TargetVddState_t |
Target Voltage supply state.
Enumerator | |
---|---|
BDM_TARGET_VDD_NONE | Target Vdd not detected. |
BDM_TARGET_VDD_EXT | Target Vdd external. |
BDM_TARGET_VDD_INT | Target Vdd internal. |
BDM_TARGET_VDD_ERR | Target Vdd error. |
Definition at line 249 of file USBDM_API.h.
enum TargetVppSelect_t |
Internal Programming Voltage supply selection.
Enumerator | |
---|---|
BDM_TARGET_VPP_OFF | Target Vpp Off. |
BDM_TARGET_VPP_STANDBY | Target Vpp Standby (Inverter on, Vpp off) |
BDM_TARGET_VPP_ON | Target Vpp On. |
BDM_TARGET_VPP_ERROR | Target Vpp ?? |
Definition at line 278 of file USBDM_API.h.
USBDM_API USBDM_ErrorCode USBDM_BasicConnect | ( | void | ) |
Does basic connect to target.
ARM-SWD - Does JTAG to Serial Wire switching only Other targets same as USBDM_Connect()
USBDM_API USBDM_ErrorCode USBDM_BDMCommand | ( | unsigned int | txSize, |
unsigned int | rxSize, | ||
unsigned char | data[] | ||
) |
Send Custom BDM command
txSize | |
rxSize | |
data |
USBDM_API USBDM_ErrorCode USBDM_Close | ( | void | ) |
Closes currently open device.
USBDM_API USBDM_ErrorCode USBDM_Connect | ( | void | ) |
Connects to Target.
This will cause the BDM module to attempt to connect to the Target. In most cases the BDM module will automatically determine the connection speed and successfully connect. If unsuccessful, it may be necessary to manually set the speed using set_speed().
USBDM_API USBDM_ErrorCode USBDM_ControlPins | ( | unsigned int | control, |
unsigned int * | status | ||
) |
Directly manipulate interface levels.
control | => mask indicating interface levels see PinLevelMasks_t |
status | => values on pins after action (not yet implemented). May be NULL. |
USBDM_API USBDM_ErrorCode USBDM_Debug | ( | unsigned char * | usb_data | ) |
Execute debug command (various, see DebugSubCommands)
usb_data | - Command for BDM |
USBDM_API unsigned int USBDM_DLLVersion | ( | void | ) |
Get version of the DLL.
const USBDM_API char* USBDM_DLLVersionString | ( | void | ) |
Get version string for DLL.
USBDM_API USBDM_ErrorCode USBDM_Exit | ( | void | ) |
Clean up.
This must be called after all USBDM operations are finished
USBDM_API USBDM_ErrorCode USBDM_FindDevices | ( | unsigned int * | deviceCount | ) |
Find USBDM Devices
This function creates an internal list of USBDM devices.
The list is held until USBDM_ReleaseDevices() is called.
USBDM_FindDevices() must be done before any device may be opened.
deviceCount | Number of BDM devices found |
USBDM_API USBDM_ErrorCode USBDM_GetBDMDescription | ( | const char ** | deviceDescription | ) |
Obtain description of the currently opened BDM.
deviceDescription | Updated to point to UTF-16LE device description |
USBDM_API USBDM_ErrorCode USBDM_GetBdmInformation | ( | USBDM_bdmInformation_t * | info | ) |
Obtains information about the currently open BDM interface.
info | ptr to structure to contain the information |
USBDM_API USBDM_ErrorCode USBDM_GetBDMSerialNumber | ( | const char ** | deviceSerialNumber | ) |
Obtain serial number of the currently opened BDM.
deviceSerialNumber | Updated to point to UTF-16LE serial number |
USBDM_API USBDM_ErrorCode USBDM_GetBDMStatus | ( | USBDMStatus_t * | USBDMStatus | ) |
Fills user supplied structure with state of BDM communication channel.
USBDMStatus | Pointer to structure to receive status, see USBDMStatus_t |
USBDM_API USBDM_ErrorCode USBDM_GetCapabilities | ( | HardwareCapabilities_t * | capabilities | ) |
Obtains the Capability vector from the BDM interface.
capabilities | : ptr to where to return capability vector see HardwareCapabilities_t |
USBDM_API USBDM_ErrorCode USBDM_GetCommandStatus | ( | void | ) |
Get status of the last command.
USBDM_API USBDM_ErrorCode USBDM_GetDefaultExtendedOptions | ( | USBDM_ExtendedOptions_t * | bdmOptions | ) |
Get default (target specific) BDM interface options.
bdmOptions | : Current options from BDM interface Note - bdmOptions.size must be initialised
|
const USBDM_API char* USBDM_GetErrorString | ( | USBDM_ErrorCode | errorCode | ) |
Gets string describing a USBDM error code.
errorCode | - error code returned from USBDM API routine. |
USBDM_API USBDM_ErrorCode USBDM_GetExtendedOptions | ( | USBDM_ExtendedOptions_t * | currentBdmOptions | ) |
Get BDM interface options.
currentBdmOptions | : Current options from BDM interface Note - currentBdmOptions.size must be initialised |
USBDM_API USBDM_ErrorCode USBDM_GetSpeed | ( | unsigned long * | frequency | ) |
Get the BDM communication speed in kHz.
frequency | => BDM Communication speed in kHz |
USBDM_API USBDM_ErrorCode USBDM_GetSpeedHz | ( | unsigned long * | frequency | ) |
Get the BDM communication speed in Hz.
frequency | => BDM Communication speed in Hz |
USBDM_API USBDM_ErrorCode USBDM_GetVersion | ( | USBDM_Version_t * | version | ) |
Gets BDM software version and type of hardware.
version | Version numbers (4 bytes)
|
USBDM_API USBDM_ErrorCode USBDM_ICP_Erase | ( | unsigned int | addr, |
unsigned int | count | ||
) |
ICP mode - erase BDM Flash memory.
addr | 32-bit memory address |
count | number of bytes to erase |
USBDM_API USBDM_ErrorCode USBDM_ICP_Program | ( | unsigned int | addr, |
unsigned int | count, | ||
unsigned char * | data | ||
) |
ICP mode - program BDM Flash memory.
addr | 32-bit memory address |
count | number of bytes to program |
data | Pointer to buffer containing data |
USBDM_API void USBDM_ICP_Reboot | ( | void | ) |
ICP mode - reboot.
The BDM does a normal reset
Used in ICP mode to reset to normal (BDM) mode.
USBDM_API USBDM_ErrorCode USBDM_ICP_Verify | ( | unsigned int | addr, |
unsigned int | count, | ||
unsigned char * | data | ||
) |
ICP mode - verify BDM Flash memory.
addr | 32-bit memory address |
count | number of bytes to verify |
data | Pointer to buffer containing data |
USBDM_API USBDM_ErrorCode USBDM_Init | ( | void | ) |
Initialises USB interface.
This must be done before any other operations.
USBDM_API USBDM_ErrorCode USBDM_JTAG_ExecuteSequence | ( | unsigned char | length, |
const unsigned char * | sequence, | ||
unsigned char | inLength, | ||
unsigned char * | inBuffer | ||
) |
Execute JTAG Sequence.
length | - JTAG sequence length. |
sequence | - Pointer to sequence. |
inLength | - Expected length of input data |
inBuffer | - Returned values |
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)
exit | action after shift, see JTAG_ExitActions_t
|
bitCount | 8-bit count of bits to shift in. [>0] It is not possible to do 0 bits. |
buffer | Pointer to buffer for data read out of the device (first bit in LSB of the last byte in the buffer) |
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)
exit | action after shift, see JTAG_ExitActions_t
|
bitCount | 8-bit count of bits to shift in. [>0] It is not possible to do 0 bits. |
inBuffer | Pointer to buffer for data written to the device (first bit in LSB of the last byte in the buffer) |
outBuffer | Pointer to buffer for data read out of the device (first bit in LSB of the last byte in the buffer) |
USBDM_API USBDM_ErrorCode USBDM_JTAG_Reset | ( | void | ) |
JTAG - Moves the TAP to TEST-LOGIC-RESET state TMS=11111, TDI=00000 or similar.
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) SHIFT_IR => TMS=1100, TDI=0 (Actually TMS=0000_1100)
mode | Action, ref JTAG_ExitActions_t
|
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,11100 TDI=NxData,00000 EXIT_SHIFT_IR => TMS=Nx0,111100 TDI=NxData,000000 EXIT_IDLE => TMS=Nx0,10 TDI=NxData,00.
exit | action after shift, see JTAG_ExitActions_t
|
bitCount | 8-bit count of bits to shift in. [>0] It is not possible to do 0 bits. |
buffer | Pointer to data buffer. The data is shifted in LSB (last byte) first, unused bits (if any) are in the MSB (first) byte; |
USBDM_API USBDM_ErrorCode USBDM_Open | ( | unsigned char | deviceNo | ) |
Opens a device.
deviceNo | Number (0..N) of device to open. A device must be open before any communication with the device can take place. |
USBDM_API USBDM_ErrorCode USBDM_ReadCReg | ( | unsigned int | regNo, |
unsigned long * | regValue | ||
) |
Read Target Control register.
regNo | Register # or address
|
regValue | 8/16/32-bit value |
USBDM_API USBDM_ErrorCode USBDM_ReadDReg | ( | unsigned int | regNo, |
unsigned long * | regValue | ||
) |
Read Target Debug register.
regNo | Register #
|
regValue | 8/16/32-bit value |
USBDM_API USBDM_ErrorCode USBDM_ReadMemory | ( | unsigned int | memorySpace, |
unsigned int | byteCount, | ||
unsigned int | address, | ||
unsigned char * | data | ||
) |
Read data from target memory.
memorySpace | = Size of data (1/2/4 bytes) |
byteCount | = Number of bytes to transfer |
address | = Memory address |
data | = Where to place data |
USBDM_API USBDM_ErrorCode USBDM_ReadMultipleRegs | ( | unsigned char | regValueBuffer[], |
unsigned int | startRegIndex, | ||
unsigned int | endRegIndex | ||
) |
Read Multiple Core registers.
regValueBuffer | Values in Target byte order?? |
startRegIndex | Register index (inclusive) to start reading at |
endRegIndex | Register index (inclusive) to stop reading at |
USBDM_API USBDM_ErrorCode USBDM_ReadReg | ( | unsigned int | regNo, |
unsigned long * | regValue | ||
) |
Read Target Core register.
regNo | Register #
|
regValue | 8/16/32-bit value |
USBDM_API USBDM_ErrorCode USBDM_ReadStatusReg | ( | unsigned long * | BDMStatusReg | ) |
Reads Target Status register byte.
BDMStatusReg | => status register value read. The register read depends on target:
|
USBDM_API void USBDM_RebootToICP | ( | void | ) |
Set BDM for ICP mode & immediately reboots - used in BDM mode only.
The BDM resets in ICP mode after this command
USBDM_API USBDM_ErrorCode USBDM_ReleaseDevices | ( | void | ) |
Release USBDM Device list.
USBDM_API USBDM_ErrorCode USBDM_SetExtendedOptions | ( | const USBDM_ExtendedOptions_t * | newBdmOptions | ) |
Set BDM interface options.
newBdmOptions | : Options to pass to BDM interface Note - size field must be initialised |
USBDM_API USBDM_ErrorCode USBDM_SetOptions | ( | BDM_Options_t * | newBdmOptions | ) |
Set BDM interface options.
newBdmOptions | : Options to pass to BDM interface |
USBDM_API USBDM_ErrorCode USBDM_SetSpeed | ( | unsigned long | frequency | ) |
Sets the BDM communication speed.
frequency | => BDM Communication speed in kHz
|
USBDM_API USBDM_ErrorCode USBDM_SetTargetType | ( | TargetType_t | targetType | ) |
Sets target MCU type.
If the BDM has target power control then it will also:
targetType | type of target |
USBDM_API USBDM_ErrorCode USBDM_SetTargetVdd | ( | TargetVddSelect_t | targetVdd | ) |
Sets Target Vdd voltage.
targetVdd | => control value for Vdd |
USBDM_API USBDM_ErrorCode USBDM_SetTargetVpp | ( | TargetVppSelect_t | targetVpp | ) |
Sets Target programming voltage.
targetVpp | => control value for Vpp |
USBDM_API USBDM_ErrorCode USBDM_TargetGo | ( | void | ) |
Starts target execution from current PC address.
USBDM_API USBDM_ErrorCode USBDM_TargetHalt | ( | void | ) |
Brings the target into active background mode.
The target will be halted.
USBDM_API USBDM_ErrorCode USBDM_TargetReset | ( | TargetMode_t | target_mode | ) |
Resets the target to normal or special mode.
target_mode | see |
USBDM_API USBDM_ErrorCode USBDM_TargetStep | ( | void | ) |
Steps over a single target instruction.
USBDM_API USBDM_ErrorCode USBDM_WriteControlReg | ( | unsigned int | value | ) |
Write Target Control Register byte.
value | => value to write The register written depends on target:
|
USBDM_API USBDM_ErrorCode USBDM_WriteCReg | ( | unsigned int | regNo, |
unsigned long | regValue | ||
) |
Write Target Control register.
regNo | Register #
|
regValue | 8/16/32-bit value |
USBDM_API USBDM_ErrorCode USBDM_WriteDReg | ( | unsigned int | regNo, |
unsigned long | regValue | ||
) |
Write Target Debug register.
regNo | Register #
|
regValue | 8/16/32-bit value |
USBDM_API USBDM_ErrorCode USBDM_WriteMemory | ( | unsigned int | memorySpace, |
unsigned int | byteCount, | ||
unsigned int | address, | ||
unsigned const char * | data | ||
) |
Write data to target memory.
memorySpace | = Size of data elements (1/2/4 bytes) |
byteCount | = Number of bytes to transfer |
address | = Memory address |
data | = Ptr to block of data to write |
USBDM_API USBDM_ErrorCode USBDM_WriteReg | ( | unsigned int | regNo, |
unsigned long | regValue | ||
) |
Write Target Core register.
regNo | Register #
|
regValue | 8/16/32-bit value |