|
67 | 67 | #include "exceptionhandler.h" |
68 | 68 |
|
69 | 69 | #include "../../drv/block_device/block_device_ev3.h" |
| 70 | +#include "../../drv/bluetooth/bluetooth_btstack_control_gpio.h" |
| 71 | +#include "../../drv/bluetooth/bluetooth_btstack_uart_block_ev3.h" |
70 | 72 | #include "../../drv/button/button_gpio.h" |
71 | 73 | #include "../../drv/display/display_ev3.h" |
72 | 74 | #include "../../drv/gpio/gpio_ev3.h" |
@@ -757,6 +759,15 @@ enum { |
757 | 759 | }; |
758 | 760 | uint8_t pbdrv_ev3_bluetooth_mac_address[6]; |
759 | 761 |
|
| 762 | +static const pbdrv_gpio_t bluetooth_enable = PBDRV_GPIO_EV3_PIN(9, 27, 24, 4, 9); |
| 763 | +const pbdrv_bluetooth_btstack_control_gpio_platform_data_t pbdrv_bluetooth_btstack_control_gpio_platform_data = { |
| 764 | + .enable_gpio = bluetooth_enable, |
| 765 | +}; |
| 766 | + |
| 767 | +const pbdrv_bluetooth_btstack_uart_block_ev3_platform_data_t pbdrv_bluetooth_btstack_uart_block_ev3_platform_data = { |
| 768 | + .uart_id = UART2, |
| 769 | +}; |
| 770 | + |
760 | 771 | // Called from assembly code in startup.s. After this, the "main" function in |
761 | 772 | // lib/pbio/sys/main.c is called. That contains all calls to the driver |
762 | 773 | // initialization (low level in pbdrv, high level in pbio), and system level |
@@ -800,7 +811,7 @@ void SystemInit(void) { |
800 | 811 | const pbdrv_gpio_t bluetooth_uart_tx = PBDRV_GPIO_EV3_PIN(4, 23, 20, 1, 2); |
801 | 812 | const pbdrv_gpio_t bluetooth_uart_cts = PBDRV_GPIO_EV3_PIN(0, 31, 28, 0, 8); |
802 | 813 | const pbdrv_gpio_t bluetooth_uart_rts = PBDRV_GPIO_EV3_PIN(0, 27, 24, 0, 9); |
803 | | - const pbdrv_gpio_t bluetooth_enable = PBDRV_GPIO_EV3_PIN(9, 27, 24, 4, 9); |
| 814 | + |
804 | 815 | pbdrv_gpio_alt(&bluetooth_uart_rx, SYSCFG_PINMUX4_PINMUX4_19_16_UART2_RXD); |
805 | 816 | pbdrv_gpio_alt(&bluetooth_uart_tx, SYSCFG_PINMUX4_PINMUX4_23_20_UART2_TXD); |
806 | 817 | pbdrv_gpio_alt(&bluetooth_uart_cts, SYSCFG_PINMUX0_PINMUX0_31_28_UART2_CTS); |
|
0 commit comments