-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example: ESP32, Pico W, Linux moved to their own folders
- Loading branch information
1 parent
105d397
commit 9578c3f
Showing
24 changed files
with
883 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Examples | ||
|
||
These examples use the "raw" API. These are **NOT** the Arduino Examples. | ||
|
||
Each folder has a `README.md` with install / compile / flash instructions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# The following lines of boilerplate have to be in your project's CMakeLists | ||
# in this exact order for cmake to work correctly | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
set(EXTRA_COMPONENT_DIRS ../../src/components) | ||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(bluepad32-libusb-app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Bluepad32 for ESP32 | ||
|
||
Supports the different ESP32 chips: | ||
|
||
* ESP32 | ||
* ESP32-S3 | ||
* ESP32-C3 | ||
|
||
## Install dependencies | ||
|
||
1. Install ESP-IDF | ||
|
||
Install the ESP32 toolchain. Use version **4.4** or **5.1**. Might work on newer / older | ||
ones, but not tested. | ||
|
||
* <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/> | ||
|
||
2. Integrate BTstack into ESP32 | ||
|
||
```sh | ||
cd ${BLUEPAD32}/external/btstack/port/esp32 | ||
# This will install BTstack as a component inside Bluepad32 source code (recommended). | ||
# Remove "IDF_PATH=../../../../src" if you want it installed in the ESP-IDF folder | ||
IDF_PATH=../../../../src ./integrate_btstack.py | ||
``` | ||
|
||
3. Compile Bluepad32 | ||
|
||
```sh | ||
# Possible options: esp32, esp32-s3 or esp32-c3 | ||
idf.py set-target esp32 | ||
``` | ||
|
||
And compile it: | ||
|
||
```sh | ||
idf.py build | ||
``` | ||
|
||
4. Flash it | ||
|
||
```sh | ||
idf.py flash monitor | ||
``` | ||
|
||
## License | ||
|
||
- Example code: licensed under Public Domain. | ||
- Bluepad32: licensed under Apache 2. | ||
- BTstack: | ||
- Free to use for open source projects. | ||
- Paid for commercial projects. | ||
- <https://github.com/bluekitchen/btstack/blob/master/LICENSE> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set(srcs "main.c" "my_platform.c") | ||
|
||
set(requires "bluepad32" "btstack") | ||
|
||
idf_component_register(SRCS "${srcs}" | ||
INCLUDE_DIRS "." | ||
REQUIRES "${requires}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Example file - Public Domain | ||
// Need help? https://tinyurl.com/bluepad32-help | ||
|
||
#include <stdlib.h> | ||
|
||
#include <btstack_port_esp32.h> | ||
#include <btstack_run_loop.h> | ||
|
||
#include "sdkconfig.h" | ||
#include "uni_main.h" | ||
#include "uni_platform.h" | ||
|
||
// Sanity check | ||
#ifndef CONFIG_BLUEPAD32_PLATFORM_CUSTOM | ||
#error "Must use BLUEPAD32_PLATFORM_CUSTOM" | ||
#endif | ||
|
||
// Defined in my_platform.c | ||
struct uni_platform* get_my_platform(void); | ||
|
||
int app_main(void) { | ||
// hci_dump_open(NULL, HCI_DUMP_STDOUT); | ||
|
||
// Configure BTstack for ESP32 VHCI Controller | ||
btstack_init(); | ||
|
||
// hci_dump_init(hci_dump_embedded_stdout_get_instance()); | ||
|
||
#ifdef CONFIG_BLUEPAD32_PLATFORM_CUSTOM | ||
// Must be called before uni_main() | ||
uni_platform_set_custom(get_my_platform()); | ||
#endif // CONFIG_BLUEPAD32_PLATFORM_CUSTOM | ||
|
||
// Init Bluepad32. | ||
uni_main(0 /* argc */, NULL /* argv */); | ||
|
||
// Does not return. | ||
btstack_run_loop_execute(); | ||
|
||
return 0; | ||
} | ||
|
Oops, something went wrong.