Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
lib/mbedtls_errors/generate_errors.diff
)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.4.1
hooks:
- id: codespell
args: [-w]
Expand Down
11 changes: 10 additions & 1 deletion extmod/vfs_blockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,16 @@ void mp_vfs_blockdev_init(mp_vfs_blockdev_t *self, mp_obj_t bdev) {
#endif
#if CIRCUITPY_SDIOIO
if (mp_obj_get_type(bdev) == &sdioio_SDCard_type) {
// TODO: Enable native blockdev for SDIO too.
self->flags |= MP_BLOCKDEV_FLAG_NATIVE | MP_BLOCKDEV_FLAG_HAVE_IOCTL;
self->readblocks[0] = mp_const_none;
self->readblocks[1] = bdev;
self->readblocks[2] = (mp_obj_t)sdioio_sdcard_readblocks; // native version
self->writeblocks[0] = mp_const_none;
self->writeblocks[1] = bdev;
self->writeblocks[2] = (mp_obj_t)sdioio_sdcard_writeblocks; // native version
self->u.ioctl[0] = mp_const_none;
self->u.ioctl[1] = bdev;
self->u.ioctl[2] = (mp_obj_t)sdioio_sdcard_ioctl; // native version
}
#endif
if (self->u.ioctl[0] != MP_OBJ_NULL) {
Expand Down
38 changes: 33 additions & 5 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ msgstr ""
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
#: ports/raspberrypi/common-hal/usb_host/Port.c
#: shared-bindings/digitalio/DigitalInOut.c
#: shared-bindings/microcontroller/Pin.c shared-module/max3421e/Max3421E.c
#: shared-bindings/i2cioexpander/IOPin.c shared-bindings/microcontroller/Pin.c
#: shared-module/max3421e/Max3421E.c
msgid "%q in use"
msgstr ""

Expand All @@ -132,7 +133,7 @@ msgid "%q indices must be integers, not %s"
msgstr ""

#: ports/analog/common-hal/busio/SPI.c ports/analog/common-hal/busio/UART.c
#: shared-module/bitbangio/SPI.c
#: shared-bindings/digitalio/DigitalInOutProtocol.c
msgid "%q init failed"
msgstr ""

Expand Down Expand Up @@ -235,6 +236,14 @@ msgstr ""
msgid "%q must be power of 2"
msgstr ""

#: shared-bindings/digitalio/DigitalInOutProtocol.c
msgid "%q object missing '%q' attribute"
msgstr ""

#: shared-bindings/digitalio/DigitalInOutProtocol.c
msgid "%q object missing '%q' method"
msgstr ""

#: shared-bindings/wifi/Monitor.c
msgid "%q out of bounds"
msgstr ""
Expand Down Expand Up @@ -304,7 +313,7 @@ msgstr ""
msgid "'%q' argument required"
msgstr ""

#: py/proto.c
#: py/proto.c shared-bindings/digitalio/DigitalInOutProtocol.c
msgid "'%q' object does not support '%q'"
msgstr ""

Expand Down Expand Up @@ -766,6 +775,10 @@ msgstr ""
msgid "Cannot create a new Adapter; use _bleio.adapter;"
msgstr ""

#: shared-module/i2cioexpander/IOExpander.c
msgid "Cannot deinitialize board IOExpander"
msgstr ""

#: shared-bindings/displayio/Bitmap.c
#: shared-bindings/memorymonitor/AllocationSize.c
#: shared-bindings/pulseio/PulseIn.c
Expand Down Expand Up @@ -800,6 +813,7 @@ msgid "Cannot remount path when visible via USB."
msgstr ""

#: shared-bindings/digitalio/DigitalInOut.c
#: shared-bindings/i2cioexpander/IOPin.c
msgid "Cannot set value when direction is input."
msgstr ""

Expand Down Expand Up @@ -939,6 +953,7 @@ msgid "Done"
msgstr ""

#: shared-bindings/digitalio/DigitalInOut.c
#: shared-bindings/i2cioexpander/IOPin.c
msgid "Drive mode not used when direction is input."
msgstr ""

Expand Down Expand Up @@ -1277,8 +1292,8 @@ msgstr ""
#: ports/raspberrypi/common-hal/picodvi/Framebuffer_RP2040.c py/argcheck.c
#: shared-bindings/digitalio/DigitalInOut.c
#: shared-bindings/epaperdisplay/EPaperDisplay.c
#: shared-bindings/mipidsi/Display.c shared-bindings/pwmio/PWMOut.c
#: shared-bindings/supervisor/__init__.c
#: shared-bindings/i2cioexpander/IOPin.c shared-bindings/mipidsi/Display.c
#: shared-bindings/pwmio/PWMOut.c shared-bindings/supervisor/__init__.c
#: shared-module/aurora_epaper/aurora_framebuffer.c
#: shared-module/lvfontio/OnDiskFont.c
msgid "Invalid %q"
Expand Down Expand Up @@ -1880,6 +1895,7 @@ msgid "Publishers can only be created from a parent node"
msgstr ""

#: shared-bindings/digitalio/DigitalInOut.c
#: shared-bindings/i2cioexpander/IOPin.c
msgid "Pull not used when direction is output."
msgstr ""

Expand Down Expand Up @@ -2539,6 +2555,10 @@ msgstr ""
msgid "a bytes-like object is required"
msgstr ""

#: shared-bindings/i2cioexpander/IOExpander.c
msgid "address out of range"
msgstr ""

#: shared-bindings/i2ctarget/I2CTarget.c
msgid "addresses is empty"
msgstr ""
Expand Down Expand Up @@ -3814,6 +3834,10 @@ msgstr ""
msgid "not supported for input types"
msgstr ""

#: shared-bindings/i2cioexpander/IOExpander.c
msgid "num_pins must be 8 or 16"
msgstr ""

#: extmod/ulab/code/numpy/create.c
msgid "number of points must be at least 2"
msgstr ""
Expand All @@ -3827,6 +3851,10 @@ msgstr ""
msgid "object '%s' isn't a tuple or list"
msgstr ""

#: shared-bindings/digitalio/DigitalInOutProtocol.c
msgid "object does not support DigitalInOut protocol"
msgstr ""

#: py/obj.c
msgid "object doesn't support item assignment"
msgstr ""
Expand Down
12 changes: 6 additions & 6 deletions ports/analog/common-hal/busio/I2C.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) {
}

// Write data to the device selected by address
uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr,
mp_errno_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr,
const uint8_t *data, size_t len) {

int ret;
Expand All @@ -202,14 +202,14 @@ uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr,
};
ret = MXC_I2C_MasterTransaction(&wr_req);
if (ret) {
return MP_EIO;
return -MP_EIO;
}

return 0;
}

// Read into buffer from the device selected by address
uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self,
mp_errno_t common_hal_busio_i2c_read(busio_i2c_obj_t *self,
uint16_t addr,
uint8_t *data, size_t len) {

Expand All @@ -226,14 +226,14 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self,
ret = MXC_I2C_MasterTransaction(&rd_req);
if (ret) {
// Return I/O error
return MP_EIO;
return -MP_EIO;
}

return 0;
}

// Write the bytes from out_data to the device selected by address
uint8_t common_hal_busio_i2c_write_read(busio_i2c_obj_t *self, uint16_t addr,
mp_errno_t common_hal_busio_i2c_write_read(busio_i2c_obj_t *self, uint16_t addr,
uint8_t *out_data, size_t out_len,
uint8_t *in_data, size_t in_len) {

Expand All @@ -249,7 +249,7 @@ uint8_t common_hal_busio_i2c_write_read(busio_i2c_obj_t *self, uint16_t addr,
};
ret = MXC_I2C_MasterTransaction(&wr_rd_req);
if (ret) {
return MP_EIO;
return -MP_EIO;
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ LIBS += -lm
endif

ifeq ($(CHIP_FAMILY), samd21)
LDFLAGS += -mthumb -mcpu=cortex-m0plus -Lasf/thirdparty/CMSIS/Lib/GCC/
LDFLAGS += -mthumb -mcpu=cortex-m0plus -Lasf/thirdparty/CMSIS/Lib/GCC/ # codespell:ignore thirdparty
BOOTLOADER_SIZE := 0x2000
else ifeq ($(CHIP_FAMILY), samd51)
LDFLAGS += -mthumb -mcpu=cortex-m4
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/asf4_conf/samd21/hpl_sercom_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
// <0x2=>8x arithmetic
// <0x3=>8x fractional
// <0x3=>3x
// <i> How many over-sampling bits used when samling data state
// <i> How many over-sampling bits used when sampling data state
// <id> usart_arch_sampr
#ifndef CONF_SERCOM_2_USART_SAMPR
#define CONF_SERCOM_2_USART_SAMPR 0x0
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/asf4_conf/samd51/hpl_sercom_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
// <0x2=>8x arithmetic
// <0x3=>8x fractional
// <0x3=>3x
// <i> How many over-sampling bits used when samling data state
// <i> How many over-sampling bits used when sampling data state
// <id> usart_arch_sampr
#ifndef CONF_SERCOM_2_USART_SAMPR
#define CONF_SERCOM_2_USART_SAMPR 0x0
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/asf4_conf/same51/hpl_sercom_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
// <0x2=>8x arithmetic
// <0x3=>8x fractional
// <0x3=>3x
// <i> How many over-sampling bits used when samling data state
// <i> How many over-sampling bits used when sampling data state
// <id> usart_arch_sampr
#ifndef CONF_SERCOM_2_USART_SAMPR
#define CONF_SERCOM_2_USART_SAMPR 0x0
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
// <0x2=>8x arithmetic
// <0x3=>8x fractional
// <0x3=>3x
// <i> How many over-sampling bits used when samling data state
// <i> How many over-sampling bits used when sampling data state
// <id> usart_arch_sampr
#ifndef CONF_SERCOM_2_USART_SAMPR
#define CONF_SERCOM_2_USART_SAMPR 0x0
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/hallowing_m0_express/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ void board_init(void) {
common_hal_busio_spi_never_reset(spi);
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PA28, // Command or data
&pin_PA01, // Chip select
&pin_PA27, // Reset
MP_OBJ_FROM_PTR(&pin_PA28), // Command or data
MP_OBJ_FROM_PTR(&pin_PA01), // Chip select
MP_OBJ_FROM_PTR(&pin_PA27), // Reset
12000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/hallowing_m4_express/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PB31, // TFT_DC Command or data
&pin_PA27, // TFT_CS Chip select
&pin_PB30, // TFT_RST Reset
MP_OBJ_FROM_PTR(&pin_PB31), // TFT_DC Command or data
MP_OBJ_FROM_PTR(&pin_PA27), // TFT_CS Chip select
MP_OBJ_FROM_PTR(&pin_PB30), // TFT_RST Reset
60000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/monster_m4sk/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PA07, // TFT_DC Command or data
&pin_PA06, // TFT_CS Chip select
&pin_PA04, // TFT_RST Reset
MP_OBJ_FROM_PTR(&pin_PA07), // TFT_DC Command or data
MP_OBJ_FROM_PTR(&pin_PA06), // TFT_CS Chip select
MP_OBJ_FROM_PTR(&pin_PA04), // TFT_RST Reset
60000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/openbook_m4/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PB05, // EPD_DC Command or data
&pin_PB07, // EPD_CS Chip select
&pin_PA00, // EPD_RST Reset
MP_OBJ_FROM_PTR(&pin_PB05), // EPD_DC Command or data
MP_OBJ_FROM_PTR(&pin_PB07), // EPD_CS Chip select
MP_OBJ_FROM_PTR(&pin_PA00), // EPD_RST Reset
1000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/pewpew_lcd/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PA19, // TFT_DC Command or data
&pin_PA17, // TFT_CS Chip select
&pin_PA18, // TFT_RST Reset
MP_OBJ_FROM_PTR(&pin_PA19), // TFT_DC Command or data
MP_OBJ_FROM_PTR(&pin_PA17), // TFT_CS Chip select
MP_OBJ_FROM_PTR(&pin_PA18), // TFT_RST Reset
60000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/pewpew_m4/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PA16, // TFT_DC Command or data
&pin_PA11, // TFT_CS Chip select
&pin_PA17, // TFT_RST Reset
MP_OBJ_FROM_PTR(&pin_PA16), // TFT_DC Command or data
MP_OBJ_FROM_PTR(&pin_PA11), // TFT_CS Chip select
MP_OBJ_FROM_PTR(&pin_PA17), // TFT_RST Reset
60000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/pybadge/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PB05, // TFT_DC Command or data
&pin_PB07, // TFT_CS Chip select
&pin_PA00, // TFT_RST Reset
MP_OBJ_FROM_PTR(&pin_PB05), // TFT_DC Command or data
MP_OBJ_FROM_PTR(&pin_PB07), // TFT_CS Chip select
MP_OBJ_FROM_PTR(&pin_PA00), // TFT_RST Reset
60000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/pygamer/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PB05, // TFT_DC Command or data
&pin_PB12, // TFT_CS Chip select
&pin_PA00, // TFT_RST Reset
MP_OBJ_FROM_PTR(&pin_PB05), // TFT_DC Command or data
MP_OBJ_FROM_PTR(&pin_PB12), // TFT_CS Chip select
MP_OBJ_FROM_PTR(&pin_PA00), // TFT_RST Reset
60000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/seeeduino_wio_terminal/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ void board_init(void) {
bus->base.type = &fourwire_fourwire_type;
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PC06, // TFT_DC Command or data
&pin_PB21, // TFT_CS Chip select
&pin_PC07, // TFT_RST Reset
MP_OBJ_FROM_PTR(&pin_PC06), // TFT_DC Command or data
MP_OBJ_FROM_PTR(&pin_PB21), // TFT_CS Chip select
MP_OBJ_FROM_PTR(&pin_PC07), // TFT_RST Reset
60000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
6 changes: 3 additions & 3 deletions ports/atmel-samd/boards/ugame10/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ void board_init(void) {
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
common_hal_fourwire_fourwire_construct(bus,
spi,
&pin_PA09, // Command or data
&pin_PA08, // Chip select
NULL, // Reset
MP_OBJ_FROM_PTR(&pin_PA09), // Command or data
MP_OBJ_FROM_PTR(&pin_PA08), // Chip select
MP_OBJ_NULL, // Reset
24000000, // Baudrate
0, // Polarity
0); // Phase
Expand Down
Loading