main.c (c41e99220ec957db1b4a31a6bd5900185fcee9f8) main.c (63ff2b1e64a6f7fe8fbdd0ac1abfc703a433f88e)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68#include "hci_dump.h"
69#include "btstack_stdin.h"
70#include "btstack_tlv_posix.h"
71
72#include "btstack_chipset_bcm.h"
73#include "btstack_chipset_bcm_download_firmware.h"
74#include "btstack_control_raspi.h"
75
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 59 unchanged lines hidden (view full) ---

68#include "hci_dump.h"
69#include "btstack_stdin.h"
70#include "btstack_tlv_posix.h"
71
72#include "btstack_chipset_bcm.h"
73#include "btstack_chipset_bcm_download_firmware.h"
74#include "btstack_control_raspi.h"
75
76#include "raspi_get_model.h"
77
76int btstack_main(int argc, const char * argv[]);
77
78typedef enum {
79 UART_INVALID,
80 UART_SOFTWARE_NO_FLOW,
81 UART_HARDWARE_NO_FLOW,
82 UART_HARDWARE_FLOW
83} uart_type_t;

--- 233 unchanged lines hidden (view full) ---

317 case UART_HARDWARE_NO_FLOW:
318 // Raspberry Pi 3 A
319 // Raspberry Pi 3 B
320 bt_reg_en_pin = 128;
321 transport_config.baudrate_main = 921600;
322 transport_config.flowcontrol = 0;
323 break;
324 case UART_HARDWARE_FLOW:
78int btstack_main(int argc, const char * argv[]);
79
80typedef enum {
81 UART_INVALID,
82 UART_SOFTWARE_NO_FLOW,
83 UART_HARDWARE_NO_FLOW,
84 UART_HARDWARE_FLOW
85} uart_type_t;

--- 233 unchanged lines hidden (view full) ---

319 case UART_HARDWARE_NO_FLOW:
320 // Raspberry Pi 3 A
321 // Raspberry Pi 3 B
322 bt_reg_en_pin = 128;
323 transport_config.baudrate_main = 921600;
324 transport_config.flowcontrol = 0;
325 break;
326 case UART_HARDWARE_FLOW:
325 // Raspberry Pi Zero W
327 // Raspberry Pi Zero W gpio 45
326 // Raspberry Pi 3A+ vgpio 129 but WLAN + BL
327 // Raspberry Pi 3B+ vgpio 129 but WLAN + BL
328 // Raspberry Pi 3A+ vgpio 129 but WLAN + BL
329 // Raspberry Pi 3B+ vgpio 129 but WLAN + BL
328 bt_reg_en_pin = 45;
329 transport_config.baudrate_main = 921600;
330 transport_config.flowcontrol = 1;
330 transport_config.baudrate_main = 3000000;
331 transport_config.flowcontrol = 1;
332
333 // 3 mbps does not work on Zero W (investigation pending)
334 if (raspi_get_model() == MODEL_ZERO_W){
335 transport_config.baudrate_main = 921600;
336 }
331 break;
332 }
333 printf("%s, %u, BT_REG_EN at GPIO %u\n", transport_config.flowcontrol ? "H4":"H5", transport_config.baudrate_main, bt_reg_en_pin);
334
335 // get BCM chipset driver
336 const btstack_chipset_t * chipset = btstack_chipset_bcm_instance();
337 chipset->init(&transport_config);
338

--- 84 unchanged lines hidden ---
337 break;
338 }
339 printf("%s, %u, BT_REG_EN at GPIO %u\n", transport_config.flowcontrol ? "H4":"H5", transport_config.baudrate_main, bt_reg_en_pin);
340
341 // get BCM chipset driver
342 const btstack_chipset_t * chipset = btstack_chipset_bcm_instance();
343 chipset->init(&transport_config);
344

--- 84 unchanged lines hidden ---