From d4fcab1e7b4cb7402d1e506ef31245eaaa495400 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Sun, 11 Dec 2022 12:59:16 +0100 Subject: [PATCH] Squashed commit of the following: commit d9f1514b26744293bbebaaf44467216a4d7193e9 Merge: 6148013 6210a57 Author: DiSlord Live Date: Sun Dec 11 13:54:00 2022 +0300 Merge branch 'DiSlord_browser' of https://github.com/erikkaashoek/tinySA into DiSlord_browser commit 6148013c545399cf14ad4f733b9876c433b3c151 Author: DiSlord Live Date: Sun Dec 11 13:53:42 2022 +0300 Rewrite progress bar update/remove dead code/use buffering in cmd_scanraw cmd_vbat now run in sweep thread commit 6210a57304d9534cd2b78535f6d31147837147ad Author: erikkaashoek Date: Fri Dec 9 12:06:01 2022 +0100 Level error + above 4.4GHz commit 63a26eb1128176560c2562f0abc36aaba402e88f Author: DiSlord Live Date: Wed Dec 7 18:59:45 2022 +0300 Less code size and remove variable commit e46a7423ee3bfc4fe8d0197527b463308e3c6f2d Author: erikkaashoek Date: Mon Dec 5 10:36:20 2022 +0100 Fix keyboard commit 519af36d93b669ff1d87c2c20b0bc5db598b001c Author: DiSlord Live Date: Sat Dec 3 21:49:32 2022 +0300 Add Enter button commit a1eeae37f35ee19d822c32df55108f0ab58437a4 Author: DiSlord Live Date: Sat Dec 3 21:49:05 2022 +0300 Not need clear text commit 1d9c85c7c36601d2d1ba89963190a2367191e826 Author: DiSlord Live Date: Sat Dec 3 20:04:37 2022 +0300 Replace commit 400175ed48c2758ba123654d2f99023380d47788 Author: DiSlord Live Date: Sat Dec 3 19:57:16 2022 +0300 Fix commit dc01db6e8aad5926e25acd20e0698e49ddbde269 Author: DiSlord Live Date: Sat Dec 3 19:52:11 2022 +0300 Add lcd_set_font function Allow lcd_printf print by selected font Fix text position in browser commit bb860080de21a6e08fa3810e4087157bbde394ba Author: DiSlord Live Date: Sat Dec 3 17:53:47 2022 +0300 Add SWEEP_UI_MODE flag for console command This allow run command if active thread in UI mode commit 31e4d72a461fde624d9433a06d953883432ae91a Merge: 18b4b94 f832809 Author: DiSlord Live Date: Sat Dec 3 16:15:39 2022 +0300 Merge branch 'DiSlord_browser' of https://github.com/erikkaashoek/tinySA into DiSlord_browser commit f8328093f10804101c115237babd2616806689fb Author: erikkaashoek Date: Sat Dec 3 13:16:53 2022 +0100 Removed compile warnings on 072 commit 18b4b948750860674f1d7e6bb1cb82817122186f Merge: 80dfb6e d99d679 Author: DiSlord Live Date: Sat Dec 3 15:05:50 2022 +0300 Merge branch 'V4.3' of https://github.com/erikkaashoek/tinySA into DiSlord_browser commit 80dfb6e6bcbe285ec0194e877fcd2c0517a68f07 Author: DiSlord Live Date: Sat Dec 3 14:01:05 2022 +0300 Fix warnings commit a61de954238af48c6eeab22e8e02e77bdbf6b120 Author: DiSlord Live Date: Sat Dec 3 13:51:47 2022 +0300 Fix f072 compile commit 467f300b3d8c7f817daaf74731acf988d6e8ce01 Author: DiSlord Live Date: Sat Dec 3 12:50:26 2022 +0300 Add *.cmd files browse and execute Added some useful functions commit f2752f1200259563bbcdec93e9a126e711db4156 Author: DiSlord Live Date: Sat Dec 3 12:48:52 2022 +0300 Fix clean frequency area commit ab35aadde31d1812641b6efb69ad4ef9354920ab Merge: 6fcdc8b 68a5114 Author: erikkaashoek Date: Sat Dec 3 09:59:06 2022 +0100 Merge branch 'DiSlord_browser' of https://github.com/erikkaashoek/tinySA into DiSlord_browser commit 6fcdc8b7afbd4b6c83ceb8fa698cdfeae02196bb Author: erikkaashoek Date: Sat Dec 3 09:56:58 2022 +0100 UI updated with STORAGE menu commit 68a5114048148d7b4a498562ba87aa3c722d9210 Merge: fae9a43 afb59b8 Author: DiSlord Live Date: Sat Dec 3 11:22:42 2022 +0300 Merge branch 'V4.3' of https://github.com/erikkaashoek/tinySA into DiSlord_browser commit fae9a43825f9a43800186e6a601a27a98bed3d59 Merge: ba7a3dc 768ecf0 Author: DiSlord Live Date: Fri Dec 2 18:23:14 2022 +0300 Merge branch 'DiSlord_browser' of https://github.com/erikkaashoek/tinySA into DiSlord_browser # Conflicts: # ui.c commit ba7a3dc941746fb2d8c48e2880265729e9c4193a Author: DiSlord Live Date: Fri Dec 2 18:19:11 2022 +0300 Add autofilename option Ask for filename on save commit 0c0ac98140051161bf4a350748f3833035045b51 Author: DiSlord Live Date: Fri Dec 2 18:17:48 2022 +0300 Add Enter symbol Update fonts commit 768ecf01cad33813a5ff44850cfb8108f29e2799 Author: erikkaashoek Date: Fri Dec 2 08:20:25 2022 +0100 Old compiler can't use "string"[0] commit c4563d6efc3fd468fac5b975ddcaf67bdf0f0db7 Author: DiSlord Live Date: Thu Dec 1 23:56:06 2022 +0300 Keyboard size and position definition commit e63db4f2df1057d9f38c783d8d6386b60b508e22 Author: DiSlord Live Date: Thu Dec 1 23:55:32 2022 +0300 Refactoring keyboard code, prepare for text input keyboard commit 597b4e300f43281e20992630bdc6c91900201dc4 Merge: c43b8c1 7b602fc Author: erikkaashoek Date: Thu Dec 1 09:53:05 2022 +0100 Merge branch 'V4.3' into DiSlord_browser commit c43b8c1005704ec718c46d3e4416f6c78f25e608 Author: erikkaashoek Date: Thu Dec 1 09:23:27 2022 +0100 Added preset load/store SD card commit a0b0351a7eed1d38f0c6c75cf597cde23ae25ab8 Author: DiSlord Live Date: Wed Nov 30 23:03:04 2022 +0300 Disable battery and cal state update in browser mode commit 9b3d07794293ef2a454b69ff2cb55657579ad75b Author: DiSlord Live Date: Wed Nov 30 22:56:55 2022 +0300 Use big font for browser commit 01e87fc27bc3df5482f09124fea8e8af3ceb06ae Author: DiSlord Live Date: Wed Nov 30 22:24:40 2022 +0300 Add browser option commit be63b81b1be6967d8f27c43942a1bde5a7177185 Merge: 5d22b2f 1543296 Author: DiSlord Live Date: Wed Nov 30 21:19:45 2022 +0300 Merge branch 'DiSlord_browser' of https://github.com/erikkaashoek/tinySA into DiSlord_browser commit 5d22b2fcceb5a9b1206eb69fcf1e13d51c07d465 Author: DiSlord Live Date: Wed Nov 30 21:18:39 2022 +0300 Add dump firmware option commit 154329698d2b0c9ff5b893f7cd4a3dbb8b943a9b Merge: d31a599 b9b9ea1 Author: erikkaashoek Date: Wed Nov 30 19:17:58 2022 +0100 Merge pull request #42 from erikkaashoek/V4.3 Add c and h commands commit d31a599b1d388dcb94629c3603baa15f4a9c5c65 Author: DiSlord Live Date: Wed Nov 30 21:17:36 2022 +0300 Fix typo commit 517428bd015b23d375f19d10a8bfd362ab6a52a8 Author: DiSlord Live Date: Wed Nov 30 20:43:38 2022 +0300 Allow read/write more then one sector (512 bytes) in one time commit 84342fbd436ccf271d52d50bf68e7c7330a622c8 Author: DiSlord Live Date: Wed Nov 30 20:28:37 2022 +0300 Update save to card part --- Font10x14.c | 20 +- Font5x7.c | 3609 +++++++++++----------------------- Font7x13b.c | 5124 ++++++++++++++++-------------------------------- flash.c | 2 +- ili9341.c | 69 +- main.c | 102 +- nanovna.h | 67 +- numfont20x22.c | 24 + plot.c | 7 +- sa_cmd.c | 46 +- sa_core.c | 70 +- ui.c | 925 +++++---- vna_browser.c | 369 ++++ 13 files changed, 4042 insertions(+), 6392 deletions(-) create mode 100644 vna_browser.c diff --git a/Font10x14.c b/Font10x14.c index bb0d3e1..43a6a4b 100644 --- a/Font10x14.c +++ b/Font10x14.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, written by DiSlord dislordlive@gmail.com + * Copyright (c) 2019-2020, Dmitry (DiSlord) dislordlive@gmail.com * All rights reserved. * * This is free software; you can redistribute it and/or modify @@ -28,7 +28,7 @@ * Check 1 byte of bitmap data for get width */ -#define wFONT_START_CHAR 0x17 +#define wFONT_START_CHAR 0x16 #define wFONT_MAX_WIDTH 12 #define wFONT_GET_HEIGHT 14 #define wFONT_STR_HEIGHT 16 @@ -50,6 +50,22 @@ // for less 8 width used 9 but next char draw at correct place const uint8_t x10x14_bits[(127-wFONT_START_CHAR)*wFONT_GET_HEIGHT*2] = { +//S_DELTA "\029" // 0x17 + _BMP16(0b0000000000000000|CW_13), // | | + _BMP16(0b0000000001110000), // | *** | + _BMP16(0b0000000001110000), // | *** | + _BMP16(0b0000000001110000), // | *** | + _BMP16(0b0000000001110000), // | *** | + _BMP16(0b0000000001110000), // | *** | + _BMP16(0b0000000001110000), // | *** | + _BMP16(0b0001000001110000), // | * *** | + _BMP16(0b0011000001110000), // | ** *** | + _BMP16(0b0111111111110000), // | *********** | + _BMP16(0b1111111111110000), // |************ | + _BMP16(0b0111111111110000), // | *********** | + _BMP16(0b0011000000000000), // | ** | + _BMP16(0b0001000000000000), // | * | + //S_DELTA "\029" // 0x17 _BMP16(0b0000000000000000|CW_13), // | | _BMP16(0b0000011000000000), // | ** | diff --git a/Font5x7.c b/Font5x7.c index 9ab283f..6c1c2a3 100644 --- a/Font5x7.c +++ b/Font5x7.c @@ -1,2448 +1,1195 @@ /* - * Font size 5x7 pixels - * most font glyph have width 5 pixels + * Copyright (c) 2019-2020, Dmitry (DiSlord) dislordlive@gmail.com + * All rights reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * The software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #include /* + * Most font glyph have width 5 pixels * Check 0 byte of char bitmap data for get width */ -// Font definitions -#define FONT_START_CHAR 0x17 -#define FONT_MAX_WIDTH 7 -#define FONT_WIDTH 5 -#define FONT_GET_HEIGHT 7 -#define FONT_STR_HEIGHT 8 +#if 0 +// Font definitions for header +#define FONT_START_CHAR 0x16 +#define FONT_WIDTH 5 +#define FONT_WIDTH_MASK 0x07 +#define FONT_GET_HEIGHT 7 +#define FONT_STR_HEIGHT 8 #define FONT_GET_DATA(ch) ( &x5x7_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]) -#define FONT_GET_WIDTH(ch) (8-(x5x7_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]&7)) - +#define FONT_GET_WIDTH(ch) (8-(x5x7_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT] & FONT_WIDTH_MASK)) +#endif -#define CHAR5x7_WIDTH_1px 0x07 -#define CHAR5x7_WIDTH_2px 0x06 -#define CHAR5x7_WIDTH_3px 0x05 -#define CHAR5x7_WIDTH_4px 0x04 -#define CHAR5x7_WIDTH_5px 0x03 -#define CHAR5x7_WIDTH_6px 0x02 -#define CHAR5x7_WIDTH_7px 0x01 -#define CHAR5x7_WIDTH_8px 0x00 +#define CW_01 (8 - 1) +#define CW_02 (8 - 2) +#define CW_03 (8 - 3) +#define CW_04 (8 - 4) +#define CW_05 (8 - 5) +#define CW_06 (8 - 6) +#define CW_07 (8 - 7) +#define CW_08 (8 - 8) -/* Font character bitmap data. */ +// Font character bitmap data. const uint8_t x5x7_bits[] = { #if 0 - /* Character (0x00): - width=5 - +--------+ - |**** | - |**** | - |**** | - |**** | - |**** | - |**** | - | | - +--------+ */ - 0b11110000|CHAR5x7_WIDTH_5px, - 0b11110000, - 0b11110000, - 0b11110000, - 0b11110000, - 0b11110000, - 0b00000000, - - /* Character (0x01): - width=5 - +--------+ - | | - | * | - | *** | - |***** | - | *** | - | * | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00100000, - 0b01110000, - 0b11111000, - 0b01110000, - 0b00100000, - 0b00000000, - - /* Character (0x02): - width=5 - +--------+ - | * * | - |* * * | - | * * | - |* * * | - | * * | - |* * * | - | * * | - +--------+ */ - 0b01010000|CHAR5x7_WIDTH_5px, - 0b10101000, - 0b01010000, - 0b10101000, - 0b01010000, - 0b10101000, - 0b01010000, - - /* Character (0x03): - width=5 - +--------+ - |* * | - |*** | - |* * | - |* * | - | *** | - | * | - | * | - +--------+ */ - 0b10100000|CHAR5x7_WIDTH_5px, - 0b11100000, - 0b10100000, - 0b10100000, - 0b01110000, - 0b00100000, - 0b00100000, - - /* Character (0x04): - width=5 - +--------+ - | ** | - | *** | - | *** | - | *** | - | *** | - | *** | - | ** | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_5px, - 0b00100000, - 0b00100000, - 0b11100000, - 0b00100000, - 0b00100000, - 0b00100000, - - /* Character (0x05): - width=5 - +--------+ - |** | - |* | - |** | - | ** | - | * * | - | ** | - | * * | - +--------+ */ - 0b11000000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b11000000, - 0b01100000, - 0b01010000, - 0b01100000, - 0b01010000, - - /* Character (0x06): - width=5 - +--------+ - |* | - |* | - |** | - | ** | - | * | - | ** | - | * | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b11000000, - 0b00110000, - 0b00100000, - 0b00110000, - 0b00100000, - - /* Character (0x07): - width=5 - +--------+ - | * | - | * * | - | * | - | | - | | - | | - | | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_5px, - 0b01010000, - 0b00100000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x08): - width=5 - +--------+ - | | - | * | - | *** | - | * | - | | - | *** | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00100000, - 0b01110000, - 0b00100000, - 0b00000000, - 0b01110000, - 0b00000000, - - /* Character (0x09): - width=5 - +--------+ - |* * | - |** * | - |* ** | - |* * | - | * | - | * | - | ** | - +--------+ */ - 0b10010000|CHAR5x7_WIDTH_5px, - 0b11010000, - 0b10110000, - 0b10010000, - 0b00100000, - 0b00100000, - 0b00110000, - - /* Character (0x0a): - width=5 - +--------+ - |* * | - |* * | - |* * | - | * | - | *** | - | * | - | * | - +--------+ */ - 0b10100000|CHAR5x7_WIDTH_5px, - 0b10100000, - 0b10100000, - 0b01000000, - 0b01110000, - 0b00100000, - 0b00100000, - - /* Character (0x0b): - width=5 - +--------+ - | * | - | * | - | * | - |*** | - | | - | | - | | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_5px, - 0b00100000, - 0b00100000, - 0b11100000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x0c): - width=5 - +--------+ - | | - | | - | | - |*** | - | * | - | * | - | * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b00000000, - 0b11100000, - 0b00100000, - 0b00100000, - 0b00100000, - - /* Character (0x0d): - width=5 - +--------+ - | | - | | - | | - | *** | - | * | - | * | - | * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b00000000, - 0b00111000, - 0b00100000, - 0b00100000, - 0b00100000, - - /* Character (0x0e): - width=5 - +--------+ - | * | - | * | - | * | - | *** | - | | - | | - | | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_5px, - 0b00100000, - 0b00100000, - 0b00111000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x0f): - width=5 - +--------+ - | * | - | * | - | * | - |***** | - | * | - | * | - | * | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_5px, - 0b00100000, - 0b00100000, - 0b11111000, - 0b00100000, - 0b00100000, - 0b00100000, - - /* Character (0x10): - width=5 - +--------+ - | | - |***** | - | | - | | - | | - | | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b11111000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x11): - width=5 - +--------+ - | | - | | - |***** | - | | - | | - | | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b11111000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x12): - width=5 - +--------+ - | | - | | - | | - |***** | - | | - | | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b00000000, - 0b11111000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x13): - width=5 - +--------+ - | | - | | - | | - | | - |***** | - | | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111000, - 0b00000000, - 0b00000000, - - /* Character (0x14): - width=5 - +--------+ - | | - | | - | | - | | - | | - |***** | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111000, - 0b00000000, - - /* Character (0x15): - width=5 - +--------+ - | * | - | * | - | * | - | *** | - | * | - | * | - | * | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_5px, - 0b00100000, - 0b00100000, - 0b00111000, - 0b00100000, - 0b00100000, - 0b00100000, - - /* Character (0x16): - width=6 - +--------+ - | | - |** | - |**** | - |****** | - |**** | - |** | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b11000000, - 0b11110000, - 0b00011100, - 0b11110000, - 0b11000000, - 0b00000000, +// Char 0x00 width = 5 + 0b11110000|CW_05, // |**** | + 0b11110000, // |**** | + 0b11110000, // |**** | + 0b11110000, // |**** | + 0b11110000, // |**** | + 0b11110000, // |**** | + 0b00000000, // | | + +// Char 0x01 width = 5 + 0b00000000|CW_05, // | | + 0b00100000, // | * | + 0b01110000, // | *** | + 0b11111000, // |***** | + 0b01110000, // | *** | + 0b00100000, // | * | + 0b00000000, // | | + +// Char 0x02 width = 5 + 0b01010000|CW_05, // | * * | + 0b10101000, // |* * * | + 0b01010000, // | * * | + 0b10101000, // |* * * | + 0b01010000, // | * * | + 0b10101000, // |* * * | + 0b01010000, // | * * | + +// Char 0x03 width = 5 + 0b10100000|CW_05, // |* * | + 0b11100000, // |*** | + 0b10100000, // |* * | + 0b10100000, // |* * | + 0b01110000, // | *** | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char 0x04 width = 5 + 0b00100000|CW_05, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b11100000, // |*** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char 0x05 width = 5 + 0b11000000|CW_05, // |** | + 0b10000000, // |* | + 0b11000000, // |** | + 0b01100000, // | ** | + 0b01010000, // | * * | + 0b01100000, // | ** | + 0b01010000, // | * * | + +// Char 0x06 width = 5 + 0b10000000|CW_05, // |* | + 0b10000000, // |* | + 0b11000000, // |** | + 0b00110000, // | ** | + 0b00100000, // | * | + 0b00110000, // | ** | + 0b00100000, // | * | + +// Char 0x07 width = 5 + 0b00100000|CW_05, // | * | + 0b01010000, // | * * | + 0b00100000, // | * | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x08 width = 5 + 0b00000000|CW_05, // | | + 0b00100000, // | * | + 0b01110000, // | *** | + 0b00100000, // | * | + 0b00000000, // | | + 0b01110000, // | *** | + 0b00000000, // | | + +// Char 0x09 width = 5 + 0b10010000|CW_05, // |* * | + 0b11010000, // |** * | + 0b10110000, // |* ** | + 0b10010000, // |* * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00110000, // | ** | + +// Char 0x0A width = 5 + 0b10100000|CW_05, // |* * | + 0b10100000, // |* * | + 0b10100000, // |* * | + 0b01000000, // | * | + 0b01110000, // | *** | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char 0x0B width = 5 + 0b00100000|CW_05, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b11100000, // |*** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x0C width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11100000, // |*** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char 0x0D width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00111000, // | *** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char 0x0E width = 5 + 0b00100000|CW_05, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00111000, // | *** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x0F width = 5 + 0b00100000|CW_05, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b11111000, // |***** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char 0x10 width = 5 + 0b00000000|CW_05, // | | + 0b11111000, // |***** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x11 width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b11111000, // |***** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x12 width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111000, // |***** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x13 width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111000, // |***** | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x14 width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111000, // |***** | + 0b00000000, // | | + +// Char 0x15 width = 5 + 0b00100000|CW_05, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00111000, // | *** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | #endif -// FONT_START_CHAR = 0x17 - /* Character (0x17): - width=6 - +--------+ - | | - | * | - | * | - | * * | - | * * | - |* * | - |***** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00100000, - 0b00100000, - 0b01010000, - 0b01010000, - 0b10001000, - 0b11111000, - - /* Character (0x18): - width=5 - +--------+ - |* | - |** | - |*** | - |**** | - |*** | - |** | - |* | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_4px, - 0b11000000, - 0b11100000, - 0b11110000, - 0b11100000, - 0b11000000, - 0b10000000, - - /* Character (0x19): - width=7 - +--------+ - | | - | ** ** | - |* ** * | - |* * * | - |* ** * | - | ** ** | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_7px, - 0b01101100, - 0b10110010, - 0b10010010, - 0b10011010, - 0b01101100, - 0b00000000, - - /* Character (0x1a): - width=6 - +--------+ - | | - | * | - | * | - |***** | - | * | - | * | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00100000, - 0b01000000, - 0b11111000, - 0b01000000, - 0b00100000, - 0b00000000, - - /* Character (0x1b): - width=6 - +--------+ - | | - | * | - | * | - |***** | - | * | - | * | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00100000, - 0b00010000, - 0b11111000, - 0b00010000, - 0b00100000, - 0b00000000, - - /* Character (0x1c): - width=6 - +--------+ - | | - |***** | - | * * | - | * * | - | * * | - | * * | - |* ** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b11111000, - 0b01010000, - 0b01010000, - 0b01010000, - 0b01010000, - 0b10011000, - - /* Character (0x1d): - width=6 - +--------+ - | | - | | - |* * | - |* * | - |** ** | - |* * * | - |* | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00000000, - 0b10001000, - 0b10001000, - 0b11011000, - 0b10101000, - 0b10000000, - - /* Character (0x1e): - width=6 - +--------+ - | | - | *** | - |* * | - |* * | - |* * | - | * * | - |** ** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b01110000, - 0b10001000, - 0b10001000, - 0b10001000, - 0b01010000, - 0b11011000, - - /* Character (0x1f): - width=5 - +--------+ - | ** | - |* * | - |* * | - | ** | - | | - | | - | | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b01100000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x20): ' ' - width=3 - +--------+ - | | - | | - | | - | | - | | - | | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_4px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x21): '!' - width=3 - +--------+ - | * | - | * | - | * | - | * | - | * | - | | - | * | - +--------+ */ - 0b01000000|CHAR5x7_WIDTH_3px, - 0b01000000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b00000000, - 0b01000000, - - /* Character (0x22): '"' - width=5 - +--------+ - | * * | - | * * | - | * * | - | | - | | - | | - | | - +--------+ */ - 0b01010000, - 0b01010000, - 0b01010000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x23): '#' - width=5 - +--------+ - | * * | - | * * | - |***** | - | * * | - |***** | - | * * | - | * * | - +--------+ */ - 0b01010000|CHAR5x7_WIDTH_6px, - 0b01010000, - 0b11111000, - 0b01010000, - 0b11111000, - 0b01010000, - 0b01010000, - - /* Character (0x24): '$' - width=5 - +--------+ - | * | - | **** | - |* * | - | *** | - | * * | - |**** | - | * | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_6px, - 0b01111000, - 0b10100000, - 0b01110000, - 0b00101000, - 0b11110000, - 0b00100000, - - /* Character (0x25): '%' - width=6 - +--------+ - |** | - |** * | - | * | - | * | - | * | - |* ** | - | ** | - +--------+ */ - 0b11000000|CHAR5x7_WIDTH_6px, - 0b11001000, - 0b00010000, - 0b00100000, - 0b01000000, - 0b10011000, - 0b00011000, - - /* Character (0x26): '&' - width=5 - +--------+ - | | - | * | - | * * | - | ** | - |* * * | - |* * | - | ** * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00100000, - 0b01010000, - 0b01100000, - 0b10101000, - 0b10010000, - 0b01101000, - - /* Character (0x27): ''' - width=4 - +--------+ - | ** | - | * | - |* | - | | - | | - | | - | | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_4px, - 0b01000000, - 0b10000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x28): '(' - width=4 - +--------+ - | * | - | * | - |* | - |* | - |* | - | * | - | * | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_4px, - 0b01000000, - 0b10000000, - 0b10000000, - 0b10000000, - 0b01000000, - 0b00100000, - - /* Character (0x29): ')' - width=5 - +--------+ - |* | - | * | - | * | - | * | - | * | - | * | - |* | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_4px, - 0b01000000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b01000000, - 0b10000000, - - /* Character (0x2a): '*' - width=6 - +--------+ - | | - | * | - |* * * | - | *** | - |* * * | - | * | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00100000, - 0b10101000, - 0b01110000, - 0b10101000, - 0b00100000, - 0b00000000, - - /* Character (0x2b): '+' - width=6 - +--------+ - | | - | * | - | * | - |***** | - | * | - | * | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00100000, - 0b00100000, - 0b11111000, - 0b00100000, - 0b00100000, - 0b00000000, - - /* Character (0x2c): ',' - width=4 - +--------+ - | | - | | - | | - | | - |** | - | * | - |* | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_3px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11000000, - 0b01000000, - 0b10000000, - - /* Character (0x2d): '-' - width=5 - +--------+ - | | - | | - | | - |**** | - | | - | | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b00000000, - 0b11110000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x2e): '.' - width=3 - +--------+ - | | - | | - | | - | | - | | - |** | - |** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_3px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11000000, - 0b11000000, - - /* Character (0x2f): '/' - width=4 - +--------+ - | * | - | * | - | * | - | * | - | * | - |* | - |* | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_4px, - 0b00100000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b10000000, - 0b10000000, - - /* Character (0x30): '0' - width=5 - +--------+ - | ** | - |* * | - |* ** | - |** * | - |* * | - |* * | - | ** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b01100000, - - /* Character (0x31): '1' - width=5 - +--------+ - | * | - | ** | - | * | - | * | - | * | - | * | - | *** | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_5px, - 0b01100000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b01110000, - - /* Character (0x32): '2' - width=5 - +--------+ - | ** | - |* * | - | * | - | * | - | * | - |* | - |**** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b00010000, - 0b00100000, - 0b01000000, - 0b10000000, - 0b11110000, - - /* Character (0x33): '3' - width=5 - +--------+ - | ** | - |* * | - | * | - | ** | - | * | - |* * | - | ** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b00010000, - 0b01100000, - 0b00010000, - 0b10010000, - 0b01100000, - - /* Character (0x34): '4' - width=5 - +--------+ - |* * | - |* * | - |* * | - |* * | - |**** | - | * | - | * | - +--------+ */ - 0b10010000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b10010000, - 0b11110000, - 0b00010000, - 0b00010000, - - /* Character (0x35): '5' - width=5 - +--------+ - |**** | - |* | - |*** | - | * | - | * | - |* * | - | ** | - +--------+ */ - 0b11110000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b11100000, - 0b00010000, - 0b00010000, - 0b10010000, - 0b01100000, - - /* Character (0x36): '6' - width=5 - +--------+ - | ** | - |* * | - |* | - |*** | - |* * | - |* * | - | ** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10000000, - 0b11100000, - 0b10010000, - 0b10010000, - 0b01100000, - - /* Character (0x37): '7' - width=5 - +--------+ - |**** | - | * | - | * | - | * | - | * | - | * | - | * | - +--------+ */ - 0b11110000|CHAR5x7_WIDTH_5px, - 0b00010000, - 0b00100000, - 0b00100000, - 0b01000000, - 0b01000000, - 0b01000000, - - /* Character (0x38): '8' - width=5 - +--------+ - | ** | - |* * | - |* * | - | ** | - |* * | - |* * | - | ** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b01100000, - 0b10010000, - 0b10010000, - 0b01100000, - - /* Character (0x39): '9' - width=5 - +--------+ - | ** | - |* * | - |* * | - | *** | - | * | - |* * | - | ** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b01110000, - 0b00010000, - 0b10010000, - 0b01100000, - - /* Character (0x3a): ':' - width=3 - +--------+ - | | - |** | - |** | - | | - |** | - |** | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_4px, - 0b11000000, - 0b11000000, - 0b00000000, - 0b11000000, - 0b11000000, - 0b00000000, - - /* Character (0x3b): ';' - width=4 - +--------+ - | | - | ** | - | ** | - | | - | ** | - | * | - |* | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_4px, - 0b01100000, - 0b01100000, - 0b00000000, - 0b01100000, - 0b01000000, - 0b10000000, - - /* Character (0x3c): '<' - width=5 - +--------+ - | | - | * | - | * | - |* | - | * | - | * | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00100000, - 0b01000000, - 0b10000000, - 0b01000000, - 0b00100000, - 0b00000000, - - /* Character (0x3d): '=' - width=5 - +--------+ - | | - | | - |**** | - | | - |**** | - | | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b11110000, - 0b00000000, - 0b11110000, - 0b00000000, - 0b00000000, - - /* Character (0x3e): '>' - width=5 - +--------+ - | | - |* | - | * | - | * | - | * | - |* | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b01000000, - 0b00100000, - 0b01000000, - 0b10000000, - 0b00000000, - - /* Character (0x3f): '?' - width=5 - +--------+ - | ** | - |* * | - | * | - | * | - | * | - | | - | * | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b00010000, - 0b00100000, - 0b01000000, - 0b00000000, - 0b01000000, - - /* Character (0x40): '@' - width=5 - +--------+ - | ** | - |* * | - |* ** | - |* ** | - |* | - |* | - | *** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10110000, - 0b10110000, - 0b10000000, - 0b10000000, - 0b01110000, - - /* Character (0x41): 'A' - width=5 - +--------+ - | ** | - |* * | - |* * | - |* * | - |**** | - |* * | - |* * | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b10010000, - 0b11110000, - 0b10010000, - 0b10010000, - - /* Character (0x42): 'B' - width=5 - +--------+ - |*** | - |* * | - |* * | - |*** | - |* * | - |* * | - |*** | - +--------+ */ - 0b11100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b11100000, - 0b10010000, - 0b10010000, - 0b11100000, - - /* Character (0x43): 'C' - width=5 - +--------+ - | ** | - |* * | - |* | - |* | - |* | - |* * | - | ** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10000000, - 0b10000000, - 0b10000000, - 0b10010000, - 0b01100000, - - /* Character (0x44): 'D' - width=5 - +--------+ - |*** | - |* * | - |* * | - |* * | - |* * | - |* * | - |*** | - +--------+ */ - 0b11100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b11100000, - - /* Character (0x45): 'E' - width=5 - +--------+ - |**** | - |* | - |* | - |*** | - |* | - |* | - |**** | - +--------+ */ - 0b11110000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b10000000, - 0b11100000, - 0b10000000, - 0b10000000, - 0b11110000, - - /* Character (0x46): 'F' - width=5 - +--------+ - |**** | - |* | - |* | - |*** | - |* | - |* | - |* | - +--------+ */ - 0b11110000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b10000000, - 0b11100000, - 0b10000000, - 0b10000000, - 0b10000000, - - /* Character (0x47): 'G' - width=5 - +--------+ - | ** | - |* * | - |* | - |* ** | - |* * | - |* * | - | *** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10000000, - 0b10110000, - 0b10010000, - 0b10010000, - 0b01110000, - - /* Character (0x48): 'H' - width=5 - +--------+ - |* * | - |* * | - |* * | - |**** | - |* * | - |* * | - |* * | - +--------+ */ - 0b10010000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b11110000, - 0b10010000, - 0b10010000, - 0b10010000, - - /* Character (0x49): 'I' - width=4 - +--------+ - |*** | - | * | - | * | - | * | - | * | - | * | - |*** | - +--------+ */ - 0b11100000|CHAR5x7_WIDTH_4px, - 0b01000000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b11100000, - - /* Character (0x4a): 'J' - width=5 - +--------+ - | *** | - | * | - | * | - | * | - | * | - |* * | - | ** | - +--------+ */ - 0b01110000|CHAR5x7_WIDTH_5px, - 0b00010000, - 0b00010000, - 0b00010000, - 0b00010000, - 0b10010000, - 0b01100000, - - /* Character (0x4b): 'K' - width=5 - +--------+ - |* * | - |* * | - |* * | - |** | - |* * | - |* * | - |* * | - +--------+ */ - 0b10010000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b11100000, - 0b10010000, - 0b10010000, - 0b10010000, - - /* Character (0x4c): 'L' - width=5 - +--------+ - |* | - |* | - |* | - |* | - |* | - |* | - |**** | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b10000000, - 0b10000000, - 0b10000000, - 0b10000000, - 0b11110000, - - /* Character (0x4d): 'M' - width=6 - +--------+ - |* * | - |** ** | - |* * * | - |* * * | - |* * | - |* * | - |* * | - +--------+ */ - 0b10001000|CHAR5x7_WIDTH_6px, - 0b11011000, - 0b10101000, - 0b10101000, - 0b10001000, - 0b10001000, - 0b10001000, - - /* Character (0x4e): 'N' - width=5 - +--------+ - |* * | - |* * | - |** * | - |* ** | - |* * | - |* * | - |* * | - +--------+ */ - 0b10010000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b11010000, - 0b10110000, - 0b10010000, - 0b10010000, - 0b10010000, - - /* Character (0x4f): 'O' - width=5 - +--------+ - | ** | - |* * | - |* * | - |* * | - |* * | - |* * | - | ** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b01100000, - - /* Character (0x50): 'P' - width=5 - +--------+ - |*** | - |* * | - |* * | - |*** | - |* | - |* | - |* | - +--------+ */ - 0b11100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b11100000, - 0b10000000, - 0b10000000, - 0b10000000, - - /* Character (0x51): 'Q' - width=5 - +--------+ - | ** | - |* * | - |* * | - |* * | - |* * | - |* * | - | * * | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10100000, - 0b01010000, - - /* Character (0x52): 'R' - width=5 - +--------+ - |*** | - |* * | - |* * | - |*** | - |* * | - |* * | - |* * | - +--------+ */ - 0b11100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b11100000, - 0b10010000, - 0b10010000, - 0b10010000, - - /* Character (0x53): 'S' - width=5 - +--------+ - | ** | - |* * | - |* | - | ** | - | * | - |* * | - | ** | - +--------+ */ - 0b01100000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10000000, - 0b01100000, - 0b00010000, - 0b10010000, - 0b01100000, - - /* Character (0x54): 'T' - width=6 - +--------+ - |***** | - | * | - | * | - | * | - | * | - | * | - | * | - +--------+ */ - 0b11111000|CHAR5x7_WIDTH_6px, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - - /* Character (0x55): 'U' - width=5 - +--------+ - |* * | - |* * | - |* * | - |* * | - |* * | - |* * | - | *** | - +--------+ */ - 0b10010000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b01110000, - - /* Character (0x56): 'V' - width=5 - +--------+ - |* * | - |* * | - |* * | - |* * | - |* * | - | ** | - | ** | - +--------+ */ - 0b10010000|CHAR5x7_WIDTH_5px, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b01100000, - 0b01100000, - - /* Character (0x57): 'W' - width=6 - +--------+ - |* * | - |* * | - |* * | - |* * * | - |* * * | - |* * * | - | * * | - +--------+ */ - 0b10001000|CHAR5x7_WIDTH_6px, - 0b10001000, - 0b10001000, - 0b10101000, - 0b10101000, - 0b10101000, - 0b01010000, - - /* Character (0x58): 'X' - width=6 - +--------+ - |* * | - |* * | - | * * | - | * | - | * * | - |* * | - |* * | - +--------+ */ - 0b10001000|CHAR5x7_WIDTH_6px, - 0b10001000, - 0b01010000, - 0b00100000, - 0b01010000, - 0b10001000, - 0b10001000, - - /* Character (0x59): 'Y' - width=6 - +--------+ - |* * | - |* * | - |* * | - | * * | - | * | - | * | - | * | - +--------+ */ - 0b10001000|CHAR5x7_WIDTH_6px, - 0b10001000, - 0b10001000, - 0b01010000, - 0b00100000, - 0b00100000, - 0b00100000, - - /* Character (0x5a): 'Z' - width=5 - +--------+ - |**** | - | * | - | * | - | * | - |* | - |* | - |**** | - +--------+ */ - 0b11110000|CHAR5x7_WIDTH_5px, - 0b00010000, - 0b00100000, - 0b01000000, - 0b10000000, - 0b10000000, - 0b11110000, - - /* Character (0x5b): '[' - width=4 - +--------+ - |*** | - |* | - |* | - |* | - |* | - |* | - |*** | - +--------+ */ - 0b11100000|CHAR5x7_WIDTH_4px, - 0b10000000, - 0b10000000, - 0b10000000, - 0b10000000, - 0b10000000, - 0b11100000, - - /* Character (0x5c): '\' - width=4 - +--------+ - |* | - |* | - | * | - | * | - | * | - | * | - | * | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_4px, - 0b10000000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b00100000, - 0b00100000, - - /* Character (0x5d): ']' - width=4 - +--------+ - |*** | - | * | - | * | - | * | - | * | - | * | - |*** | - +--------+ */ - 0b11100000|CHAR5x7_WIDTH_4px, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b11100000, - - /* Character (0x5e): '^' - width=4 - +--------+ - | * | - |* * | - | | - | | - | | - | | - | | - +--------+ */ - 0b01000000|CHAR5x7_WIDTH_4px, - 0b10100000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x5f): '_' - width=5 - +--------+ - | | - | | - | | - | | - | | - | | - |***** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111000, - - /* Character (0x60): '`' - width=4 - +--------+ - |** | - | * | - | * | - | | - | | - | | - | | - +--------+ */ - 0b11000000|CHAR5x7_WIDTH_4px, - 0b01000000, - 0b00100000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character (0x61): 'a' - width=5 - +--------+ - | | - | | - | *** | - |* * | - |* * | - |* ** | - | * * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b01110000, - 0b10010000, - 0b10010000, - 0b10110000, - 0b01010000, - - /* Character (0x62): 'b' - width=5 - +--------+ - |* | - |* | - |* * | - |** * | - |* * | - |* * | - |*** | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b10100000, - 0b11010000, - 0b10010000, - 0b10010000, - 0b11100000, - - /* Character (0x63): 'c' - width=5 - +--------+ - | | - | | - | *** | - |* | - |* | - |* | - | *** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b01110000, - 0b10000000, - 0b10000000, - 0b10000000, - 0b01110000, - - /* Character (0x64): 'd' - width=5 - +--------+ - | * | - | * | - | * * | - |* ** | - |* * | - |* * | - | *** | - +--------+ */ - 0b00010000|CHAR5x7_WIDTH_5px, - 0b00010000, - 0b01010000, - 0b10110000, - 0b10010000, - 0b10010000, - 0b01110000, - - /* Character (0x65): 'e' - width=5 - +--------+ - | | - | | - | ** | - |* * | - |**** | - |* | - | *** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b01100000, - 0b10010000, - 0b11110000, - 0b10000000, - 0b01110000, - - /* Character (0x66): 'f' - width=5 - +--------+ - | * | - | * * | - | * | - |*** | - | * | - | * | - | * | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_5px, - 0b01010000, - 0b01000000, - 0b11100000, - 0b01000000, - 0b01000000, - 0b01000000, - - /* Character (0x67): 'g' - width=5 - +--------+ - | | - | | - | *** | - |* * | - | *** | - | * | - | ** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b01110000, - 0b10010000, - 0b01110000, - 0b00010000, - 0b01100000, - - /* Character (0x68): 'h' - width=5 - +--------+ - |* | - |* | - |* * | - |** * | - |* * | - |* * | - |* * | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b10100000, - 0b11010000, - 0b10010000, - 0b10010000, - 0b10010000, - - /* Character (0x69): 'i' - width=4 - +--------+ - | * | - | | - |** | - | * | - | * | - | * | - |*** | - +--------+ */ - 0b01000000|CHAR5x7_WIDTH_4px, - 0b00000000, - 0b11000000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b11100000, - - /* Character (0x6a): - width=4 - +--------+ - | * | - | | - | * | - | * | - | * | - |* * | - | * | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_4px, - 0b00000000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b10100000, - 0b01000000, - - /* Character (0x6b): 'k' - width=5 - +--------+ - |* | - |* | - |* * | - |* * | - |** | - |* * | - |* * | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_5px, - 0b10000000, - 0b10010000, - 0b10100000, - 0b11000000, - 0b10100000, - 0b10010000, - - /* Character (0x6c): 'l' - width=4 - +--------+ - |** | - | * | - | * | - | * | - | * | - | * | - |*** | - +--------+ */ - 0b11000000|CHAR5x7_WIDTH_4px, - 0b01000000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b11100000, - - /* Character (0x6d): 'm' - width=6 - +--------+ - | | - | | - |**** | - |* * * | - |* * * | - |* * * | - |* * * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00000000, - 0b11110000, - 0b10101000, - 0b10101000, - 0b10101000, - 0b10101000, - - /* Character (0x6e): 'n' - width=5 - +--------+ - | | - | | - |* * | - |** * | - |* * | - |* * | - |* * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b10100000, - 0b11010000, - 0b10010000, - 0b10010000, - 0b10010000, - - /* Character (0x6f): 'o' - width=5 - +--------+ - | | - | | - | ** | - |* * | - |* * | - |* * | - | ** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b01100000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b01100000, - - /* Character (0x70): 'p' - width=5 - +--------+ - | | - | | - |*** | - |* * | - |* * | - |*** | - |* | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b11100000, - 0b10010000, - 0b10010000, - 0b11100000, - 0b10000000, - - /* Character (0x71): 'q' - width=5 - +--------+ - | | - | | - | *** | - |* * | - |* * | - | *** | - | * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b01110000, - 0b10010000, - 0b10010000, - 0b01110000, - 0b00010000, - - /* Character (0x72): 'r' - width=5 - +--------+ - | | - | | - |* * | - |** * | - |* | - |* | - |* | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b10100000, - 0b11010000, - 0b10000000, - 0b10000000, - 0b10000000, - - /* Character (0x73): 's' - width=5 - +--------+ - | | - | | - | *** | - |* | - | ** | - | * | - |*** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b01110000, - 0b10000000, - 0b01100000, - 0b00010000, - 0b11100000, - - /* Character (0x74): 't' - width=5 - +--------+ - | * | - | * | - |*** | - | * | - | * | - | * | - | ** | - +--------+ */ - 0b01000000|CHAR5x7_WIDTH_5px, - 0b01000000, - 0b11100000, - 0b01000000, - 0b01000000, - 0b01000000, - 0b00110000, - - /* Character (0x75): 'u' - width=5 - +--------+ - | | - | | - |* * | - |* * | - |* * | - |* ** | - | * * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b10110000, - 0b01010000, - - /* Character (0x76): 'v' - width=5 - +--------+ - | | - | | - |* * | - |* * | - |* * | - | ** | - | ** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b10010000, - 0b10010000, - 0b10010000, - 0b01100000, - 0b01100000, - - /* Character (0x77): 'w' - width=6 - +--------+ - | | - | | - |* * | - |* * | - |* * * | - |* * * | - | * * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_6px, - 0b00000000, - 0b10001000, - 0b10001000, - 0b10101000, - 0b10101000, - 0b01010000, - - /* Character (0x78): 'x' - width=5 - +--------+ - | | - | | - |* * | - |* * | - | ** | - |* * | - |* * | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b10010000, - 0b10010000, - 0b01100000, - 0b10010000, - 0b10010000, - - /* Character (0x79): 'y' - width=5 - +--------+ - | | - | | - |* * | - |* * | - | *** | - | * | - |*** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b10010000, - 0b10010000, - 0b01110000, - 0b00010000, - 0b11100000, - - /* Character (0x7a): 'z' - width=5 - +--------+ - | | - | | - |**** | - | * | - | * | - |* | - |**** | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b11110000, - 0b00100000, - 0b01000000, - 0b10000000, - 0b11110000, - - /* Character (0x7b): '{' - width=5 - +--------+ - | * | - | * | - | * | - |* | - | * | - | * | - | * | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_4px, - 0b01000000, - 0b01000000, - 0b10000000, - 0b01000000, - 0b01000000, - 0b00100000, - - /* Character (0x7c): '|' - width=5 - +--------+ - | * | - | * | - | * | - | * | - | * | - | * | - | * | - +--------+ */ - 0b00100000|CHAR5x7_WIDTH_4px, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - 0b00100000, - - /* Character (0x7d): '}' - width=5 - +--------+ - |* | - | * | - | * | - | * | - | * | - | * | - |* | - +--------+ */ - 0b10000000|CHAR5x7_WIDTH_4px, - 0b01000000, - 0b01000000, - 0b00100000, - 0b01000000, - 0b01000000, - 0b10000000, - - /* Character (0x7e): '~' - width=5 - +--------+ - | | - | | - | * * | - |* * | - | | - | | - | | - +--------+ */ - 0b00000000|CHAR5x7_WIDTH_5px, - 0b00000000, - 0b01010000, - 0b10100000, - 0b00000000, - 0b00000000, - 0b00000000, + +// Char 0x16 width = 8 + 0b00000000|CW_08, // | | + 0b00000110, // | ** | + 0b00000110, // | ** | + 0b01000110, // | * ** | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b01000000, // | * | + +// Char "\029" width = 6 + 0b00000000|CW_06, // | | + 0b00100000, // | * | + 0b00100000, // | * | + 0b01010000, // | * * | + 0b01010000, // | * * | + 0b10001000, // |* * | + 0b11111000, // |***** | + +// Char "\030" width = 4 + 0b10000000|CW_04, // |* | + 0b11000000, // |** | + 0b11100000, // |*** | + 0b11110000, // |**** | + 0b11100000, // |*** | + 0b11000000, // |** | + 0b10000000, // |* | + +// Char "\031" width = 8 + 0b00000000|CW_08, // | | + 0b01101100, // | ** ** | + 0b10110010, // |* ** * | + 0b10010010, // |* * * | + 0b10011010, // |* ** * | + 0b01101100, // | ** ** | + 0b00000000, // | | + +// Char "\032" width = 6 + 0b00000000|CW_06, // | | + 0b00100000, // | * | + 0b01000000, // | * | + 0b11111000, // |***** | + 0b01000000, // | * | + 0b00100000, // | * | + 0b00000000, // | | + +// Char "\033" width = 6 + 0b00000000|CW_06, // | | + 0b00100000, // | * | + 0b00010000, // | * | + 0b11111000, // |***** | + 0b00010000, // | * | + 0b00100000, // | * | + 0b00000000, // | | + +// Char "\034" width = 6 + 0b00000000|CW_06, // | | + 0b11111000, // |***** | + 0b01010000, // | * * | + 0b01010000, // | * * | + 0b01010000, // | * * | + 0b01010000, // | * * | + 0b10011000, // |* ** | + +// Char "\035" width = 6 + 0b00000000|CW_06, // | | + 0b00000000, // | | + 0b10001000, // |* * | + 0b10001000, // |* * | + 0b11011000, // |** ** | + 0b10101000, // |* * * | + 0b10000000, // |* | + +// Char "\036" width = 6 + 0b01110000|CW_06, // | *** | + 0b10001000, // |* * | + 0b10001000, // |* * | + 0b10001000, // |* * | + 0b01010000, // | * * | + 0b01010000, // | * * | + 0b11011000, // |** ** | + +// Char "\037" width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char ' ' width = 4 + 0b00000000|CW_04, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '!' width = 3 + 0b01000000|CW_03, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b00000000, // | | + 0b01000000, // | * | + +// Char '"' width = 8 + 0b01010000|CW_08, // | * * | + 0b01010000, // | * * | + 0b01010000, // | * * | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '#' width = 6 + 0b01010000|CW_06, // | * * | + 0b01010000, // | * * | + 0b11111000, // |***** | + 0b01010000, // | * * | + 0b11111000, // |***** | + 0b01010000, // | * * | + 0b01010000, // | * * | + +// Char '$' width = 6 + 0b00100000|CW_06, // | * | + 0b01111000, // | **** | + 0b10100000, // |* * | + 0b01110000, // | *** | + 0b00101000, // | * * | + 0b11110000, // |**** | + 0b00100000, // | * | + +// Char '%' width = 6 + 0b11000000|CW_06, // |** | + 0b11001000, // |** * | + 0b00010000, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b10011000, // |* ** | + 0b00011000, // | ** | + +// Char '&' width = 6 + 0b00000000|CW_06, // | | + 0b00100000, // | * | + 0b01010000, // | * * | + 0b01100000, // | ** | + 0b10101000, // |* * * | + 0b10010000, // |* * | + 0b01101000, // | ** * | + +// Char ''' width = 4 + 0b01100000|CW_04, // | ** | + 0b01000000, // | * | + 0b10000000, // |* | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '(' width = 4 + 0b00100000|CW_04, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b01000000, // | * | + 0b00100000, // | * | + +// Char ')' width = 4 + 0b10000000|CW_04, // |* | + 0b01000000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + +// Char '*' width = 6 + 0b00000000|CW_06, // | | + 0b00100000, // | * | + 0b10101000, // |* * * | + 0b01110000, // | *** | + 0b10101000, // |* * * | + 0b00100000, // | * | + 0b00000000, // | | + +// Char '+' width = 6 + 0b00000000|CW_06, // | | + 0b00100000, // | * | + 0b00100000, // | * | + 0b11111000, // |***** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00000000, // | | + +// Char ',' width = 3 + 0b00000000|CW_03, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11000000, // |** | + 0b01000000, // | * | + 0b10000000, // |* | + +// Char '-' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11110000, // |**** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '.' width = 3 + 0b00000000|CW_03, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11000000, // |** | + 0b11000000, // |** | + +// Char '/' width = 4 + 0b00100000|CW_04, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + 0b10000000, // |* | + +// Char '0' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char '1' width = 5 + 0b00100000|CW_05, // | * | + 0b01100000, // | ** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b01110000, // | *** | + +// Char '2' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b00010000, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + 0b11110000, // |**** | + +// Char '3' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b00010000, // | * | + 0b01100000, // | ** | + 0b00010000, // | * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char '4' width = 5 + 0b10010000|CW_05, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11110000, // |**** | + 0b00010000, // | * | + 0b00010000, // | * | + +// Char '5' width = 5 + 0b11110000|CW_05, // |**** | + 0b10000000, // |* | + 0b11100000, // |*** | + 0b00010000, // | * | + 0b00010000, // | * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char '6' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10000000, // |* | + 0b11100000, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char '7' width = 5 + 0b11110000|CW_05, // |**** | + 0b00010000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + +// Char '8' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char '9' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01110000, // | *** | + 0b00010000, // | * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char ':' width = 4 + 0b00000000|CW_04, // | | + 0b11000000, // |** | + 0b11000000, // |** | + 0b00000000, // | | + 0b11000000, // |** | + 0b11000000, // |** | + 0b00000000, // | | + +// Char ';' width = 4 + 0b00000000|CW_04, // | | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00000000, // | | + 0b01100000, // | ** | + 0b01000000, // | * | + 0b10000000, // |* | + +// Char '<' width = 5 + 0b00000000|CW_05, // | | + 0b00100000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + 0b01000000, // | * | + 0b00100000, // | * | + 0b00000000, // | | + +// Char '=' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b11110000, // |**** | + 0b00000000, // | | + 0b11110000, // |**** | + 0b00000000, // | | + 0b00000000, // | | + +// Char '>' width = 5 + 0b00000000|CW_05, // | | + 0b10000000, // |* | + 0b01000000, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + 0b00000000, // | | + +// Char '?' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b00010000, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b00000000, // | | + 0b01000000, // | * | + +// Char '@' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10110000, // |* ** | + 0b10110000, // |* ** | + 0b10000000, // |* | + 0b10000000, // |* | + 0b01110000, // | *** | + +// Char 'A' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11110000, // |**** | + 0b10010000, // |* * | + 0b10010000, // |* * | + +// Char 'B' width = 5 + 0b11100000|CW_05, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11100000, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11100000, // |*** | + +// Char 'C' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char 'D' width = 5 + 0b11100000|CW_05, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11100000, // |*** | + +// Char 'E' width = 5 + 0b11110000|CW_05, // |**** | + 0b10000000, // |* | + 0b10000000, // |* | + 0b11100000, // |*** | + 0b10000000, // |* | + 0b10000000, // |* | + 0b11110000, // |**** | + +// Char 'F' width = 5 + 0b11110000|CW_05, // |**** | + 0b10000000, // |* | + 0b10000000, // |* | + 0b11100000, // |*** | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + +// Char 'G' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10000000, // |* | + 0b10110000, // |* ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01110000, // | *** | + +// Char 'H' width = 5 + 0b10010000|CW_05, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11110000, // |**** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + +// Char 'I' width = 4 + 0b11100000|CW_04, // |*** | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b11100000, // |*** | + +// Char 'J' width = 5 + 0b01110000|CW_05, // | *** | + 0b00010000, // | * | + 0b00010000, // | * | + 0b00010000, // | * | + 0b00010000, // | * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char 'K' width = 5 + 0b10010000|CW_05, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11100000, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + +// Char 'L' width = 5 + 0b10000000|CW_05, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b11110000, // |**** | + +// Char 'M' width = 6 + 0b10001000|CW_06, // |* * | + 0b11011000, // |** ** | + 0b10101000, // |* * * | + 0b10101000, // |* * * | + 0b10101000, // |* * * | + 0b10001000, // |* * | + 0b10001000, // |* * | + +// Char 'N' width = 5 + 0b10010000|CW_05, // |* * | + 0b10010000, // |* * | + 0b11010000, // |** * | + 0b10110000, // |* ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + +// Char 'O' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char 'P' width = 5 + 0b11100000|CW_05, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11100000, // |*** | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + +// Char 'Q' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10100000, // |* * | + 0b01010000, // | * * | + +// Char 'R' width = 5 + 0b11100000|CW_05, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11100000, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + +// Char 'S' width = 5 + 0b01100000|CW_05, // | ** | + 0b10010000, // |* * | + 0b10000000, // |* | + 0b01100000, // | ** | + 0b00010000, // | * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char 'T' width = 6 + 0b11111000|CW_06, // |***** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char 'U' width = 5 + 0b10010000|CW_05, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01110000, // | *** | + +// Char 'V' width = 5 + 0b10010000|CW_05, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + 0b01100000, // | ** | + +// Char 'W' width = 6 + 0b10001000|CW_06, // |* * | + 0b10001000, // |* * | + 0b10001000, // |* * | + 0b10101000, // |* * * | + 0b10101000, // |* * * | + 0b10101000, // |* * * | + 0b01010000, // | * * | + +// Char 'X' width = 6 + 0b10001000|CW_06, // |* * | + 0b10001000, // |* * | + 0b01010000, // | * * | + 0b00100000, // | * | + 0b01010000, // | * * | + 0b10001000, // |* * | + 0b10001000, // |* * | + +// Char 'Y' width = 6 + 0b10001000|CW_06, // |* * | + 0b10001000, // |* * | + 0b10001000, // |* * | + 0b01010000, // | * * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char 'Z' width = 5 + 0b11110000|CW_05, // |**** | + 0b00010000, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + 0b10000000, // |* | + 0b11110000, // |**** | + +// Char '[' width = 4 + 0b11100000|CW_04, // |*** | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b11100000, // |*** | + +// Char '\' width = 4 + 0b10000000|CW_04, // |* | + 0b10000000, // |* | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char ']' width = 4 + 0b11100000|CW_04, // |*** | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b11100000, // |*** | + +// Char '^' width = 4 + 0b01000000|CW_04, // | * | + 0b10100000, // |* * | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '_' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111000, // |***** | + +// Char '`' width = 4 + 0b11000000|CW_04, // |** | + 0b01000000, // | * | + 0b00100000, // | * | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 'a' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b01110000, // | *** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10110000, // |* ** | + 0b01010000, // | * * | + +// Char 'b' width = 5 + 0b10000000|CW_05, // |* | + 0b10000000, // |* | + 0b10100000, // |* * | + 0b11010000, // |** * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11100000, // |*** | + +// Char 'c' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b01110000, // | *** | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + 0b01110000, // | *** | + +// Char 'd' width = 5 + 0b00010000|CW_05, // | * | + 0b00010000, // | * | + 0b01010000, // | * * | + 0b10110000, // |* ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01110000, // | *** | + +// Char 'e' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b01100000, // | ** | + 0b10010000, // |* * | + 0b11110000, // |**** | + 0b10000000, // |* | + 0b01110000, // | *** | + +// Char 'f' width = 5 + 0b00100000|CW_05, // | * | + 0b01010000, // | * * | + 0b01000000, // | * | + 0b11100000, // |*** | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + +// Char 'g' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b01110000, // | *** | + 0b10010000, // |* * | + 0b01110000, // | *** | + 0b00010000, // | * | + 0b01100000, // | ** | + +// Char 'h' width = 5 + 0b10000000|CW_05, // |* | + 0b10000000, // |* | + 0b10100000, // |* * | + 0b11010000, // |** * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + +// Char 'i' width = 4 + 0b01000000|CW_04, // | * | + 0b00000000, // | | + 0b11000000, // |** | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b11100000, // |*** | + +// Char 'j' width = 4 + 0b00100000|CW_04, // | * | + 0b00000000, // | | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b10100000, // |* * | + 0b01000000, // | * | + +// Char 'k' width = 5 + 0b10000000|CW_05, // |* | + 0b10000000, // |* | + 0b10010000, // |* * | + 0b10100000, // |* * | + 0b11000000, // |** | + 0b10100000, // |* * | + 0b10010000, // |* * | + +// Char 'l' width = 4 + 0b11000000|CW_04, // |** | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b11100000, // |*** | + +// Char 'm' width = 6 + 0b00000000|CW_06, // | | + 0b00000000, // | | + 0b11110000, // |**** | + 0b10101000, // |* * * | + 0b10101000, // |* * * | + 0b10101000, // |* * * | + 0b10101000, // |* * * | + +// Char 'n' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b10100000, // |* * | + 0b11010000, // |** * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + +// Char 'o' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b01100000, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + +// Char 'p' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b11100000, // |*** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b11100000, // |*** | + 0b10000000, // |* | + +// Char 'q' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b01110000, // | *** | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01110000, // | *** | + 0b00010000, // | * | + +// Char 'r' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b10100000, // |* * | + 0b11010000, // |** * | + 0b10000000, // |* | + 0b10000000, // |* | + 0b10000000, // |* | + +// Char 's' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b01110000, // | *** | + 0b10000000, // |* | + 0b01100000, // | ** | + 0b00010000, // | * | + 0b11100000, // |*** | + +// Char 't' width = 5 + 0b01000000|CW_05, // | * | + 0b01000000, // | * | + 0b11100000, // |*** | + 0b01000000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b00110000, // | ** | + +// Char 'u' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10110000, // |* ** | + 0b01010000, // | * * | + +// Char 'v' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + 0b01100000, // | ** | + +// Char 'w' width = 6 + 0b00000000|CW_06, // | | + 0b00000000, // | | + 0b10001000, // |* * | + 0b10001000, // |* * | + 0b10101000, // |* * * | + 0b10101000, // |* * * | + 0b01010000, // | * * | + +// Char 'x' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01100000, // | ** | + 0b10010000, // |* * | + 0b10010000, // |* * | + +// Char 'y' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b10010000, // |* * | + 0b10010000, // |* * | + 0b01110000, // | *** | + 0b00010000, // | * | + 0b11100000, // |*** | + +// Char 'z' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b11110000, // |**** | + 0b00100000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + 0b11110000, // |**** | + +// Char '{' width = 4 + 0b00100000|CW_04, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + 0b01000000, // | * | + 0b01000000, // | * | + 0b00100000, // | * | + +// Char '|' width = 4 + 0b00100000|CW_04, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + 0b00100000, // | * | + +// Char '}' width = 4 + 0b10000000|CW_04, // |* | + 0b01000000, // | * | + 0b01000000, // | * | + 0b00100000, // | * | + 0b01000000, // | * | + 0b01000000, // | * | + 0b10000000, // |* | + +// Char '~' width = 5 + 0b00000000|CW_05, // | | + 0b00000000, // | | + 0b01010000, // | * * | + 0b10100000, // |* * | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | }; diff --git a/Font7x13b.c b/Font7x13b.c index dc882ac..cd0ef57 100644 --- a/Font7x13b.c +++ b/Font7x13b.c @@ -1,3461 +1,1703 @@ /* - * Font size 7x11 pixels - * most font glyph have width 7 pixels + * Copyright (c) 2019-2020, Dmitry (DiSlord) dislordlive@gmail.com + * All rights reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * The software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. */ #include /* + * Most font glyph have width 7 pixels * Check 0 byte of char bitmap data for get width */ -// Font definitions -#define FONT_START_CHAR 0x17 -#define FONT_MAX_WIDTH 8 -#define FONT_WIDTH 7 -#define FONT_GET_HEIGHT 11 -#define FONT_STR_HEIGHT 11 +#if 0 +// Font definitions for header +#define FONT_START_CHAR 0x16 +#define FONT_WIDTH 7 +#define FONT_GET_HEIGHT 11 +#define FONT_STR_HEIGHT 11 #define FONT_GET_DATA(ch) ( &x7x11b_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]) #define FONT_GET_WIDTH(ch) (8-(x7x11b_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]&7)) +#endif #define CHAR7x11_WIDTH_MASK 0x07 -#define CHAR7x11_WIDTH_4px 0x04 -#define CHAR7x11_WIDTH_5px 0x03 -#define CHAR7x11_WIDTH_6px 0x02 -#define CHAR7x11_WIDTH_7px 0x01 -#define CHAR7x11_WIDTH_8px 0x00 +#define CW_01 (8 - 1) +#define CW_02 (8 - 2) +#define CW_03 (8 - 3) +#define CW_04 (8 - 4) +#define CW_05 (8 - 5) +#define CW_06 (8 - 6) +#define CW_07 (8 - 7) +#define CW_08 (8 - 8) /* Font character bitmap data. */ const uint8_t x7x11b_bits[] = { #if 0 - /* Character 0 (0x00): - width 7 - +-------+ - | | - | ***** | - | ***** | - | ***** | - | ***** | - | ***** | - | ***** | - | ***** | - | ***** | - | ***** | - | ***** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111100, - 0b01111100, - 0b01111100, - 0b01111100, - 0b01111100, - 0b01111100, - 0b01111100, - 0b01111100, - 0b01111100, - 0b01111100, - - /* Character 1 (0x01): - width 7 - +-------+ - | | - | | - | | - | | - | ** | - | **** | - |****** | - | **** | - | ** | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00110000, - 0b01111000, - 0b11111100, - 0b01111000, - 0b00110000, - 0b00000000, - 0b00000000, - - /* Character 2 (0x02): - width 7 - +-------+ - |** ** | - | ** | - |** ** | - | ** | - |** ** | - | ** | - |** ** | - | ** | - |** ** | - | ** | - |** ** | - +-------+ */ - 0b11001100|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b11001100, - 0b00110000, - 0b11001100, - 0b00110000, - 0b11001100, - 0b00110000, - 0b11001100, - 0b00110000, - 0b11001100, - - /* Character 3 (0x03): - width 7 - +-------+ - |** ** | - |** ** | - |***** | - |** ** | - |** ** | - | | - | **** | - | ** | - | ** | - | ** | - | ** | - +-------+ */ - 0b11011000|CHAR7x11_WIDTH_7px, - 0b11011000, - 0b11111000, - 0b11011000, - 0b11011000, - 0b00000000, - 0b00111100, - 0b00011000, - 0b00011000, - 0b00011000, - 0b00011000, - - /* Character 4 (0x04): - width 7 - +-------+ - | ** | - | ** | - | ** | - | ** | - |*******| - |*******| - | | - | | - | | - | | - | | - +-------+ */ - 0b00110000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b00110000, - 0b00110000, - 0b11111110, - 0b11111110, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 5 (0x05): - width 7 - +-------+ - | *** | - |** | - |** | - |** | - | *** | - | | - | *** | - | ** * | - | *** | - | ** * | - | ** * | - +-------+ */ - 0b01110000|CHAR7x11_WIDTH_7px, - 0b11000000, - 0b11000000, - 0b11000000, - 0b01110000, - 0b00000000, - 0b00111000, - 0b00110100, - 0b00111000, - 0b00110100, - 0b00110100, - - /* Character 6 (0x06): - width 7 - +-------+ - |** | - |** | - |** | - |** | - |**** | - | | - | **** | - | ** | - | *** | - | ** | - | ** | - +-------+ */ - 0b11000000|CHAR7x11_WIDTH_7px, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11110000, - 0b00000000, - 0b00111100, - 0b00110000, - 0b00111000, - 0b00110000, - 0b00110000, - - /* Character 7 (0x07): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - | **** | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 8 (0x08): - width 7 - +-------+ - | | - | ** | - | ** | - |****** | - |****** | - | ** | - | ** | - | | - |****** | - |****** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b00110000, - 0b11111100, - 0b11111100, - 0b00110000, - 0b00110000, - 0b00000000, - 0b11111100, - 0b11111100, - 0b00000000, - - /* Character 9 (0x09): - width 7 - +-------+ - |** ** | - |*** ** | - |****** | - |** *** | - |** ** | - | | - | ** | - | ** | - | ** | - | ** | - | **** | - +-------+ */ - 0b11001100|CHAR7x11_WIDTH_7px, - 0b11101100, - 0b11111100, - 0b11011100, - 0b11001100, - 0b00000000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00111100, - - /* Character 10 (0x0a): - width 7 - +-------+ - |** ** | - |** ** | - | * * | - | **** | - | ** | - | | - | **** | - | ** | - | ** | - | ** | - | ** | - +-------+ */ - 0b11001100|CHAR7x11_WIDTH_7px, - 0b11001100, - 0b01001000, - 0b01111000, - 0b00110000, - 0b00000000, - 0b00111100, - 0b00011000, - 0b00011000, - 0b00011000, - 0b00011000, - - /* Character 11 (0x0b): - width 7 - +-------+ - | ** | - | ** | - | ** | - | ** | - | ** | - |**** | - |**** | - | | - | | - | | - | | - +-------+ */ - 0b00110000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b11110000, - 0b11110000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 12 (0x0c): - width 7 - +-------+ - | | - | | - | | - | | - |**** | - |**** | - | ** | - | ** | - | ** | - | ** | - | ** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11110000, - 0b11110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - - /* Character 13 (0x0d): - width 7 - +-------+ - | | - | | - | | - | | - | *****| - | *****| - | ** | - | ** | - | ** | - | ** | - | ** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00111110, - 0b00111110, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - - /* Character 14 (0x0e): - width 7 - +-------+ - | ** | - | ** | - | ** | - | ** | - | *****| - | *****| - | | - | | - | | - | | - | | - +-------+ */ - 0b00110000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00111110, - 0b00111110, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 15 (0x0f): - width 7 - +-------+ - | ** | - | ** | - | ** | - | ** | - |*******| - |*******| - | ** | - | ** | - | ** | - | ** | - | ** | - +-------+ */ - 0b00110000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b00110000, - 0b00110000, - 0b11111110, - 0b11111110, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - - /* Character 16 (0x10): - width 7 - +-------+ - | | - |*******| - |*******| - | | - | | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111110, - 0b11111110, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 17 (0x11): - width 7 - +-------+ - | | - | | - | | - |*******| - |*******| - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b11111110, - 0b11111110, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 18 (0x12): - width 7 - +-------+ - | | - | | - | | - | | - | | - |*******| - |*******| - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111110, - 0b11111110, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 19 (0x13): - width 7 - +-------+ - | | - | | - | | - | | - | | - | | - | | - |*******| - |*******| - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111110, - 0b11111110, - 0b00000000, - 0b00000000, - - /* Character 20 (0x14): - width 7 - +-------+ - | | - | | - | | - | | - | | - | | - | | - | | - | | - |*******| - |*******| - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111110, - 0b11111110, - - /* Character 21 (0x15): - width 7 - +-------+ - | ** | - | ** | - | ** | - | ** | - | *****| - | *****| - | ** | - | ** | - | ** | - | ** | - | ** | - +-------+ */ - 0b00110000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00111110, - 0b00111110, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - - /* Character 22 (0x16): - width 7 - +-------+ - | ** | - | ** | - | ** | - | ** | - |**** | - |**** | - | ** | - | ** | - | ** | - | ** | - | ** | - +-------+ */ - 0b00110000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b00110000, - 0b00110000, - 0b11110000, - 0b11110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, +// Char 0x00 width = 7 + 0b00000000|CW_07, // | | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + 0b01111100, // | ***** | + +// Char 0x01 width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00110000, // | ** | + 0b01111000, // | **** | + 0b11111100, // |****** | + 0b01111000, // | **** | + 0b00110000, // | ** | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x02 width = 3 + 0b11001000|CW_03, // |** * | + 0b00110000, // | ** | + 0b11001100, // |** ** | + 0b00110000, // | ** | + 0b11001100, // |** ** | + 0b00110000, // | ** | + 0b11001100, // |** ** | + 0b00110000, // | ** | + 0b11001100, // |** ** | + 0b00110000, // | ** | + 0b11001100, // |** ** | + +// Char 0x03 width = 7 + 0b11011000|CW_07, // |** ** | + 0b11011000, // |** ** | + 0b11111000, // |***** | + 0b11011000, // |** ** | + 0b11011000, // |** ** | + 0b00000000, // | | + 0b00111100, // | **** | + 0b00011000, // | ** | + 0b00011000, // | ** | + 0b00011000, // | ** | + 0b00011000, // | ** | + +// Char 0x04 width = 7 + 0b00110000|CW_07, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x05 width = 7 + 0b01110000|CW_07, // | *** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b01110000, // | *** | + 0b00000000, // | | + 0b00111000, // | *** | + 0b00110100, // | ** * | + 0b00111000, // | *** | + 0b00110100, // | ** * | + 0b00110100, // | ** * | + +// Char 0x06 width = 7 + 0b11000000|CW_07, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11110000, // |**** | + 0b00000000, // | | + 0b00111100, // | **** | + 0b00110000, // | ** | + 0b00111000, // | *** | + 0b00110000, // | ** | + 0b00110000, // | ** | + +// Char 0x07 width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x08 width = 7 + 0b00000000|CW_07, // | | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11111100, // |****** | + 0b11111100, // |****** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + 0b11111100, // |****** | + 0b11111100, // |****** | + 0b00000000, // | | + +// Char 0x09 width = 3 + 0b11001000|CW_03, // |** * | + 0b11101100, // |*** ** | + 0b11111100, // |****** | + 0b11011100, // |** *** | + 0b11001100, // |** ** | + 0b00000000, // | | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00111100, // | **** | + +// Char 0x0A width = 3 + 0b11001000|CW_03, // |** * | + 0b11001100, // |** ** | + 0b01001000, // | * * | + 0b01111000, // | **** | + 0b00110000, // | ** | + 0b00000000, // | | + 0b00111100, // | **** | + 0b00011000, // | ** | + 0b00011000, // | ** | + 0b00011000, // | ** | + 0b00011000, // | ** | + +// Char 0x0B width = 7 + 0b00110000|CW_07, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11110000, // |**** | + 0b11110000, // |**** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x0C width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11110000, // |**** | + 0b11110000, // |**** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + +// Char 0x0D width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00111110, // | ***** | + 0b00111110, // | ***** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + +// Char 0x0E width = 7 + 0b00110000|CW_07, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00111110, // | ***** | + 0b00111110, // | ***** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x0F width = 7 + 0b00110000|CW_07, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + +// Char 0x10 width = 7 + 0b00000000|CW_07, // | | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x11 width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x12 width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x13 width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b00000000, // | | + 0b00000000, // | | + +// Char 0x14 width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111110, // |******* | + 0b11111110, // |******* | + +// Char 0x15 width = 7 + 0b00110000|CW_07, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00111110, // | ***** | + 0b00111110, // | ***** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | #endif -// FONT_START_CHAR = 23 - /* Character 23 (0x17): - width 8 - +-------+ - | | - | * | - | * | - | *** | - | *** | - | ** ** | - | ** ** | - |** **| - |** **| - |*******| - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b00010000, - 0b00010000, - 0b00111000, - 0b00111000, - 0b01101100, - 0b01101100, - 0b11000110, - 0b11000110, - 0b11111110, - 0b00000000, - - /* Character 24 (0x18): - width 5 - +-------+ - | | - |* | - |** | - |*** | - |**** | - |***** | - |**** | - |*** | - |** | - |* | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b10000000, - 0b11000000, - 0b11100000, - 0b11110000, - 0b11111000, - 0b11110000, - 0b11100000, - 0b11000000, - 0b10000000, - 0b00000000, - - /* Character 25 (0x19): - width 8 - +--------+ - | | - | | - | ** *** | - |** ** **| - |* * *| - |* ** *| - |* ** *| - |* * *| - |** ** **| - | *** ** | - | | - +--------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b00000000, - 0b01101110, - 0b11011011, - 0b10010001, - 0b10011001, - 0b10011001, - 0b10001001, - 0b11011011, - 0b01110110, - 0b00000000, - - /* Character 26 (0x1a): - width 8 - +-------+ - | | - | | - | * | - | ** | - | ** | - |*******| - |*******| - | ** | - | ** | - | * | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b00000000, - 0b00010000, - 0b00110000, - 0b01100000, - 0b11111110, - 0b11111110, - 0b01100000, - 0b00110000, - 0b00010000, - 0b00000000, - - /* Character 27 (0x1b): - width 7 - +-------+ - | | - | | - | * | - | ** | - | ** | - |*******| - |*******| - | ** | - | ** | - | * | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00010000, - 0b00011000, - 0b00001100, - 0b01111110, - 0b01111110, - 0b00001100, - 0b00011000, - 0b00010000, - 0b00000000, - - /* Character 28 (0x1c): - width 7 - +-------+ - | | - | | - | | - | | - |****** | - | ** ** | - | ** ** | - | ** ** | - |*** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111100, - 0b01101100, - 0b01101100, - 0b01101100, - 0b11101100, - 0b11001100, - 0b00000000, - - /* Character 29 (0x1d): - width 8 - +-------+ - | | - | | - | | - | | - |** **| - |** **| - |** **| - |** **| - |*** ***| - |** * **| - |** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11000110, - 0b11000110, - 0b11000110, - 0b11000110, - 0b11101110, - 0b11010110, - 0b11000000, - - /* Character 30 (0x1e): - width 7 - +-------+ - | | - | ***** | - |** **| - |** **| - |** **| - |** **| - |** **| - | ** ** | - | ** ** | - |*** ***| - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b01111100, - 0b11000110, - 0b11000110, - 0b11000110, - 0b11000110, - 0b11000110, - 0b01101100, - 0b01101100, - 0b11101110, - 0b00000000, - - /* Character 31 (0x1f): - width 6 - +-------+ - | | - | *** | - |** ** | - |** ** | - | *** | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_6px, - 0b01110000, - 0b11011000, - 0b11011000, - 0b01110000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 32 (0x20): - width 4 - +-------+ - | | - | | - | | - | | - | | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_4px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 33 (0x21): - width 4 - +-------+ - | | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_4px, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b00000000, - 0b01100000, - 0b01100000, - 0b00000000, - - /* Character 34 (0x22): - width 6 - +-------+ - | | - |** ** | - |** ** | - |** ** | - | | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_6px, - 0b11011000, - 0b11011000, - 0b11011000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 35 (0x23): - width 6 - +-------+ - | | - | * * | - | * * | - |***** | - |***** | - | * * | - |***** | - |***** | - | * * | - | * * | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_6px, - 0b01010000, - 0b01010000, - 0b11111000, - 0b11111000, - 0b01010000, - 0b11111000, - 0b11111000, - 0b01010000, - 0b01010000, - 0b00000000, - - /* Character 36 (0x24): - width 8 - +-------+ - | | - | ** | - | ***** | - |* ** | - |* ** | - | **** | - | ** * | - | ** * | - |***** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b00110000, - 0b01111100, - 0b10110000, - 0b10110000, - 0b01111000, - 0b00110100, - 0b00110100, - 0b11111000, - 0b00110000, - 0b00000000, - - /* Character 37 (0x25): - width 8 - +-------+ - | ** | - |* * *| - |* * **| - | ** ** | - | ** | - | ** | - | ** ** | - |** * *| - |* * *| - | ** | - | | - +-------+ */ - 0b01100000|CHAR7x11_WIDTH_8px, - 0b10010010, - 0b10010110, - 0b01101100, - 0b00011000, - 0b00110000, - 0b01101100, - 0b11010010, - 0b10010010, - 0b00001100, - 0b00000000, - - /* Character 38 (0x26): - width 8 - +-------+ - | | - | *** | - |** ** | - |** ** | - | *** | - | *** *| - |** *** | - |** ** | - |** *** | - | *** *| - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b01110000, - 0b11011000, - 0b11011000, - 0b01110000, - 0b01110010, - 0b11011100, - 0b11001100, - 0b11011100, - 0b01110010, - 0b00000000, - - /* Character 39 (0x27): - width 5 - +-------+ - | | - | *** | - | *** | - | ** | - |** | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b01110000, - 0b01110000, - 0b01100000, - 0b11000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 40 (0x28): - width 5 - +-------+ - | | - | ** | - | ** | - | ** | - |** | - |** | - |** | - | ** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b00110000, - 0b01100000, - 0b01100000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b01100000, - 0b01100000, - 0b00110000, - 0b00000000, - - /* Character 41 (0x29): - width 5 - +-------+ - | | - |** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b11000000, - 0b01100000, - 0b01100000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b01100000, - 0b01100000, - 0b11000000, - 0b00000000, - - /* Character 42 (0x2a): '*' - width 7 - +-------+ - | | - | | - | | - | * | - |* * * | - | *** | - |* * * | - | * | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00100000, - 0b10101000, - 0b01110000, - 0b10101000, - 0b00100000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 43 (0x2b): - width 7 - +-------+ - | | - | | - | | - | ** | - | ** | - |****** | - |****** | - | ** | - | ** | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00110000, - 0b00110000, - 0b11111100, - 0b11111100, - 0b00110000, - 0b00110000, - 0b00000000, - 0b00000000, - - /* Character 44 (0x2c): - width 4 - +-------+ - | | - | | - | | - | | - | | - | | - | | - | * | - |*** | - | ** | - |** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_4px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01000000, - 0b11100000, - 0b01100000, - 0b11000000, - - /* Character 45 (0x2d): - width 7 - +-------+ - | | - | | - | | - | | - | | - |****** | - |****** | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111100, - 0b11111100, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 46 (0x2e): - width 4 - +-------+ - | | - | | - | | - | | - | | - | | - | | - | * | - |*** | - | * | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_4px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01000000, - 0b11100000, - 0b01000000, - 0b00000000, - - /* Character 47 (0x2f): - width 7 - +-------+ - | | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |** | - |** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00001100, - 0b00001100, - 0b00011000, - 0b00011000, - 0b00110000, - 0b01100000, - 0b01100000, - 0b11000000, - 0b11000000, - 0b00000000, - - /* Character 48 (0x30): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - |** *** | - |*** ** | - |** ** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 49 (0x31): - width 7 - +-------+ - | | - | ** | - | *** | - |* ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |****** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b01110000, - 0b10110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b11111100, - 0b00000000, - - /* Character 50 (0x32): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - | ** | - | *** | - | ** | - |** | - |** | - |****** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b00001100, - 0b00111000, - 0b01100000, - 0b11000000, - 0b11000000, - 0b11111100, - 0b00000000, - - /* Character 51 (0x33): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - | ** | - | *** | - | ** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b00001100, - 0b00111000, - 0b00001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 52 (0x34): - width 7 - +-------+ - | | - | ** | - | *** | - | **** | - | ** ** | - |** ** | - |** ** | - |****** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00001100, - 0b00011100, - 0b00111100, - 0b01101100, - 0b11001100, - 0b11001100, - 0b11111100, - 0b00001100, - 0b00001100, - 0b00000000, - - /* Character 53 (0x35): - width 7 - +-------+ - | | - |****** | - |** | - |** | - |***** | - |** ** | - | ** | - | ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111100, - 0b11000000, - 0b11000000, - 0b11111000, - 0b11001100, - 0b00001100, - 0b00001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 54 (0x36): - width 7 - +-------+ - | | - | **** | - |** ** | - |** | - |** | - |***** | - |** ** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11000000, - 0b11000000, - 0b11111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 55 (0x37): - width 7 - +-------+ - | | - |****** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111100, - 0b00001100, - 0b00001100, - 0b00011000, - 0b00011000, - 0b00110000, - 0b00110000, - 0b01100000, - 0b01100000, - 0b00000000, - - /* Character 56 (0x38): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - |** ** | - | **** | - |** ** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 57 (0x39): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - |** ** | - | ***** | - | ** | - | ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111100, - 0b00001100, - 0b00001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 58 (0x3a): - width 4 - +-------+ - | | - | | - | * | - |*** | - | * | - | | - | * | - |*** | - | * | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_4px, - 0b00000000, - 0b01000000, - 0b11100000, - 0b01000000, - 0b00000000, - 0b01000000, - 0b11100000, - 0b01000000, - 0b00000000, - 0b00000000, - - /* Character 59 (0x3b): - width 4 - +-------+ - | | - | | - | * | - |*** | - | * | - | | - | * | - |*** | - | * | - |* | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_4px, - 0b00000000, - 0b01000000, - 0b11100000, - 0b01000000, - 0b00000000, - 0b01000000, - 0b11100000, - 0b01000000, - 0b10000000, - 0b00000000, - - /* Character 60 (0x3c): - width 7 - +-------+ - | | - | ** | - | ** | - | ** | - | ** | - |** | - | ** | - | ** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00001100, - 0b00011000, - 0b00110000, - 0b01100000, - 0b11000000, - 0b01100000, - 0b00110000, - 0b00011000, - 0b00001100, - 0b00000000, - - /* Character 61 (0x3d): - width 7 - +-------+ - | | - | | - | | - | | - |****** | - | | - | | - |****** | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111100, - 0b00000000, - 0b00000000, - 0b11111100, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 62 (0x3e): - width 7 - +-------+ - | | - |** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11000000, - 0b01100000, - 0b00110000, - 0b00011000, - 0b00001100, - 0b00011000, - 0b00110000, - 0b01100000, - 0b11000000, - 0b00000000, - - /* Character 63 (0x3f): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - | ** | - | ** | - | ** | - | | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b00001100, - 0b00011000, - 0b00110000, - 0b00000000, - 0b00110000, - 0b00110000, - 0b00000000, - - /* Character 64 (0x40): - width 7 - +-------+ - | | - | **** | - |* ** | - |* ** | - |* **** | - |* * ** | - |* *** | - |* | - |* ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b10001100, - 0b10001100, - 0b10111100, - 0b10101100, - 0b10111000, - 0b10000000, - 0b10001100, - 0b01111000, - 0b00000000, - - /* Character 65 (0x41): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - |** ** | - |****** | - |** ** | - |** ** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11111100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b00000000, - - /* Character 66 (0x42): - width 7 - +-------+ - | | - |***** | - |** ** | - |** ** | - |** ** | - |***** | - |** ** | - |** ** | - |** ** | - |***** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11111000, - 0b00000000, - - /* Character 67 (0x43): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - |** | - |** | - |** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 68 (0x44): - width 7 - +-------+ - | | - |***** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |***** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11111000, - 0b00000000, - - /* Character 69 (0x45): - width 7 - +-------+ - | | - |****** | - |** | - |** | - |** | - |***** | - |** | - |** | - |** | - |****** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111100, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11111000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11111100, - 0b00000000, - - /* Character 70 (0x46): - width 7 - +-------+ - | | - |****** | - |** | - |** | - |** | - |***** | - |** | - |** | - |** | - |** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111100, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11111000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b00000000, - - /* Character 71 (0x47): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - |** | - |** | - |** *** | - |** ** | - |** *** | - | ** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11000000, - 0b11000000, - 0b11011100, - 0b11001100, - 0b11011100, - 0b01101100, - 0b00000000, - - /* Character 72 (0x48): - width 7 - +-------+ - | | - |** ** | - |** ** | - |** ** | - |** ** | - |****** | - |** ** | - |** ** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11111100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b00000000, - - /* Character 73 (0x49): - width 5 - +-------+ - | | - |**** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |**** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b11110000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b11110000, - 0b00000000, - - /* Character 74 (0x4a): - width 7 - +-------+ - | | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00001100, - 0b00001100, - 0b00001100, - 0b00001100, - 0b00001100, - 0b00001100, - 0b00001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 75 (0x4b): - width 7 - +-------+ - | | - |** ** | - |** ** | - |** ** | - |** ** | - |**** | - |** ** | - |** ** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11011000, - 0b11110000, - 0b11011000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b00000000, - - /* Character 76 (0x4c): - width 7 - +-------+ - | | - |** | - |** | - |** | - |** | - |** | - |** | - |** | - |** | - |****** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11111100, - 0b00000000, - - /* Character 77 (0x4d): - width 8 - +-------+ - | | - |** **| - |** **| - |*** ***| - |*** ***| - |** * **| - |** * **| - |** * **| - |** **| - |** **| - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b11000110, - 0b11000110, - 0b11101110, - 0b11101110, - 0b11010110, - 0b11010110, - 0b11010110, - 0b11000110, - 0b11000110, - 0b00000000, - - /* Character 78 (0x4e): - width 7 - +-------+ - | | - |** ** | - |** ** | - |*** ** | - |*** ** | - |****** | - |** *** | - |** *** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11001100, - 0b11001100, - 0b11101100, - 0b11101100, - 0b11111100, - 0b11011100, - 0b11011100, - 0b11001100, - 0b11001100, - 0b00000000, - - /* Character 79 (0x4f): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 80 (0x50): - width 7 - +-------+ - | | - |***** | - |** ** | - |** ** | - |** ** | - |***** | - |** | - |** | - |** | - |** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11111000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b00000000, - - /* Character 81 (0x51): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |*** ** | - |** *** | - | **** | - | ** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11101100, - 0b11011100, - 0b01111000, - 0b00001100, - - /* Character 82 (0x52): - width 7 - +-------+ - | | - |***** | - |** ** | - |** ** | - |** ** | - |***** | - |** ** | - |** ** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11111000, - 0b11011000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b00000000, - - /* Character 83 (0x53): - width 7 - +-------+ - | | - | **** | - |** ** | - |** ** | - | ** | - | ** | - | ** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01111000, - 0b11001100, - 0b11001100, - 0b01100000, - 0b00110000, - 0b00011000, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 84 (0x54): - width 7 - +-------+ - | | - |****** | - |* ** * | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111100, - 0b10110100, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00000000, - - /* Character 85 (0x55): - width 7 - +-------+ - | | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 86 (0x56): - width 8 - +-------+ - | | - |** **| - |** **| - |** **| - | ** ** | - | ** ** | - | ** ** | - | *** | - | *** | - | * | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b11000110, - 0b11000110, - 0b11000110, - 0b01101100, - 0b01101100, - 0b01101100, - 0b00111000, - 0b00111000, - 0b00010000, - 0b00000000, - - /* Character 87 (0x57): - width 7 - +-------+ - | | - |** **| - |** **| - |** * **| - |** * **| - |** * **| - |** * **| - |*******| - |*******| - | ** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b11000110, - 0b11000110, - 0b11000110, - 0b11010110, - 0b11010110, - 0b11010110, - 0b11010110, - 0b11111110, - 0b01101100, - 0b00000000, - - /* Character 88 (0x58): - width 7 - +-------+ - | | - |** ** | - |** ** | - |** ** | - | * * | - | ** | - | * * | - |** ** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01001000, - 0b00110000, - 0b01001000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b00000000, - - /* Character 89 (0x59):Y - width 7 - +-------+ - | | - |** ** | - |** ** | - |** ** | - |** ** | - | **** | - | ** | - | ** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00000000, - - /* Character 90 (0x5a): - width 7 - +-------+ - | | - |****** | - | ** | - | ** | - | ** | - | ** | - | ** | - |** | - |** | - |****** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11111100, - 0b00001100, - 0b00001100, - 0b00011000, - 0b00110000, - 0b01100000, - 0b11000000, - 0b11000000, - 0b11111100, - 0b00000000, - - /* Character 91 (0x5b): - width 5 - +-------+ - | | - | **** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b11110000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11110000, - 0b00000000, - - /* Character 92 (0x5c): - width 7 - +-------+ - | | - |** | - |** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11000000, - 0b11000000, - 0b01100000, - 0b01100000, - 0b00110000, - 0b00011000, - 0b00011000, - 0b00001100, - 0b00001100, - 0b00000000, - - /* Character 93 (0x5d): - width 5 - +-------+ - | | - |**** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |**** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b11110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b11110000, - 0b00000000, - - /* Character 94 (0x5e): - width 7 - +-------+ - | | - | ** | - | **** | - |** ** | - |* * | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00110000, - 0b01111000, - 0b11001100, - 0b10000100, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 95 (0x5f): - width 7 - +-------+ - | | - | | - | | - | | - | | - | | - | | - | | - | | - |****** | - |****** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111100, - 0b11111100, - - /* Character 96 (0x60): - width 5 - +-------+ - | | - |** | - | ** | - | ** | - | | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b11000000, - 0b01100000, - 0b00110000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - - /* Character 97 (0x61): - width 7 - +-------+ - | | - | | - | | - | | - | **** | - | ** | - | ***** | - |** ** | - |** ** | - | ***** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01111000, - 0b00001100, - 0b01111100, - 0b11001100, - 0b11001100, - 0b01111100, - 0b00000000, - - /* Character 98 (0x62): - width 7 - +-------+ - | | - |** | - |** | - |** | - |** ** | - |*** ** | - |** ** | - |** ** | - |*** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11011000, - 0b11101100, - 0b11001100, - 0b11001100, - 0b11101100, - 0b11011000, - 0b00000000, - - /* Character 99 (0x63): - width 7 - +-------+ - | | - | | - | | - | | - | **** | - |** ** | - |** | - |** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01111000, - 0b11001100, - 0b11000000, - 0b11000000, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 100 (0x64): - width 7 - +-------+ - | | - | ** | - | ** | - | ** | - | ** ** | - |** *** | - |** ** | - |** ** | - |** *** | - | ** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00001100, - 0b00001100, - 0b00001100, - 0b01101100, - 0b11011100, - 0b11001100, - 0b11001100, - 0b11011100, - 0b01101100, - 0b00000000, - - /* Character 101 (0x65): - width 7 - +-------+ - | | - | | - | | - | | - | **** | - |** ** | - |****** | - |** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01111000, - 0b11001100, - 0b11111100, - 0b11000000, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 102 (0x66): - width 7 - +-------+ - | | - | *** | - | ** ** | - | ** | - | ** | - |**** | - | ** | - | ** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00111000, - 0b01101100, - 0b01100000, - 0b01100000, - 0b11110000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b00000000, - - /* Character 103 (0x67):g - width 7 - +-------+ - | | - | | - | | - | | - | *** * | - |** ** | - |** ** | - |** ** | - | ***** | - | ** | - | **** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01110100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111100, - 0b00001100, - 0b01111000, - - /* Character 104 (0x68): - width 7 - +-------+ - | | - |** | - |** | - |** | - |** ** | - |*** ** | - |** ** | - |** ** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11011000, - 0b11101100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b00000000, - - /* Character 105 (0x69): - width 7 - +-------+ - | | - | ** | - | ** | - | | - |*** | - | ** | - | ** | - | ** | - | ** | - |**** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b01100000, - 0b01100000, - 0b00000000, - 0b11100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b11110000, - 0b00000000, - - /* Character 106 (0x6a): - width 7 - +-------+ - | | - | ** | - | ** | - | | - | ** | - | ** | - | ** | - | ** | - | ** | - |** ** | - | **** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00001100, - 0b00001100, - 0b00000000, - 0b00001100, - 0b00001100, - 0b00001100, - 0b00001100, - 0b00001100, - 0b11001100, - 0b01111000, - - /* Character 107 (0x6b): - width 7 - +-------+ - | | - |** | - |** | - |** | - |** ** | - |** ** | - |**** | - |**** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11001100, - 0b11011000, - 0b11110000, - 0b11110000, - 0b11011000, - 0b11001100, - 0b00000000, - - /* Character 108 (0x6c): - width 7 - +-------+ - | | - | *** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |****** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b11111100, - 0b00000000, - - /* Character 109 (0x6d): - width 7 - +-------+ - | | - | | - | | - | | - |*** ** | - |*******| - |** * **| - |** * **| - |** * **| - |** * **| - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11101100, - 0b11111110, - 0b11010110, - 0b11010110, - 0b11010110, - 0b11010110, - 0b00000000, - - /* Character 110 (0x6e): - width 7 - +-------+ - | | - | | - | | - | | - |** ** | - |*** ** | - |** ** | - |** ** | - |** ** | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11011000, - 0b11101100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b00000000, - - /* Character 111 (0x6f): - width 7 - +-------+ - | | - | | - | | - | | - | **** | - |** ** | - |** ** | - |** ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01111000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 112 (0x70): - width 7 - +-------+ - | | - | | - | | - | | - |** ** | - |*** ** | - |** ** | - |** ** | - |***** | - |** | - |** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11011000, - 0b11101100, - 0b11001100, - 0b11001100, - 0b11111000, - 0b11000000, - 0b11000000, - - /* Character 113 (0x71): - width 7 - +-------+ - | | - | | - | | - | | - | ** ** | - |** *** | - |** ** | - |** ** | - | ***** | - | ** | - | ** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01101100, - 0b11011100, - 0b11001100, - 0b11001100, - 0b01111100, - 0b00001100, - 0b00001100, - - /* Character 114 (0x72): - width 7 - +-------+ - | | - | | - | | - | | - |* *** | - |*** ** | - |** | - |** | - |** | - |** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11011000, - 0b11101100, - 0b11000000, - 0b11000000, - 0b11000000, - 0b11000000, - 0b00000000, - - /* Character 115 (0x73): - width 7 - +-------+ - | | - | | - | | - | | - | **** | - |** ** | - | ** | - | ** | - |** ** | - | **** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b01111000, - 0b11001100, - 0b01100000, - 0b00011000, - 0b11001100, - 0b01111000, - 0b00000000, - - /* Character 116 (0x74): - width 7 - +-------+ - | | - | | - | ** | - | ** | - |***** | - | ** | - | ** | - | ** | - | ** ** | - | *** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b01100000, - 0b01100000, - 0b11111000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01101100, - 0b00111000, - 0b00000000, - - /* Character 117 (0x75): - width 7 - +-------+ - | | - | | - | | - | | - |** ** | - |** ** | - |** ** | - |** ** | - |** *** | - | ** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11001100, - 0b11011100, - 0b01101100, - 0b00000000, - - /* Character 118 (0x76): - width 7 - +-------+ - | | - | | - | | - | | - |** ** | - |** ** | - | * * | - | * * | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11001100, - 0b11001100, - 0b01001000, - 0b01001000, - 0b00110000, - 0b00110000, - 0b00000000, - - /* Character 119 (0x77): - width 7 - +-------+ - | | - | | - | | - | | - |** **| - |** **| - |** * **| - |** * **| - |*******| - | ** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_8px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11000110, - 0b11000110, - 0b11010110, - 0b11010110, - 0b11111110, - 0b01101100, - 0b00000000, - - /* Character 120 (0x78): - width 7 - +-------+ - | | - | | - | | - | | - |** ** | - | * * | - | ** | - | ** | - | * * | - |** ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11001100, - 0b01001000, - 0b00110000, - 0b00110000, - 0b01001000, - 0b11001100, - 0b00000000, - - /* Character 121 (0x79): - width 7 - +-------+ - | | - | | - | | - | | - |** ** | - |** ** | - |** ** | - | ***** | - | ** | - |** ** | - | **** | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11001100, - 0b11001100, - 0b11001100, - 0b01111100, - 0b00001100, - 0b11001100, - 0b01111000, - - /* Character 122 (0x7a): - width 7 - +-------+ - | | - | | - | | - | | - |****** | - | ** | - | ** | - | ** | - |** | - |****** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b00000000, - 0b00000000, - 0b00000000, - 0b11111100, - 0b00001100, - 0b00011000, - 0b01100000, - 0b11000000, - 0b11111100, - 0b00000000, - - /* Character 123 (0x7b): - width 6 - +-------+ - | | - | *** | - | ** | - | ** | - | ** | - |** | - | ** | - | ** | - | ** | - | *** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_6px, - 0b00111000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b11000000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b00111000, - 0b00000000, - - /* Character 124 (0x7c): - width 5 - +-------+ - | | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_5px, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b01100000, - 0b00000000, - - /* Character 125 (0x7d): - width 6 - +-------+ - | | - |*** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - | ** | - |*** | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_6px, - 0b11100000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b00011000, - 0b00110000, - 0b00110000, - 0b00110000, - 0b11100000, - 0b00000000, - - /* Character 126 (0x7e): - width 7 - +-------+ - | | - | ** * | - |****** | - |* ** | - | | - | | - | | - | | - | | - | | - | | - +-------+ */ - 0b00000000|CHAR7x11_WIDTH_7px, - 0b01100100, - 0b11111100, - 0b10011000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, - 0b00000000, + +// Char 0x16 width = 8 + 0b00000000|CW_08, // | | + 0b00000110, // | ** | + 0b00000110, // | ** | + 0b00000110, // | ** | + 0b00100110, // | * ** | + 0b01100110, // | ** ** | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b01100000, // | ** | + 0b00100000, // | * | + 0b00000000, // | | + +// Char "\029" width = 8 + 0b00000000|CW_08, // | | + 0b00010000, // | * | + 0b00010000, // | * | + 0b00111000, // | *** | + 0b00111000, // | *** | + 0b01101100, // | ** ** | + 0b01101100, // | ** ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11111110, // |******* | + 0b00000000, // | | + +// Char "\030" width = 6 + 0b00000000|CW_06, // | | + 0b10000000, // |* | + 0b11000000, // |** | + 0b11100000, // |*** | + 0b11110000, // |**** | + 0b11111000, // |***** | + 0b11110000, // |**** | + 0b11100000, // |*** | + 0b11000000, // |** | + 0b10000000, // |* | + 0b00000000, // | | + +// Char "\031" width = 8 + 0b00000000|CW_08, // | | + 0b00000000, // | | + 0b01101110, // | ** *** | + 0b11011011, // |** ** **| + 0b10010001, // |* * *| + 0b10011001, // |* ** *| + 0b10001001, // |* * *| + 0b11011011, // |** ** **| + 0b01110110, // | *** ** | + 0b00000000, // | | + 0b00000000, // | | + +// Char "\032" width = 8 + 0b00000000|CW_08, // | | + 0b00000000, // | | + 0b00010000, // | * | + 0b00110000, // | ** | + 0b01100000, // | ** | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b01100000, // | ** | + 0b00110000, // | ** | + 0b00010000, // | * | + 0b00000000, // | | + +// Char "\033" width = 8 + 0b00000000|CW_08, // | | + 0b00000000, // | | + 0b00010000, // | * | + 0b00011000, // | ** | + 0b00001100, // | ** | + 0b11111110, // |******* | + 0b11111110, // |******* | + 0b00001100, // | ** | + 0b00011000, // | ** | + 0b00010000, // | * | + 0b00000000, // | | + +// Char "\034" width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111100, // |****** | + 0b01101100, // | ** ** | + 0b01101100, // | ** ** | + 0b01101100, // | ** ** | + 0b11101100, // |*** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char "\035" width = 8 + 0b00000000|CW_08, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11101110, // |*** *** | + 0b11010110, // |** * ** | + 0b11000000, // |** | + +// Char "\036" width = 8 + 0b00000000|CW_08, // | | + 0b01111100, // | ***** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b01101100, // | ** ** | + 0b01101100, // | ** ** | + 0b11101110, // |*** *** | + 0b00000000, // | | + +// Char "\037" width = 6 + 0b00000000|CW_06, // | | + 0b01110000, // | *** | + 0b11011000, // |** ** | + 0b11011000, // |** ** | + 0b01110000, // | *** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char ' ' width = 4 + 0b00000000|CW_04, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '!' width = 4 + 0b00000000|CW_04, // | | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00000000, // | | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00000000, // | | + +// Char '"' width = 6 + 0b00000000|CW_06, // | | + 0b11011000, // |** ** | + 0b11011000, // |** ** | + 0b11011000, // |** ** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '#' width = 6 + 0b00000000|CW_06, // | | + 0b01010000, // | * * | + 0b01010000, // | * * | + 0b11111000, // |***** | + 0b11111000, // |***** | + 0b01010000, // | * * | + 0b11111000, // |***** | + 0b11111000, // |***** | + 0b01010000, // | * * | + 0b01010000, // | * * | + 0b00000000, // | | + +// Char '$' width = 8 + 0b00000000|CW_08, // | | + 0b00110000, // | ** | + 0b01111100, // | ***** | + 0b10110000, // |* ** | + 0b10110000, // |* ** | + 0b01111000, // | **** | + 0b00110100, // | ** * | + 0b00110100, // | ** * | + 0b11111000, // |***** | + 0b00110000, // | ** | + 0b00000000, // | | + +// Char '%' width = 8 + 0b01100000|CW_08, // | ** | + 0b10010010, // |* * * | + 0b10010110, // |* * ** | + 0b01101100, // | ** ** | + 0b00011000, // | ** | + 0b00110000, // | ** | + 0b01101100, // | ** ** | + 0b11010010, // |** * * | + 0b10010010, // |* * * | + 0b00001100, // | ** | + 0b00000000, // | | + +// Char '&' width = 8 + 0b00000000|CW_08, // | | + 0b01110000, // | *** | + 0b11011000, // |** ** | + 0b11011000, // |** ** | + 0b01110000, // | *** | + 0b01110010, // | *** * | + 0b11011100, // |** *** | + 0b11001100, // |** ** | + 0b11011100, // |** *** | + 0b01110010, // | *** * | + 0b00000000, // | | + +// Char ''' width = 5 + 0b00000000|CW_05, // | | + 0b11100000, // |*** | + 0b11100000, // |*** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '(' width = 5 + 0b00000000|CW_05, // | | + 0b00110000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + +// Char ')' width = 5 + 0b00000000|CW_05, // | | + 0b11000000, // |** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b00000000, // | | + +// Char '*' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00100000, // | * | + 0b10101000, // |* * * | + 0b01110000, // | *** | + 0b10101000, // |* * * | + 0b00100000, // | * | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '+' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11111100, // |****** | + 0b11111100, // |****** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + 0b00000000, // | | + +// Char ',' width = 4 + 0b00000000|CW_04, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01000000, // | * | + 0b11100000, // |*** | + 0b01100000, // | ** | + 0b11000000, // |** | + +// Char '-' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111100, // |****** | + 0b11111100, // |****** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '.' width = 4 + 0b00000000|CW_04, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01000000, // | * | + 0b11100000, // |*** | + 0b01000000, // | * | + 0b00000000, // | | + +// Char '/' width = 7 + 0b00000000|CW_07, // | | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00011000, // | ** | + 0b00011000, // | ** | + 0b00110000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b00000000, // | | + +// Char '0' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11011100, // |** *** | + 0b11101100, // |*** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char '1' width = 7 + 0b00000000|CW_07, // | | + 0b00110000, // | ** | + 0b01110000, // | *** | + 0b10110000, // |* ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11111100, // |****** | + 0b00000000, // | | + +// Char '2' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00001100, // | ** | + 0b00111000, // | *** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11111100, // |****** | + 0b00000000, // | | + +// Char '3' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00001100, // | ** | + 0b00111000, // | *** | + 0b00001100, // | ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char '4' width = 7 + 0b00000000|CW_07, // | | + 0b00001100, // | ** | + 0b00011100, // | *** | + 0b00111100, // | **** | + 0b01101100, // | ** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111100, // |****** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00000000, // | | + +// Char '5' width = 7 + 0b00000000|CW_07, // | | + 0b11111100, // |****** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11111000, // |***** | + 0b11001100, // |** ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char '6' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11111000, // |***** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char '7' width = 7 + 0b00000000|CW_07, // | | + 0b11111100, // |****** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00011000, // | ** | + 0b00011000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00000000, // | | + +// Char '8' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char '9' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111100, // | ***** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char ':' width = 4 + 0b00000000|CW_04, // | | + 0b00000000, // | | + 0b01000000, // | * | + 0b11100000, // |*** | + 0b01000000, // | * | + 0b00000000, // | | + 0b01000000, // | * | + 0b11100000, // |*** | + 0b01000000, // | * | + 0b00000000, // | | + 0b00000000, // | | + +// Char ';' width = 4 + 0b00000000|CW_04, // | | + 0b00000000, // | | + 0b01000000, // | * | + 0b11100000, // |*** | + 0b01000000, // | * | + 0b00000000, // | | + 0b01000000, // | * | + 0b11100000, // |*** | + 0b01000000, // | * | + 0b10000000, // |* | + 0b00000000, // | | + +// Char '<' width = 7 + 0b00000000|CW_07, // | | + 0b00001100, // | ** | + 0b00011000, // | ** | + 0b00110000, // | ** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b01100000, // | ** | + 0b00110000, // | ** | + 0b00011000, // | ** | + 0b00001100, // | ** | + 0b00000000, // | | + +// Char '=' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111100, // |****** | + 0b00000000, // | | + 0b00000000, // | | + 0b11111100, // |****** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '>' width = 7 + 0b00000000|CW_07, // | | + 0b11000000, // |** | + 0b01100000, // | ** | + 0b00110000, // | ** | + 0b00011000, // | ** | + 0b00001100, // | ** | + 0b00011000, // | ** | + 0b00110000, // | ** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b00000000, // | | + +// Char '?' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00001100, // | ** | + 0b00011000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + +// Char '@' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b10001100, // |* ** | + 0b10001100, // |* ** | + 0b10111100, // |* **** | + 0b10101100, // |* * ** | + 0b10111000, // |* *** | + 0b10000000, // |* | + 0b10001100, // |* ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'A' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111100, // |****** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'B' width = 7 + 0b00000000|CW_07, // | | + 0b11111000, // |***** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111000, // |***** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111000, // |***** | + 0b00000000, // | | + +// Char 'C' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'D' width = 7 + 0b00000000|CW_07, // | | + 0b11111000, // |***** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111000, // |***** | + 0b00000000, // | | + +// Char 'E' width = 7 + 0b00000000|CW_07, // | | + 0b11111100, // |****** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11111000, // |***** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11111100, // |****** | + 0b00000000, // | | + +// Char 'F' width = 7 + 0b00000000|CW_07, // | | + 0b11111100, // |****** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11111000, // |***** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b00000000, // | | + +// Char 'G' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11011100, // |** *** | + 0b11001100, // |** ** | + 0b11011100, // |** *** | + 0b01101100, // | ** ** | + 0b00000000, // | | + +// Char 'H' width = 7 + 0b00000000|CW_07, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111100, // |****** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'I' width = 5 + 0b00000000|CW_05, // | | + 0b11110000, // |**** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b11110000, // |**** | + 0b00000000, // | | + +// Char 'J' width = 7 + 0b00000000|CW_07, // | | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'K' width = 7 + 0b00000000|CW_07, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11011000, // |** ** | + 0b11110000, // |**** | + 0b11011000, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'L' width = 7 + 0b00000000|CW_07, // | | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11111100, // |****** | + 0b00000000, // | | + +// Char 'M' width = 8 + 0b00000000|CW_08, // | | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11101110, // |*** *** | + 0b11101110, // |*** *** | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b00000000, // | | + +// Char 'N' width = 7 + 0b00000000|CW_07, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11101100, // |*** ** | + 0b11101100, // |*** ** | + 0b11111100, // |****** | + 0b11011100, // |** *** | + 0b11011100, // |** *** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'O' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'P' width = 7 + 0b00000000|CW_07, // | | + 0b11111000, // |***** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111000, // |***** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b00000000, // | | + +// Char 'Q' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11101100, // |*** ** | + 0b11011100, // |** *** | + 0b01111000, // | **** | + 0b00001100, // | ** | + +// Char 'R' width = 7 + 0b00000000|CW_07, // | | + 0b11111000, // |***** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111000, // |***** | + 0b11011000, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'S' width = 7 + 0b00000000|CW_07, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01100000, // | ** | + 0b00110000, // | ** | + 0b00011000, // | ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'T' width = 7 + 0b00000000|CW_07, // | | + 0b11111100, // |****** | + 0b10110100, // |* ** * | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + +// Char 'U' width = 7 + 0b00000000|CW_07, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'V' width = 8 + 0b00000000|CW_08, // | | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b01101100, // | ** ** | + 0b01101100, // | ** ** | + 0b01101100, // | ** ** | + 0b00111000, // | *** | + 0b00111000, // | *** | + 0b00010000, // | * | + 0b00000000, // | | + +// Char 'W' width = 8 + 0b00000000|CW_08, // | | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b11111110, // |******* | + 0b01101100, // | ** ** | + 0b00000000, // | | + +// Char 'X' width = 7 + 0b00000000|CW_07, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01001000, // | * * | + 0b00110000, // | ** | + 0b01001000, // | * * | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'Y' width = 7 + 0b00000000|CW_07, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + +// Char 'Z' width = 7 + 0b00000000|CW_07, // | | + 0b11111100, // |****** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00011000, // | ** | + 0b00110000, // | ** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11111100, // |****** | + 0b00000000, // | | + +// Char '[' width = 5 + 0b00000000|CW_05, // | | + 0b11110000, // |**** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11110000, // |**** | + 0b00000000, // | | + +// Char '\' width = 7 + 0b00000000|CW_07, // | | + 0b11000000, // |** | + 0b11000000, // |** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00110000, // | ** | + 0b00011000, // | ** | + 0b00011000, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00000000, // | | + +// Char ']' width = 5 + 0b00000000|CW_05, // | | + 0b11110000, // |**** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11110000, // |**** | + 0b00000000, // | | + +// Char '^' width = 7 + 0b00000000|CW_07, // | | + 0b00110000, // | ** | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b10000100, // |* * | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char '_' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111100, // |****** | + 0b11111100, // |****** | + +// Char '`' width = 5 + 0b00000000|CW_05, // | | + 0b11000000, // |** | + 0b01100000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + +// Char 'a' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01111000, // | **** | + 0b00001100, // | ** | + 0b01111100, // | ***** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111100, // | ***** | + 0b00000000, // | | + +// Char 'b' width = 7 + 0b00000000|CW_07, // | | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11011000, // |** ** | + 0b11101100, // |*** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11101100, // |*** ** | + 0b11011000, // |** ** | + 0b00000000, // | | + +// Char 'c' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'd' width = 7 + 0b00000000|CW_07, // | | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b01101100, // | ** ** | + 0b11011100, // |** *** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11011100, // |** *** | + 0b01101100, // | ** ** | + 0b00000000, // | | + +// Char 'e' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11111100, // |****** | + 0b11000000, // |** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'f' width = 7 + 0b00000000|CW_07, // | | + 0b00111000, // | *** | + 0b01101100, // | ** ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b11110000, // |**** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00000000, // | | + +// Char 'g' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01110100, // | *** * | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111100, // | ***** | + 0b00001100, // | ** | + 0b01111000, // | **** | + +// Char 'h' width = 7 + 0b00000000|CW_07, // | | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11011000, // |** ** | + 0b11101100, // |*** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'i' width = 5 + 0b00000000|CW_05, // | | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00000000, // | | + 0b11100000, // |*** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b11110000, // |**** | + 0b00000000, // | | + +// Char 'j' width = 7 + 0b00000000|CW_07, // | | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00000000, // | | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b00001100, // | ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + +// Char 'k' width = 7 + 0b00000000|CW_07, // | | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11001100, // |** ** | + 0b11011000, // |** ** | + 0b11110000, // |**** | + 0b11110000, // |**** | + 0b11011000, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'l' width = 7 + 0b00000000|CW_07, // | | + 0b01110000, // | *** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11111100, // |****** | + 0b00000000, // | | + +// Char 'm' width = 8 + 0b00000000|CW_08, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11101100, // |*** ** | + 0b11111110, // |******* | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b00000000, // | | + +// Char 'n' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11011000, // |** ** | + 0b11101100, // |*** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'o' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 'p' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11011000, // |** ** | + 0b11101100, // |*** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11111000, // |***** | + 0b11000000, // |** | + 0b11000000, // |** | + +// Char 'q' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01101100, // | ** ** | + 0b11011100, // |** *** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111100, // | ***** | + 0b00001100, // | ** | + 0b00001100, // | ** | + +// Char 'r' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11011000, // |** ** | + 0b11101100, // |*** ** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b11000000, // |** | + 0b00000000, // | | + +// Char 's' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b01111000, // | **** | + 0b11001100, // |** ** | + 0b01100000, // | ** | + 0b00011000, // | ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + 0b00000000, // | | + +// Char 't' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b11111000, // |***** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01101100, // | ** ** | + 0b00111000, // | *** | + 0b00000000, // | | + +// Char 'u' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11011100, // |** *** | + 0b01101100, // | ** ** | + 0b00000000, // | | + +// Char 'v' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01001000, // | * * | + 0b01001000, // | * * | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00000000, // | | + +// Char 'w' width = 8 + 0b00000000|CW_08, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11000110, // |** ** | + 0b11000110, // |** ** | + 0b11010110, // |** * ** | + 0b11010110, // |** * ** | + 0b11111110, // |******* | + 0b01101100, // | ** ** | + 0b00000000, // | | + +// Char 'x' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11001100, // |** ** | + 0b01001000, // | * * | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b01001000, // | * * | + 0b11001100, // |** ** | + 0b00000000, // | | + +// Char 'y' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b11001100, // |** ** | + 0b01111100, // | ***** | + 0b00001100, // | ** | + 0b11001100, // |** ** | + 0b01111000, // | **** | + +// Char 'z' width = 7 + 0b00000000|CW_07, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b11111100, // |****** | + 0b00001100, // | ** | + 0b00011000, // | ** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b11111100, // |****** | + 0b00000000, // | | + +// Char '{' width = 6 + 0b00000000|CW_06, // | | + 0b00111000, // | *** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b11000000, // |** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00111000, // | *** | + 0b00000000, // | | + +// Char '|' width = 5 + 0b00000000|CW_05, // | | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b01100000, // | ** | + 0b00000000, // | | + +// Char '}' width = 6 + 0b00000000|CW_06, // | | + 0b11100000, // |*** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00011000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b00110000, // | ** | + 0b11100000, // |*** | + 0b00000000, // | | + +// Char '~' width = 7 + 0b00000000|CW_07, // | | + 0b01100100, // | ** * | + 0b11111100, // |****** | + 0b10011000, // |* ** | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | + 0b00000000, // | | }; diff --git a/flash.c b/flash.c index 7a4b3e7..63a61be 100644 --- a/flash.c +++ b/flash.c @@ -64,7 +64,7 @@ void flash_unlock(void) FLASH->KEYR = 0xCDEF89AB; } -static uint32_t +uint32_t checksum(const void *start, size_t len) { uint32_t *p = (uint32_t*)start; diff --git a/ili9341.c b/ili9341.c index c20a882..552f371 100644 --- a/ili9341.c +++ b/ili9341.c @@ -827,7 +827,7 @@ typedef struct { int16_t y; } lcdPrintStream; -static msg_t lcd_put(void *ip, uint8_t ch) { +static msg_t lcd_put5x7(void *ip, uint8_t ch) { lcdPrintStream *ps = ip; if (ch == '\n') {ps->x = ps->start_x; ps->y+=FONT_STR_HEIGHT; return MSG_OK;} uint16_t w = FONT_GET_WIDTH(ch); @@ -836,23 +836,25 @@ static msg_t lcd_put(void *ip, uint8_t ch) { return MSG_OK; } -#if 0 -static msg_t lcd_put_7x13(void *ip, uint8_t ch) { +static msg_t lcd_put_7x11b(void *ip, uint8_t ch) { lcdPrintStream *ps = ip; - if (ch == '\n') {ps->x = ps->start_x; ps->y+=FONT_STR_HEIGHT; return MSG_OK;} - uint16_t w = FONT_GET_WIDTH(ch); - ili9341_blitBitmap(ps->x, ps->y, w, FONT_GET_HEIGHT, FONT_GET_DATA(ch)); + if (ch == '\n') {ps->x = ps->start_x; ps->y+=bFONT_STR_HEIGHT; return MSG_OK;} + uint16_t w = bFONT_GET_WIDTH(ch); + ili9341_blitBitmap(ps->x, ps->y, w, bFONT_GET_HEIGHT, bFONT_GET_DATA(ch)); ps->x+= w; return MSG_OK; } -#endif + +typedef msg_t (*font_put_t)(void *ps, uint8_t ch); +static font_put_t put_char = lcd_put5x7; +void lcd_set_font(int type) {put_char = type == FONT_SMALL ? lcd_put5x7 : lcd_put_7x11b;} // Simple print in buffer function int lcd_printf(int16_t x, int16_t y, const char *fmt, ...) { // Init small lcd print stream struct lcd_printStreamVMT { _base_sequential_stream_methods - } lcd_vmt = {NULL, NULL, lcd_put, NULL}; + } lcd_vmt = {NULL, NULL, put_char, NULL}; lcdPrintStream ps = {&lcd_vmt, x, y, x, y}; // Performing the print operation using the common code. va_list ap; @@ -1351,7 +1353,7 @@ static bool SD_RxDataBlock(uint8_t *buff, uint16_t len, uint8_t token) { } // Transmit data block to SD -static bool SD_TxDataBlock(const uint8_t *buff, uint8_t token) { +static bool SD_TxDataBlock(const uint8_t *buff, uint16_t len, uint8_t token) { uint8_t resp; // Transmit token spi_TxByte(token); @@ -1361,13 +1363,13 @@ static bool SD_TxDataBlock(const uint8_t *buff, uint8_t token) { #endif #ifdef __USE_SDCARD_DMA__ - spi_DMATxBuffer((uint8_t*)buff, SD_SECTOR_SIZE, true); + spi_DMATxBuffer((uint8_t*)buff, len, true); #else - spi_TxBuffer((uint8_t*)buff, SD_SECTOR_SIZE); + spi_TxBuffer((uint8_t*)buff, len); #endif // Send CRC #ifdef SD_USE_DATA_CRC - uint16_t bcrc = crc16(buff, SD_SECTOR_SIZE); + uint16_t bcrc = crc16(buff, len); spi_TxWord(bcrc); #else spi_TxWord(0xFFFF); @@ -1580,7 +1582,7 @@ DSTATUS disk_status(BYTE pdrv) { // diskio.c - Read sector DRESULT disk_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count) { // No disk or wrong block count - if (pdrv != 0 || count != 1 || (Stat & STA_NOINIT)) return RES_NOTRDY; + if (pdrv != 0 || (Stat & STA_NOINIT)) return RES_NOTRDY; // convert to byte address if (!(CardType & CT_BLOCK)) sector *= SD_SECTOR_SIZE; @@ -1590,14 +1592,18 @@ DRESULT disk_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count) { #endif SD_Select_SPI(); - // READ_SINGLE_BLOCK - uint8_t cnt = SD_READ_WRITE_REPEAT; // read repeat count - do{ - if ((SD_SendCmd(CMD17, sector) == 0) && SD_RxDataBlock(buff, SD_SECTOR_SIZE, SD_TOKEN_START_BLOCK)){ - count = 0; - break; - } - }while (--cnt); + uint8_t cmd = count == 1 ? CMD17 : CMD18; + // convert to byte address + if (!(CardType & CT_BLOCK)) sector*= SD_SECTOR_SIZE; + // Read single / multiple block + if (SD_SendCmd(cmd, sector) == 0) { + do { + if (SD_RxDataBlock(buff, SD_SECTOR_SIZE, SD_TOKEN_START_BLOCK)) + buff+= SD_SECTOR_SIZE; + else break; + } while(--count); + } + if (cmd == CMD18) SD_SendCmd(CMD12, 0); // Finish multiple block transfer SD_Unselect_SPI(); #if DEBUG == 1 @@ -1622,12 +1628,9 @@ DRESULT disk_read(BYTE pdrv, BYTE* buff, DWORD sector, UINT count) { // diskio.c - Write sector DRESULT disk_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count) { // No disk or wrong count - if (pdrv != 0 || count != 1 || (Stat & STA_NOINIT)) return RES_NOTRDY; + if (pdrv != 0 || (Stat & STA_NOINIT)) return RES_NOTRDY; // Write protection if (Stat & STA_PROTECT) return RES_WRPRT; - // Convert to byte address if no Block mode - if (!(CardType & CT_BLOCK)) sector*= SD_SECTOR_SIZE; - #if DEBUG == 1 #if 0 DEBUG_PRINT("Sector write 0x%08X, %d\r\n", sector, count); @@ -1642,14 +1645,14 @@ DRESULT disk_write(BYTE pdrv, const BYTE* buff, DWORD sector, UINT count) { #endif SD_Select_SPI(); - // WRITE_SINGLE_BLOCK - uint8_t cnt = SD_READ_WRITE_REPEAT; // write repeat count - do{ - if ((SD_SendCmd(CMD24, sector) == 0) && SD_TxDataBlock(buff, SD_TOKEN_START_BLOCK)){ - count = 0; - break; - } - } while (--cnt); + do { + // WRITE_SINGLE_BLOCK * count + uint32_t sect = (CardType & CT_BLOCK) ? sector : sector * SD_SECTOR_SIZE; + if ((SD_SendCmd(CMD24, sect) == 0) && SD_TxDataBlock(buff, SD_SECTOR_SIZE, SD_TOKEN_START_BLOCK)) { + sector++; + buff+= SD_SECTOR_SIZE; + } else break; + } while (--count); SD_Unselect_SPI(); #if DEBUG == 1 diff --git a/main.c b/main.c index 9feddc9..ece9c49 100644 --- a/main.c +++ b/main.c @@ -226,8 +226,11 @@ static THD_FUNCTION(Thread1, arg) } // START_PROFILE // Process UI inputs - if (!(sweep_mode & SWEEP_SELFTEST)) + if (!(sweep_mode & SWEEP_SELFTEST)) { + sweep_mode|= SWEEP_UI_MODE; ui_process(); + sweep_mode&=~SWEEP_UI_MODE; + } // Process collected data, calculate trace coordinates and plot only if scan // completed if (completed) { @@ -961,7 +964,7 @@ config_t config = { #ifdef TINYSA4 .touch_cal = { 278, 513, 115, 154 }, // 4 inch panel #endif - ._mode = _MODE_USB, + ._mode = _MODE_USB | _MODE_AUTO_FILENAME, ._serial_speed = SERIAL_DEFAULT_BITRATE, .lcd_palette = LCD_DEFAULT_PALETTE, #ifdef TINYSA3 @@ -2019,6 +2022,7 @@ typedef struct { // Some commands can executed only in sweep thread, not in main cycle #define CMD_WAIT_MUTEX 1 #define CMD_RUN_IN_LOAD 2 +#define CMD_RUN_IN_UI 4 static const VNAShellCommand commands[] = { {"version" , cmd_version , 0}, @@ -2067,13 +2071,13 @@ static const VNAShellCommand commands[] = {"usart" , cmd_usart , CMD_WAIT_MUTEX}, {"usart_cfg" , cmd_usart_cfg , CMD_WAIT_MUTEX | CMD_RUN_IN_LOAD}, #endif - {"capture" , cmd_capture , CMD_WAIT_MUTEX}, + {"capture" , cmd_capture , CMD_WAIT_MUTEX | CMD_RUN_IN_UI}, #ifdef __REMOTE_DESKTOP__ {"refresh" , cmd_refresh , 0}, {"touch" , cmd_touch , 0}, {"release" , cmd_release , 0}, #endif - {"vbat" , cmd_vbat , 0}, // Uses same adc as touch!!!!! + {"vbat" , cmd_vbat , CMD_WAIT_MUTEX}, // Uses same adc as touch!!!!! #ifdef ENABLE_VBAT_OFFSET_COMMAND {"vbat_offset" , cmd_vbat_offset , CMD_RUN_IN_LOAD}, #endif @@ -2322,37 +2326,48 @@ static void shell_init_connection(void){ bool global_abort = false; -static const VNAShellCommand *VNAShell_parceLine(char *line){ - // Parse and execute line - char *lp = line, *ep; - shell_nargs = 0; - shell_args[0] = line; // shell_args[0] is used in error message, must be initialized -// DEBUG_LOG(0, lp); // debug console log - while (*lp != 0) { - // Skipping white space and tabs at string begin. - while (*lp == ' ' || *lp == '\t') lp++; - // If an argument starts with a double quote then its delimiter is another quote, else - // delimiter is white space. - ep = (*lp == '"') ? strpbrk(++lp, "\"") : strpbrk(lp, " \t"); - // Store in args string - shell_args[shell_nargs++] = lp; - // Stop, end of input string - if ((lp = ep) == NULL) break; - // Argument limits check - if (shell_nargs > VNA_SHELL_MAX_ARGUMENTS) { - shell_printf("too many arguments, max " define_to_STR(VNA_SHELL_MAX_ARGUMENTS) "" VNA_SHELL_NEWLINE_STR); - return NULL; +static inline char* vna_strpbrk(char *s1, const char *s2) { + do { + const char *s = s2; + do { + if (*s == *s1) return s1; + s++; + } while (*s); + s1++; + } while(*s1); + return s1; +} + +/* + * Split line by arguments, return arguments count + */ +int parse_line(char *line, char* args[], int max_cnt) { + char *lp = line, c; + const char *brk; + uint16_t nargs = 0; + while ((c = *lp) != 0) { // While not end + if (c != ' ' && c != '\t') { // Skipping white space and tabs. + if (c == '"') {lp++; brk = "\""; } // string end is next quote or end + else { brk = " \t";} // string end is tab or space or end + if (nargs < max_cnt) args[nargs] = lp; // Put pointer in args buffer (if possible) + nargs++; // Substring count + lp = vna_strpbrk(lp, brk); // search end + if (*lp == 0) break; // Stop, end of input string + *lp = 0; // Set zero at the end of substring } - // Set zero at the end of string and continue check - *lp++ = 0; + lp++; } - if (shell_nargs){ - if (shell_args[0][0] == '.') { - global_abort = true; - return NULL; - } - global_abort = false; + return nargs; +} +static const VNAShellCommand *VNAShell_parceLine(char *line){ + // Parse and execute line + shell_nargs = parse_line(line, shell_args, ARRAY_COUNT(shell_args)); + if (shell_nargs > ARRAY_COUNT(shell_args)) { + shell_printf("too many arguments, max " define_to_STR(VNA_SHELL_MAX_ARGUMENTS) "" VNA_SHELL_NEWLINE_STR); + return NULL; + } + if (shell_nargs > 0) { const VNAShellCommand *scp; for (scp = commands; scp->sc_name != NULL; scp++) if (get_str_index(scp->sc_name, shell_args[0]) == 0) @@ -2401,14 +2416,16 @@ static void VNAShell_executeLine(char *line) // Execute line const VNAShellCommand *scp = VNAShell_parceLine(line); if (scp) { - if (scp->flags & CMD_WAIT_MUTEX) { + uint16_t cmd_flag = scp->flags; + // Skip wait mutex if process UI + if ((cmd_flag & CMD_RUN_IN_UI) && (sweep_mode&SWEEP_UI_MODE)) cmd_flag&=~CMD_WAIT_MUTEX; + if (cmd_flag & CMD_WAIT_MUTEX) { shell_function = scp->sc_function; operation_requested|=OP_CONSOLE; // this will abort current sweep to give priority to the new request // Wait execute command in sweep thread - osalThreadEnqueueTimeoutS(&shell_thread, TIME_INFINITE); -// do { -// osalThreadSleepMilliseconds(10); -// } while (shell_function); + do { + osalThreadEnqueueTimeoutS(&shell_thread, TIME_INFINITE); + } while (shell_function); } else { operation_requested = false; // otherwise commands will be aborted scp->sc_function(shell_nargs - 1, &shell_args[1]); @@ -2425,6 +2442,15 @@ static void VNAShell_executeLine(char *line) shell_printf("%s?" VNA_SHELL_NEWLINE_STR, shell_args[0]); } +void shell_executeCMDLine(char *line) { + // Disable shell output (not allow shell_printf write, but not block other output!!) + shell_stream = NULL; + const VNAShellCommand *scp = VNAShell_parceLine(line); + if (scp && (scp->flags & CMD_RUN_IN_LOAD)) + scp->sc_function(shell_nargs - 1, &shell_args[1]); + PREPARE_STREAM; +} + #ifdef __SD_CARD_LOAD__ #ifndef __USE_SD_CARD__ #error "Need enable SD card support __USE_SD_CARD__ in nanovna.h, for use ENABLE_SD_CARD_CMD" @@ -2630,7 +2656,7 @@ int main(void) #ifdef TINYSA4 ili9341_set_foreground(LCD_FG_COLOR); PULSE - ili9341_drawstring("Starting...", 0,0); + ili9341_drawstring_7x13("Starting...", 0, 0); PULSE #ifdef __DISABLE_HOT_INSERT__ sd_card_inserted_at_boot = SD_Inserted(); diff --git a/nanovna.h b/nanovna.h index 0f1bd76..f3507bd 100644 --- a/nanovna.h +++ b/nanovna.h @@ -90,7 +90,9 @@ #define __ULTRA__ #define __USE_RTC__ // Enable RTC clock #define __USE_SD_CARD__ // Enable SD card support -#define __SD_CARD_LOAD__ // Allow run commands from SD card (config.ini in root) +//#define __SD_CARD_LOAD__ // Allow run commands from SD card (config.ini in root), if enabled __SD_FILE_BROWSER__ scripts run from *.cmd in it +#define __SD_CARD_DUMP_FIRMWARE__ // Allow dump firmware to SD card +#define __SD_FILE_BROWSER__ #define __LCD_BRIGHTNESS__ // LCD or hardware allow change brightness, add menu item for this #define __HARMONIC__ #define __NOISE_FIGURE__ @@ -322,6 +324,7 @@ enum { #define SWEEP_CALIBRATE_HARMONIC 0x40 //#define SWEEP_FACTORY 0x20 #endif +#define SWEEP_UI_MODE 0x80 extern uint8_t sweep_mode; extern uint8_t completed; @@ -584,6 +587,14 @@ extern uint16_t graph_bottom; #define MENU_BUTTON_HEIGHT_N(n) (LCD_HEIGHT/(n)-1) +#define BROWSER_BUTTON_BORDER 1 +// Browser window settings +#define FILES_COLUMNS (LCD_WIDTH/160) // columns in browser +#define FILES_ROWS 10 // rows in browser +#define FILES_PER_PAGE (FILES_COLUMNS*FILES_ROWS) // FILES_ROWS * FILES_COLUMNS +#define FILE_BOTTOM_HEIGHT 20 // Height of bottom buttons (< > X) +#define FILE_BUTTON_HEIGHT ((LCD_HEIGHT - FILE_BOTTOM_HEIGHT)/FILES_ROWS) // Height of file buttons + // Define message box width #ifdef TINYSA4 #define MESSAGE_BOX_WIDTH 300 @@ -612,7 +623,10 @@ extern const uint8_t x7x11b_bits []; extern const uint8_t x10x14_bits[]; extern const uint8_t numfont16x22[]; -#define FONT_START_CHAR 0x17 +#define FONT_SMALL 0 +#define FONT_NORMAL 1 + +#define FONT_START_CHAR 0x16 #define FONT_MAX_WIDTH 7 #define FONT_WIDTH 5 #define FONT_GET_HEIGHT 7 @@ -620,7 +634,7 @@ extern const uint8_t numfont16x22[]; #define FONT_GET_DATA(ch) ( &x5x7_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]) #define FONT_GET_WIDTH(ch) (8-(x5x7_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]&7)) -#define bFONT_START_CHAR 0x17 +#define bFONT_START_CHAR 0x16 #define bFONT_MAX_WIDTH 8 #define bFONT_WIDTH 7 #define bFONT_GET_HEIGHT 11 @@ -629,7 +643,7 @@ extern const uint8_t numfont16x22[]; #define bFONT_GET_WIDTH(ch) (8-(x7x11b_bits[(ch-bFONT_START_CHAR)*bFONT_GET_HEIGHT]&7)) #ifdef __NICE_BIG_FONT__ -#define wFONT_START_CHAR 0x17 +#define wFONT_START_CHAR 0x16 #define wFONT_MAX_WIDTH 12 #define wFONT_GET_HEIGHT 14 #define wFONT_STR_HEIGHT 16 @@ -644,20 +658,16 @@ extern const uint8_t numfont16x22[]; #define NUM_FONT_GET_HEIGHT 22 #define NUM_FONT_GET_DATA(ch) (&numfont16x22[ch*2*NUM_FONT_GET_HEIGHT]) -#if 1 -#define KP_WIDTH ((LCD_WIDTH) / 4)// numeric keypad button width -#define KP_HEIGHT ((LCD_HEIGHT - NUM_INPUT_HEIGHT) / 4) // numeric keypad button height -// Key x, y position (0 - 15) on screen -#define KP_GET_X(posx) ((posx) * KP_WIDTH) // numeric keypad left -#define KP_GET_Y(posy) ((posy) * KP_HEIGHT) // numeric keypad top -#else -#define KP_WIDTH (LCD_HEIGHT/5) -#define KP_HEIGHT (LCD_HEIGHT/5) -// Key x, y position (0 - 15) on screen -#define KP_GET_X(posx) ((posx)*KP_WIDTH + (LCD_WIDTH-MENU_BUTTON_WIDTH-5-KP_WIDTH*4)) -#define KP_GET_Y(posy) ((posy)*KP_HEIGHT + 12 ) -#endif +#define KP_WIDTH (LCD_WIDTH / 4) // numeric keypad button width +#define KP_HEIGHT ((LCD_HEIGHT - NUM_INPUT_HEIGHT) / 4) // numeric keypad button height +#define KP_X_OFFSET 0 // numeric keypad X offset +#define KP_Y_OFFSET 0 // numeric keypad Y offset +#define KPF_WIDTH (LCD_WIDTH / 10) // text keypad button width +#define KPF_HEIGHT KPF_WIDTH // text keypad button height +#define KPF_X_OFFSET 0 // text keypad X offset +#define KPF_Y_OFFSET (LCD_HEIGHT - NUM_INPUT_HEIGHT - 4 * KPF_HEIGHT) // text keypad Y offset +#define S_ENTER "\026" // 0x16 #define S_DELTA "\027" // 0x17 #define S_SARROW "\030" // 0x18 #define S_INFINITY "\031" // 0x19 @@ -668,6 +678,10 @@ extern const uint8_t numfont16x22[]; #define S_OHM "\036" // 0x1E #define S_DEGREE "\037" // 0x1F +#define C_ENTER 0x16 // 0x16 +#define C_LARROW 0x1A // 0x1A +#define C_RARROW 0x1B // 0x1B + // String prefix for select font size (use not printable chars) #define FONT_s "\001" #define _FONT_s 1 @@ -712,14 +726,17 @@ float marker_to_value(const int i); #define FREQ_MODE_START_STOP 0x0 #define FREQ_MODE_CENTER_SPAN 0x1 -#define FREQ_MODE_DOTTED_GRID 0x2 +//#define FREQ_MODE_DOTTED_GRID 0x2 // Connection flag #define _MODE_CONNECTION_MASK 0x04 #define _MODE_SERIAL 0x04 #define _MODE_USB 0x00 +// don't save state #define _MODE_DONT_SAVE_STATE 0x08 +// auto name +#define _MODE_AUTO_FILENAME 0x10 #pragma pack(push, 4) typedef struct config { @@ -819,6 +836,7 @@ extern void clear_marker_cache(void); void shell_update_speed(void); void shell_reset_console(void); int shell_serial_printf(const char *fmt, ...); +void shell_executeCMDLine(char *line); // marker enum { @@ -1098,6 +1116,7 @@ void ili9341_drawchar(uint8_t ch, int x, int y); void ili9341_drawstring(const char *str, int x, int y); void ili9341_drawstring_7x13(const char *str, int x, int y); void ili9341_drawstring_10x14(const char *str, int x, int y); +void lcd_set_font(int type); int lcd_printf(int16_t x, int16_t y, const char *fmt, ...); void ili9341_drawstringV(const char *str, int x, int y); int ili9341_drawchar_size(uint8_t ch, int x, int y, uint8_t size, int x_max); @@ -1277,6 +1296,7 @@ extern int linear_averaging; #else #define SAVEAREA_MAX 5 #endif + // STM32 minimum page size for write #define FLASH_PAGESIZE 0x800 // config save area (flash7 addr) @@ -1284,12 +1304,16 @@ extern int linear_averaging; #define SAVE_CONFIG_ADDR 0x0801D000 #define SAVE_CONFIG_SIZE FLASH_PAGESIZE #define FLASH_END 0x08020000 +#define FLASH_START_ADDRESS 0x08000000 +#define FLASH_TOTAL_SIZE (128*1024) #endif #ifdef TINYSA4 #define SAVE_CONFIG_ADDR 0x0803C000 #define SAVE_CONFIG_SIZE FLASH_PAGESIZE*2 #define FLASH_END 0x08040000 +#define FLASH_START_ADDRESS 0x08000000 +#define FLASH_TOTAL_SIZE (256*1024) #endif typedef char assert_config[sizeof(config_t)> SAVE_CONFIG_SIZE ? -1 : 1]; // Check config size @@ -1407,6 +1431,7 @@ int caldata_save(uint16_t id); int config_save(void); int config_recall(void); setting_t * caldata_pointer(uint16_t id); +uint32_t checksum(const void *start, size_t len); void clear_all_config_prop_data(void); @@ -1445,7 +1470,8 @@ int invoke_quick_menu(int); bool ui_process_listen_lever(void); void refresh_sweep_menu(int i); void save_to_sd(int mask); -void drawMessageBox(char *header, char *text, uint32_t delay); +void drawMessageBox(const char *header, char *text, uint32_t delay); +bool isFullScreenMode(void); // Irq operation process set #define OP_NONE 0x00 @@ -1583,8 +1609,6 @@ void SD_PowerOff(void); #define fs_volume (FATFS *)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS)) // FatFS file object (at the end of spi_buffer) #define fs_file ( FIL*)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS) - sizeof(FIL)) -// Filename object (at the end of spi_buffer) -#define fs_filename ( char*)(((uint8_t*)(&spi_buffer[SPI_BUFFER_SIZE])) - sizeof(FATFS) - sizeof(FIL) - FF_LFN_BUF - 4) #endif void testLog(void); // debug log void sd_card_load_config(char *filename); @@ -1631,6 +1655,7 @@ typedef struct { /* * misclinous */ +int parse_line(char *line, char* args[], int max_cnt); int plot_printf(char *str, int, const char *fmt, ...); #define PULSE do { palClearPad(GPIOC, GPIOC_LED); palSetPad(GPIOC, GPIOC_LED);} while(0) //extern int setting_attenuate; diff --git a/numfont20x22.c b/numfont20x22.c index a7593e5..f4b70ae 100644 --- a/numfont20x22.c +++ b/numfont20x22.c @@ -599,4 +599,28 @@ const uint8_t numfont16x22[] = { _BMP16(0b1111000000000000), _BMP16(0b1111000000000000), _BMP16(0b1111000000000000), + + + _BMP16(0b1111010001011111), // ENTER + _BMP16(0b1000011001000100), + _BMP16(0b1111010101000100), + _BMP16(0b1000010011000100), + _BMP16(0b1111010001000100), + _BMP16(0b0000000000000000), + _BMP16(0b0000000000000000), + _BMP16(0b0000000000001111), + _BMP16(0b0000000000001111), + _BMP16(0b0000000000001111), + _BMP16(0b0000000000001111), + _BMP16(0b0000000000001111), + _BMP16(0b0000000000001111), + _BMP16(0b0000000000001111), + _BMP16(0b0001100000001111), + _BMP16(0b0011100000001111), + _BMP16(0b0111111111111111), + _BMP16(0b1111111111111111), + _BMP16(0b1111111111111111), + _BMP16(0b0111111111111111), + _BMP16(0b0011100000000000), + _BMP16(0b0001100000000000), }; diff --git a/plot.c b/plot.c index 7f90f28..77fb688 100644 --- a/plot.c +++ b/plot.c @@ -1252,6 +1252,7 @@ draw_all_cells(bool flush_markmap) void draw_all(bool flush) { + if (isFullScreenMode()) return; #ifdef __LEVEL_METER__ level_text[0] = 0; // Clear level text #endif @@ -1830,7 +1831,7 @@ draw_frequencies(void) } ili9341_set_foreground(LCD_FG_COLOR); ili9341_set_background(LCD_BG_COLOR); - ili9341_fill(FREQUENCIES_XPOS1, FREQUENCIES_YPOS, LCD_WIDTH - FREQUENCIES_XPOS1, LCD_HEIGHT - FREQUENCIES_YPOS); + ili9341_fill(FREQUENCIES_XPOS1, CHART_BOTTOM + 1, LCD_WIDTH - FREQUENCIES_XPOS1, LCD_HEIGHT - CHART_BOTTOM - 1); if (uistat.lever_mode == LM_CENTER) buf1[0] = S_SARROW[0]; if (uistat.lever_mode == LM_SPAN) @@ -1845,8 +1846,8 @@ draw_frequencies(void) #ifdef TINYSA4 if (get_sweep_frequency(ST_STOP) > 2000000000ULL && setting.attenuate_x2 >= 16 ) { ili9341_drawstring("REDUCED LINEARITY", p2 - 18*7, FREQUENCIES_YPOS); - } else - ili9341_drawstring(" ", p2 - 18*7, FREQUENCIES_YPOS); + }// else + // ili9341_drawstring(" ", p2 - 18*7, FREQUENCIES_YPOS); #endif } diff --git a/sa_cmd.c b/sa_cmd.c index c4f5155..2da7f5e 100644 --- a/sa_cmd.c +++ b/sa_cmd.c @@ -1245,37 +1245,39 @@ VNA_SHELL_FUNCTION(cmd_scanraw) float f_step = (stop-start)/ points; setting.frequency_step = (freq_t)f_step; - streamPut(shell_stream, '{'); - static freq_t old_start=0, old_stop=0; - static uint32_t old_points=0; - if (old_start != start || old_stop != stop || old_points != points) { // To prevent dirty for every sweep - dirty = true; - old_start = start; - old_stop = stop; - old_points = points; - } operation_requested = false; dirty = true; - - for (uint32_t i = 0; iusbp->state != USB_ACTIVE) // break on operation in perform break; - streamPut(shell_stream, 'x'); - streamPut(shell_stream, (uint8_t)(val & 0xFF)); - streamPut(shell_stream, (uint8_t)((val>>8) & 0xFF)); - if ((i & 0x07) == 0) { // if required - int pos = i * (WIDTH+1) / points; - ili9341_set_background(LCD_SWEEP_LINE_COLOR); - ili9341_fill(OFFSETX, CHART_BOTTOM+1, pos, 1); // update sweep progress bar - ili9341_set_background(LCD_BG_COLOR); - ili9341_fill(OFFSETX+pos, CHART_BOTTOM+1, WIDTH-pos, 1); + buf[idx++] = 'x'; + buf[idx++] = (uint8_t)(val & 0xFF); + buf[idx++] = (uint8_t)((val>>8) & 0xFF); + if (idx >= BUFFER_SIZE - 4) { + streamWrite(shell_stream, buf, idx); + idx = 0; + } + int pos = i * (WIDTH+1) / points; + if (pos - oldpos > 8) { + ili9341_fill(OFFSETX + oldpos, CHART_BOTTOM+1, pos - oldpos, 1); // update sweep progress bar + oldpos = pos; } - } + buf[idx++] = '}'; + streamWrite(shell_stream, buf, idx); +// adc_start_analog_watchdog(); ili9341_set_background(LCD_BG_COLOR); ili9341_fill(OFFSETX, CHART_BOTTOM+1, WIDTH, 1); - streamPut(shell_stream, '}'); setting.frequency_step = old_step; dirty = true; redraw_request = 0; // disable screen update in this mode diff --git a/sa_core.c b/sa_core.c index 4b82f6f..5ecb87f 100644 --- a/sa_core.c +++ b/sa_core.c @@ -492,7 +492,10 @@ void update_min_max_freq(void) minFreq = 0; #ifdef TINYSA4 #ifdef __ULTRA_OUT__ - maxFreq = ULTRA_MAX_FREQ+60000000; // Add 60MHz to go to 5.40GHz + if (setting.mixer_output) + maxFreq = ULTRA_MAX_FREQ+60000000; // Add 60MHz to go to 5.40GHz + else + maxFreq = 4400000000ULL; // 4.4GHz #else maxFreq = MAX_LOW_OUTPUT_FREQ; #endif @@ -4413,6 +4416,25 @@ again: // Spur redu my_microsecond_delay(200); // To prevent lockup of SI4432 #endif } + + + // Calculate the RSSI correction for later use + if (MODE_INPUT(setting.mode)){ // only cases where the value can change on 0 point of sweep + if (setting.frequency_step != 0 || (i==0 && scandirty)) { + correct_RSSI_freq = get_frequency_correction(lf); + } + } + // #define DEBUG_CORRECTION + #ifdef DEBUG_CORRECTION + if (SDU1.config->usbp->state == USB_ACTIVE) { + shell_printf ("%d:%Q %f\r\n", i, lf, PURE_TO_float(correct_RSSI_freq)); + osalThreadSleepMilliseconds(2); + } + #endif + + + + #ifdef TINYSA4 if (debug_frequencies ) { @@ -4437,46 +4459,33 @@ again: // Spur redu } char spur = ' '; int delta=0; - freq_t f = (LO_mirrored ? f_high : f_low); - if ( f * 4 < real_old_freq[SI4463_RX] + real_offset) { - delta = real_old_freq[SI4463_RX] + real_offset - 4*f; + freq_t tf = (LO_mirrored ? f_high : f_low); + if ( tf * 4 < real_old_freq[SI4463_RX] + real_offset) { + delta = real_old_freq[SI4463_RX] + real_offset - 4*tf; if (delta < actual_rbw_x10*100) spur = '!'; } else { - delta = 4*f - real_old_freq[SI4463_RX] + real_offset; + delta = 4*tf - real_old_freq[SI4463_RX] + real_offset; if (delta < actual_rbw_x10*100) spur = '!'; } char shifted = ( LO_spur_shifted ? '>' : ' '); if (SDU1.config->usbp->state == USB_ACTIVE) - shell_printf ("%d:%c%c%c%cLO=%11.6Lq:%11.6Lq\tIF=%11.6Lq:%11.6Lq\tOF=%11.6d\tF=%11.6Lq:%11.6Lq\tD=%.2f:%.2f %c%c%c\r\n", + shell_printf ("%d:%c%c%c%cLO=%11.6Lq:%11.6Lq\tIF=%11.6Lq:%11.6Lq\tOF=%11.6d\tF=%11.6Lq:%11.6Lq\tD=%.2f:%.2f %c%c%c %d\r\n", i, spur, shifted,(LO_mirrored ? 'm' : ' '), (LO_harmonic ? 'h':' ' ), old_freq[ADF4351_LO],real_old_freq[ADF4351_LO], old_freq[SI4463_RX], real_old_freq[SI4463_RX], (int32_t)real_offset, f_low, f_high , f_error_low, f_error_high, (ADF4351_frequency_changed? 'A' : ' '), (SI4463_frequency_changed? 'S' : ' '), - (SI4463_offset_changed? 'O' : ' ') - ); + (SI4463_offset_changed? 'O' : ' '), + correct_RSSI_freq + ); osalThreadSleepMilliseconds(100); } #endif // ------------------------- end of processing when in output mode ------------------------------------------------ - // Calculate the RSSI correction for later use - if (MODE_INPUT(setting.mode)){ // only cases where the value can change on 0 point of sweep - if (setting.frequency_step != 0 || (i==0 && scandirty)) { - correct_RSSI_freq = get_frequency_correction(f); - } - } - // #define DEBUG_CORRECTION - #ifdef DEBUG_CORRECTION - if (SDU1.config->usbp->state == USB_ACTIVE) { - shell_printf ("%d:%Q %f\r\n", i, f, PURE_TO_float(correct_RSSI_freq)); - osalThreadSleepMilliseconds(2); - } - #endif - skip_LO_setting: if (i == 0 && t == 0) // if first point in scan (here is get 1 point data) @@ -4613,7 +4622,7 @@ again: // Spur redu #ifdef TINYSA4 if (SI4432_step_delay && (ADF4351_frequency_changed || SI4463_frequency_changed)) { int my_step_delay = SI4432_step_delay; - if (f < LOW_SHIFT_FREQ && actual_rbw_x10 == 3 && !in_step_test) + if (lf < LOW_SHIFT_FREQ && actual_rbw_x10 == 3 && !in_step_test) my_step_delay = my_step_delay * 2; // if (LO_spur_shifted) // || SI4463_offset_changed) // my_step_delay = my_step_delay * 2; @@ -4676,6 +4685,11 @@ again: // Spur redu if (LO_shifting) pureRSSI += float_TO_PURE_RSSI(actual_rbw_x10>USE_SHIFT2_RBW ? config.shift2_level_offset : (lf < LOW_SHIFT_FREQ ? config.shift1_level_offset: 0.0)); } + if (setting.unit == U_RAW) + pureRSSI += - float_TO_PURE_RSSI(120); // don't add correction; + else + pureRSSI += correct_RSSI + correct_RSSI_freq; // add correction + //#define __DEBUG_FREQUENCY_SETTING__ #ifdef __DEBUG_FREQUENCY_SETTING__ // For debugging the frequency calculation stored_t[i] = -60.0 + (real_old_freq[ADF4351_LO] - f - old_freq[2])/10; @@ -4687,7 +4701,7 @@ again: // Spur redu // i = i + 1; // } #ifdef __ULTRA__ - float debug_rssi = PURE_TO_float(pureRSSI+ correct_RSSI + correct_RSSI_freq); + float debug_rssi = PURE_TO_float(pureRSSI); #endif #ifdef __SPUR__ static pureRSSI_t spur_RSSI = -1; // Initialization only to avoid warning. @@ -4733,11 +4747,7 @@ again: // Spur redu // } #define IGNORE_RSSI 30000 // pureRSSI_t rssi = (RSSI>0 ? RSSI + correct_RSSI + correct_RSSI_freq : IGNORE_RSSI); // add correction - pureRSSI_t rssi; - if (setting.unit == U_RAW) - rssi = RSSI - float_TO_PURE_RSSI(120); // don't add correction; - else - rssi = RSSI + correct_RSSI + correct_RSSI_freq; // add correction + pureRSSI_t rssi = RSSI; if (false) { abort: rssi = 0; @@ -7405,7 +7415,7 @@ void calibrate_harmonic(void) test_acquire(TEST_JUMP_HARMONIC); // Acquire test if (peakLevel < -50) { ili9341_set_foreground(LCD_BRIGHT_COLOR_RED); - ili9341_drawstring_7x13("Signal level too low", 30, 200); + ili9341_drawstring_7x13("Signal level too low or not on frequency", 30, 200); goto quit; } set_jump_config(i, get_jump_config(i) + measure_jump(i)); diff --git a/ui.c b/ui.c index ed1438f..7b36b0b 100644 --- a/ui.c +++ b/ui.c @@ -74,18 +74,30 @@ volatile uint8_t operation_requested = OP_NONE; int8_t previous_marker = MARKER_INVALID; enum { - UI_NORMAL, UI_MENU, UI_KEYPAD + UI_NORMAL, UI_MENU, UI_KEYPAD, +#ifdef __SD_FILE_BROWSER__ + UI_BROWSER, +#endif + UI_END }; #define NUMINPUT_LEN 12 +#ifdef FF_USE_LFN +#define TXTINPUT_LEN (FF_MAX_LFN - 4) +#else +#define TXTINPUT_LEN (8) +#endif + +#if NUMINPUT_LEN + 2 > TXTINPUT_LEN + 1 +static char kp_buf[NUMINPUT_LEN+2]; // !!!!!! WARNING size must be + 2 from NUMINPUT_LEN or TXTINPUT_LEN + 1 +#else +static char kp_buf[TXTINPUT_LEN+1]; // !!!!!! WARNING size must be + 2 from NUMINPUT_LEN or TXTINPUT_LEN + 1 +#endif static uint8_t ui_mode = UI_NORMAL; static uint8_t keypad_mode; -static char kp_buf[NUMINPUT_LEN+1]; -static int8_t kp_index = 0; static char *kp_help_text = NULL; static uint8_t menu_current_level = 0; static int selection = 0; - static const uint8_t slider_bitmap[]= { _BMP8(0b11111110), @@ -109,7 +121,8 @@ static const uint8_t slider_bitmap[]= #define AUTO_ICON(S) (S>=2?BUTTON_ICON_CHECK_AUTO:S) // Depends on order of ICONs!!!!! #define BUTTON_BORDER_NONE 0x00 -#define BUTTON_BORDER_WIDTH_MASK 0x0F +#define BUTTON_BORDER_WIDTH_MASK 0x07 +#define BUTTON_BORDER_NO_FILL 0x08 // Define mask for draw border (if 1 use light color, if 0 dark) #define BUTTON_BORDER_TYPE_MASK 0xF0 @@ -145,8 +158,21 @@ static void erase_menu_buttons(void); static void ui_process_keypad(void); static void choose_active_marker(void); static void menu_move_back(bool leave_ui); +static void draw_button(uint16_t x, uint16_t y, uint16_t w, uint16_t h, ui_button_t *b); //static const menuitem_t menu_marker_type[]; +#ifdef __USE_SD_CARD__ +static void save_csv(uint8_t mask); +#endif + +bool isFullScreenMode(void) { +#ifdef __SD_FILE_BROWSER__ + return ui_mode == UI_BROWSER; +#else + return false; +#endif +} + static int btn_check(void) { systime_t ticks; @@ -435,17 +461,16 @@ touch_draw_test(void) ili9341_drawstring("TOUCH TEST: DRAG PANEL, PRESS BUTTON TO FINISH", OFFSETX, LCD_HEIGHT - FONT_GET_HEIGHT); int old_button_state = 0; + lcd_set_font(FONT_NORMAL); while (touch_check() != EVT_TOUCH_PRESSED) { int button_state = READ_PORT() & BUTTON_MASK; if (button_state != old_button_state) { - char buf[20]; - plot_printf(buf, sizeof buf, "STATE: %4d ", button_state); - ili9341_drawstring_7x13(buf, 120, 120); + lcd_printf(120, 120, "STATE: % 4d ", button_state); old_button_state = button_state; } } - + lcd_set_font(FONT_SMALL); do { if (touch_check() == EVT_TOUCH_PRESSED){ touch_position(&x0, &y0); @@ -516,9 +541,8 @@ show_version(void) do {shift>>=1; y+=5;} while (shift&1); ili9341_drawstring_7x13(info_about[i++], x, y+=bFONT_STR_HEIGHT+2-5); } - char buf[96]; - plot_printf(buf, sizeof(buf), "HW Version:%s (%d)", get_hw_version_text(), adc1_single_read(0)); - ili9341_drawstring_7x13(buf, x, y+=bFONT_STR_HEIGHT); + lcd_set_font(FONT_NORMAL); + lcd_printf(x, y+=bFONT_STR_HEIGHT, "HW Version:%s (%d)", get_hw_version_text(), adc1_single_read(0)); extern const char *states[]; #define ENABLE_THREADS_COMMAND @@ -536,12 +560,10 @@ extern const char *states[]; #else uint32_t stklimit = 0U; #endif - char buf[96]; - plot_printf(buf, sizeof(buf), "%08x|%08x|%08x|%08x|%4u|%4u|%9s|%12s", + lcd_printf(x, y+=bFONT_STR_HEIGHT, "%08x|%08x|%08x|%08x|%4u|%4u|%9s|%12s", stklimit, (uint32_t)tp->ctx.sp, max_stack_use, (uint32_t)tp, (uint32_t)tp->refs - 1, (uint32_t)tp->prio, states[tp->state], tp->name == NULL ? "" : tp->name); - ili9341_drawstring_7x13(buf, x, y+=bFONT_STR_HEIGHT); tp = chRegNextThread(tp); } while (tp != NULL); #endif @@ -560,8 +582,7 @@ extern const char *states[]; #ifdef __USE_RTC__ uint32_t tr = rtc_get_tr_bin(); // TR read first uint32_t dr = rtc_get_dr_bin(); // DR read second - char buf[96]; - plot_printf(buf, sizeof(buf), "Time: 20%02d/%02d/%02d %02d:%02d:%02d" " (LS%c)", + lcd_printf(x, y, "Time: 20%02d/%02d/%02d %02d:%02d:%02d" " (LS%c)", RTC_DR_YEAR(dr), RTC_DR_MONTH(dr), RTC_DR_DAY(dr), @@ -569,15 +590,14 @@ extern const char *states[]; RTC_TR_MIN(dr), RTC_TR_SEC(dr), (RCC->BDCR & STM32_RTCSEL_MASK) == STM32_RTCSEL_LSE ? 'E' : 'I'); - ili9341_drawstring_7x13(buf, x, y); #endif #if 0 uint32_t vbat=adc_vbat_read(); - plot_printf(buf, sizeof(buf), "Batt: %d.%03dV", vbat/1000, vbat%1000); - ili9341_drawstring_7x13(buf, x, y + bFONT_STR_HEIGHT + 1); + lcd_printf(x, y + bFONT_STR_HEIGHT + 1, "Batt: %d.%03dV", vbat/1000, vbat%1000); #endif #endif // TINYSA4 } + lcd_set_font(FONT_SMALL); } #ifndef TINYSA4 @@ -995,22 +1015,22 @@ const uint8_t right_icons [] = #define KP_X(x) (48*(x) + 2 + (LCD_WIDTH-BUTTON_WIDTH-192)) #define KP_Y(y) (48*(y) + 2) - -#define KP_PERIOD 10 -#define KP_MINUS 11 -#define KP_X1 12 -#define KP_K 13 -#define KP_M 14 -#define KP_G 15 -#define KP_BS 16 -#define KP_INF 17 -#define KP_DB 18 +#define KP_PERIOD 10 +#define KP_MINUS 11 +#define KP_X1 12 +#define KP_K 13 +#define KP_M 14 +#define KP_G 15 +#define KP_BS 16 +#define KP_INF 17 +#define KP_DB 18 #define KP_PLUSMINUS 19 -#define KP_KEYPAD 20 -#define KP_m 21 -#define KP_u 22 -#define KP_n 23 -#define KP_p 24 +#define KP_KEYPAD 20 +#define KP_m 21 +#define KP_u 22 +#define KP_n 23 +#define KP_p 24 +#define KP_ENTER 25 #define KP_0 31 #define KP_1 32 @@ -1023,10 +1043,23 @@ const uint8_t right_icons [] = #define KP_200 39 #define KP_500 40 +enum {NUM_KEYBOARD, TXT_KEYBOARD}; typedef struct { - uint8_t x:4; - uint8_t y:4; + uint16_t x_offs; + uint16_t y_offs; + uint16_t width; + uint16_t height; +} keypad_pos_t; + +// Keyboard size and position data +static const keypad_pos_t key_pos[] = { + [NUM_KEYBOARD] = {KP_X_OFFSET, KP_Y_OFFSET, KP_WIDTH, KP_HEIGHT}, + [TXT_KEYBOARD] = {KPF_X_OFFSET, KPF_Y_OFFSET, KPF_WIDTH, KPF_HEIGHT} +}; + +typedef struct { + uint8_t pos; int8_t c; } keypads_t; @@ -1038,45 +1071,44 @@ static const keypads_t *keypads; // 0 . < x static const keypads_t keypads_freq[] = { - { 1, 3, KP_PERIOD }, - { 0, 3, 0 }, - { 0, 2, 1 }, - { 1, 2, 2 }, - { 2, 2, 3 }, - { 0, 1, 4 }, - { 1, 1, 5 }, - { 2, 1, 6 }, - { 0, 0, 7 }, - { 1, 0, 8 }, - { 2, 0, 9 }, - { 3, 0, KP_G }, - { 3, 1, KP_M }, - { 3, 2, KP_K }, - { 3, 3, KP_X1 }, - { 2, 3, KP_BS }, - { 0, 0, -1 } + { 16 , NUM_KEYBOARD }, // size and position + { 0x13, KP_PERIOD }, + { 0x03, 0 }, + { 0x02, 1 }, + { 0x12, 2 }, + { 0x22, 3 }, + { 0x01, 4 }, + { 0x11, 5 }, + { 0x21, 6 }, + { 0x00, 7 }, + { 0x10, 8 }, + { 0x20, 9 }, + { 0x30, KP_G }, + { 0x31, KP_M }, + { 0x32, KP_K }, + { 0x33, KP_X1 }, + { 0x23, KP_BS } }; // 7 8 9 // 4 5 6 // 1 2 3 // 0 . < x - static const keypads_t keypads_positive[] = { - { 1, 3, KP_PERIOD }, - { 0, 3, 0 }, - { 0, 2, 1 }, - { 1, 2, 2 }, - { 2, 2, 3 }, - { 0, 1, 4 }, - { 1, 1, 5 }, - { 2, 1, 6 }, - { 0, 0, 7 }, - { 1, 0, 8 }, - { 2, 0, 9 }, - { 3, 3, KP_X1 }, - { 2, 3, KP_BS }, - { 0, 0, -1 } + { 13 , NUM_KEYBOARD }, // size and position + { 0x13, KP_PERIOD }, + { 0x03, 0 }, + { 0x02, 1 }, + { 0x12, 2 }, + { 0x22, 3 }, + { 0x01, 4 }, + { 0x11, 5 }, + { 0x21, 6 }, + { 0x00, 7 }, + { 0x10, 8 }, + { 0x20, 9 }, + { 0x33, KP_ENTER }, + { 0x23, KP_BS } }; // 100 200 500 n @@ -1085,72 +1117,71 @@ static const keypads_t keypads_positive[] = { // 0 . < x static const keypads_t keypads_pos_unit[] = { - { 1, 3, KP_PERIOD }, - { 0, 3, 0 }, - { 0, 2, 1 }, - { 1, 2, 2 }, - { 2, 2, 5 }, - { 0, 1, KP_10 }, - { 1, 1, KP_20 }, - { 2, 1, KP_50 }, - { 0, 0, KP_100 }, - { 1, 0, KP_200 }, - { 2, 0, KP_500 }, - { 3, 0, KP_n }, - { 3, 1, KP_u }, - { 3, 2, KP_m }, - { 3, 3, KP_X1 }, - { 2, 3, KP_BS }, - { 0, 0, -1 } + { 16 , NUM_KEYBOARD }, // size and position + { 0x13, KP_PERIOD }, + { 0x03, 0 }, + { 0x02, 1 }, + { 0x12, 2 }, + { 0x22, 5 }, + { 0x01, KP_10 }, + { 0x11, KP_20 }, + { 0x21, KP_50 }, + { 0x00, KP_100 }, + { 0x10, KP_200 }, + { 0x20, KP_500 }, + { 0x30, KP_n }, + { 0x31, KP_u }, + { 0x32, KP_m }, + { 0x33, KP_X1 }, + { 0x23, KP_BS }, }; // 7 8 9 m // 4 5 6 u // 1 2 3 - // 0 . < x - static const keypads_t keypads_plusmin_unit[] = { - { 1, 3, KP_PERIOD }, - { 0, 3, 0 }, - { 0, 2, 1 }, - { 1, 2, 2 }, - { 2, 2, 3 }, - { 0, 1, 4 }, - { 1, 1, 5 }, - { 2, 1, 6 }, - { 0, 0, 7 }, - { 1, 0, 8 }, - { 2, 0, 9 }, - { 3, 0, KP_u}, - { 3, 1, KP_m}, - { 3, 2, KP_MINUS }, - { 3, 3, KP_X1 }, - { 2, 3, KP_BS }, - { 0, 0, -1 } + { 16 , NUM_KEYBOARD }, // size and position + { 0x13, KP_PERIOD }, + { 0x03, 0 }, + { 0x02, 1 }, + { 0x12, 2 }, + { 0x22, 3 }, + { 0x01, 4 }, + { 0x11, 5 }, + { 0x21, 6 }, + { 0x00, 7 }, + { 0x10, 8 }, + { 0x20, 9 }, + { 0x30, KP_u}, + { 0x31, KP_m}, + { 0x32, KP_MINUS }, + { 0x33, KP_X1 }, + { 0x23, KP_BS } }; -// 7 8 9 -// 4 5 6 + +// 7 8 9 u +// 4 5 6 m // 1 2 3 - // 0 . < x - static const keypads_t keypads_plusmin[] = { - { 1, 3, KP_PERIOD }, - { 0, 3, 0 }, - { 0, 2, 1 }, - { 1, 2, 2 }, - { 2, 2, 3 }, - { 0, 1, 4 }, - { 1, 1, 5 }, - { 2, 1, 6 }, - { 0, 0, 7 }, - { 1, 0, 8 }, - { 2, 0, 9 }, - { 3, 0, KP_u}, - { 3, 1, KP_m}, - { 3, 2, KP_MINUS }, - { 3, 3, KP_X1 }, - { 2, 3, KP_BS }, - { 0, 0, -1 } + { 16, NUM_KEYBOARD }, // size and position + { 0x13, KP_PERIOD }, + { 0x03, 0 }, + { 0x02, 1 }, + { 0x12, 2 }, + { 0x22, 3 }, + { 0x01, 4 }, + { 0x11, 5 }, + { 0x21, 6 }, + { 0x00, 7 }, + { 0x10, 8 }, + { 0x20, 9 }, + { 0x30, KP_u}, + { 0x31, KP_m}, + { 0x32, KP_MINUS }, + { 0x33, KP_X1 }, + { 0x23, KP_BS } }; // 7 8 9 @@ -1158,24 +1189,34 @@ static const keypads_t keypads_plusmin[] = { // 1 2 3 m // 0 . < x static const keypads_t keypads_time[] = { - { 1, 3, KP_PERIOD }, - { 0, 3, 0 }, - { 0, 2, 1 }, - { 1, 2, 2 }, - { 2, 2, 3 }, - { 0, 1, 4 }, - { 1, 1, 5 }, - { 2, 1, 6 }, - { 0, 0, 7 }, - { 1, 0, 8 }, - { 2, 0, 9 }, -// { 3, 0, KP_n}, -// { 3, 1, KP_u}, - { 3, 2, KP_m }, - { 3, 3, KP_X1 }, - { 2, 3, KP_BS }, - { 0, 0, -1 } + { 14 , NUM_KEYBOARD }, // size and position + { 0x13, KP_PERIOD }, + { 0x03, 0 }, + { 0x02, 1 }, + { 0x12, 2 }, + { 0x22, 3 }, + { 0x01, 4 }, + { 0x11, 5 }, + { 0x21, 6 }, + { 0x00, 7 }, + { 0x10, 8 }, + { 0x20, 9 }, +// { 0x30, KP_n}, +// { 0x31, KP_u}, + { 0x32, KP_m }, + { 0x33, KP_X1 }, + { 0x23, KP_BS } +}; + +#ifdef __USE_SD_CARD__ +static const keypads_t keypads_text[] = { + {40, TXT_KEYBOARD }, // size and position + {0x00, '1'}, {0x10, '2'}, {0x20, '3'}, {0x30, '4'}, {0x40, '5'}, {0x50, '6'}, {0x60, '7'}, {0x70, '8'}, {0x80, '9'}, {0x90, '0'}, + {0x01, 'Q'}, {0x11, 'W'}, {0x21, 'E'}, {0x31, 'R'}, {0x41, 'T'}, {0x51, 'Y'}, {0x61, 'U'}, {0x71, 'I'}, {0x81, 'O'}, {0x91, 'P'}, + {0x02, 'A'}, {0x12, 'S'}, {0x22, 'D'}, {0x32, 'F'}, {0x42, 'G'}, {0x52, 'H'}, {0x62, 'J'}, {0x72, 'K'}, {0x82, 'L'}, {0x92, '_'}, + {0x03, '-'}, {0x13, 'Z'}, {0x23, 'X'}, {0x33, 'C'}, {0x43, 'V'}, {0x53, 'B'}, {0x63, 'N'}, {0x73, 'M'}, {0x83, C_LARROW}, {0x93, C_ENTER}, }; +#endif enum { KM_START, KM_STOP, KM_CENTER, KM_SPAN, KM_CW, // These must be first to share common help text @@ -1228,6 +1269,9 @@ enum { #endif #endif KM_CODE, +#ifdef __USE_SD_CARD__ + KM_FILENAME, +#endif KM_NONE // always at enum end }; @@ -1303,6 +1347,9 @@ static const struct { #endif #endif [KM_CODE] = {keypads_positive , "CODE"}, // KM_CODE +#ifdef __USE_SD_CARD__ +[KM_FILENAME] = {keypads_text , "NAME"}, // filename +#endif }; #if 0 // Not used @@ -1958,10 +2005,13 @@ static UI_FUNCTION_ADV_CALLBACK(menu_lowoutput_settings_acb) case 0: setting.mixer_output = false; dirty = true; + update_min_max_freq(); + set_sweep_frequency(ST_CENTER,get_sweep_frequency(ST_CENTER)); // Just to update center if above 4.4GHz break; case 1: setting.mixer_output = true; dirty = true; + update_min_max_freq(); break; } menu_move_back(false); @@ -2824,62 +2874,15 @@ static UI_FUNCTION_ADV_CALLBACK(menu_traces_acb) return; break; -#ifdef TINYSA4 +#ifdef __USE_SD_CARD__ case 6: - save_to_sd(1+(2<icon = BUTTON_ICON_CHECK; - if (setting.subtract[0]){ - if (data == 2 && setting.show_stored) - b->icon = BUTTON_ICON_CHECK; - if (data == 3 && !setting.show_stored) - b->icon = BUTTON_ICON_CHECK; - } - return; - } - switch(data) { - case 0: - store_trace(0,2); - break; - case 1: - set_clear_storage(); - break; - case 2: - set_subtract_storage(); - break; - case 3: - toggle_normalize(); - if (setting.subtract[0]) { - kp_help_text = "Ref level"; - ui_mode_keypad(KM_REFLEVEL); -// setting.normalize_level = uistat.value; - } else - set_auto_reflevel(true); - break; -#ifdef TINYSA4 - case 4: - save_to_sd(1+2); // frequencies + actual - break; - case 5: - save_to_sd(1+4); // frequencies + stored - break; -#endif - } - ui_mode_normal(); -// draw_cal_status(); -} -#endif static UI_FUNCTION_ADV_CALLBACK(menu_waterfall_acb){ (void)item; @@ -3511,6 +3514,109 @@ static UI_FUNCTION_ADV_CALLBACK(menu_connection_acb) shell_reset_console(); } #endif + +#ifdef __USE_SD_CARD__ +//******************************************************************************************* +// Bitmap file header for LCD_WIDTH x LCD_HEIGHT image 16bpp (v4 format allow set RGB mask) +//******************************************************************************************* +#define BMP_UINT32(val) ((val)>>0)&0xFF, ((val)>>8)&0xFF, ((val)>>16)&0xFF, ((val)>>24)&0xFF +#define BMP_UINT16(val) ((val)>>0)&0xFF, ((val)>>8)&0xFF +#define BMP_H1_SIZE (14) // BMP header 14 bytes +#define BMP_V4_SIZE (108) // v4 header 108 bytes +#define BMP_HEAD_SIZE (BMP_H1_SIZE + BMP_V4_SIZE) // Size of all headers +#define BMP_SIZE (2*LCD_WIDTH*LCD_HEIGHT) // Bitmap size = 2*w*h +#define BMP_FILE_SIZE (BMP_SIZE + BMP_HEAD_SIZE) // File size = headers + bitmap +static const uint8_t bmp_header_v4[BMP_H1_SIZE + BMP_V4_SIZE] = { +// BITMAPFILEHEADER (14 byte size) + 0x42, 0x4D, // BM signature + BMP_UINT32(BMP_FILE_SIZE), // File size (h + v4 + bitmap) + BMP_UINT16(0), // reserved + BMP_UINT16(0), // reserved + BMP_UINT32(BMP_HEAD_SIZE), // Size of all headers (h + v4) +// BITMAPINFOv4 (108 byte size) + BMP_UINT32(BMP_V4_SIZE), // Data offset after this point (v4 size) + BMP_UINT32(LCD_WIDTH), // Width + BMP_UINT32(LCD_HEIGHT), // Height + BMP_UINT16(1), // Planes + BMP_UINT16(16), // 16bpp + BMP_UINT32(3), // Compression (BI_BITFIELDS) + BMP_UINT32(BMP_SIZE), // Bitmap size (w*h*2) + BMP_UINT32(0x0EC4), // x Resolution (96 DPI = 96 * 39.3701 inches per meter = 0x0EC4) + BMP_UINT32(0x0EC4), // y Resolution (96 DPI = 96 * 39.3701 inches per meter = 0x0EC4) + BMP_UINT32(0), // Palette size + BMP_UINT32(0), // Palette used +// Extend v4 header data (color mask for RGB565) + BMP_UINT32(0b1111100000000000),// R mask = 0b11111000 00000000 + BMP_UINT32(0b0000011111100000),// G mask = 0b00000111 11100000 + BMP_UINT32(0b0000000000011111),// B mask = 0b00000000 00011111 + BMP_UINT32(0b0000000000000000),// A mask = 0b00000000 00000000 + 'B','G','R','s', // CSType = 'sRGB' + BMP_UINT32(0), // ciexyzRed.ciexyzX Endpoints + BMP_UINT32(0), // ciexyzRed.ciexyzY + BMP_UINT32(0), // ciexyzRed.ciexyzZ + BMP_UINT32(0), // ciexyzGreen.ciexyzX + BMP_UINT32(0), // ciexyzGreen.ciexyzY + BMP_UINT32(0), // ciexyzGreen.ciexyzZ + BMP_UINT32(0), // ciexyzBlue.ciexyzX + BMP_UINT32(0), // ciexyzBlue.ciexyzY + BMP_UINT32(0), // ciexyzBlue.ciexyzZ + BMP_UINT32(0), // GammaRed + BMP_UINT32(0), // GammaGreen + BMP_UINT32(0), // GammaBlue +}; + +static void swap_bytes(uint16_t *buf, int size) { + for (int i = 0; i < size; i++) + buf[i] = __REVSH(buf[i]); // swap byte order (example 0x10FF to 0xFF10) +} + +static uint16_t file_mask; + +// Save format enum +enum { + FMT_BMP_FILE, FMT_CSV_FILE, +#ifdef __SD_CARD_DUMP_FIRMWARE__ + FMT_BIN_FILE, +#endif + FMT_CMD_FILE, + FMT_CFG_FILE, + FMT_PRS_FILE, +}; + +// Save file extension +static const char *file_ext[] = { + [FMT_BMP_FILE] = "bmp", + [FMT_CSV_FILE] = "csv", +#ifdef __SD_CARD_DUMP_FIRMWARE__ + [FMT_BIN_FILE] = "bin", +#endif + [FMT_CMD_FILE] = "cmd", + [FMT_CFG_FILE] = "cfg", + [FMT_PRS_FILE] = "prs", +}; + +static void sa_save_file(uint8_t format); + +static UI_FUNCTION_CALLBACK(menu_sdcard_cb) { + (void)item; + sa_save_file(data); +} + +static UI_FUNCTION_ADV_CALLBACK(menu_autoname_acb) +{ + (void)item; + (void)data; + if (b){ + b->icon = config._mode & _MODE_AUTO_FILENAME ? BUTTON_ICON_CHECK : BUTTON_ICON_NOCHECK; + return; + } + config._mode^= _MODE_AUTO_FILENAME; +} + +#ifdef __SD_FILE_BROWSER__ +#include "vna_browser.c" +#endif +#endif // ===[MENU DEFINITION]========================================================= // Back button submenu list @@ -3523,6 +3629,10 @@ static const menuitem_t menu_store_preset[] = { { MT_ADV_CALLBACK, 0, "STORE AS\nSTARTUP",menu_store_preset_acb}, { MT_ADV_CALLBACK |MT_REPEATS, DATA_STARTS_REPEATS(1,4), "STORE %d", menu_store_preset_acb}, +#ifdef TINYSA4 + { MT_CALLBACK, FMT_PRS_FILE, "STORE\n"S_RARROW"SD", menu_sdcard_cb}, +#endif + { MT_ADV_CALLBACK, 100,"FACTORY\nDEFAULTS",menu_store_preset_acb}, { MT_NONE, 0, NULL,menu_back} // next-> menu_back }; @@ -3532,6 +3642,9 @@ static const menuitem_t menu_load_preset[] = { MT_ADV_CALLBACK|MT_REPEATS, DATA_STARTS_REPEATS(1,4), MT_CUSTOM_LABEL, menu_load_preset_acb}, { MT_ADV_CALLBACK, 101, "LOAD\nDEFAULTS",menu_store_preset_acb}, { MT_ADV_CALLBACK, _MODE_DONT_SAVE_STATE, "SAVE\nSTATE", menu_save_state_acb}, +#ifdef __SD_FILE_BROWSER__ + { MT_CALLBACK, FMT_PRS_FILE, "LOAD FROM\n SD", menu_sdcard_browse_cb }, +#endif { MT_SUBMENU, 0, "STORE" , menu_store_preset}, { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; @@ -3916,7 +4029,6 @@ static const menuitem_t menu_settings4[] = { MT_KEYPAD, KM_DIRECT_STOP, "DSTOP\n\b%s", ""}, { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; -#endif static const menuitem_t menu_settings3[] = { @@ -3957,6 +4069,7 @@ static const menuitem_t menu_settings3[] = #endif // TINYSA4 { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; +#endif static const menuitem_t menu_settings2[] = { @@ -3982,28 +4095,28 @@ static const menuitem_t menu_settings2[] = { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; - +#ifdef TINYSA4 static const menuitem_t menu_settings[] = { -#ifdef TINYSA4 { MT_ADV_CALLBACK,0, "PROGRESS\nBAR", menu_progress_bar_acb}, { MT_ADV_CALLBACK, 0, "DIRECT\nMODE", menu_direct_acb}, { MT_ADV_CALLBACK, 0, "LINEAR\nAVERAGING", menu_linear_averaging_acb}, { MT_KEYPAD, KM_FREQ_CORR, "FREQ CORR\n\b%s", "Enter ppb correction"}, // { MT_SUBMENU, 0, "CALIBRATE\nHARMONIC", menu_calibrate_harmonic}, -#endif #ifdef __NOISE_FIGURE__ { MT_KEYPAD, KM_NF, "NF\n\b%s", "Enter tinySA noise figure"}, #endif +#ifdef __SD_CARD_DUMP_FIRMWARE__ + { MT_CALLBACK, FMT_BIN_FILE, "DUMP\nFIRMWARE", menu_sdcard_cb}, +#endif #ifdef __SD_CARD_LOAD__ { MT_CALLBACK, 0 , "LOAD\nCONFIG.INI", menu_load_config_cb}, // { MT_CALLBACK, 1 , "LOAD\nSETTING.INI", menu_load_config_cb}, #endif -#ifdef TINYSA4 { MT_ADV_CALLBACK, 0, "INTERNALS", menu_internals_acb}, -#endif { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; +#endif #ifdef __NOISE_FIGURE__ static const menuitem_t menu_measure_noise_figure[] = @@ -4159,19 +4272,7 @@ static const menuitem_t menu_config[] = { { MT_SUBMENU, 0, S_RARROW"MORE", menu_config2}, { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; -#if 0 -static const menuitem_t menu_storage[] = -{ - { MT_ADV_CALLBACK,0, "TRACE %d", menu_storage_acb}, - { MT_ADV_CALLBACK,1, "%s", menu_storage_acb}, - { MT_ADV_CALLBACK,1, "DISPLAY", menu_storage_acb}, - { MT_ADV_CALLBACK,2, "COPY\nFROM", menu_storage_acb}, - { MT_ADV_CALLBACK,3, "SUBTRACT", menu_storage_acb}, - { MT_ADV_CALLBACK,4, "NORMALIZE", menu_storage_acb}, - { MT_ADV_CALLBACK,5, "WRITE\n"S_RARROW"SD",menu_storage_acb}, - { MT_NONE, 0, NULL, menu_back} // next-> menu_back -}; -#endif + static const menuitem_t menu_trace[] = { { MT_ADV_CALLBACK|MT_REPEATS,DATA_STARTS_REPEATS(0,TRACES_MAX), "TRACE %d", menu_trace_acb}, @@ -4290,6 +4391,17 @@ static const menuitem_t menu_stimulus[] = { { MT_NONE, 0, NULL, menu_back} // next-> menu_back }; +#ifdef __USE_SD_CARD__ +static const menuitem_t menu_storage[] = { +#ifdef __SD_FILE_BROWSER__ + { MT_CALLBACK, FMT_BMP_FILE, "LOAD BMP", menu_sdcard_browse_cb }, + { MT_CALLBACK, FMT_CMD_FILE, "LOAD CMD", menu_sdcard_browse_cb }, +#endif + { MT_ADV_CALLBACK, 0, "AUTO NAME", menu_autoname_acb }, + { MT_NONE, 0, NULL, menu_back} // next-> menu_back +}; +#endif + #ifdef TINYSA4 const menuitem_t menu_mode[] = { // { MT_FORM | MT_TITLE, 0, "tinySA MODE", NULL}, @@ -4321,6 +4433,9 @@ static const menuitem_t menu_top[] = { { MT_SUBMENU, 0, "DISPLAY", menu_display}, { MT_SUBMENU, 0, "MARKER", menu_marker}, { MT_SUBMENU, 0, "MEASURE", menu_measure}, +#ifdef __USE_SD_CARD__ + { MT_SUBMENU, 0, "STORAGE", menu_storage}, +#endif { MT_SUBMENU, 0, "CONFIG", menu_config}, { MT_SUBMENU, 0, "MODE", menu_mode}, { MT_NONE, 0, NULL, NULL } // sentinel, @@ -5443,7 +5558,7 @@ draw_button(uint16_t x, uint16_t y, uint16_t w, uint16_t h, ui_button_t *b) { uint16_t bw = b->border&BUTTON_BORDER_WIDTH_MASK; ili9341_set_foreground(b->fg); - ili9341_set_background(b->bg);ili9341_fill(x + bw, y + bw, w - (bw * 2), h - (bw * 2)); + ili9341_set_background(b->bg); if (bw==0) return; uint16_t br = LCD_RISE_EDGE_COLOR; uint16_t bd = LCD_FALLEN_EDGE_COLOR; @@ -5454,9 +5569,11 @@ draw_button(uint16_t x, uint16_t y, uint16_t w, uint16_t h, ui_button_t *b) ili9341_set_background(type&BUTTON_BORDER_BOTTOM ? br : bd);ili9341_fill(x, y + h - bw, w, bw); // bottom // Set colors for button text after ili9341_set_background(b->bg); + if (type & BUTTON_BORDER_NO_FILL) return; + ili9341_fill(x + bw, y + bw, w - (bw * 2), h - (bw * 2)); } -void drawMessageBox(char *header, char *text, uint32_t delay){ +void drawMessageBox(const char *header, char *text, uint32_t delay){ ui_button_t b; b.bg = LCD_MENU_COLOR; b.fg = LCD_MENU_TEXT_COLOR; @@ -5472,36 +5589,51 @@ void drawMessageBox(char *header, char *text, uint32_t delay){ } static void -draw_keypad(uint32_t mask) -{ - int i; +draw_keypad_button(int id) { + if (id < 0) return; ui_button_t button; button.fg = LCD_MENU_TEXT_COLOR; - for(i = 0; keypads[i].c >= 0; i++) { - if ((mask&(1<x_offs + (keypads[id+1].pos>> 4) * p->width; + int y = p->y_offs + (keypads[id+1].pos&0xF) * p->height; + draw_button(x, y, p->width, p->height, &button); + if (keypads[0].c == NUM_KEYBOARD) { + if (keypads[id+1].c < KP_0) { // KP_0 + ili9341_drawfont(keypads[id+1].c, x + (KP_WIDTH - NUM_FONT_GET_WIDTH) / 2, y + (KP_HEIGHT - NUM_FONT_GET_HEIGHT) / 2); } else { - const char *t = keypad_scale_text[keypads[i].c - KP_0]; + const char *t = keypad_scale_text[keypads[id+1].c - KP_0]; ili9341_drawstring_10x14(t, x + (KP_WIDTH - wFONT_MAX_WIDTH*strlen(t)) / 2, y + (KP_HEIGHT - wFONT_GET_HEIGHT) / 2); } + } else { + txt[0] = keypads[id+1].c; + ili9341_drawstring_10x14(txt, + x + KPF_WIDTH/2 - FONT_WIDTH + 1, + y + KPF_HEIGHT/2 - FONT_GET_HEIGHT); } } +static void +draw_keypad(void) +{ + int i; + for(i = 0; i < keypads[0].pos; i++) + draw_keypad_button(i); +} + static int menu_is_multiline(const char *label) { @@ -5513,7 +5645,7 @@ menu_is_multiline(const char *label) return n; } -static int period_pos(void) {int j; for (j = 0; j < kp_index && kp_buf[j] != '.'; j++); return j;} +static int period_pos(void) {int j; for (j = 0; kp_buf[j] && kp_buf[j] != '.'; j++); return j;} static void draw_numeric_input(const char *buf) @@ -5556,6 +5688,17 @@ draw_numeric_input(const char *buf) } } +static void +draw_text_input(const char *buf) +{ + ili9341_set_foreground(LCD_INPUT_TEXT_COLOR); + ili9341_set_background(LCD_INPUT_BG_COLOR); + uint16_t x = 14 + 10 * FONT_WIDTH; + uint16_t y = LCD_HEIGHT-(wFONT_GET_HEIGHT + NUM_INPUT_HEIGHT)/2; + ili9341_fill(x, y, wFONT_MAX_WIDTH * 20, wFONT_GET_HEIGHT); + ili9341_drawstring_10x14(buf, x, y); +} + static void draw_numeric_area_frame(void) { @@ -6090,7 +6233,7 @@ ui_mode_keypad(int _keypad_mode) ui_mode = UI_KEYPAD; if (!current_menu_is_form()) draw_menu(); - draw_keypad(-1); + draw_keypad(); draw_numeric_area_frame(); ui_process_keypad(); } @@ -6280,9 +6423,9 @@ ui_process_menu_lever(void) } static int -keypad_click(int key) +num_keypad_click(int c, int kp_index) { - int c = keypads[key].c; + if (c == KP_ENTER) c = KP_X1; if ((c >= KP_X1 && c <= KP_G) || c == KP_m || c == KP_u || c == KP_n) { #if 0 float scale = 1.0; @@ -6363,29 +6506,52 @@ keypad_click(int key) return KP_CONTINUE; } +static int +full_keypad_click(int c, int kp_index) +{ + if (c == S_ENTER[0]) { // Enter + return kp_index == 0 ? KP_CANCEL : KP_DONE; + } + if (c == S_LARROW[0]) { // Backspace + if (kp_index == 0) + return KP_CANCEL; + --kp_index; + } else if (kp_index < TXTINPUT_LEN) { // any other text input + kp_buf[kp_index++] = c; + } + kp_buf[kp_index] = '\0'; + draw_text_input(kp_buf); + return KP_CONTINUE; +} + +static int +keypad_click(int key) { + int c = keypads[key+1].c; // !!! Use key + 1 (zero key index used or size define) + int index = strlen(kp_buf); + int result = keypads[0].c == NUM_KEYBOARD ? num_keypad_click(c, index) : full_keypad_click(c, index); + return result; +} + static int keypad_apply_touch(void) { int touch_x, touch_y; - int i = 0; - touch_position(&touch_x, &touch_y); - - while (keypads[i].c >= 0) { - int x = KP_GET_X(keypads[i].x); - int y = KP_GET_Y(keypads[i].y); - if (x < touch_x && touch_x < x+KP_WIDTH && y < touch_y && touch_y < y+KP_HEIGHT) { - uint32_t mask = (1<x_offs || touch_y < p->y_offs) return -1; + // Calculate key position from touch x and y + touch_x-= p->x_offs; touch_x/= p->width; + touch_y-= p->y_offs; touch_y/= p->height; + uint8_t pos = (touch_y & 0x0F) | (touch_x<<4); + for (int i = 0; i < keypads[0].pos; i++) { + if (keypads[i+1].pos != pos) continue; + int old = selection; + draw_keypad_button(selection = i); // draw new focus + draw_keypad_button(old); // Erase old focus + touch_wait_release(); + selection = -1; + draw_keypad_button(i); // erase new focus + return i; // Process input; } return -1; } @@ -6394,29 +6560,25 @@ static void ui_process_keypad(void) { int status; - kp_index = 0; - int keypads_last_index; - for (keypads_last_index = 0; keypads[keypads_last_index+1].c >= 0; keypads_last_index++) - ; + int keypads_last_index = keypads[0].pos - 1; + kp_buf[0] = 0; while (TRUE) { status = btn_check(); if (status & (EVT_UP|EVT_DOWN)) { - int s = status; do { - uint32_t mask = (1< keypads_last_index) - selection = 0; - draw_keypad(mask|(1< keypads_last_index) + selection = 0; + draw_keypad_button(old); + draw_keypad_button(selection); chThdSleepMilliseconds(100); - } while ((s = btn_wait_release()) != 0); + } while ((status = btn_wait_release()) != 0); } if (status == EVT_BUTTON_SINGLE_CLICK) { - if (keypad_click(selection)) + if (selection >= 0 && keypad_click(selection)) /* exit loop on done or cancel */ break; } @@ -6452,6 +6614,11 @@ ui_process_lever(void) // case UI_KEYPAD: // ui_process_keypad(); // break; +#ifdef __SD_FILE_BROWSER__ + case UI_BROWSER: + ui_process_browser_lever(); + break; +#endif } } @@ -6529,131 +6696,144 @@ static int touch_quick_menu(int touch_x, int touch_y) } #ifdef __USE_SD_CARD__ -//******************************************************************************************* -// Bitmap file header for LCD_WIDTH x LCD_HEIGHT image 16bpp (v4 format allow set RGB mask) -//******************************************************************************************* -#define BMP_UINT32(val) ((val)>>0)&0xFF, ((val)>>8)&0xFF, ((val)>>16)&0xFF, ((val)>>24)&0xFF -#define BMP_H1_SIZE (14) // BMP header 14 bytes -#define BMP_V4_SIZE (56) // v4 header 56 bytes -#define BMP_HEAD_SIZE (BMP_H1_SIZE + BMP_V4_SIZE) // Size of all headers -#define BMP_SIZE (2*LCD_WIDTH*LCD_HEIGHT) // Bitmap size = 2*w*h -#define BMP_FILE_SIZE (BMP_SIZE + BMP_HEAD_SIZE) // File size = headers + bitmap -static const uint8_t bmp_header_v4[14+56] = { -// BITMAPFILEHEADER (14 byte size) - 0x42, 0x4D, // BM signature - BMP_UINT32(BMP_FILE_SIZE), // File size (h + v4 + bitmap) - 0x00, 0x00, // reserved - 0x00, 0x00, // reserved - BMP_UINT32(BMP_HEAD_SIZE), // Size of all headers (h + v4) -// BITMAPINFOv4 (56 byte size) - BMP_UINT32(BMP_V4_SIZE), // Data offset after this point (v4 size) - BMP_UINT32(LCD_WIDTH), // Width - BMP_UINT32(LCD_HEIGHT), // Height - 0x01, 0x00, // Planes - 0x10, 0x00, // 16bpp - 0x03, 0x00, 0x00, 0x00, // Compression (BI_BITFIELDS) - BMP_UINT32(BMP_SIZE), // Bitmap size (w*h*2) - 0xC4, 0x0E, 0x00, 0x00, // x Resolution (96 DPI = 96 * 39.3701 inches per metre = 0x0EC4) - 0xC4, 0x0E, 0x00, 0x00, // y Resolution (96 DPI = 96 * 39.3701 inches per metre = 0x0EC4) - 0x00, 0x00, 0x00, 0x00, // Palette size - 0x00, 0x00, 0x00, 0x00, // Palette used -// Extend v4 header data (color mask for RGB565) - 0x00, 0xF8, 0x00, 0x00, // R mask = 0b11111000 00000000 - 0xE0, 0x07, 0x00, 0x00, // G mask = 0b00000111 11100000 - 0x1F, 0x00, 0x00, 0x00, // B mask = 0b00000000 00011111 - 0x00, 0x00, 0x00, 0x00 // A mask = 0b00000000 00000000 -}; - -FRESULT open_file(char *ext) +// Create file name from current time +static FRESULT sa_create_file(char *fs_filename) { -#ifdef __DISABLE_HOT_INSERT__ - if (!sd_card_inserted_at_boot) { - drawMessageBox("Warning:", "Restart tinySA to use SD card", 2000); - return FR_NOT_READY; - } -#endif +// shell_printf("S file\r\n"); FRESULT res = f_mount(fs_volume, "", 1); - // fs_volume, fs_file and fs_filename stored at end of spi_buffer!!!!! // shell_printf("Mount = %d\r\n", res); if (res != FR_OK) return res; -#if FF_USE_LFN >= 1 - uint32_t tr = rtc_get_tr_bcd(); // TR read first - uint32_t dr = rtc_get_dr_bcd(); // DR read second - plot_printf(fs_filename, FF_LFN_BUF, "SA_%06x_%06x.%s", dr, tr, ext); -#else - plot_printf(fs_filename, FF_LFN_BUF, "%08x.%s", rtc_get_FAT(), ext); -#endif res = f_open(fs_file, fs_filename, FA_CREATE_ALWAYS | FA_READ | FA_WRITE); - return res; +// shell_printf("Open %s, = %d\r\n", fs_filename, res); + return res; } -void close_file(FRESULT res) -{ - if (res == FR_OK) - res = f_close(fs_file); -// time = chVTGetSystemTimeX() - time; -// shell_printf("Total time: %dms (write %d byte/sec)\r\n", time/10, (LCD_WIDTH*LCD_HEIGHT*sizeof(uint16_t)+sizeof(bmp_header_v4))*10000/time); - drawMessageBox("Save:", res == FR_OK ? fs_filename : " Write failed ", 2000); - redraw_request|= REDRAW_AREA; -} -static bool -made_screenshot(int touch_x, int touch_y) -{ - int y, i; +static void sa_save_file(uint8_t format) { + uint16_t *buf_16; + int i, y; UINT size; - if (touch_y < SD_CARD_START || touch_y > SD_CARD_START + 20 || touch_x > OFFSETX) - return FALSE; - ili9341_set_background(LCD_BG_COLOR); - ili9341_fill(4, SD_CARD_START, 16, 16); - touch_wait_release(); + char fs_filename[FF_LFN_BUF]; #ifdef __DISABLE_HOT_INSERT__ if (!sd_card_inserted_at_boot) { drawMessageBox("Warning:", "Restart tinySA to use SD card", 2000); - return FALSE; + return; } #endif -// uint32_t time = chVTGetSystemTimeX(); -// shell_printf("Screenshot\r\n"); - FRESULT res = open_file("bmp"); - uint16_t *buf = (uint16_t *)spi_buffer; -// shell_printf("Open %s, result = %d\r\n", fs_filename, res); - if (res == FR_OK){ - res = f_write(fs_file, bmp_header_v4, sizeof(bmp_header_v4), &size); - for (y = LCD_HEIGHT-1; y >= 0 && res == FR_OK; y--) { - ili9341_read_memory(0, y, LCD_WIDTH, 1, buf); - for (i = 0; i < LCD_WIDTH; i++) - buf[i] = __REVSH(buf[i]); // swap byte order (example 0x10FF to 0xFF10) - res = f_write(fs_file, buf, LCD_WIDTH*sizeof(uint16_t), &size); - } -// res = f_close(fs_file); -// shell_printf("Close %d\r\n", res); -// testLog(); + + // Prepare filename and open for write + if (config._mode & _MODE_AUTO_FILENAME) { // Auto name, use date / time +#if FF_USE_LFN >= 1 + uint32_t tr = rtc_get_tr_bcd(); // TR read first + uint32_t dr = rtc_get_dr_bcd(); // DR read second + plot_printf(fs_filename, FF_LFN_BUF, "SA_%06x_%06x.%s", dr, tr, file_ext[format]); +#else + plot_printf(fs_filename, FF_LFN_BUF, "%08x.%s", rtc_get_FAT(), file_ext[format]); +#endif + } + else { + ui_mode_keypad(KM_FILENAME); + if (kp_buf[0] == 0) return; + plot_printf(fs_filename, FF_LFN_BUF, "%s.%s", kp_buf, file_ext[format]); } - close_file(res); - return TRUE; -} -void save_to_sd(int mask) -{ - FRESULT res = open_file("csv"); - UINT size; + // For screenshot need back to normal mode and redraw screen before capture!! + // Redraw use spi_buffer so need do it before any file ops + if (format == FMT_BMP_FILE && (ui_mode != UI_NORMAL || !(config._mode & _MODE_AUTO_FILENAME))){ + ui_mode_normal(); + draw_all(false); + } +// UINT total_size = 0; +// systime_t time = chVTGetSystemTimeX(); + // Prepare filename = .bmp / .csv and open for write + FRESULT res = sa_create_file(fs_filename); if (res == FR_OK) { - for (int i = 0; i < sweep_points; i++) { - char *buf = (char *)spi_buffer; - if (mask & 1) buf += plot_printf(buf, 100, "%U, ", getFrequency(i)); - if (mask & 2) buf += plot_printf(buf, 100, "%f ", value(measured[TRACE_ACTUAL][i])); - if (mask & 4) buf += plot_printf(buf, 100, "%f ", value(measured[TRACE_STORED][i])); - if (mask & 8) buf += plot_printf(buf, 100, "%f", value(measured[TRACE_TEMP][i])); - buf += plot_printf(buf, 100, "\r\n"); - res = f_write(fs_file, (char *)spi_buffer, buf - (char *)spi_buffer, &size); - if (res != FR_OK) - break; + switch(format) { + /* + * Save bitmap file (use v4 format allow set RGB mask) + */ + case FMT_BMP_FILE: + buf_16 = spi_buffer; + res = f_write(fs_file, bmp_header_v4, BMP_HEAD_SIZE, &size); // Write header struct +// total_size+=size; + ili9341_set_background(LCD_SWEEP_LINE_COLOR); + for (y = LCD_HEIGHT-1; y >= 0 && res == FR_OK; y--) { + ili9341_read_memory(0, y, LCD_WIDTH, 1, buf_16); + swap_bytes(buf_16, LCD_WIDTH); + res = f_write(fs_file, buf_16, LCD_WIDTH*sizeof(uint16_t), &size); +// total_size+=size; + ili9341_fill(LCD_WIDTH-1, y, 1, 1); + } + break; + case FMT_CSV_FILE: + for (i = 0; i < sweep_points && res == FR_OK; i++) { + char *buf = (char *)spi_buffer; + if (file_mask & 1) buf += plot_printf(buf, 100, "%U, ", getFrequency(i)); + if (file_mask & 2) buf += plot_printf(buf, 100, "%f ", value(measured[TRACE_ACTUAL][i])); + if (file_mask & 4) buf += plot_printf(buf, 100, "%f ", value(measured[TRACE_STORED][i])); + if (file_mask & 8) buf += plot_printf(buf, 100, "%f ", value(measured[TRACE_STORED2][i])); + if (file_mask & 16) buf += plot_printf(buf, 100, "%f", value(measured[TRACE_TEMP][i])); + buf += plot_printf(buf, 100, "\r\n"); + res = f_write(fs_file, (char *)spi_buffer, buf - (char *)spi_buffer, &size); + } + break; +#ifdef __SD_CARD_DUMP_FIRMWARE__ + /* + * Dump firmware to SD card as bin file image + */ + case FMT_BIN_FILE: + { + const char *src = (const char*)FLASH_START_ADDRESS; + const uint32_t total = FLASH_TOTAL_SIZE; + res = f_write(fs_file, src, total, &size); + } + break; +#endif + /* + * Dump preset to SD card as prs file + */ + case FMT_PRS_FILE: + { + uint16_t *src = (uint16_t*)&setting; + int total = sizeof(setting_t); + setting.magic = CONFIG_MAGIC; + setting.checksum = 0x12345678; + setting.checksum = checksum( + &setting, + // (sizeof (setting)) - sizeof setting.checksum + (void *)&setting.checksum - (void *) &setting + ); + res = f_write(fs_file, src, total, &size); + } + break; } + f_close(fs_file); +// shell_printf("Close = %d\r\n", res); +// testLog(); +// time = chVTGetSystemTimeX() - time; +// shell_printf("Total time: %dms (write %d byte/sec)\r\n", time/10, total_size*10000/time); } - close_file(res); + + drawMessageBox("SD CARD SAVE", res == FR_OK ? fs_filename : " Fail write ", 2000); + redraw_request|= REDRAW_AREA|REDRAW_FREQUENCY; + ui_mode_normal(); } +static void save_csv(uint8_t mask) { + file_mask = mask; + menu_sdcard_cb(0, FMT_CSV_FILE); +} + +static bool +made_screenshot(int touch_x, int touch_y) { + if (touch_y < SD_CARD_START || touch_y > SD_CARD_START + 20 || touch_x > OFFSETX) + return FALSE; + ili9341_set_background(LCD_BG_COLOR); + ili9341_fill(4, SD_CARD_START, 16, 16); + touch_wait_release(); + menu_sdcard_cb(0, FMT_BMP_FILE); + return TRUE; +} #endif static int @@ -6776,6 +6956,11 @@ void ui_process_touch(void) case UI_MENU: menu_apply_touch(touch_x, touch_y); break; +#ifdef __SD_FILE_BROWSER__ + case UI_BROWSER: + browser_apply_touch(touch_x, touch_y); + break; +#endif } } } @@ -6796,7 +6981,7 @@ ui_process(void) operation_requested = OP_NONE; } if (operation_requested&OP_TOUCH) { - ui_process_touch(); + ui_process_touch(); operation_requested = OP_NONE; } touch_start_watchdog(); diff --git a/vna_browser.c b/vna_browser.c new file mode 100644 index 0000000..2183f2d --- /dev/null +++ b/vna_browser.c @@ -0,0 +1,369 @@ +static uint16_t file_count; +static uint16_t page_count; +static uint16_t current_page; +static uint16_t sel_mode; + +// Buttons in browser +enum {FILE_BUTTON_LEFT = 0, FILE_BUTTON_RIGHT, FILE_BUTTON_EXIT, FILE_BUTTON_DEL, FILE_BUTTON_FILE}; +// Button position on screen +typedef struct { + uint16_t x; + uint16_t y; + uint16_t w; + uint8_t h; + uint8_t ofs; +} browser_btn_t; +static const browser_btn_t browser_btn[] = { + [FILE_BUTTON_LEFT] = { 0 + 40, LCD_HEIGHT - FILE_BOTTOM_HEIGHT, LCD_WIDTH/2 - 80, FILE_BOTTOM_HEIGHT, (LCD_WIDTH/2 - 80 - FONT_WIDTH)/2}, // < previous + [FILE_BUTTON_RIGHT]= {LCD_WIDTH/2 + 40, LCD_HEIGHT - FILE_BOTTOM_HEIGHT, LCD_WIDTH/2 - 80, FILE_BOTTOM_HEIGHT, (LCD_WIDTH/2 - 80 - FONT_WIDTH)/2}, // > next + [FILE_BUTTON_EXIT] = {LCD_WIDTH - 40, LCD_HEIGHT - FILE_BOTTOM_HEIGHT, 40, FILE_BOTTOM_HEIGHT, ( 40 - FONT_WIDTH)/2}, // X exit + [FILE_BUTTON_DEL] = { 0 + 0, LCD_HEIGHT - FILE_BOTTOM_HEIGHT, 40, FILE_BOTTOM_HEIGHT, ( 40 - 3*FONT_WIDTH)/2}, // DEL + // File button, only size and start position, must be idx = FILE_BUTTON_FILE + [FILE_BUTTON_FILE] = { 0, 0, LCD_WIDTH/FILES_COLUMNS, FILE_BUTTON_HEIGHT, 5}, +}; + +static void browser_get_button_pos(int idx, browser_btn_t *b) { + int n = idx >= FILE_BUTTON_FILE ? FILE_BUTTON_FILE : idx; +#if 0 + memcpy(b, &browser_btn[n], sizeof(browser_btn_t)); +#else + b->x = browser_btn[n].x; + b->y = browser_btn[n].y; + b->w = browser_btn[n].w; + b->h = browser_btn[n].h; + b->ofs = browser_btn[n].ofs; +#endif + if (idx > FILE_BUTTON_FILE) { // for file buttons use multiplier from start offset + idx-= FILE_BUTTON_FILE; + b->x+= b->w * (idx / FILES_ROWS); + b->y+= b->h * (idx % FILES_ROWS); + } +} + +static void browser_draw_button(int idx, const char *txt) { + if (idx < 0) return; + ui_button_t b; + browser_btn_t btn; + browser_get_button_pos(idx, &btn); + // Mark DEL button in file delete mode + b.bg = (idx == FILE_BUTTON_DEL && sel_mode) ? LCD_LOW_BAT_COLOR : LCD_MENU_COLOR; + b.fg = LCD_MENU_TEXT_COLOR; + b.border = (idx == selection) ? BROWSER_BUTTON_BORDER|BUTTON_BORDER_FALLING : BROWSER_BUTTON_BORDER|BUTTON_BORDER_RISE; + if (txt == NULL) b.border|= BUTTON_BORDER_NO_FILL; + draw_button(btn.x, btn.y, btn.w, btn.h, &b); + if (txt) ili9341_drawstring_7x13(txt, btn.x + btn.ofs, btn.y + (btn.h - bFONT_STR_HEIGHT) / 2); +} + +static char to_lower(char c) {return (c >='A' && c <= 'Z') ? c - 'A' + 'a' : c;} + +static bool strcmpi(const char *t1, const char *t2) { + int i = 0; + while (1) { + char ch1 = to_lower(t1[i]), ch2 = to_lower(t2[i]); + if (ch1 != ch2) return false; + if (ch1 == 0) return true; + i++; + } +} + +static bool compare_ext(const char *name, const char *ext) { + int i = 0, j = 0; + while (name[i]) if (name[i++] == '.') j = i; // Get last '.' position + 1 + return j == 0 ? false : strcmpi(&name[j], ext); // Compare text after '.' and ext +} + +static FRESULT sd_findnext(DIR* dp, FILINFO* fno) { + while (f_readdir(dp, fno) == FR_OK && fno->fname[0]) { + if (fno->fattrib & AM_DIR) continue; + if (compare_ext(fno->fname, dp->pat)) return FR_OK; +//#if FF_USE_LFN && FF_USE_FIND == 2 +// if (compare_ext(fno->altname, dp->pat)) return FR_OK; +//#endif + } + return FR_NO_FILE; +} + +static FRESULT sd_open_dir(DIR* dp, const TCHAR* path, const TCHAR* pattern) { + dp->pat = pattern; + return f_opendir(dp, path); +} + +static void browser_open_file(int sel) { + FILINFO fno; + FRESULT res; + DIR dj; + int cnt; + if ((uint16_t)sel >= file_count) return; + if (f_mount(fs_volume, "", 1) != FR_OK) return; +repeat: + cnt = sel; + if (sd_open_dir(&dj, "", file_ext[keypad_mode]) != FR_OK) return; // open dir + while (sd_findnext(&dj, &fno) == FR_OK && cnt != 0) cnt--; // skip cnt files + f_closedir(&dj); + if (cnt != 0) return; + + // Delete file if in delete mode + if (sel_mode) {f_unlink(fno.fname); return;} + + const char *error = NULL; + bool leave_show = true; + UINT size; + if (f_open(fs_file, fno.fname, FA_READ) != FR_OK) return; + + ili9341_set_foreground(LCD_FG_COLOR); + ili9341_set_background(LCD_BG_COLOR); + switch (keypad_mode) { + case FMT_CMD_FILE: + { + const int buffer_size = 256; + const int line_size = 128; + char *buf_8 = (char *)spi_buffer; // must be greater then buffer_size + line_size + char *line = buf_8 + buffer_size; + uint16_t j = 0, i; + while (f_read(fs_file, buf_8, buffer_size, &size) == FR_OK && size > 0) { + for (i = 0; i < size; i++) { + uint8_t c = buf_8[i]; + if (c == '\r') { // New line (Enter) + line[j] = 0; j = 0; + shell_executeCMDLine(line); + } + else if (c < 0x20) continue; // Others (skip) + else if (j < line_size) line[j++] = (char)c; // Store + } + } + break; + } + /* + * BMP file load procedure, load only device screenshots + */ + case FMT_BMP_FILE: + { + int y; + leave_show = false; // allow step up/down load bitmap + uint16_t *buf_16 = spi_buffer; // prepare buffer + res = f_read(fs_file, (void *)buf_16, sizeof(bmp_header_v4), &size); // read heaser + if (res != FR_OK || buf_16[9] != LCD_WIDTH || buf_16[11] != LCD_HEIGHT || buf_16[14] != 16) {error = "Format err"; break;} + for (y = LCD_HEIGHT-1; y >=0 && res == FR_OK; y--) { + res = f_read(fs_file, (void *)buf_16, LCD_WIDTH * sizeof(uint16_t), &size); + swap_bytes(buf_16, LCD_WIDTH); + ili9341_bulk(0, y, LCD_WIDTH, 1); + } + ili9341_drawstring_7x13(fno.fname, 0, LCD_HEIGHT - 3*bFONT_STR_HEIGHT); + } + break; + /* + * Load calibration + */ +// case FMT_CAL_FILE: +// { +// uint32_t magic; +// char *src = (char*)¤t_props + sizeof(magic); +// uint32_t total = sizeof(current_props) - sizeof(magic); +// // Compare file size and try read magic header, if all OK load it +// if (fno.fsize == sizeof(current_props) && f_read(fs_file, &magic, sizeof(magic), &size) == FR_OK && +// magic == PROPS_MAGIC && f_read(fs_file, src, total, &size) == FR_OK) +// load_properties(NO_SAVE_SLOT); +// else error = "Format err"; +// } +// break; + /* + * Load preset + */ + case FMT_PRS_FILE: + { + uint32_t magic; + char *src = (char*)&setting + sizeof(magic); + uint32_t total = sizeof(setting_t) - sizeof(magic); + // Compare file size and try read magic header, if all OK load it + if (fno.fsize == sizeof(setting) && f_read(fs_file, &magic, sizeof(magic), &size) == FR_OK && + magic == CONFIG_MAGIC && f_read(fs_file, src, total, &size) == FR_OK) { + + // TODO remove code duplication with flash.c + update_min_max_freq(); + update_frequencies(); + set_scale(setting.scale); + set_reflevel(setting.reflevel); + set_waterfall(); + set_level_meter(); + } + else error = "Format err"; + } + break; + default: break; + } + f_close(fs_file); + if (error) { + ili9341_clear_screen(); + drawMessageBox(error, fno.fname, leave_show ? 2000 : 0); + } + if (leave_show) return; + // Process input + while (1) { + uint16_t status = btn_check(); + int key = -1; + if (status & EVT_DOWN) key = 0; + if (status & EVT_UP ) key = 1; + if (status & EVT_BUTTON_SINGLE_CLICK) key = 2; + + status = touch_check(); + if (status == EVT_TOUCH_PRESSED || status == EVT_TOUCH_DOWN) { + int touch_x, touch_y; + touch_position(&touch_x, &touch_y); + if (touch_x < LCD_WIDTH *1/3) key = 0; + else if (touch_x < LCD_WIDTH *2/3) key = 2; + else key = 1; + touch_wait_release(); + } + chThdSleepMilliseconds(100); + int old_sel = sel; + if (key == 0) {if (--sel < 0) sel = file_count - 1;} + else if (key == 1) {if (++sel > file_count - 1) sel = 0;} + else if (key == 2) break; + if (old_sel != sel) goto repeat; + } +} + +static void browser_draw_buttons(void) { + browser_draw_button(FILE_BUTTON_DEL, "DEL"); + browser_draw_button(FILE_BUTTON_LEFT, "<"); + browser_draw_button(FILE_BUTTON_RIGHT, ">"); + browser_draw_button(FILE_BUTTON_EXIT, "X"); +} + +static void browser_draw_page(int page) { + FILINFO fno; + DIR dj; + // Mount SD card and open directory + if (f_mount(fs_volume, "", 1) != FR_OK || + sd_open_dir(&dj, "", file_ext[keypad_mode]) != FR_OK) { + drawMessageBox("ERROR", "NO CARD", 2000); + ui_mode_normal(); + return; + } + // Draw Browser UI + int cnt = 0; + uint16_t start_file = (page - 1) * FILES_PER_PAGE; + ili9341_set_background(LCD_MENU_COLOR); + ili9341_clear_screen(); + lcd_set_font(FONT_NORMAL); + while (sd_findnext(&dj, &fno) == FR_OK) { + if (cnt >= start_file && cnt < (start_file + FILES_PER_PAGE)) { + //uint16_t sec = ((fno.ftime<<1) & 0x3F); + //uint16_t min = ((fno.ftime>>5) & 0x3F); + //uint16_t h = ((fno.ftime>>11) & 0x1F); + //uint16_t d = ((fno.fdate>>0) & 0x1F); + //uint16_t m = ((fno.fdate>>5) & 0x0F); + //uint16_t year= ((fno.fdate>>9) & 0x3F) + 1980; + //lcd_printf(x, y, "%2d %s %u - %u/%02u/%02u %02u:%02u:%02u", cnt, fno.fname, fno.fsize, year, m, d, h, min, sec); + browser_draw_button(cnt - start_file + FILE_BUTTON_FILE, fno.fname); + } + cnt++; + if (file_count && (start_file + FILES_PER_PAGE == cnt)) break; + } + f_closedir(&dj); + // Calculate page and file count on first run + if (file_count == 0) { + file_count = cnt; + page_count = cnt == 0 ? 1 : (file_count + FILES_PER_PAGE - 1) / FILES_PER_PAGE; + } + browser_draw_buttons(); + lcd_printf(LCD_WIDTH / 2 - 3 * bFONT_WIDTH, LCD_HEIGHT - (FILE_BOTTOM_HEIGHT + bFONT_STR_HEIGHT) / 2, "- %u | %u -", page, page_count); + lcd_set_font(FONT_SMALL); + return; +} + +static void browser_key_press(int key) { + int page; + switch (key) { + case FILE_BUTTON_LEFT: + case FILE_BUTTON_RIGHT: // Switch page on left / right change + page = current_page; + if (key == FILE_BUTTON_LEFT && --current_page < 1) current_page = page_count; + if (key == FILE_BUTTON_RIGHT && ++current_page > page_count) current_page = 1; + if (page != current_page) + browser_draw_page(current_page); + break; + case FILE_BUTTON_EXIT: //Exit + ui_mode_normal(); + break; + case FILE_BUTTON_DEL: // Toggle delete mode + sel_mode^= 1; + browser_draw_buttons(); + break; + case FILE_BUTTON_FILE: // Open or delete file + default: + browser_open_file(key - FILE_BUTTON_FILE + (current_page - 1) * FILES_PER_PAGE); + if (sel_mode) { + file_count = 0; // Reeset file count (recalculate on draw page) + selection = -1; // Reset delection + sel_mode = 0; // Exit file delete mode + browser_draw_page(current_page); + return; + } + ui_mode_normal(); // Exit + break; + } +} + +static int browser_get_max(void) { + // get max buttons depend from page and file count + int max = current_page == page_count ? (file_count % FILES_PER_PAGE) : FILES_PER_PAGE; + if (file_count > 0 && max == 0) max = FILES_PER_PAGE; + return max + FILE_BUTTON_FILE - 1; +} + +// Process UI input for browser +static void browser_apply_touch(int touch_x, int touch_y) { + browser_btn_t btn; + int old = selection; + int max = browser_get_max(); + for (int idx = 0; idx <= max; idx++) { + browser_get_button_pos(idx, &btn); + if (touch_x < btn.x || touch_x >= btn.x + btn.w || + touch_y < btn.y || touch_y >= btn.y + btn.h) continue; + // Found button under touch + browser_draw_button(selection = idx, NULL); // draw new selection + browser_draw_button(old, NULL); // clear old + touch_wait_release(); + selection = -1; + browser_draw_button(idx, NULL); // clear selection + browser_key_press(idx); + return; + } +} + +static void ui_process_browser_lever(void) { + uint16_t status = btn_check(); + if (status == 0) return; + if (status == EVT_BUTTON_SINGLE_CLICK) { + if (selection >= 0) browser_key_press(selection); // Process click + return; + } + int max = browser_get_max(); + do { + int old = selection; + if((status & EVT_DOWN) && --selection < 0) selection = max; + if((status & EVT_UP) && ++selection > max) selection = 0; + if (old != selection) { + browser_draw_button(old, NULL); // clear old selection + browser_draw_button(selection, NULL); // draw new selection + } + chThdSleepMilliseconds(100); + } while ((status = btn_wait_release()) != 0); +} + +static UI_FUNCTION_CALLBACK(menu_sdcard_browse_cb) { + (void)item; + if (ui_mode == UI_BROWSER) + return; + area_width = 0; + area_height = 0; + ui_mode = UI_BROWSER; + keypad_mode = data; + current_page = 1; + + file_count = 0; + selection = -1; + sel_mode = 0; + browser_draw_page(current_page); +}