_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q231400
JLink.unlock
train
def unlock(self): """Unlocks the device connected to the J-Link. Unlocking a device allows for access to read/writing memory, as well as flash programming. Note: Unlock is not supported on all devices. Supported Devices: Kinetis Returns: ...
python
{ "resource": "" }
q231401
JLink.erase
train
def erase(self): """Erases the flash contents of the device. This erases the flash memory of the target device. If this method fails, the device may be left in an inoperable state. Args: self (JLink): the ``JLink`` instance Returns: Number of bytes erased....
python
{ "resource": "" }
q231402
JLink.reset
train
def reset(self, ms=0, halt=True): """Resets the target. This method resets the target, and by default toggles the RESET and TRST pins. Args: self (JLink): the ``JLink`` instance ms (int): Amount of milliseconds to delay after reset (default: 0) halt (bool)...
python
{ "resource": "" }
q231403
JLink.halt
train
def halt(self): """Halts the CPU Core. Args: self (JLink): the ``JLink`` instance Returns: ``True`` if halted, ``False`` otherwise. """ res = int(self._dll.JLINKARM_Halt()) if res == 0: time.sleep(1) return True return...
python
{ "resource": "" }
q231404
JLink.halted
train
def halted(self): """Returns whether the CPU core was halted. Args: self (JLink): the ``JLink`` instance Returns: ``True`` if the CPU core is halted, otherwise ``False``. Raises: JLinkException: on device errors. """ result = int(self._dll...
python
{ "resource": "" }
q231405
JLink.core_name
train
def core_name(self): """Returns the name of the target ARM core. Args: self (JLink): the ``JLink`` instance Returns: The target core's name. """ buf_size = self.MAX_BUF_SIZE buf = (ctypes.c_char * buf_size)() self._dll.JLINKARM_Core2CoreName(...
python
{ "resource": "" }
q231406
JLink.scan_chain_len
train
def scan_chain_len(self, scan_chain): """Retrieves and returns the number of bits in the scan chain. Args: self (JLink): the ``JLink`` instance scan_chain (int): scan chain to be measured Returns: Number of bits in the specified scan chain. Raises: ...
python
{ "resource": "" }
q231407
JLink.register_list
train
def register_list(self): """Returns a list of the indices for the CPU registers. The returned indices can be used to read the register content or grab the register name. Args: self (JLink): the ``JLink`` instance Returns: List of registers. """ ...
python
{ "resource": "" }
q231408
JLink.register_name
train
def register_name(self, register_index): """Retrives and returns the name of an ARM CPU register. Args: self (JLink): the ``JLink`` instance register_index (int): index of the register whose name to retrieve Returns: Name of the register. """ resul...
python
{ "resource": "" }
q231409
JLink.cpu_speed
train
def cpu_speed(self, silent=False): """Retrieves the CPU speed of the target. If the target does not support CPU frequency detection, this function will return ``0``. Args: self (JLink): the ``JLink`` instance silent (bool): ``True`` if the CPU detection should not r...
python
{ "resource": "" }
q231410
JLink.cpu_halt_reasons
train
def cpu_halt_reasons(self): """Retrives the reasons that the CPU was halted. Args: self (JLink): the ``JLink`` instance Returns: A list of ``JLInkMOEInfo`` instances specifying the reasons for which the CPU was halted. This list may be empty in the case that the ...
python
{ "resource": "" }
q231411
JLink.jtag_send
train
def jtag_send(self, tms, tdi, num_bits): """Sends data via JTAG. Sends data via JTAG on the rising clock edge, TCK. At on each rising clock edge, on bit is transferred in from TDI and out to TDO. The clock uses the TMS to step through the standard JTAG state machine. Args: ...
python
{ "resource": "" }
q231412
JLink.swd_read8
train
def swd_read8(self, offset): """Gets a unit of ``8`` bits from the input buffer. Args: self (JLink): the ``JLink`` instance offset (int): the offset (in bits) from which to start reading Returns: The integer read from the input buffer. """ value = ...
python
{ "resource": "" }
q231413
JLink.swd_read16
train
def swd_read16(self, offset): """Gets a unit of ``16`` bits from the input buffer. Args: self (JLink): the ``JLink`` instance offset (int): the offset (in bits) from which to start reading Returns: The integer read from the input buffer. """ value ...
python
{ "resource": "" }
q231414
JLink.swd_read32
train
def swd_read32(self, offset): """Gets a unit of ``32`` bits from the input buffer. Args: self (JLink): the ``JLink`` instance offset (int): the offset (in bits) from which to start reading Returns: The integer read from the input buffer. """ value ...
python
{ "resource": "" }
q231415
JLink.swd_sync
train
def swd_sync(self, pad=False): """Causes a flush to write all data remaining in output buffers to SWD device. Args: self (JLink): the ``JLink`` instance pad (bool): ``True`` if should pad the data to full byte size Returns: ``None`` """ if ...
python
{ "resource": "" }
q231416
JLink.flash_write
train
def flash_write(self, addr, data, nbits=None, flags=0): """Writes data to the flash region of a device. The given number of bits, if provided, must be either ``8``, ``16``, or ``32``. Args: self (JLink): the ``JLink`` instance addr (int): starting flash address to w...
python
{ "resource": "" }
q231417
JLink.code_memory_read
train
def code_memory_read(self, addr, num_bytes): """Reads bytes from code memory. Note: This is similar to calling ``memory_read`` or ``memory_read8``, except that this uses a cache and reads ahead. This should be used in instances where you want to read a small amount of byt...
python
{ "resource": "" }
q231418
JLink.num_memory_zones
train
def num_memory_zones(self): """Returns the number of memory zones supported by the target. Args: self (JLink): the ``JLink`` instance Returns: An integer count of the number of memory zones supported by the target. Raises: JLinkException: on err...
python
{ "resource": "" }
q231419
JLink.memory_zones
train
def memory_zones(self): """Gets all memory zones supported by the current target. Some targets support multiple memory zones. This function provides the ability to get a list of all the memory zones to facilate using the memory zone routing functions. Args: self (JLi...
python
{ "resource": "" }
q231420
JLink.memory_read
train
def memory_read(self, addr, num_units, zone=None, nbits=None): """Reads memory from a target system or specific memory zone. The optional ``zone`` specifies a memory zone to access to read from, e.g. ``IDATA``, ``DDATA``, or ``CODE``. The given number of bits, if provided, must be eith...
python
{ "resource": "" }
q231421
JLink.memory_read8
train
def memory_read8(self, addr, num_bytes, zone=None): """Reads memory from the target system in units of bytes. Args: self (JLink): the ``JLink`` instance addr (int): start address to read from num_bytes (int): number of bytes to read zone (str): memory zone to rea...
python
{ "resource": "" }
q231422
JLink.memory_read16
train
def memory_read16(self, addr, num_halfwords, zone=None): """Reads memory from the target system in units of 16-bits. Args: self (JLink): the ``JLink`` instance addr (int): start address to read from num_halfwords (int): number of half words to read zone (str): me...
python
{ "resource": "" }
q231423
JLink.memory_read32
train
def memory_read32(self, addr, num_words, zone=None): """Reads memory from the target system in units of 32-bits. Args: self (JLink): the ``JLink`` instance addr (int): start address to read from num_words (int): number of words to read zone (str): memory zone to ...
python
{ "resource": "" }
q231424
JLink.memory_read64
train
def memory_read64(self, addr, num_long_words): """Reads memory from the target system in units of 64-bits. Args: self (JLink): the ``JLink`` instance addr (int): start address to read from num_long_words (int): number of long words to read Returns: List ...
python
{ "resource": "" }
q231425
JLink.memory_write
train
def memory_write(self, addr, data, zone=None, nbits=None): """Writes memory to a target system or specific memory zone. The optional ``zone`` specifies a memory zone to access to write to, e.g. ``IDATA``, ``DDATA``, or ``CODE``. The given number of bits, if provided, must be either ``8...
python
{ "resource": "" }
q231426
JLink.memory_write8
train
def memory_write8(self, addr, data, zone=None): """Writes bytes to memory of a target system. Args: self (JLink): the ``JLink`` instance addr (int): start address to write to data (list): list of bytes to write zone (str): optional memory zone to access ...
python
{ "resource": "" }
q231427
JLink.memory_write16
train
def memory_write16(self, addr, data, zone=None): """Writes half-words to memory of a target system. Args: self (JLink): the ``JLink`` instance addr (int): start address to write to data (list): list of half-words to write zone (str): optional memory zone to acces...
python
{ "resource": "" }
q231428
JLink.memory_write32
train
def memory_write32(self, addr, data, zone=None): """Writes words to memory of a target system. Args: self (JLink): the ``JLink`` instance addr (int): start address to write to data (list): list of words to write zone (str): optional memory zone to access ...
python
{ "resource": "" }
q231429
JLink.memory_write64
train
def memory_write64(self, addr, data, zone=None): """Writes long words to memory of a target system. Note: This is little-endian. Args: self (JLink): the ``JLink`` instance addr (int): start address to write to data (list): list of long words to write ...
python
{ "resource": "" }
q231430
JLink.register_read_multiple
train
def register_read_multiple(self, register_indices): """Retrieves the values from the registers specified. Args: self (JLink): the ``JLink`` instance register_indices (list): list of registers to read Returns: A list of values corresponding one-to-one for each of t...
python
{ "resource": "" }
q231431
JLink.register_write
train
def register_write(self, reg_index, value): """Writes into an ARM register. Note: The data is not immediately written, but is cached before being transferred to the CPU on CPU start. Args: self (JLink): the ``JLink`` instance reg_index (int): the ARM reg...
python
{ "resource": "" }
q231432
JLink.register_write_multiple
train
def register_write_multiple(self, register_indices, values): """Writes to multiple CPU registers. Writes the values to the given registers in order. There must be a one-to-one correspondence between the values and the registers specified. Args: self (JLink): the ``JL...
python
{ "resource": "" }
q231433
JLink.ice_register_write
train
def ice_register_write(self, register_index, value, delay=False): """Writes a value to an ARM ICE register. Args: self (JLink): the ``JLink`` instance register_index (int): the ICE register to write to value (int): the value to write to the ICE register delay (bo...
python
{ "resource": "" }
q231434
JLink.etm_supported
train
def etm_supported(self): """Returns if the CPU core supports ETM. Args: self (JLink): the ``JLink`` instance. Returns: ``True`` if the CPU has the ETM unit, otherwise ``False``. """ res = self._dll.JLINKARM_ETM_IsPresent() if (res == 1): ...
python
{ "resource": "" }
q231435
JLink.etm_register_write
train
def etm_register_write(self, register_index, value, delay=False): """Writes a value to an ETM register. Args: self (JLink): the ``JLink`` instance. register_index (int): the register to write to. value (int): the value to write to the register. delay (bool): bool...
python
{ "resource": "" }
q231436
JLink.set_vector_catch
train
def set_vector_catch(self, flags): """Sets vector catch bits of the processor. The CPU will jump to a vector if the given vector catch is active, and will enter a debug state. This has the effect of halting the CPU as well, meaning the CPU must be explicitly restarted. Args: ...
python
{ "resource": "" }
q231437
JLink.step
train
def step(self, thumb=False): """Executes a single step. Steps even if there is a breakpoint. Args: self (JLink): the ``JLink`` instance thumb (bool): boolean indicating if to step in thumb mode Returns: ``None`` Raises: JLinkException: ...
python
{ "resource": "" }
q231438
JLink.num_available_breakpoints
train
def num_available_breakpoints(self, arm=False, thumb=False, ram=False, flash=False, hw=False): """Returns the number of available breakpoints of the specified type. If ``arm`` is set, gets the number of available ARM breakpoint units. If ``thumb`` is set, gets the number of available THUMB brea...
python
{ "resource": "" }
q231439
JLink.breakpoint_info
train
def breakpoint_info(self, handle=0, index=-1): """Returns the information about a set breakpoint. Note: Either ``handle`` or ``index`` can be specified. If the ``index`` is not provided, the ``handle`` must be set, and vice-versa. If both ``index`` and ``handle`` are pro...
python
{ "resource": "" }
q231440
JLink.breakpoint_set
train
def breakpoint_set(self, addr, thumb=False, arm=False): """Sets a breakpoint at the specified address. If ``thumb`` is ``True``, the breakpoint is set in THUMB-mode, while if ``arm`` is ``True``, the breakpoint is set in ARM-mode, otherwise a normal breakpoint is set. Args: ...
python
{ "resource": "" }
q231441
JLink.software_breakpoint_set
train
def software_breakpoint_set(self, addr, thumb=False, arm=False, flash=False, ram=False): """Sets a software breakpoint at the specified address. If ``thumb`` is ``True``, the breakpoint is set in THUMB-mode, while if ``arm`` is ``True``, the breakpoint is set in ARM-mode, otherwise a no...
python
{ "resource": "" }
q231442
JLink.watchpoint_info
train
def watchpoint_info(self, handle=0, index=-1): """Returns information about the specified watchpoint. Note: Either ``handle`` or ``index`` can be specified. If the ``index`` is not provided, the ``handle`` must be set, and vice-versa. If both ``index`` and ``handle`` are...
python
{ "resource": "" }
q231443
JLink.watchpoint_set
train
def watchpoint_set(self, addr, addr_mask=0x0, data=0x0, data_mask=0x0, access_size=None, read=False, write=False, privileged=False): ...
python
{ "resource": "" }
q231444
JLink.disassemble_instruction
train
def disassemble_instruction(self, instruction): """Disassembles and returns the assembly instruction string. Args: self (JLink): the ``JLink`` instance. instruction (int): the instruction address. Returns: A string corresponding to the assembly instruction string ...
python
{ "resource": "" }
q231445
JLink.strace_configure
train
def strace_configure(self, port_width): """Configures the trace port width for tracing. Note that configuration cannot occur while STRACE is running. Args: self (JLink): the ``JLink`` instance port_width (int): the trace port width to use. Returns: ``None...
python
{ "resource": "" }
q231446
JLink.strace_read
train
def strace_read(self, num_instructions): """Reads and returns a number of instructions captured by STRACE. The number of instructions must be a non-negative value of at most ``0x10000`` (``65536``). Args: self (JLink): the ``JLink`` instance. num_instructions (int):...
python
{ "resource": "" }
q231447
JLink.strace_data_access_event
train
def strace_data_access_event(self, operation, address, data, data_mask=None, access_width=4, address_range=0): """...
python
{ "resource": "" }
q231448
JLink.strace_data_store_event
train
def strace_data_store_event(self, operation, address, address_range=0): """Sets an event to trigger trace logic when data write access is made. Args: self (JLink): the ``JLink`` instance. operation (int): one of the operations in ``JLinkStraceOperation``. address (int): th...
python
{ "resource": "" }
q231449
JLink.strace_clear
train
def strace_clear(self, handle): """Clears the trace event specified by the given handle. Args: self (JLink): the ``JLink`` instance. handle (int): handle of the trace event. Returns: ``None`` Raises: JLinkException: on error. """ ...
python
{ "resource": "" }
q231450
JLink.strace_clear_all
train
def strace_clear_all(self): """Clears all STRACE events. Args: self (JLink): the ``JLink`` instance. Returns: ``None`` Raises: JLinkException: on error. """ data = 0 res = self._dll.JLINK_STRACE_Control(enums.JLinkStraceCommand.TRA...
python
{ "resource": "" }
q231451
JLink.strace_set_buffer_size
train
def strace_set_buffer_size(self, size): """Sets the STRACE buffer size. Args: self (JLink): the ``JLink`` instance. Returns: ``None`` Raises: JLinkException: on error. """ size = ctypes.c_uint32(size) res = self._dll.JLINK_STRACE_C...
python
{ "resource": "" }
q231452
JLink.trace_start
train
def trace_start(self): """Starts collecting trace data. Args: self (JLink): the ``JLink`` instance. Returns: ``None`` """ cmd = enums.JLinkTraceCommand.START res = self._dll.JLINKARM_TRACE_Control(cmd, 0) if (res == 1): raise erro...
python
{ "resource": "" }
q231453
JLink.trace_stop
train
def trace_stop(self): """Stops collecting trace data. Args: self (JLink): the ``JLink`` instance. Returns: ``None`` """ cmd = enums.JLinkTraceCommand.STOP res = self._dll.JLINKARM_TRACE_Control(cmd, 0) if (res == 1): raise errors....
python
{ "resource": "" }
q231454
JLink.trace_flush
train
def trace_flush(self): """Flushes the trace buffer. After this method is called, the trace buffer is empty. This method is best called when the device is reset. Args: self (JLink): the ``JLink`` instance. Returns: ``None`` """ cmd = enums.J...
python
{ "resource": "" }
q231455
JLink.trace_buffer_capacity
train
def trace_buffer_capacity(self): """Retrieves the trace buffer's current capacity. Args: self (JLink): the ``JLink`` instance. Returns: The current capacity of the trace buffer. This is not necessarily the maximum possible size the buffer could be configured with...
python
{ "resource": "" }
q231456
JLink.trace_set_buffer_capacity
train
def trace_set_buffer_capacity(self, size): """Sets the capacity for the trace buffer. Args: self (JLink): the ``JLink`` instance. size (int): the new capacity for the trace buffer. Returns: ``None`` """ cmd = enums.JLinkTraceCommand.SET_CAPACITY ...
python
{ "resource": "" }
q231457
JLink.trace_min_buffer_capacity
train
def trace_min_buffer_capacity(self): """Retrieves the minimum capacity the trace buffer can be configured with. Args: self (JLink): the ``JLink`` instance. Returns: The minimum configurable capacity for the trace buffer. """ cmd = enums.JLinkTraceCommand.GET...
python
{ "resource": "" }
q231458
JLink.trace_max_buffer_capacity
train
def trace_max_buffer_capacity(self): """Retrieves the maximum size the trace buffer can be configured with. Args: self (JLink): the ``JLink`` instance. Returns: The maximum configurable capacity for the trace buffer. """ cmd = enums.JLinkTraceCommand.GET_MAX...
python
{ "resource": "" }
q231459
JLink.trace_set_format
train
def trace_set_format(self, fmt): """Sets the format for the trace buffer to use. Args: self (JLink): the ``JLink`` instance. fmt (int): format for the trace buffer; this is one of the attributes of ``JLinkTraceFormat``. Returns: ``None`` """ ...
python
{ "resource": "" }
q231460
JLink.trace_format
train
def trace_format(self): """Retrieves the current format the trace buffer is using. Args: self (JLink): the ``JLink`` instance. Returns: The current format the trace buffer is using. This is one of the attributes of ``JLinkTraceFormat``. """ cmd = ...
python
{ "resource": "" }
q231461
JLink.trace_region_count
train
def trace_region_count(self): """Retrieves a count of the number of available trace regions. Args: self (JLink): the ``JLink`` instance. Returns: Count of the number of available trace regions. """ cmd = enums.JLinkTraceCommand.GET_NUM_REGIONS data =...
python
{ "resource": "" }
q231462
JLink.trace_region
train
def trace_region(self, region_index): """Retrieves the properties of a trace region. Args: self (JLink): the ``JLink`` instance. region_index (int): the trace region index. Returns: An instance of ``JLinkTraceRegion`` describing the specified region. """ ...
python
{ "resource": "" }
q231463
JLink.trace_read
train
def trace_read(self, offset, num_items): """Reads data from the trace buffer and returns it. Args: self (JLink): the ``JLink`` instance. offset (int): the offset from which to start reading from the trace buffer. num_items (int): number of items to read from th...
python
{ "resource": "" }
q231464
JLink.swo_start
train
def swo_start(self, swo_speed=9600): """Starts collecting SWO data. Note: If SWO is already enabled, it will first stop SWO before enabling it again. Args: self (JLink): the ``JLink`` instance swo_speed (int): the frequency in Hz used by the target to co...
python
{ "resource": "" }
q231465
JLink.swo_stop
train
def swo_stop(self): """Stops collecting SWO data. Args: self (JLink): the ``JLink`` instance Returns: ``None`` Raises: JLinkException: on error """ res = self._dll.JLINKARM_SWO_Control(enums.JLinkSWOCommands.STOP, 0) if res < 0: ...
python
{ "resource": "" }
q231466
JLink.swo_enable
train
def swo_enable(self, cpu_speed, swo_speed=9600, port_mask=0x01): """Enables SWO output on the target device. Configures the output protocol, the SWO output speed, and enables any ITM & stimulus ports. This is equivalent to calling ``.swo_start()``. Note: If SWO is al...
python
{ "resource": "" }
q231467
JLink.swo_disable
train
def swo_disable(self, port_mask): """Disables ITM & Stimulus ports. Args: self (JLink): the ``JLink`` instance port_mask (int): mask specifying which ports to disable Returns: ``None`` Raises: JLinkException: on error """ res = s...
python
{ "resource": "" }
q231468
JLink.swo_flush
train
def swo_flush(self, num_bytes=None): """Flushes data from the SWO buffer. After this method is called, the flushed part of the SWO buffer is empty. If ``num_bytes`` is not present, flushes all data currently in the SWO buffer. Args: self (JLink): the ``JLink`...
python
{ "resource": "" }
q231469
JLink.swo_speed_info
train
def swo_speed_info(self): """Retrieves information about the supported SWO speeds. Args: self (JLink): the ``JLink`` instance Returns: A ``JLinkSWOSpeedInfo`` instance describing the target's supported SWO speeds. Raises: JLinkException: on erro...
python
{ "resource": "" }
q231470
JLink.swo_num_bytes
train
def swo_num_bytes(self): """Retrives the number of bytes in the SWO buffer. Args: self (JLink): the ``JLink`` instance Returns: Number of bytes in the SWO buffer. Raises: JLinkException: on error """ res = self._dll.JLINKARM_SWO_Control(en...
python
{ "resource": "" }
q231471
JLink.swo_set_host_buffer_size
train
def swo_set_host_buffer_size(self, buf_size): """Sets the size of the buffer used by the host to collect SWO data. Args: self (JLink): the ``JLink`` instance buf_size (int): the new size of the host buffer Returns: ``None`` Raises: JLinkExceptio...
python
{ "resource": "" }
q231472
JLink.swo_set_emu_buffer_size
train
def swo_set_emu_buffer_size(self, buf_size): """Sets the size of the buffer used by the J-Link to collect SWO data. Args: self (JLink): the ``JLink`` instance buf_size (int): the new size of the emulator buffer Returns: ``None`` Raises: JLinkExc...
python
{ "resource": "" }
q231473
JLink.swo_supported_speeds
train
def swo_supported_speeds(self, cpu_speed, num_speeds=3): """Retrives a list of SWO speeds supported by both the target and the connected J-Link. The supported speeds are returned in order from highest to lowest. Args: self (JLink): the ``JLink`` instance cpu_speed (...
python
{ "resource": "" }
q231474
JLink.swo_read
train
def swo_read(self, offset, num_bytes, remove=False): """Reads data from the SWO buffer. The data read is not automatically removed from the SWO buffer after reading unless ``remove`` is ``True``. Otherwise the callee must explicitly remove the data by calling ``.swo_flush()``. ...
python
{ "resource": "" }
q231475
JLink.swo_read_stimulus
train
def swo_read_stimulus(self, port, num_bytes): """Reads the printable data via SWO. This method reads SWO for one stimulus port, which is all printable data. Note: Stimulus port ``0`` is used for ``printf`` debugging. Args: self (JLink): the ``JLink`` instan...
python
{ "resource": "" }
q231476
JLink.rtt_read
train
def rtt_read(self, buffer_index, num_bytes): """Reads data from the RTT buffer. This method will read at most num_bytes bytes from the specified RTT buffer. The data is automatically removed from the RTT buffer. If there are not num_bytes bytes waiting in the RTT buffer, the ent...
python
{ "resource": "" }
q231477
JLink.rtt_write
train
def rtt_write(self, buffer_index, data): """Writes data to the RTT buffer. This method will write at most len(data) bytes to the specified RTT buffer. Args: self (JLink): the ``JLink`` instance buffer_index (int): the index of the RTT buffer to write to da...
python
{ "resource": "" }
q231478
JLink.rtt_control
train
def rtt_control(self, command, config): """Issues an RTT Control command. All RTT control is done through a single API call which expects specifically laid-out configuration structures. Args: self (JLink): the ``JLink`` instance command (int): the command to issue (...
python
{ "resource": "" }
q231479
main
train
def main(target_device): """Creates an interactive terminal to the target via RTT. The main loop opens a connection to the JLink, and then connects to the target device. RTT is started, the number of buffers is presented, and then two worker threads are spawned: one for read, and one for write. Th...
python
{ "resource": "" }
q231480
ThreadReturn.run
train
def run(self): """Runs the thread. Args: self (ThreadReturn): the ``ThreadReturn`` instance Returns: ``None`` """ target = getattr(self, '_Thread__target', getattr(self, '_target', None)) args = getattr(self, '_Thread__args', getattr(self, '_args', N...
python
{ "resource": "" }
q231481
ThreadReturn.join
train
def join(self, *args, **kwargs): """Joins the thread. Args: self (ThreadReturn): the ``ThreadReturn`` instance args: optional list of arguments kwargs: optional key-word arguments Returns: The return value of the exited thread. """ super(...
python
{ "resource": "" }
q231482
main
train
def main(): """Upgrades the firmware of the J-Links connected to a Windows device. Returns: None. Raises: OSError: if there are no J-Link software packages. """ windows_libraries = list(pylink.Library.find_library_windows()) latest_library = None for lib in windows_libraries: ...
python
{ "resource": "" }
q231483
async_decorator
train
def async_decorator(func): """Asynchronous function decorator. Interprets the function as being asynchronous, so returns a function that will handle calling the Function asynchronously. Args: func (function): function to be called asynchronously Returns: The wrapped function. Rai...
python
{ "resource": "" }
q231484
strace
train
def strace(device, trace_address, breakpoint_address): """Implements simple trace using the STrace API. Args: device (str): the device to connect to trace_address (int): address to begin tracing from breakpoint_address (int): address to breakpoint at Returns: ``None`` """ j...
python
{ "resource": "" }
q231485
create_parser
train
def create_parser(): """Builds the command parser. This needs to be exported in order for Sphinx to document it correctly. Returns: An instance of an ``argparse.ArgumentParser`` that parses all the commands supported by the PyLink CLI. """ parser = argparse.ArgumentParser(prog=pylink._...
python
{ "resource": "" }
q231486
main
train
def main(args=None): """Main command-line interface entrypoint. Runs the given subcommand or argument that were specified. If not given a ``args`` parameter, assumes the arguments are passed on the command-line. Args: args (list): list of command-line arguments Returns: Zero on succe...
python
{ "resource": "" }
q231487
Command.create_jlink
train
def create_jlink(self, args): """Creates an instance of a J-Link from the given arguments. Args: self (Command): the ``Command`` instance args (Namespace): arguments to construct the ``JLink`` instance from Returns: An instance of a ``JLink``. """ ...
python
{ "resource": "" }
q231488
Command.add_common_arguments
train
def add_common_arguments(self, parser, has_device=False): """Adds common arguments to the given parser. Common arguments for a J-Link command are the target interface, and J-Link serial number or IP address. Args: self (Command): the ``Command`` instance parser (arg...
python
{ "resource": "" }
q231489
EraseCommand.run
train
def run(self, args): """Erases the device connected to the J-Link. Args: self (EraseCommand): the ``EraseCommand`` instance args (Namespace): the arguments passed on the command-line Returns: ``None`` """ jlink = self.create_jlink(args) era...
python
{ "resource": "" }
q231490
FlashCommand.run
train
def run(self, args): """Flashes the device connected to the J-Link. Args: self (FlashCommand): the ``FlashCommand`` instance args (Namespace): the arguments passed on the command-line Returns: ``None`` """ kwargs = {} kwargs['path'] = args....
python
{ "resource": "" }
q231491
UnlockCommand.add_arguments
train
def add_arguments(self, parser): """Adds the unlock command arguments to the parser. Args: self (UnlockCommand): the ``UnlockCommand`` instance parser (argparse.ArgumentParser): the parser to add the arguments to Returns: ``None`` """ parser.add_ar...
python
{ "resource": "" }
q231492
UnlockCommand.run
train
def run(self, args): """Unlocks the target device. Args: self (UnlockCommand): the ``UnlockCommand`` instance args (Namespace): the arguments passed on the command-line Returns: ``None`` """ jlink = self.create_jlink(args) mcu = args.name[0...
python
{ "resource": "" }
q231493
LicenseCommand.run
train
def run(self, args): """Runs the license command. Args: self (LicenseCommand): the ``LicenseCommand`` instance args (Namespace): the arguments passed on the command-line Returns: ``None`` """ jlink = self.create_jlink(args) if args.list: ...
python
{ "resource": "" }
q231494
InfoCommand.add_arguments
train
def add_arguments(self, parser): """Adds the information commands to the parser. Args: self (InfoCommand): the ``InfoCommand`` instance parser (argparse.ArgumentParser): the parser to add the arguments to Returns: ``None`` """ parser.add_argument('...
python
{ "resource": "" }
q231495
InfoCommand.run
train
def run(self, args): """Runs the information command. Args: self (InfoCommand): the ``InfoCommand`` instance args (Namespace): the arguments passed on the command-line Returns: ``None`` """ jlink = self.create_jlink(args) if args.product: ...
python
{ "resource": "" }
q231496
EmulatorCommand.add_arguments
train
def add_arguments(self, parser): """Adds the arguments for the emulator command. Args: self (EmulatorCommand): the ``EmulatorCommand`` instance parser (argparse.ArgumentParser): parser to add the commands to Returns: ``None`` """ group = parser.add...
python
{ "resource": "" }
q231497
EmulatorCommand.run
train
def run(self, args): """Runs the emulator command. Args: self (EmulatorCommand): the ``EmulatorCommand`` instance args (Namespace): arguments to parse Returns: ``None`` """ jlink = pylink.JLink() if args.test: if jlink.test(): ...
python
{ "resource": "" }
q231498
FirmwareCommand.add_arguments
train
def add_arguments(self, parser): """Adds the arguments for the firmware command. Args: self (FirmwareCommand): the ``FirmwareCommand`` instance parser (argparse.ArgumentParser): parser to add the commands to Returns: ``None`` """ group = parser.add...
python
{ "resource": "" }
q231499
FirmwareCommand.run
train
def run(self, args): """Runs the firmware command. Args: self (FirmwareCommand): the ``FirmwareCommand`` instance args (Namespace): arguments to parse Returns: ``None`` """ jlink = self.create_jlink(args) if args.downgrade: if n...
python
{ "resource": "" }