Merge pull request #4765 from dhalbert/rotary-trinkey-rev-c-pins

Update various Trinkey pins and add _pixelbuf
This commit is contained in:
Limor "Ladyada" Fried 2021-05-15 11:52:33 -04:00 committed by GitHub
commit 9752162508
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 46 additions and 22 deletions

View File

@ -18,6 +18,8 @@ CIRCUITPY_PWMIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_PIXELBUF = 1
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID

View File

@ -8,17 +8,20 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_AUDIOCORE = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_BUSIO_SPI = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_PWMIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_USB_MIDI = 0
CIRCUITPY_PIXELBUF = 0
CIRCUITPY_TOUCHIO = 1
CIRCUITPY_PIXELBUF = 1
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -10,6 +10,7 @@
#define IGNORE_PIN_PA02 1
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PA05 1
#define IGNORE_PIN_PA07 1
#define IGNORE_PIN_PA08 1
#define IGNORE_PIN_PA09 1
#define IGNORE_PIN_PA10 1

View File

@ -16,7 +16,8 @@ CIRCUITPY_PULSEIO = 0
CIRCUITPY_PWMIO = 0
CIRCUITPY_AUDIOCORE = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_PIXELBUF = 1
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -2,8 +2,9 @@
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_ROTA), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_ROTB), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_ROTA), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA06) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -37,5 +37,5 @@ bool board_requests_safe_mode(void) {
}
void reset_board(void) {
board_reset_user_neopixels(&pin_PA06, 2);
board_reset_user_neopixels(&pin_PA04, 2);
}

View File

@ -1,7 +1,7 @@
#define MICROPY_HW_BOARD_NAME "Adafruit Slide Trinkey M0"
#define MICROPY_HW_MCU_NAME "samd21e18"
#define MICROPY_HW_NEOPIXEL (&pin_PA06)
#define MICROPY_HW_NEOPIXEL (&pin_PA04)
#define MICROPY_PORT_A (0)
#define MICROPY_PORT_B (0)
@ -9,10 +9,9 @@
#define IGNORE_PIN_PA00 1
#define IGNORE_PIN_PA01 1
#define IGNORE_PIN_PA02 1
#define IGNORE_PIN_PA03 1
#define IGNORE_PIN_PA04 1
#define IGNORE_PIN_PA05 1
#define IGNORE_PIN_PA06 1
#define IGNORE_PIN_PA08 1
#define IGNORE_PIN_PA09 1
#define IGNORE_PIN_PA10 1

View File

@ -18,6 +18,8 @@ CIRCUITPY_PWMIO = 0
CIRCUITPY_AUDIOCORE = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_PIXELBUF = 1
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SimpleMath
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -1,8 +1,8 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
// { MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_POTENTIOMETER), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_POTENTIOMETER), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -12,17 +12,15 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_PWMIO = 0
CIRCUITPY_AUDIOCORE = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_PWMIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_PIXELBUF = 1
CIRCUITPY_USB_MIDI = 1
CIRCUITPY_TOUCHIO = 1
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -60,14 +60,19 @@ CIRCUITPY_VECTORIO = 0
MICROPY_PY_ASYNC_AWAIT = 0
# We don't have room for the fonts for terminalio for ja and ko
# so turn off terminalio, and if it's off and displayio is on,
# force a clean build.
# Note that we cannot test $(CIRCUITPY_DISPLAYIO) directly with an
# ifeq, because it's not set yet.
ifeq ($(TRANSLATION), ja)
RELEASE_NEEDS_CLEAN_BUILD = 1
CIRCUITPY_TERMINALIO = 0
RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO)
endif
ifeq ($(TRANSLATION), ko)
RELEASE_NEEDS_CLEAN_BUILD = 1
CIRCUITPY_TERMINALIO = 0
RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO)
endif
SUPEROPT_GC = 0

View File

@ -121,6 +121,9 @@ CFLAGS += -DCIRCUITPY_BUILTINS_POW3=$(CIRCUITPY_BUILTINS_POW3)
CIRCUITPY_BUSIO ?= 1
CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO)
CIRCUITPY_BUSIO_SPI ?= 1
CFLAGS += -DCIRCUITPY_BUSIO_SPI=$(CIRCUITPY_BUSIO_SPI)
CIRCUITPY_CAMERA ?= 0
CFLAGS += -DCIRCUITPY_CAMERA=$(CIRCUITPY_CAMERA)

View File

@ -81,6 +81,7 @@
// TODO(tannewt): Support LSB SPI.
STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
#if CIRCUITPY_BUSIO_SPI
busio_spi_obj_t *self = m_new_obj(busio_spi_obj_t);
self->base.type = &busio_spi_type;
enum { ARG_clock, ARG_MOSI, ARG_MISO };
@ -102,8 +103,12 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con
common_hal_busio_spi_construct(self, clock, mosi, miso);
return MP_OBJ_FROM_PTR(self);
#else
mp_raise_NotImplementedError(NULL);
#endif // CIRCUITPY_BUSIO_SPI
}
#if CIRCUITPY_BUSIO_SPI
//| def deinit(self) -> None:
//| """Turn off the SPI bus."""
//| ...
@ -399,8 +404,11 @@ const mp_obj_property_t busio_spi_frequency_obj = {
MP_ROM_NONE,
MP_ROM_NONE},
};
#endif // CIRCUITPY_BUSIO_SPI
STATIC const mp_rom_map_elem_t busio_spi_locals_dict_table[] = {
#if CIRCUITPY_BUSIO_SPI
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&busio_spi_deinit_obj) },
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) },
{ MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&busio_spi_obj___exit___obj) },
@ -413,6 +421,7 @@ STATIC const mp_rom_map_elem_t busio_spi_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&busio_spi_write_obj) },
{ MP_ROM_QSTR(MP_QSTR_write_readinto), MP_ROM_PTR(&busio_spi_write_readinto_obj) },
{ MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&busio_spi_frequency_obj) }
#endif // CIRCUITPY_BUSIO_SPI
};
STATIC MP_DEFINE_CONST_DICT(busio_spi_locals_dict, busio_spi_locals_dict_table);