adafruit / Adafruit_Blinka

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

Add "generic os-agnostic" board and remove "fake_mcp2221" board #828

Closed brentru closed 1 month ago

brentru commented 1 month ago

This PR adds support for a generic, OS-agnostic board for broader use cases (such as with pytest). It also removes the "fake_mcp2221" board and its related files, since the new "generic agnostic board" is intended to supersede this board.

@lorennorman You may want to take a look/review pass over this as well since we will switch to using it in WipperSnapper Python.

Test Results:

pytest tests/ -v                             906ms  Tue May 21 14:40:07 2024
========================================================= test session starts ==========================================================
platform darwin -- Python 3.12.2, pytest-8.2.1, pluggy-1.5.0 -- /Users/brentrubell/Desktop/github_brentru/Adafruit_Blinka/.env/bin/python3.12
cachedir: .pytest_cache
rootdir: /Users/brentrubell/Desktop/github_brentru/Adafruit_Blinka
collected 12 items

tests/test_generic_agnostic_board_analogio.py::test_Ax_OUTPUT PASSED                                                             [  8%]
tests/test_generic_agnostic_board_analogio.py::test_Ax_INPUT_RAND_INT PASSED                                                     [ 16%]
tests/test_generic_agnostic_board_analogio.py::test_Ax_INPUT_FIXED_INT_PI PASSED                                                 [ 25%]
tests/test_generic_agnostic_board_analogio.py::test_Ax_INPUT_WAVE_SINE PASSED                                                    [ 33%]
tests/test_generic_agnostic_board_analogio.py::test_Ax_INPUT_WAVE_SAW PASSED                                                     [ 41%]
tests/test_generic_agnostic_board_digitalio.py::test_Dx_OUTPUT_TRUE PASSED                                                       [ 50%]
tests/test_generic_agnostic_board_digitalio.py::test_Dx_INPUT_TRUE PASSED                                                        [ 58%]
tests/test_generic_agnostic_board_digitalio.py::test_Dx_INPUT_TRUE_PULL_DOWN PASSED                                              [ 66%]
tests/test_generic_agnostic_board_digitalio.py::test_Dx_INPUT_FALSE_PULL_UP PASSED                                               [ 75%]
tests/test_generic_agnostic_board_digitalio.py::test_Dx_INPUT_FALSE PASSED                                                       [ 83%]
tests/test_generic_agnostic_board_digitalio.py::test_Dx_INPUT_TOGGLE PASSED                                                      [ 91%]
tests/test_generic_agnostic_board_i2c.py::test_i2c_scan_random PASSED                                                            [100%]

========================================================== 12 passed in 0.04s ==========================================================
woolseyj commented 1 month ago

How can this be used with macOS? I can't get it to work.