aboutsummaryrefslogtreecommitdiff
path: root/users/bcat/bcat_oled.h
diff options
context:
space:
mode:
Diffstat (limited to 'users/bcat/bcat_oled.h')
-rw-r--r--users/bcat/bcat_oled.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/users/bcat/bcat_oled.h b/users/bcat/bcat_oled.h
new file mode 100644
index 000000000..f617e1f06
--- /dev/null
+++ b/users/bcat/bcat_oled.h
@@ -0,0 +1,55 @@
1/* Copyright 2021 Jonathan Rascher
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include <stdbool.h>
20#include <stdint.h>
21
22#include "led.h"
23
24/* Keyboard status passed to the oled_task_keymap function and used by the
25 * various keyboard pet implementations.
26 */
27typedef struct {
28 uint8_t mods;
29 led_t leds;
30 uint8_t wpm;
31} oled_keyboard_state_t;
32
33/* Note: Functions below assume a vertical OLED that is 32px (5 chars) wide. */
34
35/* Renders layer status at the cursor. Occupies 5x1 character cells. */
36void render_oled_layers(void);
37
38/* Renders LED indicators (Num/Caps/Scroll Lock) at the cursor. Occupies 5x3
39 * character cells.
40 */
41void render_oled_indicators(led_t leds);
42
43/* Renders calculated WPM count at the cursor. Occupies 5x2 character cells. */
44void render_oled_wpm(uint8_t wpm);
45
46#if defined(BCAT_OLED_PET)
47/* Renders an animated critter at the cursor that can respond to keystrokes,
48 * typing speed, etc. Should be about 5 character cells wide, but exact height
49 * varies depending on the specific OLED pet implementation linked in.
50 *
51 * The rendered image will be one line taller than the OLED pet's animation
52 * frame height to accommodate pets that "jump" when the spacebar is pressed.
53 */
54void render_oled_pet(uint8_t col, uint8_t line, const oled_keyboard_state_t *keyboard_state);
55#endif