Skip to content

Commit 3bbed95

Browse files
iabdalkaderdpgeorge
authored andcommitted
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 <[email protected]>
1 parent 399c10d commit 3bbed95

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

ports/mimxrt/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ endif
280280

281281
ifeq ($(MICROPY_PY_BLUETOOTH),1)
282282
SRC_C += mpbthciport.c
283-
DRIVERS_SRC_C += drivers/cyw43/cywbt.c
284283
endif # MICROPY_PY_BLUETOOTH
285284

286285
ifeq ($(MICROPY_BLUETOOTH_NIMBLE),1)

ports/mimxrt/cyw43_configport.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232
#include "py/mperrno.h"
3333
#include "py/mphal.h"
3434
#include "extmod/modnetwork.h"
35+
#include "extmod/mpbthci.h"
3536
#include "pendsv.h"
3637
#include "sdio.h"
3738

3839
#define CYW43_USE_SPI (0)
40+
#define CYW43_ENABLE_BLUETOOTH_OVER_UART (1)
3941
#define CYW43_LWIP (1)
4042
#define CYW43_USE_STATS (0)
4143

@@ -47,6 +49,18 @@
4749
#define CYW43_WIFI_NVRAM_INCLUDE_FILE "lib/cyw43-driver/firmware/wifi_nvram_1dx.h"
4850
#endif
4951

52+
#ifndef CYW43_BT_FIRMWARE_INCLUDE_FILE
53+
#define CYW43_BT_FIRMWARE_INCLUDE_FILE "lib/cyw43-driver/firmware/cyw43_btfw_4343A1.h"
54+
#endif
55+
56+
#ifdef MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY
57+
#define CYW43_BT_UART_BAUDRATE_ACTIVE_USE MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY
58+
#endif
59+
60+
#ifdef MICROPY_HW_BLE_UART_BAUDRATE_DOWNLOAD_FIRMWARE
61+
#define CYW43_BT_UART_BAUDRATE_DOWNLOAD_FIRMWARE MICROPY_HW_BLE_UART_BAUDRATE_DOWNLOAD_FIRMWARE
62+
#endif
63+
5064
#define CYW43_IOCTL_TIMEOUT_US (1000000)
5165
#define CYW43_SLEEP_MAX (50)
5266
#define CYW43_NETUTILS (1)
@@ -75,6 +89,7 @@
7589
#define CYW43_HAL_PIN_PULL_DOWN MP_HAL_PIN_PULL_DOWN
7690

7791
#define CYW43_HAL_MAC_WLAN0 MP_HAL_MAC_WLAN0
92+
#define CYW43_HAL_MAC_BDADDR MP_HAL_MAC_BDADDR
7893

7994
#define cyw43_hal_ticks_us mp_hal_ticks_us
8095
#define cyw43_hal_ticks_ms mp_hal_ticks_ms
@@ -88,9 +103,19 @@
88103
#define cyw43_hal_get_mac_ascii mp_hal_get_mac_ascii
89104
#define cyw43_hal_generate_laa_mac mp_hal_generate_laa_mac
90105

106+
#define cyw43_hal_uart_set_baudrate mp_bluetooth_hci_uart_set_baudrate
107+
#define cyw43_hal_uart_write mp_bluetooth_hci_uart_write
108+
#define cyw43_hal_uart_readchar mp_bluetooth_hci_uart_readchar
109+
91110
#define cyw43_delay_us mp_hal_delay_us
92111
#define cyw43_delay_ms mp_hal_delay_ms
93112

113+
#define cyw43_bluetooth_controller_init mp_bluetooth_hci_controller_init
114+
#define cyw43_bluetooth_controller_deinit mp_bluetooth_hci_controller_deinit
115+
#define cyw43_bluetooth_controller_woken mp_bluetooth_hci_controller_woken
116+
#define cyw43_bluetooth_controller_wakeup mp_bluetooth_hci_controller_wakeup
117+
#define cyw43_bluetooth_controller_sleep_maybe mp_bluetooth_hci_controller_sleep_maybe
118+
94119
#define CYW43_PIN_WL_REG_ON MICROPY_HW_WL_REG_ON
95120
#define CYW43_PIN_WL_HOST_WAKE MICROPY_HW_WL_HOST_WAKE
96121
#define CYW43_PIN_WL_SDIO_1 MICROPY_HW_SDIO_D1

0 commit comments

Comments
 (0)