Skip to content

Commit 22ed0ab

Browse files
committed
spresens: configure pin mode for i2c and spi
1 parent 3cbff45 commit 22ed0ab

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <arch/chip/pin.h>
2828
#include <nuttx/i2c/i2c_master.h>
2929
#include <cxd56_i2c.h>
30+
#include <cxd56_pinconfig.h>
3031

3132
#include "py/runtime.h"
3233

@@ -49,6 +50,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *
4950
self->sda_pin = sda;
5051
self->frequency = frequency;
5152
self->i2c_dev = cxd56_i2cbus_initialize(0);
53+
CXD56_PIN_CONFIGS(PINCONFS_I2C0);
5254
}
5355

5456
void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) {

ports/cxd56/common-hal/busio/SPI.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <arch/chip/pin.h>
2828
#include <cxd56_spi.h>
29+
#include <cxd56_pinconfig.h>
2930

3031
#include "py/runtime.h"
3132

@@ -39,10 +40,12 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *
3940
(mosi == NULL || mosi->number == PIN_SPI4_MOSI) &&
4041
(miso == NULL || miso->number == PIN_SPI4_MISO)) {
4142
port = 4;
43+
CXD56_PIN_CONFIGS(PINCONFS_SPI4);
4244
} else if (clock->number == PIN_EMMC_CLK &&
4345
(mosi == NULL || mosi->number == PIN_EMMC_DATA0) &&
4446
(miso == NULL || miso->number == PIN_EMMC_DATA1)) {
4547
port = 5;
48+
CXD56_PIN_CONFIGS(PINCONFS_EMMCA_SPI5);
4649
}
4750

4851
if (port < 0) {

0 commit comments

Comments
 (0)