diff options
author | Ally Parker <ally.parker@red-gate.com> | 2021-01-22 16:23:21 +0000 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2021-01-23 18:38:31 -0500 |
commit | a4aaa73f06939417a911c5213480efe78aa70fab (patch) | |
tree | ca38fa9f6dff26cdc8563f47008322370f2e448d /app/include | |
parent | c0cab57c2d4d1fd4a7db4e7d6edda7bdc6549619 (diff) |
feat: Add WPM calculator and display widget
Diffstat (limited to 'app/include')
-rw-r--r-- | app/include/zmk/display/widgets/wpm_status.h | 18 | ||||
-rw-r--r-- | app/include/zmk/events/wpm_state_changed.h | 17 | ||||
-rw-r--r-- | app/include/zmk/wpm.h | 9 |
3 files changed, 44 insertions, 0 deletions
diff --git a/app/include/zmk/display/widgets/wpm_status.h b/app/include/zmk/display/widgets/wpm_status.h new file mode 100644 index 0000000..0592299 --- /dev/null +++ b/app/include/zmk/display/widgets/wpm_status.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include <lvgl.h> +#include <kernel.h> + +struct zmk_widget_wpm_status { + sys_snode_t node; + lv_obj_t *obj; +}; + +int zmk_widget_wpm_status_init(struct zmk_widget_wpm_status *widget, lv_obj_t *parent); +lv_obj_t *zmk_widget_wpm_status_obj(struct zmk_widget_wpm_status *widget);
\ No newline at end of file diff --git a/app/include/zmk/events/wpm_state_changed.h b/app/include/zmk/events/wpm_state_changed.h new file mode 100644 index 0000000..3d1a369 --- /dev/null +++ b/app/include/zmk/events/wpm_state_changed.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include <zephyr.h> +#include <zmk/event_manager.h> +#include <zmk/wpm.h> + +struct zmk_wpm_state_changed { + int state; +}; + +ZMK_EVENT_DECLARE(zmk_wpm_state_changed); diff --git a/app/include/zmk/wpm.h b/app/include/zmk/wpm.h new file mode 100644 index 0000000..6db100a --- /dev/null +++ b/app/include/zmk/wpm.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +int zmk_wpm_get_state();
\ No newline at end of file |