Skip to content

Commit

Permalink
Merge pull request #5990 from sgauche/stm_spi_3wire
Browse files Browse the repository at this point in the history
Add support for half-duplex SPI to CPy
  • Loading branch information
dhalbert authored Feb 9, 2022
2 parents 7270d46 + 72317c3 commit da035fe
Show file tree
Hide file tree
Showing 45 changed files with 102 additions and 62 deletions.
17 changes: 12 additions & 5 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ msgstr ""

#: shared-bindings/displayio/Display.c
#: shared-bindings/framebufferio/FramebufferDisplay.c
#: shared-bindings/is31fl3741/IS31FL3741.c
#: shared-bindings/is31fl3741/FrameBuffer.c
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "Brightness must be 0-1.0"
msgstr ""
Expand Down Expand Up @@ -1129,6 +1129,13 @@ msgstr ""
msgid "Group already used"
msgstr ""

#: ports/atmel-samd/common-hal/busio/SPI.c ports/cxd56/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c
#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Half duplex SPI is not implemented"
msgstr ""

#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c
#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c
#: ports/stm/common-hal/sdioio/SDCard.c
Expand Down Expand Up @@ -1480,7 +1487,7 @@ msgstr ""
msgid "Key must be 16, 24, or 32 bytes long"
msgstr ""

#: shared-module/is31fl3741/IS31FL3741.c
#: shared-module/is31fl3741/FrameBuffer.c
msgid "LED mappings must match display size"
msgstr ""

Expand Down Expand Up @@ -1508,7 +1515,7 @@ msgstr ""
msgid "MOSI pin init failed."
msgstr ""

#: shared-bindings/is31fl3741/__init__.c
#: shared-bindings/is31fl3741/IS31FL3741.c
msgid "Mapping must be a tuple"
msgstr ""

Expand Down Expand Up @@ -2121,7 +2128,7 @@ msgstr ""
msgid "Sample rate too high. It must be less than %d"
msgstr ""

#: shared-bindings/is31fl3741/IS31FL3741.c
#: shared-bindings/is31fl3741/FrameBuffer.c
msgid "Scale dimensions must divide by 3"
msgstr ""

Expand Down Expand Up @@ -4557,7 +4564,7 @@ msgstr ""
msgid "width must be from 2 to 8 (inclusive), not %d"
msgstr ""

#: shared-bindings/is31fl3741/IS31FL3741.c
#: shared-bindings/is31fl3741/FrameBuffer.c
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
Expand Down
2 changes: 0 additions & 2 deletions ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_ONEWIREIO = 0
2 changes: 0 additions & 2 deletions ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_ONEWIREIO = 0
3 changes: 2 additions & 1 deletion ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_ONEWIREIO = 0
# This board has many pins, and we have to remove something else to make room.
CIRCUITPY_RAINBOWIO = 0
2 changes: 0 additions & 2 deletions ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_ONEWIREIO = 0
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ LONGINT_IMPL = NONE
CIRCUITPY_BUSDEVICE = 1
CIRCUITPY_DISPLAYIO = 0
CIRCUITPY_KEYPAD = 0
CIRCUITPY_ONEWIREIO = 0

# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground
Expand Down
2 changes: 0 additions & 2 deletions ports/atmel-samd/boards/datum_imu/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_ONEWIREIO = 0
2 changes: 0 additions & 2 deletions ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_ONEWIREIO = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/hallowing_m4_express/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, NULL);
common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/monster_m4sk/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, NULL);
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/openbook_m4/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ uint8_t stop_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL);
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pewpew_m4/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, NULL);
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pybadge/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL);
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pygamer/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL);
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/seeeduino_wio_terminal/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_PB20, &pin_PB19, NULL);
common_hal_busio_spi_construct(spi, &pin_PB20, &pin_PB19, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 0 additions & 2 deletions ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_ONEWIREIO = 0
2 changes: 0 additions & 2 deletions ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

# There are many pin definitions on this board; it doesn't quite fit on very large translations.
# Remove a couple of modules.
CIRCUITPY_ONEWIREIO = 0
CIRCUITPY_RAINBOWIO = 0
2 changes: 0 additions & 2 deletions ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_ONEWIREIO = 0
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ EXTERNAL_FLASH_DEVICES = AT25SF161
LONGINT_IMPL = MPZ

CIRCUITPY_KEYPAD = 0
CIRCUITPY_ONEWIREIO = 0
CIRCUITPY_USB_MIDI = 0

CIRCUITPY_BITBANG_APA102 = 1
6 changes: 5 additions & 1 deletion ports/atmel-samd/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

void common_hal_busio_spi_construct(busio_spi_obj_t *self,
const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi,
const mcu_pin_obj_t *miso) {
const mcu_pin_obj_t *miso, bool half_duplex) {
Sercom *sercom = NULL;
uint8_t sercom_index;
uint32_t clock_pinmux = 0;
Expand All @@ -57,6 +57,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
uint8_t miso_pad = 0;
uint8_t dopo = 255;

if (half_duplex) {
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
}

// Ensure the object starts in its deinit state.
self->clock_pin = NO_PIN;

Expand Down
8 changes: 8 additions & 0 deletions ports/atmel-samd/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1
CIRCUITPY_ULAB = 0
CIRCUITPY_VECTORIO = 0

# TODO: In CircuitPython 8.0, turn this back on, after `busio.OneWire` is removed.
# We'd like a smoother transition, but we can't afford the space to have both
# `busio.OneWire` and `onewireio.OneWire` present on these tiny builds.

ifeq ($(INTERNAL_FLASH_FILESYSTEM),1)
CIRCUITPY_ONEWIREIO ?= 0
endif

MICROPY_PY_ASYNC_AWAIT = 0

# We don't have room for the fonts for terminalio for ja and ko
Expand Down
7 changes: 6 additions & 1 deletion ports/broadcom/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ void reset_spi(void) {

void common_hal_busio_spi_construct(busio_spi_obj_t *self,
const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi,
const mcu_pin_obj_t *miso) {
const mcu_pin_obj_t *miso, bool half_duplex) {
size_t instance_index = NUM_SPI;
BP_Function_Enum clock_alt = 0;
BP_Function_Enum mosi_alt = 0;
BP_Function_Enum miso_alt = 0;

if (half_duplex) {
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
}

for (size_t i = 0; i < NUM_SPI; i++) {
if (spi_in_use[i]) {
continue;
Expand Down
6 changes: 5 additions & 1 deletion ports/cxd56/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@
#include "shared-bindings/busio/SPI.h"

void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock,
const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso) {
const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso, bool half_duplex) {
int port = -1;

if (half_duplex) {
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
}

if (clock->number == PIN_SPI4_SCK &&
(mosi == NULL || mosi->number == PIN_SPI4_MOSI) &&
(miso == NULL || miso->number == PIN_SPI4_MISO)) {
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/boards/adafruit_funhouse/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void board_init(void) {
#endif /* DEBUG */

busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL);
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void board_init(void) {
#endif /* DEBUG */

busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL);
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/espressif/boards/espressif_esp32s3_box/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO7, &pin_GPIO6, NULL);
common_hal_busio_spi_construct(spi, &pin_GPIO7, &pin_GPIO6, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
4 changes: 2 additions & 2 deletions ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ static void display_init(void) {
spi,
&pin_GPIO36, // CLK
&pin_GPIO35, // MOSI
NULL // MISO not connected
);
NULL, // MISO not connected
false); // Not half-duplex

common_hal_busio_spi_never_reset(spi);

Expand Down
4 changes: 2 additions & 2 deletions ports/espressif/boards/morpheans_morphesp-240/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ void board_init(void) {
spi,
&pin_GPIO12, // CLK
&pin_GPIO11, // MOSI
NULL // MISO not connected
);
NULL, // MISO not connected
false); // Not half-duplex

common_hal_busio_spi_never_reset(spi);

Expand Down
6 changes: 5 additions & 1 deletion ports/espressif/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static void set_spi_config(busio_spi_obj_t *self,

void common_hal_busio_spi_construct(busio_spi_obj_t *self,
const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi,
const mcu_pin_obj_t *miso) {
const mcu_pin_obj_t *miso, bool half_duplex) {

const spi_bus_config_t bus_config = {
.mosi_io_num = mosi != NULL ? mosi->number : -1,
Expand All @@ -83,6 +83,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
.quadhd_io_num = -1,
};

if (half_duplex) {
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
}

for (spi_host_device_t host_id = SPI2_HOST; host_id < SOC_SPI_PERIPH_NUM; host_id++) {
if (spi_bus_is_free(host_id)) {
self->host_id = host_id;
Expand Down
6 changes: 5 additions & 1 deletion ports/mimxrt10xx/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ void spi_reset(void) {

void common_hal_busio_spi_construct(busio_spi_obj_t *self,
const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi,
const mcu_pin_obj_t *miso) {
const mcu_pin_obj_t *miso, bool half_duplex) {

const uint32_t sck_count = MP_ARRAY_SIZE(mcu_spi_sck_list);
const uint32_t miso_count = MP_ARRAY_SIZE(mcu_spi_miso_list);
const uint32_t mosi_count = MP_ARRAY_SIZE(mcu_spi_mosi_list);
bool spi_taken = false;

if (half_duplex) {
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
}

for (uint i = 0; i < sck_count; i++) {
if (mcu_spi_sck_list[i].pin != clock) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion ports/nrf/boards/clue_nrf52840_express/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, NULL);
common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/nrf/boards/hiibot_bluefi/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_P0_07, &pin_P1_08, NULL); // SCK, MOSI, MISO
common_hal_busio_spi_construct(spi, &pin_P0_07, &pin_P1_08, NULL, false); // SCK, MOSI, MISO, not half-duplex
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL);
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
2 changes: 1 addition & 1 deletion ports/nrf/boards/ohs2020_badge/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ uint8_t display_init_sequence[] = {

void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL);
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL, false);
common_hal_busio_spi_never_reset(spi);

displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
Expand Down
7 changes: 6 additions & 1 deletion ports/nrf/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ static nrf_spim_frequency_t baudrate_to_spim_frequency(const uint32_t baudrate)
return 0;
}

void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso) {
void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso, bool half_duplex) {

if (half_duplex) {
mp_raise_NotImplementedError(translate("Half duplex SPI is not implemented"));
}

// Find a free instance, with most desirable (highest freq and not shared) allocated first.
self->spim_peripheral = NULL;
for (size_t i = 0; i < MP_ARRAY_SIZE(spim_peripherals); i++) {
Expand Down
Loading

0 comments on commit da035fe

Please sign in to comment.