diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index 44d1254629..7a31c14e7e 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -27,15 +27,15 @@ #include "supervisor/board.h" #include "mpconfigboard.h" +#include "shared-bindings/audiopwmio/PWMAudioOut.h" #include "shared-bindings/board/__init__.h" -#include "shared-bindings/displayio/FourWire.h" #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/mipi_constants.h" #include "shared-bindings/busio/SPI.h" #include "supervisor/spi_flash_api.h" -displayio_fourwire_obj_t board_display_obj; +audiopwmio_pwmaudioout_obj_t board_buzz_obj; #define DELAY 0x80 @@ -113,6 +113,11 @@ void board_init(void) { 60, // native_frames_per_second true, // backlight_on_high false); // SH1107_addressing + + board_buzz_obj.base.type = &audiopwmio_pwmaudioout_type; + common_hal_audiopwmio_pwmaudioout_construct(&board_buzz_obj, + &pin_PB08, NULL, 0x8000); + never_reset_pin_number(pin_PB08.port, pin_PB08.number); } bool board_requests_safe_mode(void) { diff --git a/ports/stm/boards/meowbit_v121/pins.c b/ports/stm/boards/meowbit_v121/pins.c index d11341145f..fd988b5919 100644 --- a/ports/stm/boards/meowbit_v121/pins.c +++ b/ports/stm/boards/meowbit_v121/pins.c @@ -1,8 +1,11 @@ #include "shared-bindings/board/__init__.h" #include "supervisor/spi_flash_api.h" +#include "shared-bindings/audiopwmio/PWMAudioOut.h" #include "shared-module/displayio/__init__.h" +extern audiopwmio_pwmaudioout_obj_t board_buzz_obj; + STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PB04) }, { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PB05) }, @@ -15,7 +18,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_DISP_RST), MP_ROM_PTR(&pin_PB10) }, { MP_ROM_QSTR(MP_QSTR_DISP_BL), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_BUZZ), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_BUZZ), MP_ROM_PTR(&board_buzz_obj) }, { MP_ROM_QSTR(MP_QSTR_BTNA), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_BTNB), MP_ROM_PTR(&pin_PC03) }, { MP_ROM_QSTR(MP_QSTR_RIGHT), MP_ROM_PTR(&pin_PB02) },