Heerkog / MicroPythonBLEHID

Human Interface Device (HID) over Bluetooth Low Energy (BLE) GATT library for MicroPython.
GNU General Public License v3.0
204 stars 28 forks source link
hid joystick keyboard library micropython mouse

Contributors Forks Stargazers Issues GPL License Website


MicroPython Human Interface Device library

A library that offers implementations of Human Interface Devices (HID) over Bluetooth Low Energy (BLE) GATT for MicroPython.

Table of Contents
  1. About The Project
  2. Requirements
  3. Getting Started
  4. Usage
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This library offers implementations of Human Interface Devices (HID) over Bluetooth Low Energy (BLE) GATT for MicroPython. The library has been tested using an ESP32 development board (TinyPICO) as the peripheral and Windows 10 as the central. Examples and basic implementations of HID devices are available for

This library is NOT intended to offer functionality for every possible HID device configuration. Instead, the library is designed to offer basic well-documented classes that you can extend to fit your HID device needs. For example, the Mouse class offers a three button mouse with vertical scroll wheel. If you plan on developing a gaming mouse with eight buttons and both vertical and horizontal wheels, you will need to extend the Mouse class and overwrite the required functions to include a new HID report descriptor.

(back to top)

Requirements

The following is required to use this library:

(back to top)

Getting Started

To get a local copy simply clone this repository.

   git clone https://github.com/heerkog/MicroPythonBLEHID.git

The repository is structured as followed:

(back to top)

Usage

The library offers functionality for creating HID services, advertising them, and setting and notifying the central of HID events. The library does not offer functionality to, for example, send a string of characters to the central using the keyboard service (eventhough this is included in the keyboard example). The reason for this is that such functionality is entirely dependent on the intended use of the services and should be kept outside of this library.

The library consists of five classes with the following functions:

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU General Public License. See LICENSE for more information.

(back to top)

Contact

Heerko Groefsema - @HeerkoG - hgroefsema.nl

Project Link: https://github.com/heerkog/MicroPythonBLEHID

(back to top)

Acknowledgments

The following resources were of interest during development:

(back to top)