Repository navigation
Add Adafruit Newxie Nine - #12043
Add Adafruit Newxie Nine#12043
Conversation
ladyada-eagleclaw
left a comment
There was a problem hiding this comment.
AI-assisted source review requested by Ladyada, against 30ca6c7. I compared the board definition with the Newxie Rev A pin map used by the bench-tested Arduino firmware and traced the display-release paths in this revision. I have not flashed or hardware-tested this CircuitPython build.
Two findings below affect replacing the built-in displays with custom display code after displayio.release_displays().
The GPIO assignments, two SPI groups, 4 MB flash / 2 MB quad-PSRAM configuration, and registered USB ID match the hardware. The original board build and pre-commit passed; the latest merge leaves the board files unchanged.
Non-blocking behavior note: all nine built-in backlights are digital, so brightness = 0.5 turns a backlight off rather than dimming it (busdisplay_backlight_set() uses brightness > 0.99 for digital outputs). I see the eight-LEDC-channel rationale in the comment; this limitation should be clear in the examples/documentation, especially for touch-controlled dimming.
| { MP_ROM_QSTR(MP_QSTR_TFT_MOSI), MP_ROM_PTR(&pin_GPIO33) }, | ||
| { MP_ROM_QSTR(MP_QSTR_TFT_SCK2), MP_ROM_PTR(&pin_GPIO16) }, | ||
| { MP_ROM_QSTR(MP_QSTR_TFT_MOSI2), MP_ROM_PTR(&pin_GPIO17) }, | ||
| { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_GPIO15) }, |
There was a problem hiding this comment.
[P2] Expose the shared D/C object. board_init() claims GPIO15 through board_tft_dc, but this entry exposes the underlying pin. FourWire borrows the DigitalInOut object (own_command == false), so releasing all displays leaves GPIO15 claimed. Recreating a FourWire with command=board.TFT_DC then fails the free-pin check.
Could this expose &board_tft_dc, as lilygo_tkeyboard_s3/pins.c does, so callers can reuse the existing shared object? Alternatively, provide coordinated cleanup after the last display releases it. This finding is from tracing the source, not a hardware reproduction.
|
|
||
| { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, | ||
| { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, | ||
| { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, |
There was a problem hiding this comment.
[P2] Expose the second SPI singleton. Startup creates board SPI instances 0 and 1, but Python only gets board.SPI(), which returns instance 0. FourWire deinitialization leaves these board-owned SPI objects allocated, so after displayio.release_displays(), constructing busio.SPI(board.TFT_SCK2, MOSI=board.TFT_MOSI2) still fails because GPIO16/17 are claimed. The second instance is not exposed through the FourWire API either.
Please export a second board bus singleton, for example board.SPI2() using CIRCUITPY_BOARD_BUS_SINGLETON(..., spi, 1), so custom display code can reuse or explicitly deinitialize it. This is independent of the shared D/C issue above.
ladyada
left a comment
There was a problem hiding this comment.
the Astra thread that did the design has some comments but none are blocking, i think its ok to merge!
|
Ok, I'll merge this so it's for folks to use. I'll follow up with fixes next week. |
No description provided.