README.md 3.23 KB
Newer Older
Ricardo Quesada's avatar
Ricardo Quesada committed
1 2 3 4 5 6 7 8 9 10
# Bluepad32

![logo](https://lh3.googleusercontent.com/pw/ACtC-3dNNrE9YKWMQNBTVYl8gkX70jN2qLwSYMQFLR0IzzoRT9uTQ1a9n80O3tyNmF95MLxL9NPWlqm5ph7e9wTGZoHeQWPMsJWqs3qiHub1LcigLtlEX09V6f1DWwQlg52OkeumKDJTG_ext8EN_J6kn0kAqg=-no)

A bluetooth gamepad "host" for the ESP32.

Modern Bluetooth gamepads, like the Xbox One and DS4, can connect to the ESP32.
What you do with the ESP32, is up to you. But here are some examples:

* Use gamepads to play games in the Commodore 64 ([Unijoysticle2][unijoysticle2])
11 12 13 14 15
* Or play games in Commodore Amiga ([Unijoysticle2 for the Amiga][amiga])
* Or play games in [MatrixPortal M4][matrixportal] (or any AirLift board)
* Or play games in a FPGA console ([ULX3S][ulx3s])
* Or control your LED lamp
* Or control your remote car
Ricardo Quesada's avatar
Ricardo Quesada committed
16 17 18
* And so on

[unijoysticle2]: https://retro.moe/unijoysticle2/
19
[amiga]: https://gitlab.com/SukkoPera/unijoysticle2
Ricardo Quesada's avatar
Ricardo Quesada committed
20
[ulx3s]: https://www.crowdsupply.com/radiona/ulx3s
21
[matrixportal]: https://learn.adafruit.com/adafruit-matrixportal-m4
Ricardo Quesada's avatar
Ricardo Quesada committed
22

23 24 25 26 27 28 29
## Features

* Supports most, if not all, modern Bluetooth gamepads (see below)
* Fast (very low latency)
* Small footprint
* Uses only one core (CPU0). The remaining one is free to use.
* C99 based
30
* Open Source (see below)
31

Ricardo Quesada's avatar
Ricardo Quesada committed
32 33
## Supported controllers

34 35
![Supported gamepads](https://lh3.googleusercontent.com/pw/ACtC-3cg22O7VPT8NwXIATr2rsgs-rn2kShZeiUbArIK-2lIkskCLI6q06nRtK9been8Hom49dOacwHD8bVT2Tc8YKsxd5w73W25lhOvlRk6Xf9RVXgB5AZcmdl2PoWhrEAZUbmBl1pS6HrtMuZYI506US7YuA=-no)

36 37 38
* Sony DualSense (PS5)
* Sony DUALSHOCK 4 (PS4)
* Sony DUALSHOCK 3 (PS3)
39 40 41 42 43 44 45 46 47
* Xbox One S
* Nintendo Switch Pro
* Nintendo Wii U
* Nintendo Wii
* Android gamepads
* PC/Window gamepads
* 8BitDo
* iCade
* And more
Ricardo Quesada's avatar
Ricardo Quesada committed
48 49 50 51 52

See: [Supported gamepads][gamepads]

[gamepads]: https://gitlab.com/ricardoquesada/bluepad32/blob/master/docs/supported_gamepads.md

Ricardo Quesada's avatar
Ricardo Quesada committed
53 54 55 56
## How to compile it

1. Install ESP-IDF

Ricardo Quesada's avatar
Ricardo Quesada committed
57 58
Install the ESP32 toolchain. Use version **4.1**. Might work on newer / older
ones, but not tested.
Ricardo Quesada's avatar
Ricardo Quesada committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72

* https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/

2. Clone repo

```
$ git clone https://gitlab.com/ricardoquesada/bluepad32.git
$ cd bluepad32
$ git submodule update --init
```

3. Integrate BTStack into ESP32

```
73
$ cd ${BLUEPAD32}/external/btstack/port/esp32
Ricardo Quesada's avatar
Ricardo Quesada committed
74 75 76 77 78
$ ./integrate_btstack.py
```

4. Compile Bluepad32

Ricardo Quesada's avatar
Ricardo Quesada committed
79 80
Choose target platform:

Ricardo Quesada's avatar
Ricardo Quesada committed
81
```
82
# Choose target platform: unijoysticle, airlift, etc...
83
$ export PLATFORM=unijoysticle
Ricardo Quesada's avatar
Ricardo Quesada committed
84
```
85

Ricardo Quesada's avatar
Ricardo Quesada committed
86 87 88
And compile it:

```
Ricardo Quesada's avatar
Ricardo Quesada committed
89 90 91 92 93 94 95 96 97 98 99
$ cd ${BLUEPAD32}/src
$ make -j
```

5. Flash it

```
$ cd ${BLUEPAD32}/src
$ make flash monitor
```

Ricardo Quesada's avatar
Ricardo Quesada committed
100 101
## Support

102
* [Documentation][docs]
103 104
* [Discord][discord]
* [Google groups][forum]
Ricardo Quesada's avatar
Ricardo Quesada committed
105

106
[docs]: https://gitlab.com/ricardoquesada/bluepad32/-/tree/master/docs
Ricardo Quesada's avatar
Ricardo Quesada committed
107
[discord]: https://discord.gg/r5aMn6Cw5q
Ricardo Quesada's avatar
Ricardo Quesada committed
108
[forum]: https://groups.google.com/forum/#!forum/unijoysticle
109 110 111

## License

112
Bluepad32 is open source, [licensed under Apache 2][apache2].
113

114
However Bluepad32 depends on the great [BTStack library][btstack-github]. Which is free to use for
115
open source projects. But commercial for closed-source projects.
116
[Contact them for details][btstack-homepage]. They are very friendly + helpful
117 118
(I’m not affiliated with them).

119 120
[btstack-github]: https://github.com/bluekitchen/btstack
[apache2]: https://www.apache.org/licenses/LICENSE-2.0
121
[btstack-homepage]: https://bluekitchen-gmbh.com/