1 /* Bluetooth Low Energy Protocol for QMK.
2 * Author: Wez Furlong, 2016
3 * Supports the Adafruit BLE board built around the nRF51822 chip.
6 #ifdef MODULE_ADAFRUIT_BLE
11 #include "config_common.h"
18 /* Instruct the module to enable HID keyboard support and reset */
19 extern bool adafruit_ble_enable_keyboard(void);
21 /* Query to see if the BLE module is connected */
22 extern bool adafruit_ble_query_is_connected(void);
24 /* Returns true if we believe that the BLE module is connected.
25 * This uses our cached understanding that is maintained by
26 * calling ble_task() periodically. */
27 extern bool adafruit_ble_is_connected(void);
29 /* Call this periodically to process BLE-originated things */
30 extern void adafruit_ble_task(void);
32 /* Generates keypress events for a set of keys.
33 * The hid modifier mask specifies the state of the modifier keys for
35 * Also sends a key release indicator, so that the keys do not remain
37 extern bool adafruit_ble_send_keys(uint8_t hid_modifier_mask, uint8_t *keys,
40 /* Send a consumer keycode, holding it down for the specified duration
42 extern bool adafruit_ble_send_consumer_key(uint16_t keycode, int hold_duration);
45 /* Send a mouse/wheel movement report.
46 * The parameters are signed and indicate positive of negative direction
48 extern bool adafruit_ble_send_mouse_move(int8_t x, int8_t y, int8_t scroll,
49 int8_t pan, uint8_t buttons);
52 /* Compute battery voltage by reading an analog pin.
53 * Returns the integer number of millivolts */
54 extern uint32_t adafruit_ble_read_battery_voltage(void);
56 extern bool adafruit_ble_set_mode_leds(bool on);
57 extern bool adafruit_ble_set_power_level(int8_t level);
63 #endif // MODULE_ADAFRUIT_BLE