8000 Moving Adafruit_CircuitPython_BusDevice to core by gamblor21 · Pull Request #3612 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

Moving Adafruit_CircuitPython_BusDevice to core #3612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ msgstr ""
msgid "Buffer must be a multiple of 512 bytes"
msgstr ""

#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c
#: shared-bindings/bitbangio/I2C.c shared-bindings/busdevice/I2CDevice.c
#: shared-bindings/busio/I2C.c
msgid "Buffer must be at least length 1"
msgstr ""

Expand Down Expand Up @@ -1287,6 +1288,11 @@ msgstr ""
msgid "No DMA channel found"
msgstr ""

#: shared-module/busdevice/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
msgstr ""

#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/stm/common-hal/busio/SPI.c
msgid "No MISO Pin"
Expand Down
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/8086_commander/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ CFLAGS_INLINE_LIMIT = 60
CIRCUITPY_GAMEPAD = 1

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD
#FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ADXL34x
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CIRCUITPY_BITBANGIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_BUSDEVICE = 0

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ SUPEROPT_GC = 0
CFLAGS_INLINE_LIMIT = 55

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ CFLAGS_INLINE_LIMIT = 50


# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Crickit
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ SUPEROPT_GC = 0
CFLAGS_INLINE_LIMIT = 55

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
Expand Down
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/dynossat_edu_eps/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_I2CPERIPHERAL = 1
CIRCUITPY_VECTORIO = 0
CIRCUITPY_BUSDEVICE = 0
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_ROTARYIO = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_BUSDEVICE = 0

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ CIRCUITPY_GAMEPAD = 0
CFLAGS_INLINE_LIMIT = 50

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Crickit
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Motor
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
Expand Down
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ CFLAGS_INLINE_LIMIT = 35
SUPEROPT_GC = 0

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM69
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ CFLAGS_INLINE_LIMIT = 35
SUPEROPT_GC = 0

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CIRCUITPY_COUNTIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
# supersized, not ultra-supersized
CIRCUITPY_VECTORIO = 0
CIRCUITPY_BUSDEVICE = 0

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ CFLAGS_INLINE_LIMIT = 55
SUPEROPT_GC = 0

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

Expand Down
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CIRCUITPY_BITBANGIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_BUSDEVICE = 0

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0
Expand Down
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/pycubed/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ CIRCUITPY_GAMEPAD = 0
CIRCUITPY_RGBMATRIX = 0
CIRCUITPY_PS2IO = 0

FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/pycubed_mram/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ CIRCUITPY_GAMEPAD = 0
CIRCUITPY_RGBMATRIX = 0
CIRCUITPY_PS2IO = 0

FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/sam32/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ LONGINT_IMPL = MPZ
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_USTACK = 1

FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
1 change: 1 addition & 0 deletions ports/atmel-samd/boards/snekboard/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CIRCUITPY_BITBANGIO = 0
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_BUSDEVICE = 0

CFLAGS_INLINE_LIMIT = 60

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CIRCUITPY_COUNTIO = 0
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_VECTORIO = 0
CIRCUITPY_BUSDEVICE = 0

CFLAGS_INLINE_LIMIT = 60
SUPEROPT_GC = 0
Expand Down
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ CIRCUITPY_TOUCHIO_USE_NATIVE=0
CIRCUITPY_TOUCHIO=0

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
1 change: 0 additions & 1 deletion ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ CIRCUITPY_RTC=0
CIRCUITPY_COUNTIO=0

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD
1 change: 1 addition & 0 deletions ports/litex/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CIRCUITPY_AUDIOIO = 0
CIRCUITPY_BITBANGIO = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_BOARD = 0
CIRCUITPY_BUSDEVICE = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_DISPLAYIO = 0
Expand Down
1 change: 1 addition & 0 deletions ports/nrf/boards/simmel/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CIRCUITPY_RTC = 1
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_ULAB = 0
CIRCUITPY_WATCHDOG = 1
CIRCUITPY_BUSDEVICE = 0

# Enable micropython.native
#CIRCUITPY_ENABLE_MPY_NATIVE = 1
Expand Down
6 changes: 6 additions & 0 deletions py/circuitpy_defns.mk
10000
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ endif
ifeq ($(CIRCUITPY_BOARD),1)
SRC_PATTERNS += board/%
endif
ifeq ($(CIRCUITPY_BUSDEVICE),1)
SRC_PATTERNS += adafruit_bus_device/%
endif
ifeq ($(CIRCUITPY_BUSIO),1)
SRC_PATTERNS += busio/% bitbangio/OneWire.%
endif
Expand Down Expand Up @@ -432,6 +435,9 @@ SRC_SHARED_MODULE_ALL = \
bitbangio/SPI.c \
bitbangio/__init__.c \
board/__init__.c \
adafruit_bus_device/__init__.c \
adafruit_bus_device/I2CDevice.c \
adafruit_bus_device/SPIDevice.c \
busio/OneWire.c \
displayio/Bitmap.c \
displayio/ColorConverter.c \
Expand Down
8 changes: 8 additions & 0 deletions py/circuitpy_mpconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ extern const struct _mp_obj_module_t board_module;
#define BOARD_UART_ROOT_POINTER
#endif

#if CIRCUITPY_BUSDEVICE
extern const struct _mp_obj_module_t adafruit_bus_device_module;
#define BUSDEVICE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_adafruit_bus_device), (mp_obj_t)&adafruit_bus_device_module },
#else
#define BUSDEVICE_MODULE
#endif

#if CIRCUITPY_BUSIO
extern const struct _mp_obj_module_t busio_module;
#define BUSIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_busio), (mp_obj_t)&busio_module },
Expand Down Expand Up @@ -785,6 +792,7 @@ extern const struct _mp_obj_module_t wifi_module;
BITBANGIO_MODULE \
BLEIO_MODULE \
BOARD_MODULE \
BUSDEVICE_MODULE \
BUSIO_MODULE \
CAMERA_MODULE \
CANIO_MODULE \
Expand Down
3 changes: 3 additions & 0 deletions py/circuitpy_mpconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)
CIRCUITPY_BOARD ?= 1
CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD)

CIRCUITPY_BUSDEVICE ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_BUSDEVICE=$(CIRCUITPY_BUSDEVICE)

CIRCUITPY_BUILTINS_POW3 ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_BUILTINS_POW3=$(CIRCUITPY_BUILTINS_POW3)

Expand Down
Loading
0