8000 waveshare_esp32_s3_geek: don't init the wrong board SPI for the display by Neradoc · Pull Request #10162 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

waveshare_esp32_s3_geek: don't init the wrong board SPI for the display #10162

New issue

Have a ques 8000 tion about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2f4cd74
Use MICROPY_HW_MCU_NAME for sysname and nodename for all ports.
eightycc Mar 18, 2025
9b3731c
Remove watchdog.deinit() for 10.0.0.
eightycc Mar 19, 2025
68561fc
Merge pull request #10144 from eightycc/issue-7722
tannewt Mar 19, 2025
8afdccc
check if pins exist before using
FoamyGuy Mar 19, 2025
7c0fa46
Suspected typo: last "S" in "STM32F412xGS"
page200 Mar 19, 2025
8ef2168
Merge pull request #10150 from page200/patch-1
dhalbert Mar 19, 2025
df33271
CIRCUITPY_FULL_BUILD now controls a few more features
dhalbert Mar 20, 2025
214c2f6
Factor common_hal_os_uname into os_uname() and remove common_hal_os_u…
eightycc Mar 20, 2025
e40b1f5
Merge pull request #10145 from eightycc/issue-9686
tannewt Mar 20, 2025
429efe8
Merge pull request #10148 from FoamyGuy/usb_deviceinfo_fix
tannewt Mar 20, 2025
a0b482c
Merge pull request #10152 from dhalbert/use-full-build-for-some-features
tannewt Mar 20, 2025
1f0b234
Remove watchdog.deinit() for 10.0.0.
eightycc Mar 19, 2025
20e584f
Suspected typo: last "S" in "STM32F412xGS"
page200 Mar 19, 2025
47eeb93
Use MICROPY_HW_MCU_NAME for sysname and nodename for all ports.
eightycc Mar 18, 2025
b7aa2cc
Factor common_hal_os_uname into os_uname() and remove common_hal_os_u…
eightycc Mar 20, 2025
153d7c7
check if pins exist before using
FoamyGuy Mar 19, 2025
e2c5cbc
CIRCUITPY_FULL_BUILD now controls a few more features
dhalbert Mar 20, 2025
0f31506
waveshare_esp32_s3_geek: fix SPI busses and board_init()
Neradoc Mar 22, 2025
01247cc
Merge branch 'adafruit:main' into fix-waveshare_esp32_s3_geek
Neradoc Mar 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions ports/analog/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,6 @@

// #include "peripherals/periph.h"

static const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
};
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "max32");
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "max32");

static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);

static MP_DEFINE_ATTRTUPLE(
os_uname_info_obj,
os_uname_info_fields,
5,
(mp_obj_t)&os_uname_info_sysname_obj,
(mp_obj_t)&os_uname_info_nodename_obj,
(mp_obj_t)&os_uname_info_release_obj,
(mp_obj_t)&os_uname_info_version_obj,
(mp_obj_t)&os_uname_info_machine_obj
);

mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}

bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) {
#if (HAS_TRNG)
// todo (low prior): implement
Expand Down
3 changes: 0 additions & 3 deletions ports/analog/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

#include <stdint.h>

#define MICROPY_PY_FUNCTION_ATTRS (1)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)

// 24KiB stack
#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000

Expand Down
32 changes: 0 additions & 32 deletions ports/atmel-samd/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,6 @@
#include "hal/include/hal_rand_sync.h"
#endif

static const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
};
#ifdef SAMD21
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd21");
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd21");
#endif
#ifdef SAM_D5X_E5X
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "samd51");
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "samd51");
#endif
static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);


static MP_DEFINE_ATTRTUPLE(
os_uname_info_obj,
os_uname_info_fields,
5,
(mp_obj_t)&os_uname_info_sysname_obj,
(mp_obj_t)&os_uname_info_nodename_obj,
(mp_obj_t)&os_uname_info_release_obj,
(mp_obj_t)&os_uname_info_version_obj,
(mp_obj_t)&os_uname_info_machine_obj
);

mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}

bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) {
#ifdef SAM_D5X_E5X
hri_mclk_set_APBCMASK_TRNG_bit(MCLK);
Expand Down
3 changes: 1 addition & 2 deletions ports/atmel-samd/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@
#define MICROPY_PY_SYS_PLATFORM "MicroChip SAME54"
#endif
#define SPI_FLASH_MAX_BAUDRATE 24000000
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
#define MICROPY_PY_FUNCTION_ATTRS (1)

// MICROPY_PY_ERRNO_LIST - Use the default

#endif // SAM_D5X_E5X
Expand Down
27 changes: 0 additions & 27 deletions ports/broadcom/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,6 @@
#include "py/objtuple.h"
#include "py/qstr.h"

static const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
};

static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, MICROPY_HW_MCU_NAME);
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, MICROPY_HW_MCU_NAME);
static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);


static MP_DEFINE_ATTRTUPLE(
os_uname_info_obj,
os_uname_info_fields,
5,
(mp_obj_t)&os_uname_info_sysname_obj,
(mp_obj_t)&os_uname_info_nodename_obj,
(mp_obj_t)&os_uname_info_release_obj,
(mp_obj_t)&os_uname_info_version_obj,
(mp_obj_t)&os_uname_info_machine_obj
);

mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}

bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) {
return false;
}
4 changes: 1 addition & 3 deletions ports/broadcom/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

#define CIRCUITPY_MCU_FAMILY broadcom
#define MICROPY_PY_SYS_PLATFORM "BROADCOM"
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
#define MICROPY_PY_FUNCTION_ATTRS (1)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)

#if BCM_VERSION == 2837 || BCM_VERSION == 2711
#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_A)
#elif BCM_VERSION == 2835
Expand Down
2 changes: 0 additions & 2 deletions ports/cxd56/boards/spresense/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@

#define DEFAULT_UART_BUS_RX (&pin_UART2_RXD)
#define DEFAULT_UART_BUS_TX (&pin_UART2_TXD)

#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)
26 changes: 0 additions & 26 deletions ports/cxd56/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,6 @@
#include "py/objstr.h"
#include "py/objtuple.h"

static const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
};

static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "spresense");
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "spresense");
static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);

static MP_DEFINE_ATTRTUPLE(
os_uname_info_obj,
os_uname_info_fields,
5,
(mp_obj_t)&os_uname_info_sysname_obj,
(mp_obj_t)&os_uname_info_nodename_obj,
(mp_obj_t)&os_uname_info_release_obj,
(mp_obj_t)&os_uname_info_version_obj,
(mp_obj_t)&os_uname_info_machine_obj
);

mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}

bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) {
uint32_t i = 0;

Expand Down
3 changes: 0 additions & 3 deletions ports/cxd56/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

#define MICROPY_PY_SYS_PLATFORM "CXD56"

#define MICROPY_PY_FUNCTION_ATTRS (1)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)

// 64kiB stack
#define CIRCUITPY_DEFAULT_STACK_SIZE (0x10000)

Expand Down
9 changes: 0 additions & 9 deletions ports/espressif/boards/waveshare_esp32_s3_geek/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,9 @@ uint8_t display_init_sequence[] = {
};

static void display_init(void) {

busio_spi_obj_t *spi = common_hal_board_create_spi(0);
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;

common_hal_busio_spi_construct(
spi,
&pin_GPIO12, // CLK
&pin_GPIO11, // MOSI
NULL, // MISO not connected
false); // Not half-duplex


bus->base.type = &fourwire_fourwire_type;

common_hal_fourwire_fourwire_construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO17)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO16)

#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35)
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37)
#define CIRCUITPY_BOARD_SPI (2)
#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO12, .mosi = &pin_GPIO11}, \
{.clock = &pin_GPIO36, .mosi = &pin_GPIO35, .miso = &pin_GPIO37}}
15 changes: 9 additions & 6 deletions ports/espressif/boards/waveshare_esp32_s3_geek/pins.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
F438 // SPDX-License-Identifier: MIT

#include "shared-bindings/board/__init__.h"

#include "shared-module/displayio/__init__.h"

CIRCUITPY_BOARD_BUS_SINGLETON(sd_spi, spi, 1)

static const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS

Expand Down Expand Up @@ -64,11 +66,11 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },

// SD Card
{ MP_ROM_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_GPIO36)},
{ MP_ROM_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_GPIO35)},
{ MP_ROM_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_GPIO37)},
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO34)},
{ MP_ROM_QSTR(MP_QSTR_SD_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_GPIO37) },
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_SD_SPI), MP_ROM_PTR(&board_sd_spi_obj) },
// Pin 38 is for the SDIO interface, and therefore not included in the SPI object

// LCD
Expand All @@ -78,6 +80,7 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_LCD_BACKLIGHT), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_LCD_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) },

};
Expand Down
26 changes: 0 additions & 26 deletions ports/espressif/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,6 @@
#include "esp_system.h"
#include "esp_random.h"

static const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
};
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, MICROPY_HW_MCU_NAME);
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, MICROPY_HW_MCU_NAME);
static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);


static MP_DEFINE_ATTRTUPLE(
os_uname_info_obj,
os_uname_info_fields,
5,
(mp_obj_t)&os_uname_info_sysname_obj,
(mp_obj_t)&os_uname_info_nodename_obj,
(mp_obj_t)&os_uname_info_release_obj,
(mp_obj_t)&os_uname_info_version_obj,
(mp_obj_t)&os_uname_info_machine_obj
);

mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}

bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) {
uint32_t i = 0;
while (i < length) {
Expand Down
3 changes: 0 additions & 3 deletions ports/espressif/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

#define CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY (1)

#define MICROPY_PY_FUNCTION_ATTRS (1)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)

#include "py/circuitpy_mpconfig.h"

#define MICROPY_NLR_SETJMP (1)
Expand Down
26 changes: 0 additions & 26 deletions ports/litex/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,6 @@

#include "shared-bindings/os/__init__.h"

static const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
};
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "litex");
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "litex");
static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);


static MP_DEFINE_ATTRTUPLE(
os_uname_info_obj,
os_uname_info_fields,
5,
(mp_obj_t)&os_uname_info_sysname_obj,
(mp_obj_t)&os_uname_info_nodename_obj,
(mp_obj_t)&os_uname_info_release_obj,
(mp_obj_t)&os_uname_info_version_obj,
(mp_obj_t)&os_uname_info_machine_obj
);

mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}

bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) {
return false;
}
2 changes: 0 additions & 2 deletions ports/litex/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#define CIRCUITPY_INTERNAL_NVM_SIZE (0)
#define MICROPY_NLR_THUMB (0)
#define MICROPY_PY_FUNCTION_ATTRS (1)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)

#include "py/circuitpy_mpconfig.h"

Expand Down
25 changes: 0 additions & 25 deletions ports/mimxrt10xx/common-hal/os/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,6 @@
#include "sdk/drivers/trng/fsl_trng.h"
#endif

static const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
};
static const MP_DEFINE_STR_OBJ(os_uname_info_sysname_obj, "mimxrt10xx");
static const MP_DEFINE_STR_OBJ(os_uname_info_nodename_obj, "mimxrt10xx");
static const MP_DEFINE_STR_OBJ(os_uname_info_release_obj, MICROPY_VERSION_STRING);
static const MP_DEFINE_STR_OBJ(os_uname_info_version_obj, MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE);
static const MP_DEFINE_STR_OBJ(os_uname_info_machine_obj, MICROPY_HW_BOARD_NAME " with " MICROPY_HW_MCU_NAME);

static MP_DEFINE_ATTRTUPLE(
os_uname_info_obj,
os_uname_info_fields,
5,
(mp_obj_t)&os_uname_info_sysname_obj,
(mp_obj_t)&os_uname_info_nodename_obj,
(mp_obj_t)&os_uname_info_release_obj,
(mp_obj_t)&os_uname_info_version_obj,
(mp_obj_t)&os_uname_info_machine_obj
);

mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}

bool common_hal_os_urandom(uint8_t *buffer, mp_uint_t length) {
#if CIRCUITPY_RANDOM
trng_config_t trngConfig;
Expand Down
4 changes: 0 additions & 4 deletions ports/mimxrt10xx/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ extern uint8_t _ld_filesystem_end;
extern uint8_t _ld_default_stack_size;

#define CIRCUITPY_DEFAULT_STACK_SIZE ((uint32_t)&_ld_default_stack_size)
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0)
#define MICROPY_PY_FUNCTION_ATTRS (0)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)


#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR ((uint32_t)&_ld_filesystem_start)
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE ((uint32_t)(&_ld_filesystem_end - &_ld_filesystem_start))
Expand Down
Loading
Loading
0