Skip to content

Commit 34cf18d

Browse files
committed
Merge remote-tracking branch 'adafruit/main' into zephyr_native_sim
2 parents 57ce5da + 4b7b098 commit 34cf18d

File tree

217 files changed

+3906
-704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+3906
-704
lines changed

extmod/vfs_blockdev.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@ void mp_vfs_blockdev_init(mp_vfs_blockdev_t *self, mp_obj_t bdev) {
6363
#endif
6464
#if CIRCUITPY_SDIOIO
6565
if (mp_obj_get_type(bdev) == &sdioio_SDCard_type) {
66-
// TODO: Enable native blockdev for SDIO too.
66+
self->flags |= MP_BLOCKDEV_FLAG_NATIVE | MP_BLOCKDEV_FLAG_HAVE_IOCTL;
67+
self->readblocks[0] = mp_const_none;
68+
self->readblocks[1] = bdev;
69+
self->readblocks[2] = (mp_obj_t)sdioio_sdcard_readblocks; // native version
70+
self->writeblocks[0] = mp_const_none;
71+
self->writeblocks[1] = bdev;
72+
self->writeblocks[2] = (mp_obj_t)sdioio_sdcard_writeblocks; // native version
73+
self->u.ioctl[0] = mp_const_none;
74+
self->u.ioctl[1] = bdev;
75+
self->u.ioctl[2] = (mp_obj_t)sdioio_sdcard_ioctl; // native version
6776
}
6877
#endif
6978
if (self->u.ioctl[0] != MP_OBJ_NULL) {

locale/circuitpython.pot

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ msgstr ""
119119
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
120120
#: ports/raspberrypi/common-hal/usb_host/Port.c
121121
#: shared-bindings/digitalio/DigitalInOut.c
122-
#: shared-bindings/microcontroller/Pin.c shared-module/max3421e/Max3421E.c
122+
#: shared-bindings/i2cioexpander/IOPin.c shared-bindings/microcontroller/Pin.c
123+
#: shared-module/max3421e/Max3421E.c
123124
msgid "%q in use"
124125
msgstr ""
125126

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

134135
#: ports/analog/common-hal/busio/SPI.c ports/analog/common-hal/busio/UART.c
135-
#: shared-module/bitbangio/SPI.c
136+
#: shared-bindings/digitalio/DigitalInOutProtocol.c
136137
msgid "%q init failed"
137138
msgstr ""
138139

@@ -235,6 +236,14 @@ msgstr ""
235236
msgid "%q must be power of 2"
236237
msgstr ""
237238

239+
#: shared-bindings/digitalio/DigitalInOutProtocol.c
240+
msgid "%q object missing '%q' attribute"
241+
msgstr ""
242+
243+
#: shared-bindings/digitalio/DigitalInOutProtocol.c
244+
msgid "%q object missing '%q' method"
245+
msgstr ""
246+
238247
#: shared-bindings/wifi/Monitor.c
239248
msgid "%q out of bounds"
240249
msgstr ""
@@ -304,7 +313,7 @@ msgstr ""
304313
msgid "'%q' argument required"
305314
msgstr ""
306315

307-
#: py/proto.c
316+
#: py/proto.c shared-bindings/digitalio/DigitalInOutProtocol.c
308317
msgid "'%q' object does not support '%q'"
309318
msgstr ""
310319

@@ -766,6 +775,10 @@ msgstr ""
766775
msgid "Cannot create a new Adapter; use _bleio.adapter;"
767776
msgstr ""
768777

778+
#: shared-module/i2cioexpander/IOExpander.c
779+
msgid "Cannot deinitialize board IOExpander"
780+
msgstr ""
781+
769782
#: shared-bindings/displayio/Bitmap.c
770783
#: shared-bindings/memorymonitor/AllocationSize.c
771784
#: shared-bindings/pulseio/PulseIn.c
@@ -800,6 +813,7 @@ msgid "Cannot remount path when visible via USB."
800813
msgstr ""
801814

802815
#: shared-bindings/digitalio/DigitalInOut.c
816+
#: shared-bindings/i2cioexpander/IOPin.c
803817
msgid "Cannot set value when direction is input."
804818
msgstr ""
805819

@@ -939,6 +953,7 @@ msgid "Done"
939953
msgstr ""
940954

941955
#: shared-bindings/digitalio/DigitalInOut.c
956+
#: shared-bindings/i2cioexpander/IOPin.c
942957
msgid "Drive mode not used when direction is input."
943958
msgstr ""
944959

@@ -1277,8 +1292,8 @@ msgstr ""
12771292
#: ports/raspberrypi/common-hal/picodvi/Framebuffer_RP2040.c py/argcheck.c
12781293
#: shared-bindings/digitalio/DigitalInOut.c
12791294
#: shared-bindings/epaperdisplay/EPaperDisplay.c
1280-
#: shared-bindings/mipidsi/Display.c shared-bindings/pwmio/PWMOut.c
1281-
#: shared-bindings/supervisor/__init__.c
1295+
#: shared-bindings/i2cioexpander/IOPin.c shared-bindings/mipidsi/Display.c
1296+
#: shared-bindings/pwmio/PWMOut.c shared-bindings/supervisor/__init__.c
12821297
#: shared-module/aurora_epaper/aurora_framebuffer.c
12831298
#: shared-module/lvfontio/OnDiskFont.c
12841299
msgid "Invalid %q"
@@ -1880,6 +1895,7 @@ msgid "Publishers can only be created from a parent node"
18801895
msgstr ""
18811896

18821897
#: shared-bindings/digitalio/DigitalInOut.c
1898+
#: shared-bindings/i2cioexpander/IOPin.c
18831899
msgid "Pull not used when direction is output."
18841900
msgstr ""
18851901

@@ -2539,6 +2555,10 @@ msgstr ""
25392555
msgid "a bytes-like object is required"
25402556
msgstr ""
25412557

2558+
#: shared-bindings/i2cioexpander/IOExpander.c
2559+
msgid "address out of range"
2560+
msgstr ""
2561+
25422562
#: shared-bindings/i2ctarget/I2CTarget.c
25432563
msgid "addresses is empty"
25442564
msgstr ""
@@ -3814,6 +3834,10 @@ msgstr ""
38143834
msgid "not supported for input types"
38153835
msgstr ""
38163836

3837+
#: shared-bindings/i2cioexpander/IOExpander.c
3838+
msgid "num_pins must be 8 or 16"
3839+
msgstr ""
3840+
38173841
#: extmod/ulab/code/numpy/create.c
38183842
msgid "number of points must be at least 2"
38193843
msgstr ""
@@ -3827,6 +3851,10 @@ msgstr ""
38273851
msgid "object '%s' isn't a tuple or list"
38283852
msgstr ""
38293853

3854+
#: shared-bindings/digitalio/DigitalInOutProtocol.c
3855+
msgid "object does not support DigitalInOut protocol"
3856+
msgstr ""
3857+
38303858
#: py/obj.c
38313859
msgid "object doesn't support item assignment"
38323860
msgstr ""

ports/analog/common-hal/busio/I2C.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) {
187187
}
188188

189189
// Write data to the device selected by address
190-
uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr,
190+
mp_negative_errno_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr,
191191
const uint8_t *data, size_t len) {
192192

193193
int ret;
@@ -202,14 +202,14 @@ uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr,
202202
};
203203
ret = MXC_I2C_MasterTransaction(&wr_req);
204204
if (ret) {
205-
return MP_EIO;
205+
return -MP_EIO;
206206
}
207207

208208
return 0;
209209
}
210210

211211
// Read into buffer from the device selected by address
212-
uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self,
212+
mp_negative_errno_t common_hal_busio_i2c_read(busio_i2c_obj_t *self,
213213
uint16_t addr,
214214
uint8_t *data, size_t len) {
215215

@@ -226,14 +226,14 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self,
226226
ret = MXC_I2C_MasterTransaction(&rd_req);
227227
if (ret) {
228228
// Return I/O error
229-
return MP_EIO;
229+
return -MP_EIO;
230230
}
231231

232232
return 0;
233233
}
234234

235235
// Write the bytes from out_data to the device selected by address
236-
uint8_t common_hal_busio_i2c_write_read(busio_i2c_obj_t *self, uint16_t addr,
236+
mp_negative_errno_t common_hal_busio_i2c_write_read(busio_i2c_obj_t *self, uint16_t addr,
237237
uint8_t *out_data, size_t out_len,
238238
uint8_t *in_data, size_t in_len) {
239239

@@ -249,7 +249,7 @@ uint8_t common_hal_busio_i2c_write_read(busio_i2c_obj_t *self, uint16_t addr,
249249
};
250250
ret = MXC_I2C_MasterTransaction(&wr_rd_req);
251251
if (ret) {
252-
return MP_EIO;
252+
return -MP_EIO;
253253
}
254254

255255
return 0;

ports/atmel-samd/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ LIBS += -lm
169169
endif
170170

171171
ifeq ($(CHIP_FAMILY), samd21)
172-
LDFLAGS += -mthumb -mcpu=cortex-m0plus -Lasf/thirdparty/CMSIS/Lib/GCC/
172+
LDFLAGS += -mthumb -mcpu=cortex-m0plus -Lasf/thirdparty/CMSIS/Lib/GCC/ # codespell:ignore thirdparty
173173
BOOTLOADER_SIZE := 0x2000
174174
else ifeq ($(CHIP_FAMILY), samd51)
175175
LDFLAGS += -mthumb -mcpu=cortex-m4

ports/atmel-samd/asf4_conf/samd21/hpl_sercom_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@
431431
// <0x2=>8x arithmetic
432432
// <0x3=>8x fractional
433433
// <0x3=>3x
434-
// <i> How many over-sampling bits used when samling data state
434+
// <i> How many over-sampling bits used when sampling data state
435435
// <id> usart_arch_sampr
436436
#ifndef CONF_SERCOM_2_USART_SAMPR
437437
#define CONF_SERCOM_2_USART_SAMPR 0x0

ports/atmel-samd/asf4_conf/samd51/hpl_sercom_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@
431431
// <0x2=>8x arithmetic
432432
// <0x3=>8x fractional
433433
// <0x3=>3x
434-
// <i> How many over-sampling bits used when samling data state
434+
// <i> How many over-sampling bits used when sampling data state
435435
// <id> usart_arch_sampr
436436
#ifndef CONF_SERCOM_2_USART_SAMPR
437437
#define CONF_SERCOM_2_USART_SAMPR 0x0

ports/atmel-samd/asf4_conf/same51/hpl_sercom_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@
431431
// <0x2=>8x arithmetic
432432
// <0x3=>8x fractional
433433
// <0x3=>3x
434-
// <i> How many over-sampling bits used when samling data state
434+
// <i> How many over-sampling bits used when sampling data state
435435
// <id> usart_arch_sampr
436436
#ifndef CONF_SERCOM_2_USART_SAMPR
437437
#define CONF_SERCOM_2_USART_SAMPR 0x0

ports/atmel-samd/asf4_conf/same54/hpl_sercom_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@
431431
// <0x2=>8x arithmetic
432432
// <0x3=>8x fractional
433433
// <0x3=>3x
434-
// <i> How many over-sampling bits used when samling data state
434+
// <i> How many over-sampling bits used when sampling data state
435435
// <id> usart_arch_sampr
436436
#ifndef CONF_SERCOM_2_USART_SAMPR
437437
#define CONF_SERCOM_2_USART_SAMPR 0x0

ports/atmel-samd/boards/hallowing_m0_express/board.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ void board_init(void) {
5454
common_hal_busio_spi_never_reset(spi);
5555
common_hal_fourwire_fourwire_construct(bus,
5656
spi,
57-
&pin_PA28, // Command or data
58-
&pin_PA01, // Chip select
59-
&pin_PA27, // Reset
57+
MP_OBJ_FROM_PTR(&pin_PA28), // Command or data
58+
MP_OBJ_FROM_PTR(&pin_PA01), // Chip select
59+
MP_OBJ_FROM_PTR(&pin_PA27), // Reset
6060
12000000, // Baudrate
6161
0, // Polarity
6262
0); // Phase

ports/atmel-samd/boards/hallowing_m4_express/board.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ void board_init(void) {
3535
bus->base.type = &fourwire_fourwire_type;
3636
common_hal_fourwire_fourwire_construct(bus,
3737
spi,
38-
&pin_PB31, // TFT_DC Command or data
39-
&pin_PA27, // TFT_CS Chip select
40-
&pin_PB30, // TFT_RST Reset
38+
MP_OBJ_FROM_PTR(&pin_PB31), // TFT_DC Command or data
39+
MP_OBJ_FROM_PTR(&pin_PA27), // TFT_CS Chip select
40+
MP_OBJ_FROM_PTR(&pin_PB30), // TFT_RST Reset
4141
60000000, // Baudrate
4242
0, // Polarity
4343
0); // Phase

0 commit comments

Comments
 (0)