Skip to content

Commit f67d279

Browse files
authored
Merge pull request micropython#7116 from kattni/pico-stemma-i2c
Add STEMMA_I2C() object to Picos for Cowbells.
2 parents edce717 + 5ea8b75 commit f67d279

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico"
22
#define MICROPY_HW_MCU_NAME "rp2040"
3+
4+
#define CIRCUITPY_BOARD_I2C (1)
5+
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}}

ports/raspberrypi/boards/raspberry_pi_pico/pins.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
5050

5151
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) },
5252
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) },
53+
54+
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },
5355
};
5456
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

ports/raspberrypi/boards/raspberry_pi_pico_w/mpconfigboard.h

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

44
#define CIRCUITPY_DIGITALIO_HAVE_INVALID_PULL (1)
55
#define CIRCUITPY_DIGITALIO_HAVE_INVALID_DRIVE_MODE (1)
6+
7+
#define CIRCUITPY_BOARD_I2C (1)
8+
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO5, .sda = &pin_GPIO4}}

ports/raspberrypi/boards/raspberry_pi_pico_w/pins.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4444
{ MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) },
4545
{ MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) },
4646
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) },
47+
48+
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },
4749
};
4850
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)