Skip to content

Commit bdf2709

Browse files
authored
Merge pull request adafruit#10990 from FoamyGuy/audio_i2sin
audio_i2sin module for espressif and raspberrypi
2 parents d228122 + 78c3c73 commit bdf2709

33 files changed

Lines changed: 2077 additions & 7 deletions

File tree

‎locale/circuitpython.pot‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ msgstr ""
186186
msgid "%q must be 1 when %q is True"
187187
msgstr ""
188188

189+
#: ports/raspberrypi/common-hal/audioi2sin/I2SIn.c
190+
msgid "%q must be 16, 24, or 32"
191+
msgstr ""
192+
193+
#: ports/espressif/common-hal/audiobusio/PDMIn.c
194+
#: shared-bindings/audioi2sin/I2SIn.c
195+
msgid "%q must be 8, 16, 24, or 32"
196+
msgstr ""
197+
189198
#: py/argcheck.c shared-bindings/gifio/GifWriter.c
190199
#: shared-module/gifio/OnDiskGif.c
191200
msgid "%q must be <= %d"
@@ -660,6 +669,7 @@ msgid "Below minimum frame rate"
660669
msgstr ""
661670

662671
#: ports/raspberrypi/common-hal/audiobusio/I2SOut.c
672+
#: ports/raspberrypi/common-hal/audioi2sin/I2SIn.c
663673
msgid "Bit clock and word select must be sequential GPIO pins"
664674
msgstr ""
665675

@@ -804,7 +814,7 @@ msgstr ""
804814
msgid "Cannot pull on input-only pin."
805815
msgstr ""
806816

807-
#: shared-bindings/audiobusio/PDMIn.c
817+
#: shared-bindings/audiobusio/PDMIn.c shared-bindings/audioi2sin/I2SIn.c
808818
msgid "Cannot record to a file"
809819
msgstr ""
810820

@@ -926,7 +936,7 @@ msgstr ""
926936
msgid "Deep sleep pins must use a rising edge with pulldown"
927937
msgstr ""
928938

929-
#: shared-bindings/audiobusio/PDMIn.c
939+
#: shared-bindings/audiobusio/PDMIn.c shared-bindings/audioi2sin/I2SIn.c
930940
msgid "Destination capacity is smaller than destination_length."
931941
msgstr ""
932942

@@ -1815,6 +1825,7 @@ msgid "Parameter error"
18151825
msgstr ""
18161826

18171827
#: ports/espressif/common-hal/audiobusio/__init__.c
1828+
#: ports/espressif/common-hal/audioi2sin/I2SIn.c
18181829
msgid "Peripheral in use"
18191830
msgstr ""
18201831

@@ -2704,10 +2715,6 @@ msgstr ""
27042715
msgid "binary op %q not implemented"
27052716
msgstr ""
27062717

2707-
#: ports/espressif/common-hal/audiobusio/PDMIn.c
2708-
msgid "bit_depth must be 8, 16, 24, or 32."
2709-
msgstr ""
2710-
27112718
#: shared-module/bitmapfilter/__init__.c
27122719
msgid "bitmap size and depth must match"
27132720
msgstr ""
@@ -3518,6 +3525,11 @@ msgstr ""
35183525
msgid "invalid cert"
35193526
msgstr ""
35203527

3528+
#: shared-bindings/audioi2sin/I2SIn.c
3529+
#, c-format
3530+
msgid "invalid destination buffer, must be an array of type: %c"
3531+
msgstr ""
3532+
35213533
#: shared-bindings/bitmaptools/__init__.c
35223534
#, c-format
35233535
msgid "invalid element size %d for bits_per_pixel %d\n"

‎ports/espressif/Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,10 @@ ifneq ($(CIRCUITPY_AUDIOBUSIO),0)
639639
CHIP_COMPONENTS += esp_driver_i2s
640640
endif
641641

642+
ifneq ($(CIRCUITPY_AUDIOI2SIN),0)
643+
CHIP_COMPONENTS += esp_driver_i2s
644+
endif
645+
642646
ifneq ($(CIRCUITPY_BLEIO_NATIVE),0)
643647
SRC_C += common-hal/_bleio/ble_events.c
644648
endif

‎ports/espressif/boards/adafruit_sparkle_motion/pins.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {
4646
{ MP_ROM_QSTR(MP_QSTR_SIG4), MP_ROM_PTR(&pin_GPIO23) },
4747
{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) },
4848

49+
{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) },
50+
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) },
51+
{ MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) },
52+
4953
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO9) },
5054
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) },
5155

‎ports/espressif/common-hal/audiobusio/PDMIn.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self,
4040
&& bit_depth != I2S_DATA_BIT_WIDTH_16BIT
4141
&& bit_depth != I2S_DATA_BIT_WIDTH_24BIT
4242
&& bit_depth != I2S_DATA_BIT_WIDTH_32BIT) {
43-
mp_raise_ValueError(MP_ERROR_TEXT("bit_depth must be 8, 16, 24, or 32."));
43+
mp_raise_ValueError_varg(MP_ERROR_TEXT("%q must be 8, 16, 24, or 32"), MP_QSTR_bit_depth);
4444
}
4545

4646
i2s_chan_config_t chanConfig = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_0, I2S_ROLE_MASTER);

0 commit comments

Comments
 (0)