adafruit / Adafruit_Blinka

Add CircuitPython hardware API and libraries to MicroPython & CPython devices
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
MIT License
453 stars 340 forks source link

Add MCP2221 pin definitions to init #542

Closed stonehippo closed 2 years ago

stonehippo commented 2 years ago

I am working on getting Adafruit Blinka DisplayIO working with the MCP2221A breakout. The first step is addressing a missing import of the MCP2221A pins in the Blinka init.

Dependencies

Issue

Here's what I did:

import board
import displayio

The error that was returned was:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/george_w/.pyenv/versions/blinka/lib/python3.10/site-packages/displayio/__init__.py", line 21, in <module>
    from ._fourwire import FourWire
  File "/Users/george_w/.pyenv/versions/blinka/lib/python3.10/site-packages/displayio/_fourwire.py", line 24, in <module>
    import microcontroller
  File "/Users/george_w/.pyenv/versions/blinka/lib/python3.10/site-packages/microcontroller/__init__.py", line 147, in <module>
    raise NotImplementedError("Microcontroller not supported:", chip_id)
NotImplementedError: ('Microcontroller not supported:', 'MCP2221')

Fix

Add the definition for the MCP2221 pins to microcontroller/__init__.py. I have done that here, and successfully tested displayio with Blinka running on MacOS 12.1 running with the MCP2221A breakout. There are a few other issues, but they're in the Blinka DisplayIO module and I'll address them there.

stonehippo commented 2 years ago

Whoops, just noticed #541, which adds in the same definitions. I'm going to close this one in favor of the existing one.