Skip to content

bzgec/MCP2221A_python

Repository files navigation

MCP2221A python test

1. Implemented

  • ✓ Setting USB descriptor strings

  • ✓ Controlling GP as outputs/inputs (for now only one option is possible for all pins)

  • ✓ Setting default GP configuration (the one active after power-up)

  • ❏ DAC

  • ❏ ADC

  • ❏ I2C

2. Dependencies

  • pyusb: python -m pip install pyusb

  • libusb:

    • Arch Linux: sudo pacman -S libusb

  • On Linux you need to add MCP2221A to udev rules:

    1. Copy 99-MCP2221A.rules: sudo cp 99-MCP2221A.rules /etc/udev/rules.d/

    2. Log out then back in

3. Examples

3.1. testGpio.py

  • Test GP as input or output

testGpio_O testGpio_I

3.2. setDescriptorStrings.py

  • Print some MCP2221A parameters

  • Set USB Manufacturer, Product and Serial Descriptor Strings (they are used during the USB enumeration)

setDescriptorStrings

  • Run: python3 setDescriptorStrings.py

  • Open file

3.3. setFlashGpioSettings.py

  • Set default GPIO configuration (configuration which is active after power-up)

setFlashGPioSettings

  • Run: python3 setFlashGpioSettings.py

  • Open file

4. MCP2221A.py

About

Simple MCP2221A python library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages