Skip to content

Commit eda5b24

Browse files
committed
ports/stm32/cyw43_configport: Update CYW43 config.
Update the CYW43 to work with the new CYW43 BTHCI UART backend. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent 3f79c19 commit eda5b24

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

ports/stm32/cyw43_configport.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@
3535
#include "extint.h"
3636
#include "pendsv.h"
3737
#include "sdio.h"
38+
#include "extmod/mpbthci.h"
3839

3940
#define CYW43_USE_SPI (0)
4041
#define CYW43_LWIP (1)
4142
#define CYW43_USE_STATS (0)
43+
#define CYW43_ENABLE_BLUETOOTH_OVER_UART (1)
4244

4345
#ifndef CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE
4446
#define CYW43_CHIPSET_FIRMWARE_INCLUDE_FILE "lib/cyw43-driver/firmware/w4343WA1_7_45_98_50_combined.h"
@@ -48,6 +50,18 @@
4850
#define CYW43_WIFI_NVRAM_INCLUDE_FILE "lib/cyw43-driver/firmware/wifi_nvram_1dx.h"
4951
#endif
5052

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

7892
#define CYW43_HAL_MAC_WLAN0 MP_HAL_MAC_WLAN0
93+
#define CYW43_HAL_MAC_BDADDR MP_HAL_MAC_BDADDR
7994

8095
#define cyw43_hal_ticks_us mp_hal_ticks_us
8196
#define cyw43_hal_ticks_ms mp_hal_ticks_ms
@@ -90,6 +105,17 @@
90105
#define cyw43_hal_get_mac_ascii mp_hal_get_mac_ascii
91106
#define cyw43_hal_generate_laa_mac mp_hal_generate_laa_mac
92107

108+
#define cyw43_hal_uart_set_baudrate mp_bluetooth_hci_uart_set_baudrate
109+
#define cyw43_hal_uart_write mp_bluetooth_hci_uart_write
110+
#define cyw43_hal_uart_readchar mp_bluetooth_hci_uart_readchar
111+
#define CYW43_HAL_UART_READCHAR_BLOCKING_WAIT __WFI()
112+
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+
93119
#define CYW43_PIN_WL_REG_ON pyb_pin_WL_REG_ON
94120
#define CYW43_PIN_WL_HOST_WAKE pyb_pin_WL_HOST_WAKE
95121
#define CYW43_PIN_WL_SDIO_1 pyb_pin_WL_SDIO_1
@@ -104,6 +130,7 @@
104130
#if MICROPY_HW_ENABLE_RF_SWITCH
105131
#define CYW43_PIN_RFSW_VDD pyb_pin_WL_RFSW_VDD
106132
#endif
133+
#define CYW43_PIN_RFSW_SELECT pyb_pin_WL_GPIO_1
107134

108135
#define cyw43_schedule_internal_poll_dispatch(func) pendsv_schedule_dispatch(PENDSV_DISPATCH_CYW43, func)
109136

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy