You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.8 KiB

  1. /* Bluetooth Low Energy Protocol for QMK.
  2. * Author: Wez Furlong, 2016
  3. * Supports the Adafruit BLE board built around the nRF51822 chip.
  4. */
  5. #pragma once
  6. #include <stdbool.h>
  7. #include <stdint.h>
  8. #include <string.h>
  9. #include "config_common.h"
  10. #include "progmem.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /* Instruct the module to enable HID keyboard support and reset */
  15. extern bool adafruit_ble_enable_keyboard(void);
  16. /* Query to see if the BLE module is connected */
  17. extern bool adafruit_ble_query_is_connected(void);
  18. /* Returns true if we believe that the BLE module is connected.
  19. * This uses our cached understanding that is maintained by
  20. * calling ble_task() periodically. */
  21. extern bool adafruit_ble_is_connected(void);
  22. /* Call this periodically to process BLE-originated things */
  23. extern void adafruit_ble_task(void);
  24. /* Generates keypress events for a set of keys.
  25. * The hid modifier mask specifies the state of the modifier keys for
  26. * this set of keys.
  27. * Also sends a key release indicator, so that the keys do not remain
  28. * held down. */
  29. extern bool adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys, uint8_t nkeys);
  30. /* Send a consumer keycode, holding it down for the specified duration
  31. * (milliseconds) */
  32. extern bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration);
  33. # ifdef MOUSE_ENABLE
  34. /* Send a mouse/wheel movement report.
  35. * The parameters are signed and indicate positive of negative direction
  36. * change. */
  37. extern bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan, uint8_t buttons);
  38. # endif
  39. /* Compute battery voltage by reading an analog pin.
  40. * Returns the integer number of millivolts */
  41. extern uint32_t adafruit_ble_read_battery_voltage(void);
  42. extern bool adafruit_ble_set_mode_leds(bool on);
  43. extern bool adafruit_ble_set_power_level(int8_t level);
  44. #ifdef __cplusplus
  45. }
  46. #endif