bluefruit_le.h (1544B)
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 6 #pragma once 7 8 #include <stdbool.h> 9 #include <stdint.h> 10 #include "report.h" 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /* Instruct the module to enable HID keyboard support and reset */ 17 extern bool bluefruit_le_enable_keyboard(void); 18 19 /* Query to see if the BLE module is connected */ 20 extern bool bluefruit_le_query_is_connected(void); 21 22 /* Returns true if we believe that the BLE module is connected. 23 * This uses our cached understanding that is maintained by 24 * calling ble_task() periodically. */ 25 extern bool bluefruit_le_is_connected(void); 26 27 extern void bluefruit_le_init(void); 28 29 /* Call this periodically to process BLE-originated things */ 30 extern void bluefruit_le_task(void); 31 32 /* Generates keypress events for a set of keys. 33 * The hid modifier mask specifies the state of the modifier keys for 34 * this set of keys. 35 * Also sends a key release indicator, so that the keys do not remain 36 * held down. */ 37 extern void bluefruit_le_send_keyboard(report_keyboard_t *report); 38 39 /* Send a consumer usage. 40 * (milliseconds) */ 41 extern void bluefruit_le_send_consumer(uint16_t usage); 42 43 /* Send a mouse/wheel movement report. 44 * The parameters are signed and indicate positive or negative direction 45 * change. */ 46 extern void bluefruit_le_send_mouse(report_mouse_t *report); 47 48 extern bool bluefruit_le_set_mode_leds(bool on); 49 extern bool bluefruit_le_set_power_level(int8_t level); 50 51 #ifdef __cplusplus 52 } 53 #endif