Metadata-Version: 2.1
Name: pykitcommander
Version: 1.0.5.8
Summary: A protocol driver for a generic development kit command handler interface
Home-page: http://www.microchip.com
Author: Microchip Technology
Author-email: support@microchip.com
License: Microchip Technology Inc. Proprietary License
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Embedded Systems
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Description-Content-Type: text/markdown
Requires-Dist: pyserial
Requires-Dist: hexdump
Requires-Dist: pymcuprog (>=3.3)
Requires-Dist: pydebuggerconfig (>=3.5)
Provides-Extra: dev
Requires-Dist: pylint ; extra == 'dev'
Requires-Dist: mock ; extra == 'dev'

# pykitcommander
pykitcommander manages interaction with Microchip development kits based on PKOB nano on-board debugger

## Background
In many situations interaction with peripheral hardware components on a development kit is done via a "bridge" application running on the MCU on that kit.  To achieve this, the bridge firmware must be programmed onto that MCU, and then communications over a given channel and protocol can logically link the host computer to the peripheral components.

pykitcommander manages all aspects of this interaction.

## Usage
pykitcommander is intended to be used as a library.
Its primary consumers are:
- pytrustplatform (www.pypi.org/project/pytrustplatform)
- iotprovision

Supported kits are:
- AVR-IOT (all variants)
- PIC-IOT (all variants)

## Dependencies
This package uses pyedbglib for USB communications.
For more information see: https://pypi.org/project/pyedbglib/

## Short example
This example shows how pykitcommander can be used to read the serial number from an ECC608 device.  This device is connected to the MCU on the board (either PIC or AVR depending on the variant).  The MCU is connected to the host computer via a virtual serial port provided by the on-board debugger.

This example uses the 'iotprovision' helper function to achieve this very simply.
```
from pykitcommander.firmwareinterface import KitSerialConnection
from pykitcommander.kitprotocols import get_iot_provision_protocol

# Request iotprovision protocol to be set up
protocol, port = get_iot_provision_protocol()

# Connect to the protocol
with KitSerialConnection(protocol, port):
    # Read the serial number from the ECC
    ecc_serial_number = protocol.read_ecc_serialnumber()
    print("ECC serial number read out as '{}'".format(ecc_serial_number))
```

## Long example
This example shows how pykitcommander can be used to read the serial number from an ECC608 device.  This device is connected to the MCU on the board (either PIC or AVR depending on the variant).  The MCU is connected to the host computer via a virtual serial port provided by the on-board debugger.

This example does *not* use the 'iotprovision' helper function.
```
from pykitcommander.kitmanager import KitProgrammer
from pykitcommander.kitmanager import KitApplicationFirmwareProvider
from pykitcommander.firmwareinterface import KitSerialConnection

# Connect to the kit programmer/debugger
programmer = KitProgrammer()

# Look up available applications for this kit
applications = KitApplicationFirmwareProvider(kitname=programmer.kit_info['kit_name'])

# Request iotprovision application
application = applications.locate_firmware(firmware_identifier="iotprovision")

# Program the application using bundled firmware
programmer.program_application(application['bundled_firmware'])

# Create the protocol object for this application
protocol = application['protocol_driver']()

# Connect to the protocol
with KitSerialConnection(protocol, port):
    # Read the serial number from the ECC
    ecc_serial_number = protocol.read_ecc_serialnumber()
    print("ECC serial number read out as '{}'".format(ecc_serial_number))
```


