mimxrt/cyw43_configport: Update cyw43 config to use new BTHCI UART.

Update the cyw43 configuration to use the new BTHCI UART backend provided
by cyw43-driver.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader
2025-03-03 17:46:56 +01:00
committed by Damien George
parent 399c10dc28
commit 3bbed952fd
2 changed files with 25 additions and 1 deletions

View File

@@ -280,7 +280,6 @@ endif
ifeq ($(MICROPY_PY_BLUETOOTH),1)
SRC_C += mpbthciport.c
DRIVERS_SRC_C += drivers/cyw43/cywbt.c
endif # MICROPY_PY_BLUETOOTH
ifeq ($(MICROPY_BLUETOOTH_NIMBLE),1)

View File

@@ -32,10 +32,12 @@
#include "py/mperrno.h"
#include "py/mphal.h"
#include "extmod/modnetwork.h"
#include "extmod/mpbthci.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)
@@ -47,6 +49,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)
@@ -75,6 +89,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
@@ -88,9 +103,19 @@
#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_delay_us mp_hal_delay_us
#define cyw43_delay_ms mp_hal_delay_ms
#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 MICROPY_HW_WL_REG_ON
#define CYW43_PIN_WL_HOST_WAKE MICROPY_HW_WL_HOST_WAKE
#define CYW43_PIN_WL_SDIO_1 MICROPY_HW_SDIO_D1