This section summarizes some of the central pynrfjprog files. For more information, see comments and header files provided with the module itself.
The following table lists some of the central files contained in the pynrfjprog package and describes their purpose.
File name | Description |
---|---|
Hex.py | The Python file Hex.py is included in pynrfjprog to allow you to parse an Intel HEX file from a Python script and then program it using the API.py write function. |
JLink.py | The Python file JLink.py defines the functions for finding the latest JLinkARM DLL. |
HighLevel.py | The Python file HighLevel.py contains the high-level API for pynrfjprog. This API will give you access to the functions from the high-level DLL. |
LowLevel.py | The Python file LowLevel.py contains the low-level API for pynrfjprog. This API will give you access to the functions from the nrfjprog DLL. |
MultiAPI.py | The Python file MultiAPI.py contains the API for multi-access pynrfjprog. This MultiAPI will give you access to the functions from the nrfjprog DLL for handling multiple devices at the same time. |
For a description of all DLL functions that are exported through HighLevel.py and LowLevel.py, see the comments in the files. Also see the highlevelnrfjprogdll.h and nrfjprogdll.h header files that are provided in the docs folder.
There are three modules that can be used to interact with an nRF target: HighLevel, LowLevel, and MultiAPI. LowLevel.API gives the program access to one nRF target, while the MultiAPI.API class can be used for accessing multiple nRF targets at the same time. When instantiating a MultiAPI.API object, it creates a subprocess for each LowLevel.API instance and runs it. This subprocess can then be communicated to via the MultiAPI.API instance, allowing you to work with multiple instances at the same time.
if __name__ == '__main__':
. In Linux and macOS, an API object cannot
be instantiated before instantiating a MultiAPI object.