TEST
Dependents: ADXL345Test ADXL345Test1
Fork of TM1638 by
Font_7Seg.cpp@1:1f2453ed85d7, 2016-01-09 (annotated)
- Committer:
- wim
- Date:
- Sat Jan 09 14:30:43 2016 +0000
- Revision:
- 1:1f2453ed85d7
- Parent:
- 0:201dfacbe0e5
- Child:
- 2:532ce15ea9ec
TM1638 LED controller, Initial version.; Supports LED&KEY module.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wim | 0:201dfacbe0e5 | 1 | /* mbed LED Font Library, for TM1638 LED controller |
wim | 0:201dfacbe0e5 | 2 | * Copyright (c) 2015, v01: WH, Initial version, Test in LEDKEY8 |
wim | 0:201dfacbe0e5 | 3 | * |
wim | 0:201dfacbe0e5 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
wim | 0:201dfacbe0e5 | 5 | * of this software and associated documentation files (the "Software"), to deal |
wim | 0:201dfacbe0e5 | 6 | * in the Software without restriction, including without limitation the rights |
wim | 0:201dfacbe0e5 | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
wim | 0:201dfacbe0e5 | 8 | * copies of the Software, and to permit persons to whom the Software is |
wim | 0:201dfacbe0e5 | 9 | * furnished to do so, subject to the following conditions: |
wim | 0:201dfacbe0e5 | 10 | * |
wim | 0:201dfacbe0e5 | 11 | * The above copyright notice and this permission notice shall be included in |
wim | 0:201dfacbe0e5 | 12 | * all copies or substantial portions of the Software. |
wim | 0:201dfacbe0e5 | 13 | * |
wim | 0:201dfacbe0e5 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
wim | 0:201dfacbe0e5 | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
wim | 0:201dfacbe0e5 | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
wim | 0:201dfacbe0e5 | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
wim | 0:201dfacbe0e5 | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
wim | 0:201dfacbe0e5 | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
wim | 0:201dfacbe0e5 | 20 | * THE SOFTWARE. |
wim | 0:201dfacbe0e5 | 21 | */ |
wim | 0:201dfacbe0e5 | 22 | #include "Font_7Seg.h" |
wim | 0:201dfacbe0e5 | 23 | |
wim | 0:201dfacbe0e5 | 24 | // Select one of the testboards for TM1638 LED controller |
wim | 0:201dfacbe0e5 | 25 | #if (LEDKEY8_TEST == 1) |
wim | 0:201dfacbe0e5 | 26 | |
wim | 0:201dfacbe0e5 | 27 | //Mask for blending out and restoring Icons |
wim | 0:201dfacbe0e5 | 28 | const char MASK_ICON_GRID[][2] = { |
wim | 0:201dfacbe0e5 | 29 | {LO(S7_ICON_GR1), HI(S7_ICON_GR1)}, |
wim | 0:201dfacbe0e5 | 30 | {LO(S7_ICON_GR2), HI(S7_ICON_GR2)}, |
wim | 0:201dfacbe0e5 | 31 | {LO(S7_ICON_GR3), HI(S7_ICON_GR3)}, |
wim | 0:201dfacbe0e5 | 32 | {LO(S7_ICON_GR4), HI(S7_ICON_GR4)}, |
wim | 0:201dfacbe0e5 | 33 | {LO(S7_ICON_GR5), HI(S7_ICON_GR5)}, |
wim | 0:201dfacbe0e5 | 34 | {LO(S7_ICON_GR6), HI(S7_ICON_GR6)}, |
wim | 0:201dfacbe0e5 | 35 | {LO(S7_ICON_GR7), HI(S7_ICON_GR7)}, |
wim | 0:201dfacbe0e5 | 36 | {LO(S7_ICON_GR8), HI(S7_ICON_GR8)}, |
wim | 0:201dfacbe0e5 | 37 | {LO(S7_ICON_GR9), HI(S7_ICON_GR9)}, |
wim | 0:201dfacbe0e5 | 38 | {LO(S7_ICON_GR10), HI(S7_ICON_GR10)} |
wim | 0:201dfacbe0e5 | 39 | }; |
wim | 0:201dfacbe0e5 | 40 | |
wim | 0:201dfacbe0e5 | 41 | |
wim | 0:201dfacbe0e5 | 42 | // ASCII Font definition table for transmission to TM1638 |
wim | 0:201dfacbe0e5 | 43 | // |
wim | 0:201dfacbe0e5 | 44 | //#define FONT_7S_START 0x20 |
wim | 0:201dfacbe0e5 | 45 | //#define FONT_7S_END 0x7F |
wim | 0:201dfacbe0e5 | 46 | //#define FONT_7S_NR_CHARS (FONT_7_END - FONT_7S_START + 1) |
wim | 0:201dfacbe0e5 | 47 | |
wim | 0:201dfacbe0e5 | 48 | const char FONT_7S[] = { |
wim | 0:201dfacbe0e5 | 49 | C7_0, //48 0x30 |
wim | 0:201dfacbe0e5 | 50 | C7_1, |
wim | 0:201dfacbe0e5 | 51 | C7_2, |
wim | 0:201dfacbe0e5 | 52 | C7_3, |
wim | 0:201dfacbe0e5 | 53 | C7_4, |
wim | 0:201dfacbe0e5 | 54 | C7_5, |
wim | 0:201dfacbe0e5 | 55 | C7_6, |
wim | 0:201dfacbe0e5 | 56 | C7_7, |
wim | 0:201dfacbe0e5 | 57 | C7_8, |
wim | 0:201dfacbe0e5 | 58 | C7_9, |
wim | 0:201dfacbe0e5 | 59 | C7_A, //65 0x41, A |
wim | 0:201dfacbe0e5 | 60 | C7_B, |
wim | 0:201dfacbe0e5 | 61 | C7_C, |
wim | 0:201dfacbe0e5 | 62 | C7_D, |
wim | 0:201dfacbe0e5 | 63 | C7_E, |
wim | 0:201dfacbe0e5 | 64 | C7_F |
wim | 0:201dfacbe0e5 | 65 | };// 127 |
wim | 0:201dfacbe0e5 | 66 | |
wim | 0:201dfacbe0e5 | 67 | #endif |