summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/stm32/Makefile1
-rw-r--r--ports/stm32/boards/PYBD_SF2/f722_qspi.ld2
-rw-r--r--ports/stm32/cyw43_configport.h27
3 files changed, 28 insertions, 2 deletions
diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile
index c938dcbda..8ac9a8af0 100644
--- a/ports/stm32/Makefile
+++ b/ports/stm32/Makefile
@@ -432,7 +432,6 @@ endif
ifeq ($(MICROPY_PY_BLUETOOTH),1)
SRC_C += mpbthciport.c
-DRIVERS_SRC_C += drivers/cyw43/cywbt.c
ifeq ($(MICROPY_BLUETOOTH_NIMBLE),1)
SRC_C += mpnimbleport.c
diff --git a/ports/stm32/boards/PYBD_SF2/f722_qspi.ld b/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
index f5e676983..354c1919b 100644
--- a/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
+++ b/ports/stm32/boards/PYBD_SF2/f722_qspi.ld
@@ -54,7 +54,7 @@ SECTIONS
*lib/mbedtls/*(.text* .rodata*)
*lib/mynewt-nimble/*(.text* .rodata*)
*lib/cyw43-driver/*(.rodata.w4343*_combined)
- *drivers/cyw43/*(.rodata.cyw43_btfw_*)
+ *lib/cyw43-driver/*(.rodata.cyw43_btfw_*)
. = ALIGN(4);
} >FLASH_EXT
}
diff --git a/ports/stm32/cyw43_configport.h b/ports/stm32/cyw43_configport.h
index 595051180..c26c55476 100644
--- a/ports/stm32/cyw43_configport.h
+++ b/ports/stm32/cyw43_configport.h
@@ -32,11 +32,13 @@
#include "py/mperrno.h"
#include "py/mphal.h"
#include "extmod/modnetwork.h"
+#include "extmod/mpbthci.h"
#include "extint.h"
#include "pendsv.h"
#include "sdio.h"
#define CYW43_USE_SPI (0)
+#define CYW43_ENABLE_BLUETOOTH_OVER_UART (1)
#define CYW43_LWIP (1)
#define CYW43_USE_STATS (0)
@@ -48,6 +50,18 @@
#define CYW43_WIFI_NVRAM_INCLUDE_FILE "lib/cyw43-driver/firmware/wifi_nvram_1dx.h"
#endif
+#ifndef CYW43_BT_FIRMWARE_INCLUDE_FILE
+#define CYW43_BT_FIRMWARE_INCLUDE_FILE "lib/cyw43-driver/firmware/cyw43_btfw_4343A1.h"
+#endif
+
+#ifdef MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY
+#define CYW43_BT_UART_BAUDRATE_ACTIVE_USE MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY
+#endif
+
+#ifdef MICROPY_HW_BLE_UART_BAUDRATE_DOWNLOAD_FIRMWARE
+#define CYW43_BT_UART_BAUDRATE_DOWNLOAD_FIRMWARE MICROPY_HW_BLE_UART_BAUDRATE_DOWNLOAD_FIRMWARE
+#endif
+
#define CYW43_IOCTL_TIMEOUT_US (1000000)
#define CYW43_SLEEP_MAX (50)
#define CYW43_NETUTILS (1)
@@ -66,6 +80,7 @@
#define CYW43_SDPCM_SEND_COMMON_WAIT __WFI();
#define CYW43_DO_IOCTL_WAIT __WFI();
+#define CYW43_HAL_UART_READCHAR_BLOCKING_WAIT __WFI()
#define CYW43_ARRAY_SIZE(a) MP_ARRAY_SIZE(a)
@@ -76,6 +91,7 @@
#define CYW43_HAL_PIN_PULL_DOWN MP_HAL_PIN_PULL_DOWN
#define CYW43_HAL_MAC_WLAN0 MP_HAL_MAC_WLAN0
+#define CYW43_HAL_MAC_BDADDR MP_HAL_MAC_BDADDR
#define cyw43_hal_ticks_us mp_hal_ticks_us
#define cyw43_hal_ticks_ms mp_hal_ticks_ms
@@ -90,6 +106,16 @@
#define cyw43_hal_get_mac_ascii mp_hal_get_mac_ascii
#define cyw43_hal_generate_laa_mac mp_hal_generate_laa_mac
+#define cyw43_hal_uart_set_baudrate mp_bluetooth_hci_uart_set_baudrate
+#define cyw43_hal_uart_write mp_bluetooth_hci_uart_write
+#define cyw43_hal_uart_readchar mp_bluetooth_hci_uart_readchar
+
+#define cyw43_bluetooth_controller_init mp_bluetooth_hci_controller_init
+#define cyw43_bluetooth_controller_deinit mp_bluetooth_hci_controller_deinit
+#define cyw43_bluetooth_controller_woken mp_bluetooth_hci_controller_woken
+#define cyw43_bluetooth_controller_wakeup mp_bluetooth_hci_controller_wakeup
+#define cyw43_bluetooth_controller_sleep_maybe mp_bluetooth_hci_controller_sleep_maybe
+
#define CYW43_PIN_WL_REG_ON pyb_pin_WL_REG_ON
#define CYW43_PIN_WL_HOST_WAKE pyb_pin_WL_HOST_WAKE
#define CYW43_PIN_WL_SDIO_1 pyb_pin_WL_SDIO_1
@@ -103,6 +129,7 @@
#if MICROPY_HW_ENABLE_RF_SWITCH
#define CYW43_PIN_RFSW_VDD pyb_pin_WL_RFSW_VDD
+#define CYW43_PIN_RFSW_SELECT pyb_pin_WL_GPIO_1
#endif
#define cyw43_schedule_internal_poll_dispatch(func) pendsv_schedule_dispatch(PENDSV_DISPATCH_CYW43, func)