repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
square/pylink | pylink/jlink.py | JLink.extended_capabilities | def extended_capabilities(self):
"""Gets the capabilities of the connected emulator as a list.
Args:
self (JLink): the ``JLink`` instance
Returns:
List of 32 integers which define the extended capabilities based on
their value and index within the list.
""... | python | def extended_capabilities(self):
"""Gets the capabilities of the connected emulator as a list.
Args:
self (JLink): the ``JLink`` instance
Returns:
List of 32 integers which define the extended capabilities based on
their value and index within the list.
""... | [
"def",
"extended_capabilities",
"(",
"self",
")",
":",
"buf",
"=",
"(",
"ctypes",
".",
"c_uint8",
"*",
"32",
")",
"(",
")",
"self",
".",
"_dll",
".",
"JLINKARM_GetEmuCapsEx",
"(",
"buf",
",",
"32",
")",
"return",
"list",
"(",
"buf",
")"
] | Gets the capabilities of the connected emulator as a list.
Args:
self (JLink): the ``JLink`` instance
Returns:
List of 32 integers which define the extended capabilities based on
their value and index within the list. | [
"Gets",
"the",
"capabilities",
"of",
"the",
"connected",
"emulator",
"as",
"a",
"list",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1184-L1196 | train |
square/pylink | pylink/jlink.py | JLink.features | def features(self):
"""Returns a list of the J-Link embedded features.
Args:
self (JLink): the ``JLink`` instance
Returns:
A list of strings, each a feature. Example:
``[ 'RDI', 'FlashBP', 'FlashDL', 'JFlash', 'GDB' ]``
"""
buf = (ctypes.c_char * ... | python | def features(self):
"""Returns a list of the J-Link embedded features.
Args:
self (JLink): the ``JLink`` instance
Returns:
A list of strings, each a feature. Example:
``[ 'RDI', 'FlashBP', 'FlashDL', 'JFlash', 'GDB' ]``
"""
buf = (ctypes.c_char * ... | [
"def",
"features",
"(",
"self",
")",
":",
"buf",
"=",
"(",
"ctypes",
".",
"c_char",
"*",
"self",
".",
"MAX_BUF_SIZE",
")",
"(",
")",
"self",
".",
"_dll",
".",
"JLINKARM_GetFeatureString",
"(",
"buf",
")",
"result",
"=",
"ctypes",
".",
"string_at",
"(",... | Returns a list of the J-Link embedded features.
Args:
self (JLink): the ``JLink`` instance
Returns:
A list of strings, each a feature. Example:
``[ 'RDI', 'FlashBP', 'FlashDL', 'JFlash', 'GDB' ]`` | [
"Returns",
"a",
"list",
"of",
"the",
"J",
"-",
"Link",
"embedded",
"features",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1215-L1232 | train |
square/pylink | pylink/jlink.py | JLink.product_name | def product_name(self):
"""Returns the product name of the connected J-Link.
Args:
self (JLink): the ``JLink`` instance
Returns:
Product name.
"""
buf = (ctypes.c_char * self.MAX_BUF_SIZE)()
self._dll.JLINKARM_EMU_GetProductName(buf, self.MAX_BUF_SIZ... | python | def product_name(self):
"""Returns the product name of the connected J-Link.
Args:
self (JLink): the ``JLink`` instance
Returns:
Product name.
"""
buf = (ctypes.c_char * self.MAX_BUF_SIZE)()
self._dll.JLINKARM_EMU_GetProductName(buf, self.MAX_BUF_SIZ... | [
"def",
"product_name",
"(",
"self",
")",
":",
"buf",
"=",
"(",
"ctypes",
".",
"c_char",
"*",
"self",
".",
"MAX_BUF_SIZE",
")",
"(",
")",
"self",
".",
"_dll",
".",
"JLINKARM_EMU_GetProductName",
"(",
"buf",
",",
"self",
".",
"MAX_BUF_SIZE",
")",
"return",... | Returns the product name of the connected J-Link.
Args:
self (JLink): the ``JLink`` instance
Returns:
Product name. | [
"Returns",
"the",
"product",
"name",
"of",
"the",
"connected",
"J",
"-",
"Link",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1236-L1247 | train |
square/pylink | pylink/jlink.py | JLink.oem | def oem(self):
"""Retrieves and returns the OEM string of the connected J-Link.
Args:
self (JLink): the ``JLink`` instance
Returns:
The string of the OEM. If this is an original SEGGER product, then
``None`` is returned instead.
Raises:
JLinkEx... | python | def oem(self):
"""Retrieves and returns the OEM string of the connected J-Link.
Args:
self (JLink): the ``JLink`` instance
Returns:
The string of the OEM. If this is an original SEGGER product, then
``None`` is returned instead.
Raises:
JLinkEx... | [
"def",
"oem",
"(",
"self",
")",
":",
"buf",
"=",
"(",
"ctypes",
".",
"c_char",
"*",
"self",
".",
"MAX_BUF_SIZE",
")",
"(",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_GetOEMString",
"(",
"ctypes",
".",
"byref",
"(",
"buf",
")",
")",
"if",
... | Retrieves and returns the OEM string of the connected J-Link.
Args:
self (JLink): the ``JLink`` instance
Returns:
The string of the OEM. If this is an original SEGGER product, then
``None`` is returned instead.
Raises:
JLinkException: on hardware error... | [
"Retrieves",
"and",
"returns",
"the",
"OEM",
"string",
"of",
"the",
"connected",
"J",
"-",
"Link",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1264-L1288 | train |
square/pylink | pylink/jlink.py | JLink.set_speed | def set_speed(self, speed=None, auto=False, adaptive=False):
"""Sets the speed of the JTAG communication with the ARM core.
If no arguments are present, automatically detects speed.
If a ``speed`` is provided, the speed must be no larger than
``JLink.MAX_JTAG_SPEED`` and no smaller tha... | python | def set_speed(self, speed=None, auto=False, adaptive=False):
"""Sets the speed of the JTAG communication with the ARM core.
If no arguments are present, automatically detects speed.
If a ``speed`` is provided, the speed must be no larger than
``JLink.MAX_JTAG_SPEED`` and no smaller tha... | [
"def",
"set_speed",
"(",
"self",
",",
"speed",
"=",
"None",
",",
"auto",
"=",
"False",
",",
"adaptive",
"=",
"False",
")",
":",
"if",
"speed",
"is",
"None",
":",
"speed",
"=",
"0",
"elif",
"not",
"util",
".",
"is_natural",
"(",
"speed",
")",
":",
... | Sets the speed of the JTAG communication with the ARM core.
If no arguments are present, automatically detects speed.
If a ``speed`` is provided, the speed must be no larger than
``JLink.MAX_JTAG_SPEED`` and no smaller than ``JLink.MIN_JTAG_SPEED``.
The given ``speed`` can also not be ... | [
"Sets",
"the",
"speed",
"of",
"the",
"JTAG",
"communication",
"with",
"the",
"ARM",
"core",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1318-L1357 | train |
square/pylink | pylink/jlink.py | JLink.speed_info | def speed_info(self):
"""Retrieves information about supported target interface speeds.
Args:
self (JLink): the ``JLink`` instance
Returns:
The ``JLinkSpeedInfo`` instance describing the supported target
interface speeds.
"""
speed_info = structs.J... | python | def speed_info(self):
"""Retrieves information about supported target interface speeds.
Args:
self (JLink): the ``JLink`` instance
Returns:
The ``JLinkSpeedInfo`` instance describing the supported target
interface speeds.
"""
speed_info = structs.J... | [
"def",
"speed_info",
"(",
"self",
")",
":",
"speed_info",
"=",
"structs",
".",
"JLinkSpeedInfo",
"(",
")",
"self",
".",
"_dll",
".",
"JLINKARM_GetSpeedInfo",
"(",
"ctypes",
".",
"byref",
"(",
"speed_info",
")",
")",
"return",
"speed_info"
] | Retrieves information about supported target interface speeds.
Args:
self (JLink): the ``JLink`` instance
Returns:
The ``JLinkSpeedInfo`` instance describing the supported target
interface speeds. | [
"Retrieves",
"information",
"about",
"supported",
"target",
"interface",
"speeds",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1374-L1386 | train |
square/pylink | pylink/jlink.py | JLink.licenses | def licenses(self):
"""Returns a string of the built-in licenses the J-Link has.
Args:
self (JLink): the ``JLink`` instance
Returns:
String of the contents of the built-in licenses the J-Link has.
"""
buf_size = self.MAX_BUF_SIZE
buf = (ctypes.c_char... | python | def licenses(self):
"""Returns a string of the built-in licenses the J-Link has.
Args:
self (JLink): the ``JLink`` instance
Returns:
String of the contents of the built-in licenses the J-Link has.
"""
buf_size = self.MAX_BUF_SIZE
buf = (ctypes.c_char... | [
"def",
"licenses",
"(",
"self",
")",
":",
"buf_size",
"=",
"self",
".",
"MAX_BUF_SIZE",
"buf",
"=",
"(",
"ctypes",
".",
"c_char",
"*",
"buf_size",
")",
"(",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINK_GetAvailableLicense",
"(",
"buf",
",",
"buf_s... | Returns a string of the built-in licenses the J-Link has.
Args:
self (JLink): the ``JLink`` instance
Returns:
String of the contents of the built-in licenses the J-Link has. | [
"Returns",
"a",
"string",
"of",
"the",
"built",
"-",
"in",
"licenses",
"the",
"J",
"-",
"Link",
"has",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1390-L1404 | train |
square/pylink | pylink/jlink.py | JLink.custom_licenses | def custom_licenses(self):
"""Returns a string of the installed licenses the J-Link has.
Args:
self (JLink): the ``JLink`` instance
Returns:
String of the contents of the custom licenses the J-Link has.
"""
buf = (ctypes.c_char * self.MAX_BUF_SIZE)()
... | python | def custom_licenses(self):
"""Returns a string of the installed licenses the J-Link has.
Args:
self (JLink): the ``JLink`` instance
Returns:
String of the contents of the custom licenses the J-Link has.
"""
buf = (ctypes.c_char * self.MAX_BUF_SIZE)()
... | [
"def",
"custom_licenses",
"(",
"self",
")",
":",
"buf",
"=",
"(",
"ctypes",
".",
"c_char",
"*",
"self",
".",
"MAX_BUF_SIZE",
")",
"(",
")",
"result",
"=",
"self",
".",
"_dll",
".",
"JLINK_EMU_GetLicenses",
"(",
"buf",
",",
"self",
".",
"MAX_BUF_SIZE",
... | Returns a string of the installed licenses the J-Link has.
Args:
self (JLink): the ``JLink`` instance
Returns:
String of the contents of the custom licenses the J-Link has. | [
"Returns",
"a",
"string",
"of",
"the",
"installed",
"licenses",
"the",
"J",
"-",
"Link",
"has",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1409-L1422 | train |
square/pylink | pylink/jlink.py | JLink.add_license | def add_license(self, contents):
"""Adds the given ``contents`` as a new custom license to the J-Link.
Args:
self (JLink): the ``JLink`` instance
contents: the string contents of the new custom license
Returns:
``True`` if license was added, ``False`` if license a... | python | def add_license(self, contents):
"""Adds the given ``contents`` as a new custom license to the J-Link.
Args:
self (JLink): the ``JLink`` instance
contents: the string contents of the new custom license
Returns:
``True`` if license was added, ``False`` if license a... | [
"def",
"add_license",
"(",
"self",
",",
"contents",
")",
":",
"buf_size",
"=",
"len",
"(",
"contents",
")",
"buf",
"=",
"(",
"ctypes",
".",
"c_char",
"*",
"(",
"buf_size",
"+",
"1",
")",
")",
"(",
"*",
"contents",
".",
"encode",
"(",
")",
")",
"r... | Adds the given ``contents`` as a new custom license to the J-Link.
Args:
self (JLink): the ``JLink`` instance
contents: the string contents of the new custom license
Returns:
``True`` if license was added, ``False`` if license already existed.
Raises:
J... | [
"Adds",
"the",
"given",
"contents",
"as",
"a",
"new",
"custom",
"license",
"to",
"the",
"J",
"-",
"Link",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1426-L1455 | train |
square/pylink | pylink/jlink.py | JLink.supported_tifs | def supported_tifs(self):
"""Returns a bitmask of the supported target interfaces.
Args:
self (JLink): the ``JLink`` instance
Returns:
Bitfield specifying which target interfaces are supported.
"""
buf = ctypes.c_uint32()
self._dll.JLINKARM_TIF_GetAv... | python | def supported_tifs(self):
"""Returns a bitmask of the supported target interfaces.
Args:
self (JLink): the ``JLink`` instance
Returns:
Bitfield specifying which target interfaces are supported.
"""
buf = ctypes.c_uint32()
self._dll.JLINKARM_TIF_GetAv... | [
"def",
"supported_tifs",
"(",
"self",
")",
":",
"buf",
"=",
"ctypes",
".",
"c_uint32",
"(",
")",
"self",
".",
"_dll",
".",
"JLINKARM_TIF_GetAvailable",
"(",
"ctypes",
".",
"byref",
"(",
"buf",
")",
")",
"return",
"buf",
".",
"value"
] | Returns a bitmask of the supported target interfaces.
Args:
self (JLink): the ``JLink`` instance
Returns:
Bitfield specifying which target interfaces are supported. | [
"Returns",
"a",
"bitmask",
"of",
"the",
"supported",
"target",
"interfaces",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1488-L1499 | train |
square/pylink | pylink/jlink.py | JLink.set_tif | def set_tif(self, interface):
"""Selects the specified target interface.
Note that a restart must be triggered for this to take effect.
Args:
self (Jlink): the ``JLink`` instance
interface (int): integer identifier of the interface
Returns:
``True`` if ta... | python | def set_tif(self, interface):
"""Selects the specified target interface.
Note that a restart must be triggered for this to take effect.
Args:
self (Jlink): the ``JLink`` instance
interface (int): integer identifier of the interface
Returns:
``True`` if ta... | [
"def",
"set_tif",
"(",
"self",
",",
"interface",
")",
":",
"if",
"not",
"(",
"(",
"1",
"<<",
"interface",
")",
"&",
"self",
".",
"supported_tifs",
"(",
")",
")",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"'Unsupported target interface: %s'",
"%",... | Selects the specified target interface.
Note that a restart must be triggered for this to take effect.
Args:
self (Jlink): the ``JLink`` instance
interface (int): integer identifier of the interface
Returns:
``True`` if target was updated, otherwise ``False``.
... | [
"Selects",
"the",
"specified",
"target",
"interface",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1502-L1527 | train |
square/pylink | pylink/jlink.py | JLink.gpio_properties | def gpio_properties(self):
"""Returns the properties of the user-controllable GPIOs.
Provided the device supports user-controllable GPIOs, they will be
returned by this method.
Args:
self (JLink): the ``JLink`` instance
Returns:
A list of ``JLinkGPIODescrip... | python | def gpio_properties(self):
"""Returns the properties of the user-controllable GPIOs.
Provided the device supports user-controllable GPIOs, they will be
returned by this method.
Args:
self (JLink): the ``JLink`` instance
Returns:
A list of ``JLinkGPIODescrip... | [
"def",
"gpio_properties",
"(",
"self",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINK_EMU_GPIO_GetProps",
"(",
"0",
",",
"0",
")",
"if",
"res",
"<",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"res",
")",
"num_props",
"=",
"res",
... | Returns the properties of the user-controllable GPIOs.
Provided the device supports user-controllable GPIOs, they will be
returned by this method.
Args:
self (JLink): the ``JLink`` instance
Returns:
A list of ``JLinkGPIODescriptor`` instances totalling the number o... | [
"Returns",
"the",
"properties",
"of",
"the",
"user",
"-",
"controllable",
"GPIOs",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1530-L1556 | train |
square/pylink | pylink/jlink.py | JLink.gpio_get | def gpio_get(self, pins=None):
"""Returns a list of states for the given pins.
Defaults to the first four pins if an argument is not given.
Args:
self (JLink): the ``JLink`` instance
pins (list): indices of the GPIO pins whose states are requested
Returns:
... | python | def gpio_get(self, pins=None):
"""Returns a list of states for the given pins.
Defaults to the first four pins if an argument is not given.
Args:
self (JLink): the ``JLink`` instance
pins (list): indices of the GPIO pins whose states are requested
Returns:
... | [
"def",
"gpio_get",
"(",
"self",
",",
"pins",
"=",
"None",
")",
":",
"if",
"pins",
"is",
"None",
":",
"pins",
"=",
"range",
"(",
"4",
")",
"size",
"=",
"len",
"(",
"pins",
")",
"indices",
"=",
"(",
"ctypes",
".",
"c_uint8",
"*",
"size",
")",
"("... | Returns a list of states for the given pins.
Defaults to the first four pins if an argument is not given.
Args:
self (JLink): the ``JLink`` instance
pins (list): indices of the GPIO pins whose states are requested
Returns:
A list of states.
Raises:
... | [
"Returns",
"a",
"list",
"of",
"states",
"for",
"the",
"given",
"pins",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1559-L1586 | train |
square/pylink | pylink/jlink.py | JLink.gpio_set | def gpio_set(self, pins, states):
"""Sets the state for one or more user-controllable GPIOs.
For each of the given pins, sets the the corresponding state based on
the index.
Args:
self (JLink): the ``JLink`` instance
pins (list): list of GPIO indices
state... | python | def gpio_set(self, pins, states):
"""Sets the state for one or more user-controllable GPIOs.
For each of the given pins, sets the the corresponding state based on
the index.
Args:
self (JLink): the ``JLink`` instance
pins (list): list of GPIO indices
state... | [
"def",
"gpio_set",
"(",
"self",
",",
"pins",
",",
"states",
")",
":",
"if",
"len",
"(",
"pins",
")",
"!=",
"len",
"(",
"states",
")",
":",
"raise",
"ValueError",
"(",
"'Length mismatch between pins and states.'",
")",
"size",
"=",
"len",
"(",
"pins",
")"... | Sets the state for one or more user-controllable GPIOs.
For each of the given pins, sets the the corresponding state based on
the index.
Args:
self (JLink): the ``JLink`` instance
pins (list): list of GPIO indices
states (list): list of states to set
Retu... | [
"Sets",
"the",
"state",
"for",
"one",
"or",
"more",
"user",
"-",
"controllable",
"GPIOs",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1589-L1621 | train |
square/pylink | pylink/jlink.py | JLink.unlock | 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 | 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:
... | [
"def",
"unlock",
"(",
"self",
")",
":",
"if",
"not",
"unlockers",
".",
"unlock",
"(",
"self",
",",
"self",
".",
"_device",
".",
"manufacturer",
")",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"'Failed to unlock device.'",
")",
"return",
"True"
] | 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:
``True``.
Raises:
... | [
"Unlocks",
"the",
"device",
"connected",
"to",
"the",
"J",
"-",
"Link",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1680-L1701 | train |
square/pylink | pylink/jlink.py | JLink.erase | 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 | 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.... | [
"def",
"erase",
"(",
"self",
")",
":",
"try",
":",
"if",
"not",
"self",
".",
"halted",
"(",
")",
":",
"self",
".",
"halt",
"(",
")",
"except",
"errors",
".",
"JLinkException",
":",
"pass",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINK_EraseChip",
"(... | 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. | [
"Erases",
"the",
"flash",
"contents",
"of",
"the",
"device",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L1920-L1945 | train |
square/pylink | pylink/jlink.py | JLink.reset | 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 | 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)... | [
"def",
"reset",
"(",
"self",
",",
"ms",
"=",
"0",
",",
"halt",
"=",
"True",
")",
":",
"self",
".",
"_dll",
".",
"JLINKARM_SetResetDelay",
"(",
"ms",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_Reset",
"(",
")",
"if",
"res",
"<",
"0",
":"... | 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): if the CPU should halt after reset (default... | [
"Resets",
"the",
"target",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2046-L2068 | train |
square/pylink | pylink/jlink.py | JLink.halt | 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 | 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... | [
"def",
"halt",
"(",
"self",
")",
":",
"res",
"=",
"int",
"(",
"self",
".",
"_dll",
".",
"JLINKARM_Halt",
"(",
")",
")",
"if",
"res",
"==",
"0",
":",
"time",
".",
"sleep",
"(",
"1",
")",
"return",
"True",
"return",
"False"
] | Halts the CPU Core.
Args:
self (JLink): the ``JLink`` instance
Returns:
``True`` if halted, ``False`` otherwise. | [
"Halts",
"the",
"CPU",
"Core",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2121-L2134 | train |
square/pylink | pylink/jlink.py | JLink.halted | 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 | 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... | [
"def",
"halted",
"(",
"self",
")",
":",
"result",
"=",
"int",
"(",
"self",
".",
"_dll",
".",
"JLINKARM_IsHalted",
"(",
")",
")",
"if",
"result",
"<",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"result",
")",
"return",
"(",
"result",
">"... | 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. | [
"Returns",
"whether",
"the",
"CPU",
"core",
"was",
"halted",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2137-L2153 | train |
square/pylink | pylink/jlink.py | JLink.core_name | 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 | 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(... | [
"def",
"core_name",
"(",
"self",
")",
":",
"buf_size",
"=",
"self",
".",
"MAX_BUF_SIZE",
"buf",
"=",
"(",
"ctypes",
".",
"c_char",
"*",
"buf_size",
")",
"(",
")",
"self",
".",
"_dll",
".",
"JLINKARM_Core2CoreName",
"(",
"self",
".",
"core_cpu",
"(",
")... | Returns the name of the target ARM core.
Args:
self (JLink): the ``JLink`` instance
Returns:
The target core's name. | [
"Returns",
"the",
"name",
"of",
"the",
"target",
"ARM",
"core",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2184-L2196 | train |
square/pylink | pylink/jlink.py | JLink.scan_chain_len | 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 | 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:
... | [
"def",
"scan_chain_len",
"(",
"self",
",",
"scan_chain",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_MeasureSCLen",
"(",
"scan_chain",
")",
"if",
"res",
"<",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"res",
")",
"return",
"re... | 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:
JLinkException: on error. | [
"Retrieves",
"and",
"returns",
"the",
"number",
"of",
"bits",
"in",
"the",
"scan",
"chain",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2224-L2240 | train |
square/pylink | pylink/jlink.py | JLink.register_list | 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 | 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.
"""
... | [
"def",
"register_list",
"(",
"self",
")",
":",
"num_items",
"=",
"self",
".",
"MAX_NUM_CPU_REGISTERS",
"buf",
"=",
"(",
"ctypes",
".",
"c_uint32",
"*",
"num_items",
")",
"(",
")",
"num_regs",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_GetRegisterList",
"(",
... | 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. | [
"Returns",
"a",
"list",
"of",
"the",
"indices",
"for",
"the",
"CPU",
"registers",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2255-L2270 | train |
square/pylink | pylink/jlink.py | JLink.register_name | 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 | 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... | [
"def",
"register_name",
"(",
"self",
",",
"register_index",
")",
":",
"result",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_GetRegisterName",
"(",
"register_index",
")",
"return",
"ctypes",
".",
"cast",
"(",
"result",
",",
"ctypes",
".",
"c_char_p",
")",
".",
... | 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. | [
"Retrives",
"and",
"returns",
"the",
"name",
"of",
"an",
"ARM",
"CPU",
"register",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2273-L2284 | train |
square/pylink | pylink/jlink.py | JLink.cpu_speed | 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 | 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... | [
"def",
"cpu_speed",
"(",
"self",
",",
"silent",
"=",
"False",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_MeasureCPUSpeedEx",
"(",
"-",
"1",
",",
"1",
",",
"int",
"(",
"silent",
")",
")",
"if",
"res",
"<",
"0",
":",
"raise",
"errors",... | 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 report errors
to the error handler ... | [
"Retrieves",
"the",
"CPU",
"speed",
"of",
"the",
"target",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2287-L2308 | train |
square/pylink | pylink/jlink.py | JLink.cpu_halt_reasons | 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 | 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 ... | [
"def",
"cpu_halt_reasons",
"(",
"self",
")",
":",
"buf_size",
"=",
"self",
".",
"MAX_NUM_MOES",
"buf",
"=",
"(",
"structs",
".",
"JLinkMOEInfo",
"*",
"buf_size",
")",
"(",
")",
"num_reasons",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_GetMOEs",
"(",
"buf",
... | 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 CPU
is not halted.
R... | [
"Retrives",
"the",
"reasons",
"that",
"the",
"CPU",
"was",
"halted",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2311-L2331 | train |
square/pylink | pylink/jlink.py | JLink.jtag_send | 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 | 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:
... | [
"def",
"jtag_send",
"(",
"self",
",",
"tms",
",",
"tdi",
",",
"num_bits",
")",
":",
"if",
"not",
"util",
".",
"is_natural",
"(",
"num_bits",
")",
"or",
"num_bits",
"<=",
"0",
"or",
"num_bits",
">",
"32",
":",
"raise",
"ValueError",
"(",
"'Number of bit... | 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:
self (JLink): the ``JLink`` instance
... | [
"Sends",
"data",
"via",
"JTAG",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2349-L2378 | train |
square/pylink | pylink/jlink.py | JLink.swd_read8 | 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 | 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 = ... | [
"def",
"swd_read8",
"(",
"self",
",",
"offset",
")",
":",
"value",
"=",
"self",
".",
"_dll",
".",
"JLINK_SWD_GetU8",
"(",
"offset",
")",
"return",
"ctypes",
".",
"c_uint8",
"(",
"value",
")",
".",
"value"
] | 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. | [
"Gets",
"a",
"unit",
"of",
"8",
"bits",
"from",
"the",
"input",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2399-L2410 | train |
square/pylink | pylink/jlink.py | JLink.swd_read16 | 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 | 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 ... | [
"def",
"swd_read16",
"(",
"self",
",",
"offset",
")",
":",
"value",
"=",
"self",
".",
"_dll",
".",
"JLINK_SWD_GetU16",
"(",
"offset",
")",
"return",
"ctypes",
".",
"c_uint16",
"(",
"value",
")",
".",
"value"
] | 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. | [
"Gets",
"a",
"unit",
"of",
"16",
"bits",
"from",
"the",
"input",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2414-L2425 | train |
square/pylink | pylink/jlink.py | JLink.swd_read32 | 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 | 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 ... | [
"def",
"swd_read32",
"(",
"self",
",",
"offset",
")",
":",
"value",
"=",
"self",
".",
"_dll",
".",
"JLINK_SWD_GetU32",
"(",
"offset",
")",
"return",
"ctypes",
".",
"c_uint32",
"(",
"value",
")",
".",
"value"
] | 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. | [
"Gets",
"a",
"unit",
"of",
"32",
"bits",
"from",
"the",
"input",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2429-L2440 | train |
square/pylink | pylink/jlink.py | JLink.swd_sync | 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 | 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 ... | [
"def",
"swd_sync",
"(",
"self",
",",
"pad",
"=",
"False",
")",
":",
"if",
"pad",
":",
"self",
".",
"_dll",
".",
"JLINK_SWD_SyncBytes",
"(",
")",
"else",
":",
"self",
".",
"_dll",
".",
"JLINK_SWD_SyncBits",
"(",
")",
"return",
"None"
] | 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`` | [
"Causes",
"a",
"flush",
"to",
"write",
"all",
"data",
"remaining",
"in",
"output",
"buffers",
"to",
"SWD",
"device",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2512-L2527 | train |
square/pylink | pylink/jlink.py | JLink.flash_write | 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 | 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... | [
"def",
"flash_write",
"(",
"self",
",",
"addr",
",",
"data",
",",
"nbits",
"=",
"None",
",",
"flags",
"=",
"0",
")",
":",
"self",
".",
"_dll",
".",
"JLINKARM_BeginDownload",
"(",
"flags",
")",
"self",
".",
"memory_write",
"(",
"addr",
",",
"data",
",... | 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 write to
data (list): list of data units to write
... | [
"Writes",
"data",
"to",
"the",
"flash",
"region",
"of",
"a",
"device",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2530-L2556 | train |
square/pylink | pylink/jlink.py | JLink.code_memory_read | 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 | 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... | [
"def",
"code_memory_read",
"(",
"self",
",",
"addr",
",",
"num_bytes",
")",
":",
"buf_size",
"=",
"num_bytes",
"buf",
"=",
"(",
"ctypes",
".",
"c_uint8",
"*",
"buf_size",
")",
"(",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_ReadCodeMem",
"(",
... | 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 bytes at a
time, and expect to always read ahead.... | [
"Reads",
"bytes",
"from",
"code",
"memory",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2601-L2626 | train |
square/pylink | pylink/jlink.py | JLink.num_memory_zones | 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 | 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... | [
"def",
"num_memory_zones",
"(",
"self",
")",
":",
"count",
"=",
"self",
".",
"_dll",
".",
"JLINK_GetMemZones",
"(",
"0",
",",
"0",
")",
"if",
"count",
"<",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"count",
")",
"return",
"count"
] | 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 error. | [
"Returns",
"the",
"number",
"of",
"memory",
"zones",
"supported",
"by",
"the",
"target",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2629-L2645 | train |
square/pylink | pylink/jlink.py | JLink.memory_zones | 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 | 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... | [
"def",
"memory_zones",
"(",
"self",
")",
":",
"count",
"=",
"self",
".",
"num_memory_zones",
"(",
")",
"if",
"count",
"==",
"0",
":",
"return",
"list",
"(",
")",
"buf",
"=",
"(",
"structs",
".",
"JLinkMemoryZone",
"*",
"count",
")",
"(",
")",
"res",
... | 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 (JLink): the ``JLink`` instance
... | [
"Gets",
"all",
"memory",
"zones",
"supported",
"by",
"the",
"current",
"target",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2648-L2673 | train |
square/pylink | pylink/jlink.py | JLink.memory_read | 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 | 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... | [
"def",
"memory_read",
"(",
"self",
",",
"addr",
",",
"num_units",
",",
"zone",
"=",
"None",
",",
"nbits",
"=",
"None",
")",
":",
"buf_size",
"=",
"num_units",
"buf",
"=",
"None",
"access",
"=",
"0",
"if",
"nbits",
"is",
"None",
":",
"buf",
"=",
"("... | 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 either ``8``, ``16``, or
``32``. If not provided, always reads ``num_... | [
"Reads",
"memory",
"from",
"a",
"target",
"system",
"or",
"specific",
"memory",
"zone",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2676-L2732 | train |
square/pylink | pylink/jlink.py | JLink.memory_read8 | 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 | 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... | [
"def",
"memory_read8",
"(",
"self",
",",
"addr",
",",
"num_bytes",
",",
"zone",
"=",
"None",
")",
":",
"return",
"self",
".",
"memory_read",
"(",
"addr",
",",
"num_bytes",
",",
"zone",
"=",
"zone",
",",
"nbits",
"=",
"8",
")"
] | 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 read from
Returns:
List of bytes read from the ... | [
"Reads",
"memory",
"from",
"the",
"target",
"system",
"in",
"units",
"of",
"bytes",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2735-L2750 | train |
square/pylink | pylink/jlink.py | JLink.memory_read16 | 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 | 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... | [
"def",
"memory_read16",
"(",
"self",
",",
"addr",
",",
"num_halfwords",
",",
"zone",
"=",
"None",
")",
":",
"return",
"self",
".",
"memory_read",
"(",
"addr",
",",
"num_halfwords",
",",
"zone",
"=",
"zone",
",",
"nbits",
"=",
"16",
")"
] | 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): memory zone to read from
Returns:
List of halfwords... | [
"Reads",
"memory",
"from",
"the",
"target",
"system",
"in",
"units",
"of",
"16",
"-",
"bits",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2753-L2768 | train |
square/pylink | pylink/jlink.py | JLink.memory_read32 | 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 | 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 ... | [
"def",
"memory_read32",
"(",
"self",
",",
"addr",
",",
"num_words",
",",
"zone",
"=",
"None",
")",
":",
"return",
"self",
".",
"memory_read",
"(",
"addr",
",",
"num_words",
",",
"zone",
"=",
"zone",
",",
"nbits",
"=",
"32",
")"
] | 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 read from
Returns:
List of words read from th... | [
"Reads",
"memory",
"from",
"the",
"target",
"system",
"in",
"units",
"of",
"32",
"-",
"bits",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2771-L2786 | train |
square/pylink | pylink/jlink.py | JLink.memory_read64 | 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 | 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 ... | [
"def",
"memory_read64",
"(",
"self",
",",
"addr",
",",
"num_long_words",
")",
":",
"buf_size",
"=",
"num_long_words",
"buf",
"=",
"(",
"ctypes",
".",
"c_ulonglong",
"*",
"buf_size",
")",
"(",
")",
"units_read",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_Read... | 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 of long words read from the target system.
Raises... | [
"Reads",
"memory",
"from",
"the",
"target",
"system",
"in",
"units",
"of",
"64",
"-",
"bits",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2789-L2809 | train |
square/pylink | pylink/jlink.py | JLink.memory_write | 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 | 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... | [
"def",
"memory_write",
"(",
"self",
",",
"addr",
",",
"data",
",",
"zone",
"=",
"None",
",",
"nbits",
"=",
"None",
")",
":",
"buf_size",
"=",
"len",
"(",
"data",
")",
"buf",
"=",
"None",
"access",
"=",
"0",
"if",
"nbits",
"is",
"None",
":",
"pack... | 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``, ``16``, or
``32``.
Args:
self (JLink): ... | [
"Writes",
"memory",
"to",
"a",
"target",
"system",
"or",
"specific",
"memory",
"zone",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2812-L2876 | train |
square/pylink | pylink/jlink.py | JLink.memory_write8 | 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 | 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
... | [
"def",
"memory_write8",
"(",
"self",
",",
"addr",
",",
"data",
",",
"zone",
"=",
"None",
")",
":",
"return",
"self",
".",
"memory_write",
"(",
"addr",
",",
"data",
",",
"zone",
",",
"8",
")"
] | 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
Returns:
Number of bytes written to target.
... | [
"Writes",
"bytes",
"to",
"memory",
"of",
"a",
"target",
"system",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2879-L2894 | train |
square/pylink | pylink/jlink.py | JLink.memory_write16 | 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 | 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... | [
"def",
"memory_write16",
"(",
"self",
",",
"addr",
",",
"data",
",",
"zone",
"=",
"None",
")",
":",
"return",
"self",
".",
"memory_write",
"(",
"addr",
",",
"data",
",",
"zone",
",",
"16",
")"
] | 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 access
Returns:
Number of half-words written t... | [
"Writes",
"half",
"-",
"words",
"to",
"memory",
"of",
"a",
"target",
"system",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2897-L2912 | train |
square/pylink | pylink/jlink.py | JLink.memory_write32 | 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 | 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
... | [
"def",
"memory_write32",
"(",
"self",
",",
"addr",
",",
"data",
",",
"zone",
"=",
"None",
")",
":",
"return",
"self",
".",
"memory_write",
"(",
"addr",
",",
"data",
",",
"zone",
",",
"32",
")"
] | 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
Returns:
Number of words written to target.
... | [
"Writes",
"words",
"to",
"memory",
"of",
"a",
"target",
"system",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2915-L2930 | train |
square/pylink | pylink/jlink.py | JLink.memory_write64 | 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 | 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
... | [
"def",
"memory_write64",
"(",
"self",
",",
"addr",
",",
"data",
",",
"zone",
"=",
"None",
")",
":",
"words",
"=",
"[",
"]",
"bitmask",
"=",
"0xFFFFFFFF",
"for",
"long_word",
"in",
"data",
":",
"words",
".",
"append",
"(",
"long_word",
"&",
"bitmask",
... | 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
zone (str): optional memory zone to access
R... | [
"Writes",
"long",
"words",
"to",
"memory",
"of",
"a",
"target",
"system",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2933-L2956 | train |
square/pylink | pylink/jlink.py | JLink.register_read_multiple | 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 | 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... | [
"def",
"register_read_multiple",
"(",
"self",
",",
"register_indices",
")",
":",
"num_regs",
"=",
"len",
"(",
"register_indices",
")",
"buf",
"=",
"(",
"ctypes",
".",
"c_uint32",
"*",
"num_regs",
")",
"(",
"*",
"register_indices",
")",
"data",
"=",
"(",
"c... | 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 the given
register indices. The returned list of valu... | [
"Retrieves",
"the",
"values",
"from",
"the",
"registers",
"specified",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L2972-L2999 | train |
square/pylink | pylink/jlink.py | JLink.register_write | 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 | 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... | [
"def",
"register_write",
"(",
"self",
",",
"reg_index",
",",
"value",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_WriteReg",
"(",
"reg_index",
",",
"value",
")",
"if",
"res",
"!=",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
... | 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 register to write to
value (int): the value to w... | [
"Writes",
"into",
"an",
"ARM",
"register",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3002-L3023 | train |
square/pylink | pylink/jlink.py | JLink.register_write_multiple | 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 | 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... | [
"def",
"register_write_multiple",
"(",
"self",
",",
"register_indices",
",",
"values",
")",
":",
"if",
"len",
"(",
"register_indices",
")",
"!=",
"len",
"(",
"values",
")",
":",
"raise",
"ValueError",
"(",
"'Must be an equal number of registers and 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 ``JLink`` instance
register_indices (list): list of registers to w... | [
"Writes",
"to",
"multiple",
"CPU",
"registers",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3026-L3060 | train |
square/pylink | pylink/jlink.py | JLink.ice_register_write | 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 | 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... | [
"def",
"ice_register_write",
"(",
"self",
",",
"register_index",
",",
"value",
",",
"delay",
"=",
"False",
")",
":",
"self",
".",
"_dll",
".",
"JLINKARM_WriteICEReg",
"(",
"register_index",
",",
"int",
"(",
"value",
")",
",",
"int",
"(",
"delay",
")",
")... | 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 (bool): boolean specifying if the write should be delayed
Returns:
... | [
"Writes",
"a",
"value",
"to",
"an",
"ARM",
"ICE",
"register",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3076-L3089 | train |
square/pylink | pylink/jlink.py | JLink.etm_supported | 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 | 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):
... | [
"def",
"etm_supported",
"(",
"self",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_ETM_IsPresent",
"(",
")",
"if",
"(",
"res",
"==",
"1",
")",
":",
"return",
"True",
"info",
"=",
"ctypes",
".",
"c_uint32",
"(",
"0",
")",
"index",
"=",
"... | Returns if the CPU core supports ETM.
Args:
self (JLink): the ``JLink`` instance.
Returns:
``True`` if the CPU has the ETM unit, otherwise ``False``. | [
"Returns",
"if",
"the",
"CPU",
"core",
"supports",
"ETM",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3092-L3114 | train |
square/pylink | pylink/jlink.py | JLink.etm_register_write | 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 | 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... | [
"def",
"etm_register_write",
"(",
"self",
",",
"register_index",
",",
"value",
",",
"delay",
"=",
"False",
")",
":",
"self",
".",
"_dll",
".",
"JLINKARM_ETM_WriteReg",
"(",
"int",
"(",
"register_index",
")",
",",
"int",
"(",
"value",
")",
",",
"int",
"("... | 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): boolean specifying if the write should be buffered.
Returns:
`... | [
"Writes",
"a",
"value",
"to",
"an",
"ETM",
"register",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3130-L3143 | train |
square/pylink | pylink/jlink.py | JLink.set_vector_catch | 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 | 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:
... | [
"def",
"set_vector_catch",
"(",
"self",
",",
"flags",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_WriteVectorCatch",
"(",
"flags",
")",
"if",
"res",
"<",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"res",
")",
"return",
"None"
... | 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:
self (JLink): the ``JLink`` instance
... | [
"Sets",
"vector",
"catch",
"bits",
"of",
"the",
"processor",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3320-L3339 | train |
square/pylink | pylink/jlink.py | JLink.step | 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 | 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: ... | [
"def",
"step",
"(",
"self",
",",
"thumb",
"=",
"False",
")",
":",
"method",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_Step",
"if",
"thumb",
":",
"method",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_StepComposite",
"res",
"=",
"method",
"(",
")",
"if",
"... | 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: on error | [
"Executes",
"a",
"single",
"step",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3342-L3365 | train |
square/pylink | pylink/jlink.py | JLink.num_available_breakpoints | 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 | 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... | [
"def",
"num_available_breakpoints",
"(",
"self",
",",
"arm",
"=",
"False",
",",
"thumb",
"=",
"False",
",",
"ram",
"=",
"False",
",",
"flash",
"=",
"False",
",",
"hw",
"=",
"False",
")",
":",
"flags",
"=",
"[",
"enums",
".",
"JLinkBreakpoint",
".",
"... | 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 breakpoint
units. If ``ram`` is set, gets the number of available software RAM
breakpoint uni... | [
"Returns",
"the",
"number",
"of",
"available",
"breakpoints",
"of",
"the",
"specified",
"type",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3411-L3459 | train |
square/pylink | pylink/jlink.py | JLink.breakpoint_info | 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 | 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... | [
"def",
"breakpoint_info",
"(",
"self",
",",
"handle",
"=",
"0",
",",
"index",
"=",
"-",
"1",
")",
":",
"if",
"index",
"<",
"0",
"and",
"handle",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"'Handle must be provided if index is not set.'",
")",
"bp",
"=",
... | 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 provided, the ``index`` overrides
the provided ``ha... | [
"Returns",
"the",
"information",
"about",
"a",
"set",
"breakpoint",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3462-L3493 | train |
square/pylink | pylink/jlink.py | JLink.breakpoint_set | 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 | 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:
... | [
"def",
"breakpoint_set",
"(",
"self",
",",
"addr",
",",
"thumb",
"=",
"False",
",",
"arm",
"=",
"False",
")",
":",
"flags",
"=",
"enums",
".",
"JLinkBreakpoint",
".",
"ANY",
"if",
"thumb",
":",
"flags",
"=",
"flags",
"|",
"enums",
".",
"JLinkBreakpoint... | 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:
self (JLink): the ``JLink`` instance
addr (int): t... | [
"Sets",
"a",
"breakpoint",
"at",
"the",
"specified",
"address",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3510-L3542 | train |
square/pylink | pylink/jlink.py | JLink.software_breakpoint_set | 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 | 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... | [
"def",
"software_breakpoint_set",
"(",
"self",
",",
"addr",
",",
"thumb",
"=",
"False",
",",
"arm",
"=",
"False",
",",
"flash",
"=",
"False",
",",
"ram",
"=",
"False",
")",
":",
"if",
"flash",
"and",
"not",
"ram",
":",
"flags",
"=",
"enums",
".",
"... | 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
normal breakpoint is set.
If ``flash`` is ``True``, the breakpoint is set in flash, otherwise... | [
"Sets",
"a",
"software",
"breakpoint",
"at",
"the",
"specified",
"address",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3545-L3589 | train |
square/pylink | pylink/jlink.py | JLink.watchpoint_info | 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 | 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... | [
"def",
"watchpoint_info",
"(",
"self",
",",
"handle",
"=",
"0",
",",
"index",
"=",
"-",
"1",
")",
":",
"if",
"index",
"<",
"0",
"and",
"handle",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"'Handle must be provided if index is not set.'",
")",
"wp",
"=",
... | 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 provided, the ``index`` overrides
the provided ... | [
"Returns",
"information",
"about",
"the",
"specified",
"watchpoint",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3677-L3714 | train |
square/pylink | pylink/jlink.py | JLink.watchpoint_set | def watchpoint_set(self,
addr,
addr_mask=0x0,
data=0x0,
data_mask=0x0,
access_size=None,
read=False,
write=False,
privileged=False):
... | python | def watchpoint_set(self,
addr,
addr_mask=0x0,
data=0x0,
data_mask=0x0,
access_size=None,
read=False,
write=False,
privileged=False):
... | [
"def",
"watchpoint_set",
"(",
"self",
",",
"addr",
",",
"addr_mask",
"=",
"0x0",
",",
"data",
"=",
"0x0",
",",
"data_mask",
"=",
"0x0",
",",
"access_size",
"=",
"None",
",",
"read",
"=",
"False",
",",
"write",
"=",
"False",
",",
"privileged",
"=",
"F... | Sets a watchpoint at the given address.
This method allows for a watchpoint to be set on an given address or
range of addresses. The watchpoint can then be triggered if the data
at the given address matches the specified ``data`` or range of data as
determined by ``data_mask``, on spec... | [
"Sets",
"a",
"watchpoint",
"at",
"the",
"given",
"address",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3717-L3821 | train |
square/pylink | pylink/jlink.py | JLink.disassemble_instruction | 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 | 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 ... | [
"def",
"disassemble_instruction",
"(",
"self",
",",
"instruction",
")",
":",
"if",
"not",
"util",
".",
"is_integer",
"(",
"instruction",
")",
":",
"raise",
"TypeError",
"(",
"'Expected instruction to be an integer.'",
")",
"buf_size",
"=",
"self",
".",
"MAX_BUF_SI... | 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 at the
given instruction address.
Raises... | [
"Disassembles",
"and",
"returns",
"the",
"assembly",
"instruction",
"string",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3848-L3872 | train |
square/pylink | pylink/jlink.py | JLink.strace_configure | 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 | 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... | [
"def",
"strace_configure",
"(",
"self",
",",
"port_width",
")",
":",
"if",
"port_width",
"not",
"in",
"[",
"1",
",",
"2",
",",
"4",
"]",
":",
"raise",
"ValueError",
"(",
"'Invalid port width: %s'",
"%",
"str",
"(",
"port_width",
")",
")",
"config_string",
... | 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``
Raises:
ValueError: if ``port... | [
"Configures",
"the",
"trace",
"port",
"width",
"for",
"tracing",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3881-L3905 | train |
square/pylink | pylink/jlink.py | JLink.strace_read | 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 | 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):... | [
"def",
"strace_read",
"(",
"self",
",",
"num_instructions",
")",
":",
"if",
"num_instructions",
"<",
"0",
"or",
"num_instructions",
">",
"0x10000",
":",
"raise",
"ValueError",
"(",
"'Invalid instruction count.'",
")",
"buf",
"=",
"(",
"ctypes",
".",
"c_uint32",
... | 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): number of instructions to fetch.
Returns:
... | [
"Reads",
"and",
"returns",
"a",
"number",
"of",
"instructions",
"captured",
"by",
"STRACE",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L3949-L3980 | train |
square/pylink | pylink/jlink.py | JLink.strace_data_access_event | def strace_data_access_event(self,
operation,
address,
data,
data_mask=None,
access_width=4,
address_range=0):
"""... | python | def strace_data_access_event(self,
operation,
address,
data,
data_mask=None,
access_width=4,
address_range=0):
"""... | [
"def",
"strace_data_access_event",
"(",
"self",
",",
"operation",
",",
"address",
",",
"data",
",",
"data_mask",
"=",
"None",
",",
"access_width",
"=",
"4",
",",
"address_range",
"=",
"0",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkStraceCommand",
".",
"TRA... | Sets an event to trigger trace logic when data access is made.
Data access corresponds to either a read or write.
Args:
self (JLink): the ``JLink`` instance.
operation (int): one of the operations in ``JLinkStraceOperation``.
address (int): the address of the load/store d... | [
"Sets",
"an",
"event",
"to",
"trigger",
"trace",
"logic",
"when",
"data",
"access",
"is",
"made",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4012-L4053 | train |
square/pylink | pylink/jlink.py | JLink.strace_data_store_event | 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 | 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... | [
"def",
"strace_data_store_event",
"(",
"self",
",",
"operation",
",",
"address",
",",
"address_range",
"=",
"0",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkStraceCommand",
".",
"TRACE_EVENT_SET",
"event_info",
"=",
"structs",
".",
"JLinkStraceEventInfo",
"(",
")"... | 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): the address of the store data.
address_range (int): optional range of addre... | [
"Sets",
"an",
"event",
"to",
"trigger",
"trace",
"logic",
"when",
"data",
"write",
"access",
"is",
"made",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4085-L4111 | train |
square/pylink | pylink/jlink.py | JLink.strace_clear | 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 | 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.
"""
... | [
"def",
"strace_clear",
"(",
"self",
",",
"handle",
")",
":",
"data",
"=",
"ctypes",
".",
"c_int",
"(",
"handle",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINK_STRACE_Control",
"(",
"enums",
".",
"JLinkStraceCommand",
".",
"TRACE_EVENT_CLR",
",",
"ctype... | 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. | [
"Clears",
"the",
"trace",
"event",
"specified",
"by",
"the",
"given",
"handle",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4114-L4132 | train |
square/pylink | pylink/jlink.py | JLink.strace_clear_all | 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 | 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... | [
"def",
"strace_clear_all",
"(",
"self",
")",
":",
"data",
"=",
"0",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINK_STRACE_Control",
"(",
"enums",
".",
"JLinkStraceCommand",
".",
"TRACE_EVENT_CLR_ALL",
",",
"data",
")",
"if",
"res",
"<",
"0",
":",
"raise",
... | Clears all STRACE events.
Args:
self (JLink): the ``JLink`` instance.
Returns:
``None``
Raises:
JLinkException: on error. | [
"Clears",
"all",
"STRACE",
"events",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4135-L4152 | train |
square/pylink | pylink/jlink.py | JLink.strace_set_buffer_size | 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 | 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... | [
"def",
"strace_set_buffer_size",
"(",
"self",
",",
"size",
")",
":",
"size",
"=",
"ctypes",
".",
"c_uint32",
"(",
"size",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINK_STRACE_Control",
"(",
"enums",
".",
"JLinkStraceCommand",
".",
"SET_BUFFER_SIZE",
",",... | Sets the STRACE buffer size.
Args:
self (JLink): the ``JLink`` instance.
Returns:
``None``
Raises:
JLinkException: on error. | [
"Sets",
"the",
"STRACE",
"buffer",
"size",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4155-L4172 | train |
square/pylink | pylink/jlink.py | JLink.trace_start | 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 | 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... | [
"def",
"trace_start",
"(",
"self",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"START",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
"cmd",
",",
"0",
")",
"if",
"(",
"res",
"==",
"1",
")",
":",
"raise",
"erro... | Starts collecting trace data.
Args:
self (JLink): the ``JLink`` instance.
Returns:
``None`` | [
"Starts",
"collecting",
"trace",
"data",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4181-L4194 | train |
square/pylink | pylink/jlink.py | JLink.trace_stop | 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 | 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.... | [
"def",
"trace_stop",
"(",
"self",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"STOP",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
"cmd",
",",
"0",
")",
"if",
"(",
"res",
"==",
"1",
")",
":",
"raise",
"errors... | Stops collecting trace data.
Args:
self (JLink): the ``JLink`` instance.
Returns:
``None`` | [
"Stops",
"collecting",
"trace",
"data",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4197-L4210 | train |
square/pylink | pylink/jlink.py | JLink.trace_flush | 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 | 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... | [
"def",
"trace_flush",
"(",
"self",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"FLUSH",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
"cmd",
",",
"0",
")",
"if",
"(",
"res",
"==",
"1",
")",
":",
"raise",
"erro... | 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`` | [
"Flushes",
"the",
"trace",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4213-L4229 | train |
square/pylink | pylink/jlink.py | JLink.trace_buffer_capacity | 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 | 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... | [
"def",
"trace_buffer_capacity",
"(",
"self",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"GET_CONF_CAPACITY",
"data",
"=",
"ctypes",
".",
"c_uint32",
"(",
"0",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
"cmd",... | 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. | [
"Retrieves",
"the",
"trace",
"buffer",
"s",
"current",
"capacity",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4249-L4264 | train |
square/pylink | pylink/jlink.py | JLink.trace_set_buffer_capacity | 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 | 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
... | [
"def",
"trace_set_buffer_capacity",
"(",
"self",
",",
"size",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"SET_CAPACITY",
"data",
"=",
"ctypes",
".",
"c_uint32",
"(",
"size",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Contro... | Sets the capacity for the trace buffer.
Args:
self (JLink): the ``JLink`` instance.
size (int): the new capacity for the trace buffer.
Returns:
``None`` | [
"Sets",
"the",
"capacity",
"for",
"the",
"trace",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4267-L4282 | train |
square/pylink | pylink/jlink.py | JLink.trace_min_buffer_capacity | 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 | 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... | [
"def",
"trace_min_buffer_capacity",
"(",
"self",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"GET_MIN_CAPACITY",
"data",
"=",
"ctypes",
".",
"c_uint32",
"(",
"0",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
"cm... | 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. | [
"Retrieves",
"the",
"minimum",
"capacity",
"the",
"trace",
"buffer",
"can",
"be",
"configured",
"with",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4285-L4299 | train |
square/pylink | pylink/jlink.py | JLink.trace_max_buffer_capacity | 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 | 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... | [
"def",
"trace_max_buffer_capacity",
"(",
"self",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"GET_MAX_CAPACITY",
"data",
"=",
"ctypes",
".",
"c_uint32",
"(",
"0",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
"cm... | 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. | [
"Retrieves",
"the",
"maximum",
"size",
"the",
"trace",
"buffer",
"can",
"be",
"configured",
"with",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4302-L4316 | train |
square/pylink | pylink/jlink.py | JLink.trace_set_format | 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 | 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``
"""
... | [
"def",
"trace_set_format",
"(",
"self",
",",
"fmt",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"SET_FORMAT",
"data",
"=",
"ctypes",
".",
"c_uint32",
"(",
"fmt",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
... | 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`` | [
"Sets",
"the",
"format",
"for",
"the",
"trace",
"buffer",
"to",
"use",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4319-L4335 | train |
square/pylink | pylink/jlink.py | JLink.trace_format | 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 | 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 = ... | [
"def",
"trace_format",
"(",
"self",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"GET_FORMAT",
"data",
"=",
"ctypes",
".",
"c_uint32",
"(",
"0",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
"cmd",
",",
"ctype... | 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``. | [
"Retrieves",
"the",
"current",
"format",
"the",
"trace",
"buffer",
"is",
"using",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4338-L4353 | train |
square/pylink | pylink/jlink.py | JLink.trace_region_count | 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 | 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 =... | [
"def",
"trace_region_count",
"(",
"self",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"GET_NUM_REGIONS",
"data",
"=",
"ctypes",
".",
"c_uint32",
"(",
"0",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_TRACE_Control",
"(",
"cmd",
",... | 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. | [
"Retrieves",
"a",
"count",
"of",
"the",
"number",
"of",
"available",
"trace",
"regions",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4356-L4370 | train |
square/pylink | pylink/jlink.py | JLink.trace_region | 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 | 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.
"""
... | [
"def",
"trace_region",
"(",
"self",
",",
"region_index",
")",
":",
"cmd",
"=",
"enums",
".",
"JLinkTraceCommand",
".",
"GET_REGION_PROPS_EX",
"region",
"=",
"structs",
".",
"JLinkTraceRegion",
"(",
")",
"region",
".",
"RegionIndex",
"=",
"int",
"(",
"region_in... | 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. | [
"Retrieves",
"the",
"properties",
"of",
"a",
"trace",
"region",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4373-L4389 | train |
square/pylink | pylink/jlink.py | JLink.trace_read | 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 | 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... | [
"def",
"trace_read",
"(",
"self",
",",
"offset",
",",
"num_items",
")",
":",
"buf_size",
"=",
"ctypes",
".",
"c_uint32",
"(",
"num_items",
")",
"buf",
"=",
"(",
"structs",
".",
"JLinkTraceData",
"*",
"num_items",
")",
"(",
")",
"res",
"=",
"self",
".",... | 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 the trace buffer.
Returns:
A list o... | [
"Reads",
"data",
"from",
"the",
"trace",
"buffer",
"and",
"returns",
"it",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4392-L4415 | train |
square/pylink | pylink/jlink.py | JLink.swo_start | 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 | 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... | [
"def",
"swo_start",
"(",
"self",
",",
"swo_speed",
"=",
"9600",
")",
":",
"if",
"self",
".",
"swo_enabled",
"(",
")",
":",
"self",
".",
"swo_stop",
"(",
")",
"info",
"=",
"structs",
".",
"JLinkSWOStartInfo",
"(",
")",
"info",
".",
"Speed",
"=",
"swo_... | 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 communicate
Returns:
``None``
... | [
"Starts",
"collecting",
"SWO",
"data",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4435-L4464 | train |
square/pylink | pylink/jlink.py | JLink.swo_stop | 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 | 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:
... | [
"def",
"swo_stop",
"(",
"self",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_SWO_Control",
"(",
"enums",
".",
"JLinkSWOCommands",
".",
"STOP",
",",
"0",
")",
"if",
"res",
"<",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"res",... | Stops collecting SWO data.
Args:
self (JLink): the ``JLink`` instance
Returns:
``None``
Raises:
JLinkException: on error | [
"Stops",
"collecting",
"SWO",
"data",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4467-L4483 | train |
square/pylink | pylink/jlink.py | JLink.swo_enable | 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 | 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... | [
"def",
"swo_enable",
"(",
"self",
",",
"cpu_speed",
",",
"swo_speed",
"=",
"9600",
",",
"port_mask",
"=",
"0x01",
")",
":",
"if",
"self",
".",
"swo_enabled",
"(",
")",
":",
"self",
".",
"swo_stop",
"(",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"J... | 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 already enabled, it will first stop SWO before enabling it
again.
... | [
"Enables",
"SWO",
"output",
"on",
"the",
"target",
"device",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4486-L4522 | train |
square/pylink | pylink/jlink.py | JLink.swo_disable | 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 | 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... | [
"def",
"swo_disable",
"(",
"self",
",",
"port_mask",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_SWO_DisableTarget",
"(",
"port_mask",
")",
"if",
"res",
"!=",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
"(",
"res",
")",
"return",
"N... | 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 | [
"Disables",
"ITM",
"&",
"Stimulus",
"ports",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4525-L4541 | train |
square/pylink | pylink/jlink.py | JLink.swo_flush | 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 | 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`... | [
"def",
"swo_flush",
"(",
"self",
",",
"num_bytes",
"=",
"None",
")",
":",
"if",
"num_bytes",
"is",
"None",
":",
"num_bytes",
"=",
"self",
".",
"swo_num_bytes",
"(",
")",
"buf",
"=",
"ctypes",
".",
"c_uint32",
"(",
"num_bytes",
")",
"res",
"=",
"self",
... | 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`` instance
num_bytes (int): the number... | [
"Flushes",
"data",
"from",
"the",
"SWO",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4544-L4572 | train |
square/pylink | pylink/jlink.py | JLink.swo_speed_info | 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 | 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... | [
"def",
"swo_speed_info",
"(",
"self",
")",
":",
"info",
"=",
"structs",
".",
"JLinkSWOSpeedInfo",
"(",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_SWO_Control",
"(",
"enums",
".",
"JLinkSWOCommands",
".",
"GET_SPEED_INFO",
",",
"ctypes",
".",
"byref... | 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 error | [
"Retrieves",
"information",
"about",
"the",
"supported",
"SWO",
"speeds",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4575-L4594 | train |
square/pylink | pylink/jlink.py | JLink.swo_num_bytes | 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 | 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... | [
"def",
"swo_num_bytes",
"(",
"self",
")",
":",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_SWO_Control",
"(",
"enums",
".",
"JLinkSWOCommands",
".",
"GET_NUM_BYTES",
",",
"0",
")",
"if",
"res",
"<",
"0",
":",
"raise",
"errors",
".",
"JLinkException",
... | 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 | [
"Retrives",
"the",
"number",
"of",
"bytes",
"in",
"the",
"SWO",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4597-L4614 | train |
square/pylink | pylink/jlink.py | JLink.swo_set_host_buffer_size | 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 | 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... | [
"def",
"swo_set_host_buffer_size",
"(",
"self",
",",
"buf_size",
")",
":",
"buf",
"=",
"ctypes",
".",
"c_uint32",
"(",
"buf_size",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_SWO_Control",
"(",
"enums",
".",
"JLinkSWOCommands",
".",
"SET_BUFFERSIZE_HO... | 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:
JLinkException: on error | [
"Sets",
"the",
"size",
"of",
"the",
"buffer",
"used",
"by",
"the",
"host",
"to",
"collect",
"SWO",
"data",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4617-L4636 | train |
square/pylink | pylink/jlink.py | JLink.swo_set_emu_buffer_size | 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 | 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... | [
"def",
"swo_set_emu_buffer_size",
"(",
"self",
",",
"buf_size",
")",
":",
"buf",
"=",
"ctypes",
".",
"c_uint32",
"(",
"buf_size",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINKARM_SWO_Control",
"(",
"enums",
".",
"JLinkSWOCommands",
".",
"SET_BUFFERSIZE_EMU... | 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:
JLinkException: on error | [
"Sets",
"the",
"size",
"of",
"the",
"buffer",
"used",
"by",
"the",
"J",
"-",
"Link",
"to",
"collect",
"SWO",
"data",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4639-L4658 | train |
square/pylink | pylink/jlink.py | JLink.swo_supported_speeds | 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 | 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 (... | [
"def",
"swo_supported_speeds",
"(",
"self",
",",
"cpu_speed",
",",
"num_speeds",
"=",
"3",
")",
":",
"buf_size",
"=",
"num_speeds",
"buf",
"=",
"(",
"ctypes",
".",
"c_uint32",
"*",
"buf_size",
")",
"(",
")",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINK... | 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 (int): the target's CPU speed in Hz
num_speeds (int): the n... | [
"Retrives",
"a",
"list",
"of",
"SWO",
"speeds",
"supported",
"by",
"both",
"the",
"target",
"and",
"the",
"connected",
"J",
"-",
"Link",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4661-L4681 | train |
square/pylink | pylink/jlink.py | JLink.swo_read | 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 | 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()``.
... | [
"def",
"swo_read",
"(",
"self",
",",
"offset",
",",
"num_bytes",
",",
"remove",
"=",
"False",
")",
":",
"buf_size",
"=",
"ctypes",
".",
"c_uint32",
"(",
"num_bytes",
")",
"buf",
"=",
"(",
"ctypes",
".",
"c_uint8",
"*",
"num_bytes",
")",
"(",
"0",
")"... | 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()``.
Args:
self (JLink): the ``JLink`` instance
... | [
"Reads",
"data",
"from",
"the",
"SWO",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4684-L4712 | train |
square/pylink | pylink/jlink.py | JLink.swo_read_stimulus | 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 | 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... | [
"def",
"swo_read_stimulus",
"(",
"self",
",",
"port",
",",
"num_bytes",
")",
":",
"if",
"port",
"<",
"0",
"or",
"port",
">",
"31",
":",
"raise",
"ValueError",
"(",
"'Invalid port number: %s'",
"%",
"port",
")",
"buf_size",
"=",
"num_bytes",
"buf",
"=",
"... | 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`` instance
port (int): the stimulus port to read from, ... | [
"Reads",
"the",
"printable",
"data",
"via",
"SWO",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4715-L4742 | train |
square/pylink | pylink/jlink.py | JLink.rtt_read | 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 | 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... | [
"def",
"rtt_read",
"(",
"self",
",",
"buffer_index",
",",
"num_bytes",
")",
":",
"buf",
"=",
"(",
"ctypes",
".",
"c_ubyte",
"*",
"num_bytes",
")",
"(",
")",
"bytes_read",
"=",
"self",
".",
"_dll",
".",
"JLINK_RTTERMINAL_Read",
"(",
"buffer_index",
",",
"... | 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
entire contents of the RTT buffer will be read.
Ar... | [
"Reads",
"data",
"from",
"the",
"RTT",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4805-L4830 | train |
square/pylink | pylink/jlink.py | JLink.rtt_write | 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 | 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... | [
"def",
"rtt_write",
"(",
"self",
",",
"buffer_index",
",",
"data",
")",
":",
"buf_size",
"=",
"len",
"(",
"data",
")",
"buf",
"=",
"(",
"ctypes",
".",
"c_ubyte",
"*",
"buf_size",
")",
"(",
"*",
"bytearray",
"(",
"data",
")",
")",
"bytes_written",
"="... | 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
data (list): the list of bytes to write to the RTT buf... | [
"Writes",
"data",
"to",
"the",
"RTT",
"buffer",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4833-L4857 | train |
square/pylink | pylink/jlink.py | JLink.rtt_control | 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 | 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 (... | [
"def",
"rtt_control",
"(",
"self",
",",
"command",
",",
"config",
")",
":",
"config_byref",
"=",
"ctypes",
".",
"byref",
"(",
"config",
")",
"if",
"config",
"is",
"not",
"None",
"else",
"None",
"res",
"=",
"self",
".",
"_dll",
".",
"JLINK_RTTERMINAL_Cont... | 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 (see enums.JLinkRTTCommand)
config (ctypes... | [
"Issues",
"an",
"RTT",
"Control",
"command",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/jlink.py#L4860-L4880 | train |
square/pylink | examples/rtt.py | main | 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 | 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... | [
"def",
"main",
"(",
"target_device",
")",
":",
"jlink",
"=",
"pylink",
".",
"JLink",
"(",
")",
"print",
"(",
"\"connecting to JLink...\"",
")",
"jlink",
".",
"open",
"(",
")",
"print",
"(",
"\"connecting to %s...\"",
"%",
"target_device",
")",
"jlink",
".",
... | 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.
The main loops sleeps until the JL... | [
"Creates",
"an",
"interactive",
"terminal",
"to",
"the",
"target",
"via",
"RTT",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/examples/rtt.py#L93-L138 | train |
square/pylink | pylink/threads.py | ThreadReturn.run | 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 | 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... | [
"def",
"run",
"(",
"self",
")",
":",
"target",
"=",
"getattr",
"(",
"self",
",",
"'_Thread__target'",
",",
"getattr",
"(",
"self",
",",
"'_target'",
",",
"None",
")",
")",
"args",
"=",
"getattr",
"(",
"self",
",",
"'_Thread__args'",
",",
"getattr",
"("... | Runs the thread.
Args:
self (ThreadReturn): the ``ThreadReturn`` instance
Returns:
``None`` | [
"Runs",
"the",
"thread",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/threads.py#L41-L56 | train |
square/pylink | pylink/threads.py | ThreadReturn.join | 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 | 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(... | [
"def",
"join",
"(",
"self",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"super",
"(",
"ThreadReturn",
",",
"self",
")",
".",
"join",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
"return",
"self",
".",
"_return"
] | 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. | [
"Joins",
"the",
"thread",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/threads.py#L58-L70 | train |
square/pylink | examples/windows_update.py | main | 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 | 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:
... | [
"def",
"main",
"(",
")",
":",
"windows_libraries",
"=",
"list",
"(",
"pylink",
".",
"Library",
".",
"find_library_windows",
"(",
")",
")",
"latest_library",
"=",
"None",
"for",
"lib",
"in",
"windows_libraries",
":",
"if",
"os",
".",
"path",
".",
"dirname",... | Upgrades the firmware of the J-Links connected to a Windows device.
Returns:
None.
Raises:
OSError: if there are no J-Link software packages. | [
"Upgrades",
"the",
"firmware",
"of",
"the",
"J",
"-",
"Links",
"connected",
"to",
"a",
"Windows",
"device",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/examples/windows_update.py#L35-L70 | train |
square/pylink | pylink/decorators.py | async_decorator | 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 | 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... | [
"def",
"async_decorator",
"(",
"func",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"func",
")",
"def",
"async_wrapper",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"if",
"'callback'",
"not",
"in",
"kwargs",
"or",
"not",
"kwargs",
"[",
"'callbac... | 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.
Raises:
AttributeError: if ``fu... | [
"Asynchronous",
"function",
"decorator",
".",
"Interprets",
"the",
"function",
"as",
"being",
"asynchronous",
"so",
"returns",
"a",
"function",
"that",
"will",
"handle",
"calling",
"the",
"Function",
"asynchronously",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/decorators.py#L20-L91 | train |
square/pylink | examples/strace.py | strace | 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 | 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... | [
"def",
"strace",
"(",
"device",
",",
"trace_address",
",",
"breakpoint_address",
")",
":",
"jlink",
"=",
"pylink",
".",
"JLink",
"(",
")",
"jlink",
".",
"open",
"(",
")",
"jlink",
".",
"power_on",
"(",
")",
"jlink",
".",
"set_tif",
"(",
"pylink",
".",
... | 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`` | [
"Implements",
"simple",
"trace",
"using",
"the",
"STrace",
"API",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/examples/strace.py#L29-L78 | train |
square/pylink | pylink/__main__.py | create_parser | 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 | 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._... | [
"def",
"create_parser",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"prog",
"=",
"pylink",
".",
"__title__",
",",
"description",
"=",
"pylink",
".",
"__description__",
",",
"epilog",
"=",
"pylink",
".",
"__copyright__",
")",
"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. | [
"Builds",
"the",
"command",
"parser",
"."
] | 81dda0a191d923a8b2627c52cb778aba24d279d7 | https://github.com/square/pylink/blob/81dda0a191d923a8b2627c52cb778aba24d279d7/pylink/__main__.py#L535-L567 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.