stm32/mpbtstackport: Allow chipset and secondary baudrate to be set.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2021-02-17 15:45:54 +11:00
parent 89cb2c6b80
commit 301fe805ca
2 changed files with 5 additions and 4 deletions

View File

@ -185,6 +185,7 @@ extern struct _spi_bdev_t spi_bdev2;
// Bluetooth config // Bluetooth config
#define MICROPY_HW_BLE_UART_ID (PYB_UART_6) #define MICROPY_HW_BLE_UART_ID (PYB_UART_6)
#define MICROPY_HW_BLE_UART_BAUDRATE (115200) #define MICROPY_HW_BLE_UART_BAUDRATE (115200)
#define MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY (3000000)
/******************************************************************************/ /******************************************************************************/
// Bootloader configuration // Bootloader configuration

View File

@ -58,7 +58,7 @@ uint32_t hal_time_ms(void) {
STATIC const hci_transport_config_uart_t hci_transport_config_uart = { STATIC const hci_transport_config_uart_t hci_transport_config_uart = {
HCI_TRANSPORT_CONFIG_UART, HCI_TRANSPORT_CONFIG_UART,
MICROPY_HW_BLE_UART_BAUDRATE, MICROPY_HW_BLE_UART_BAUDRATE,
3000000, MICROPY_HW_BLE_UART_BAUDRATE_SECONDARY,
0, 0,
NULL, NULL,
}; };
@ -90,9 +90,9 @@ void mp_bluetooth_btstack_port_init(void) {
const hci_transport_t *transport = hci_transport_h4_instance(&mp_bluetooth_btstack_hci_uart_block); const hci_transport_t *transport = hci_transport_h4_instance(&mp_bluetooth_btstack_hci_uart_block);
hci_init(transport, &hci_transport_config_uart); hci_init(transport, &hci_transport_config_uart);
// TODO: Probably not necessary for BCM (we have our own firmware loader in the cyw43 driver), #ifdef MICROPY_HW_BLE_BTSTACK_CHIPSET_INSTANCE
// but might be worth investigating for other controllers in the future. hci_set_chipset(MICROPY_HW_BLE_BTSTACK_CHIPSET_INSTANCE);
// hci_set_chipset(btstack_chipset_bcm_instance()); #endif
} }
void mp_bluetooth_btstack_port_deinit(void) { void mp_bluetooth_btstack_port_deinit(void) {