Skip to content

Commit

Permalink
add nrf52 uart module support lib
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jun 19, 2021
1 parent 67fe370 commit 0cfbe71
Show file tree
Hide file tree
Showing 10 changed files with 2,525 additions and 0 deletions.
42 changes: 42 additions & 0 deletions keyboards/yandrstudio/biu_nrf52_ble_lib/biu_ble_common.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

#include "biu_ble_common.h"

__attribute__((weak)) bool bluetooth_init(void) { return true; }

__attribute__((weak)) void bluetooth_task(void) {}

__attribute__((weak)) bool bluetooth_is_connected(void) { return true; }

__attribute__((weak)) void bluetooth_unpair_all(void) {}

__attribute__((weak)) void bluetooth_unpair_one(uint8_t device_id) {}

__attribute__((weak)) void bluetooth_pair(void) {}

__attribute__((weak)) void bluetooth_switch_one(uint8_t device_id) {}

__attribute__((weak)) void bluetooth_send_keyboard(report_keyboard_t *report) {}

#ifdef EXTRAKEY_ENABLE
__attribute__((weak)) void bluetooth_send_extra(uint8_t report_id, uint16_t keycode) {}
#endif


#ifdef MOUSE_ENABLE
__attribute__((weak)) void bluetooth_send_mouse(report_mouse_t *report) {}
#endif

#ifdef NKRO_ENABLE
__attribute__((weak)) void bluetooth_send_keyboard_nkro(report_keyboard_t *report) {}
#endif

#ifdef JOYSTICK_ENABLE
__attribute__((weak)) void bluetooth_send_joystick(joystick_report_t *report) {}
#endif

__attribute__((weak)) void bluetooth_send_battery_level(void) { }





40 changes: 40 additions & 0 deletions keyboards/yandrstudio/biu_nrf52_ble_lib/biu_ble_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#pragma once

#include "report.h"
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

bool bluetooth_init(void);
void bluetooth_task(void);
bool bluetooth_is_connected(void);
void bluetooth_unpair_all(void);
void bluetooth_unpair_one(uint8_t device_id);
void bluetooth_pair(void);
void bluetooth_switch_one(uint8_t device_id);

void bluetooth_send_keyboard(report_keyboard_t *report);

#ifdef EXTRAKEY_ENABLE
void bluetooth_send_extra(uint8_t report_id, uint16_t keycode);
#endif

#ifdef MOUSE_ENABLE
void bluetooth_send_mouse(report_mouse_t *report);
#endif

#ifdef NKRO_ENABLE
void bluetooth_send_keyboard_nkro(report_keyboard_t *report);
#endif

#ifdef JOYSTICK_ENABLE
void bluetooth_send_joystick(joystick_report_t *report);
#endif

void bluetooth_send_battery_level(void);

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 0cfbe71

Please sign in to comment.