forked from kofal.net/zmk
feat(display): Add new peripheral status/display
* Add new API/status to track state of the peripheral connection to the central. * Add new peripheral status widget for displaying the current status of the connection to the central.
This commit is contained in:
committed by
Pete Johanson
parent
0a40f922b5
commit
16ab6df18d
19
app/include/zmk/display/widgets/peripheral_status.h
Normal file
19
app/include/zmk/display/widgets/peripheral_status.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <kernel.h>
|
||||
|
||||
struct zmk_widget_peripheral_status {
|
||||
sys_snode_t node;
|
||||
lv_obj_t *obj;
|
||||
};
|
||||
|
||||
int zmk_widget_peripheral_status_init(struct zmk_widget_peripheral_status *widget,
|
||||
lv_obj_t *parent);
|
||||
lv_obj_t *zmk_widget_peripheral_status_obj(struct zmk_widget_peripheral_status *widget);
|
||||
16
app/include/zmk/events/split_peripheral_status_changed.h
Normal file
16
app/include/zmk/events/split_peripheral_status_changed.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <zmk/event_manager.h>
|
||||
|
||||
struct zmk_split_peripheral_status_changed {
|
||||
bool connected;
|
||||
};
|
||||
|
||||
ZMK_EVENT_DECLARE(zmk_split_peripheral_status_changed);
|
||||
9
app/include/zmk/split/bluetooth/peripheral.h
Normal file
9
app/include/zmk/split/bluetooth/peripheral.h
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
bool zmk_split_bt_peripheral_is_connected(void);
|
||||
Reference in New Issue
Block a user