Kaleidoscope
LED-AlphaSquare.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*-
2  * Kaleidoscope-LED-AlphaSquare -- 4x4 pixel LED alphabet
3  * Copyright (C) 2017 Gergely Nagy
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #include <Kaleidoscope.h>
23 
24 #define SYM4x4( \
25  p00, p01, p02, p03, \
26  p10, p11, p12, p13, \
27  p20, p21, p22, p23, \
28  p30, p31, p32, p33) \
29  (uint16_t) ( \
30  p00 << 0 | p01 << 1 | p02 << 2 | p03 << 3 | \
31  p10 << 4 | p11 << 5 | p12 << 6 | p13 << 7 | \
32  p20 << 8 | p21 << 9 | p22 << 10 | p23 << 11 | \
33  p30 << 12 | p31 << 13 | p32 << 14 | p33 << 15 )
34 
35 namespace kaleidoscope {
37  public:
38  AlphaSquare(void);
39 
40  void begin(void) final;
41 
42  static void display(Key key, uint8_t row, uint8_t col, cRGB key_color);
43  static void display(Key key, uint8_t row, uint8_t col);
44  static void display(Key key) {
45  display(key, 0, 2);
46  }
47  static void display(Key key, uint8_t col) {
48  display(key, 0, col);
49  }
50 
51  static void display(uint16_t symbol, uint8_t row, uint8_t col, cRGB key_color);
52  static void display(uint16_t symbol, uint8_t row, uint8_t col);
53  static void display(uint16_t symbol) {
54  display(symbol, 0, 2);
55  }
56  static void display(uint16_t symbol, uint8_t col) {
57  display(symbol, 0, col);
58  }
59 
60  static void clear(Key key, uint8_t row, uint8_t col) {
61  display(key, row, col, {0, 0, 0});
62  }
63  static void clear(Key key, uint8_t col) {
64  clear(key, 0, col);
65  }
66  static void clear(Key key) {
67  clear(key, 0, 2);
68  }
69 
70  static void clear(uint16_t symbol, uint8_t row, uint8_t col) {
71  display(symbol, row, col, {0, 0, 0});
72  }
73  static void clear(uint16_t symbol, uint8_t col) {
74  clear(symbol, 0, col);
75  }
76  static void clear(uint16_t symbol) {
77  clear(symbol, 0, 2);
78  }
79 
80  static cRGB color;
81 };
82 
83 }
84 
static void display(uint16_t symbol, uint8_t col)
Definition: LED-AlphaSquare.h:56
Definition: hid.cpp:4
static void clear(uint16_t symbol)
Definition: LED-AlphaSquare.h:76
static void display(Key key, uint8_t col)
Definition: LED-AlphaSquare.h:47
static void clear(uint16_t symbol, uint8_t col)
Definition: LED-AlphaSquare.h:73
static void display(uint16_t symbol)
Definition: LED-AlphaSquare.h:53
byte byte col
Definition: TapDance.cpp:229
static void clear(uint16_t symbol, uint8_t row, uint8_t col)
Definition: LED-AlphaSquare.h:70
Definition: key_defs.h:13
static void clear(Key key, uint8_t col)
Definition: LED-AlphaSquare.h:63
static void display(Key key)
Definition: LED-AlphaSquare.h:44
Definition: LED-AlphaSquare.h:36
Definition: Kaleidoscope-Hardware-Shortcut.h:29
static void display(Key key, uint8_t row, uint8_t col, cRGB key_color)
Definition: LED-AlphaSquare.cpp:72
Definition: Kaleidoscope.h:40
void begin(void) final
Definition: LED-AlphaSquare.cpp:69
byte row
Definition: TapDance.cpp:229
AlphaSquare(void)
Definition: LED-AlphaSquare.cpp:66
static void clear(Key key, uint8_t row, uint8_t col)
Definition: LED-AlphaSquare.h:60
static cRGB color
Definition: LED-AlphaSquare.h:80
static void clear(Key key)
Definition: LED-AlphaSquare.h:66