diff --git a/FatFs/ff.h b/FatFs/ff.h index 4866576..58efb01 100644 --- a/FatFs/ff.h +++ b/FatFs/ff.h @@ -26,7 +26,11 @@ extern "C" { #endif -#include "ffconf.h" /* FatFs configuration options */ +#if defined(NANOVNA_F303) +#include "ffconf_303.h" /* FatFs configuration options for F303 */ +#else +#include "ffconf_072.h" /* FatFs configuration options for F072 */ +#endif #if FF_DEFINED != FFCONF_DEF #error Wrong configuration file (ffconf.h). diff --git a/FatFs/ffconf.h b/FatFs/ffconf_072.h similarity index 100% rename from FatFs/ffconf.h rename to FatFs/ffconf_072.h diff --git a/FatFs/ffconf_303.h b/FatFs/ffconf_303.h new file mode 100644 index 0000000..737b04a --- /dev/null +++ b/FatFs/ffconf_303.h @@ -0,0 +1,329 @@ +/*---------------------------------------------------------------------------/ +/ FatFs Functional Configurations +/---------------------------------------------------------------------------*/ + +#define FFCONF_DEF 86631 /* Revision ID */ + +/*---------------------------------------------------------------------------/ +/ Function Configurations +/---------------------------------------------------------------------------*/ + +#define FF_FS_READONLY 0 +/* This option switches read-only configuration. (0:Read/Write or 1:Read-only) +/ Read-only configuration removes writing API functions, f_write(), f_sync(), +/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree() +/ and optional writing functions as well. */ + + +#define FF_FS_MINIMIZE 0 +/* This option defines minimization level to remove some basic API functions. +/ +/ 0: Basic functions are fully enabled. +/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename() +/ are removed. +/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1. +/ 3: f_lseek() function is removed in addition to 2. */ + + +#define FF_USE_FIND 1 +/* This option switches filtered directory read functions, f_findfirst() and +/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */ + + +#define FF_USE_MKFS 0 +/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */ + + +#define FF_USE_FASTSEEK 0 +/* This option switches fast seek function. (0:Disable or 1:Enable) */ + + +#define FF_USE_EXPAND 0 +/* This option switches f_expand function. (0:Disable or 1:Enable) */ + + +#define FF_USE_CHMOD 0 +/* This option switches attribute manipulation functions, f_chmod() and f_utime(). +/ (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */ + + +#define FF_USE_LABEL 0 +/* This option switches volume label functions, f_getlabel() and f_setlabel(). +/ (0:Disable or 1:Enable) */ + + +#define FF_USE_FORWARD 0 +/* This option switches f_forward() function. (0:Disable or 1:Enable) */ + + +#define FF_USE_STRFUNC 0 +#define FF_PRINT_LLI 0 +#define FF_PRINT_FLOAT 0 +#define FF_STRF_ENCODE 0 +/* FF_USE_STRFUNC switches string functions, f_gets(), f_putc(), f_puts() and +/ f_printf(). +/ +/ 0: Disable. FF_PRINT_LLI, FF_PRINT_FLOAT and FF_STRF_ENCODE have no effect. +/ 1: Enable without LF-CRLF conversion. +/ 2: Enable with LF-CRLF conversion. +/ +/ FF_PRINT_LLI = 1 makes f_printf() support long long argument and FF_PRINT_FLOAT = 1/2 + makes f_printf() support floating point argument. These features want C99 or later. +/ When FF_LFN_UNICODE >= 1 with LFN enabled, string functions convert the character +/ encoding in it. FF_STRF_ENCODE selects assumption of character encoding ON THE FILE +/ to be read/written via those functions. +/ +/ 0: ANSI/OEM in current CP +/ 1: Unicode in UTF-16LE +/ 2: Unicode in UTF-16BE +/ 3: Unicode in UTF-8 +*/ + + +/*---------------------------------------------------------------------------/ +/ Locale and Namespace Configurations +/---------------------------------------------------------------------------*/ + +#define FF_CODE_PAGE 866 +/* This option specifies the OEM code page to be used on the target system. +/ Incorrect code page setting can cause a file open failure. +/ +/ 437 - U.S. +/ 720 - Arabic +/ 737 - Greek +/ 771 - KBL +/ 775 - Baltic +/ 850 - Latin 1 +/ 852 - Latin 2 +/ 855 - Cyrillic +/ 857 - Turkish +/ 860 - Portuguese +/ 861 - Icelandic +/ 862 - Hebrew +/ 863 - Canadian French +/ 864 - Arabic +/ 865 - Nordic +/ 866 - Russian +/ 869 - Greek 2 +/ 932 - Japanese (DBCS) +/ 936 - Simplified Chinese (DBCS) +/ 949 - Korean (DBCS) +/ 950 - Traditional Chinese (DBCS) +/ 0 - Include all code pages above and configured by f_setcp() +*/ + + +#define FF_USE_LFN 1 +#define FF_MAX_LFN 32 +/* The FF_USE_LFN switches the support for LFN (long file name). +/ +/ 0: Disable LFN. FF_MAX_LFN has no effect. +/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe. +/ 2: Enable LFN with dynamic working buffer on the STACK. +/ 3: Enable LFN with dynamic working buffer on the HEAP. +/ +/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function +/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and +/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. +/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can +/ be in range of 12 to 255. It is recommended to be set it 255 to fully support LFN +/ specification. +/ When use stack for the working buffer, take care on stack overflow. When use heap +/ memory for the working buffer, memory management functions, ff_memalloc() and +/ ff_memfree() exemplified in ffsystem.c, need to be added to the project. */ + + +#define FF_LFN_UNICODE 0 +/* This option switches the character encoding on the API when LFN is enabled. +/ +/ 0: ANSI/OEM in current CP (TCHAR = char) +/ 1: Unicode in UTF-16 (TCHAR = WCHAR) +/ 2: Unicode in UTF-8 (TCHAR = char) +/ 3: Unicode in UTF-32 (TCHAR = DWORD) +/ +/ Also behavior of string I/O functions will be affected by this option. +/ When LFN is not enabled, this option has no effect. */ + + +#define FF_LFN_BUF 32 +#define FF_SFN_BUF 12 +/* This set of options defines size of file name members in the FILINFO structure +/ which is used to read out directory items. These values should be suffcient for +/ the file names to read. The maximum possible length of the read file name depends +/ on character encoding. When LFN is not enabled, these options have no effect. */ + + +#define FF_FS_RPATH 0 +/* This option configures support for relative path. +/ +/ 0: Disable relative path and remove related functions. +/ 1: Enable relative path. f_chdir() and f_chdrive() are available. +/ 2: f_getcwd() function is available in addition to 1. +*/ + + +/*---------------------------------------------------------------------------/ +/ Drive/Volume Configurations +/---------------------------------------------------------------------------*/ + +#define FF_VOLUMES 1 +/* Number of volumes (logical drives) to be used. (1-10) */ + + +#define FF_STR_VOLUME_ID 0 +#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3" +/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings. +/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive +/ number in the path name. FF_VOLUME_STRS defines the volume ID strings for each +/ logical drives. Number of items must not be less than FF_VOLUMES. Valid +/ characters for the volume ID strings are A-Z, a-z and 0-9, however, they are +/ compared in case-insensitive. If FF_STR_VOLUME_ID >= 1 and FF_VOLUME_STRS is +/ not defined, a user defined volume string table needs to be defined as: +/ +/ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb",... +*/ + + +#define FF_MULTI_PARTITION 0 +/* This option switches support for multiple volumes on the physical drive. +/ By default (0), each logical drive number is bound to the same physical drive +/ number and only an FAT volume found on the physical drive will be mounted. +/ When this function is enabled (1), each logical drive number can be bound to +/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk() +/ funciton will be available. */ + + +#define FF_MIN_SS 512 +#define FF_MAX_SS 512 +/* This set of options configures the range of sector size to be supported. (512, +/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and +/ harddisk, but a larger value may be required for on-board flash memory and some +/ type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured +/ for variable sector size mode and disk_ioctl() function needs to implement +/ GET_SECTOR_SIZE command. */ + + +#define FF_LBA64 0 +/* This option switches support for 64-bit LBA. (0:Disable or 1:Enable) +/ To enable the 64-bit LBA, also exFAT needs to be enabled. (FF_FS_EXFAT == 1) */ + + +#define FF_MIN_GPT 0x10000000 +/* Minimum number of sectors to switch GPT as partitioning format in f_mkfs and +/ f_fdisk function. 0x100000000 max. This option has no effect when FF_LBA64 == 0. */ + + +#define FF_USE_TRIM 0 +/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable) +/ To enable Trim function, also CTRL_TRIM command should be implemented to the +/ disk_ioctl() function. */ + + + +/*---------------------------------------------------------------------------/ +/ System Configurations +/---------------------------------------------------------------------------*/ + +#define FF_FS_TINY 0 +/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny) +/ At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes. +/ Instead of private sector buffer eliminated from the file object, common sector +/ buffer in the filesystem object (FATFS) is used for the file data transfer. */ + + +#define FF_FS_EXFAT 1 +/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) +/ To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1) +/ Note that enabling exFAT discards ANSI C (C89) compatibility. */ + + +#define FF_FS_NORTC 0 +#define FF_NORTC_MON 1 +#define FF_NORTC_MDAY 1 +#define FF_NORTC_YEAR 2020 +/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have +/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable +/ the timestamp function. Every object modified by FatFs will have a fixed timestamp +/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. +/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be +/ added to the project to read current time form real-time clock. FF_NORTC_MON, +/ FF_NORTC_MDAY and FF_NORTC_YEAR have no effect. +/ These options have no effect in read-only configuration (FF_FS_READONLY = 1). */ + + +#define FF_FS_NOFSINFO 0 +/* If you need to know correct free space on the FAT32 volume, set bit 0 of this +/ option, and f_getfree() function at first time after volume mount will force +/ a full FAT scan. Bit 1 controls the use of last allocated cluster number. +/ +/ bit0=0: Use free cluster count in the FSINFO if available. +/ bit0=1: Do not trust free cluster count in the FSINFO. +/ bit1=0: Use last allocated cluster number in the FSINFO if available. +/ bit1=1: Do not trust last allocated cluster number in the FSINFO. +*/ + + +#define FF_FS_LOCK 0 +/* The option FF_FS_LOCK switches file lock function to control duplicated file open +/ and illegal operation to open objects. This option must be 0 when FF_FS_READONLY +/ is 1. +/ +/ 0: Disable file lock function. To avoid volume corruption, application program +/ should avoid illegal open, remove and rename to the open objects. +/ >0: Enable file lock function. The value defines how many files/sub-directories +/ can be opened simultaneously under file lock control. Note that the file +/ lock control is independent of re-entrancy. */ + + +/* #include // O/S definitions */ +#define FF_FS_REENTRANT 0 +#define FF_FS_TIMEOUT 1000 +#define FF_SYNC_t HANDLE +/* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs +/ module itself. Note that regardless of this option, file access to different +/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs() +/ and f_fdisk() function, are always not re-entrant. Only file/directory access +/ to the same volume is under control of this function. +/ +/ 0: Disable re-entrancy. FF_FS_TIMEOUT and FF_SYNC_t have no effect. +/ 1: Enable re-entrancy. Also user provided synchronization handlers, +/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj() +/ function, must be added to the project. Samples are available in +/ option/syscall.c. +/ +/ The FF_FS_TIMEOUT defines timeout period in unit of time tick. +/ The FF_SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*, +/ SemaphoreHandle_t and etc. A header file for O/S definitions needs to be +/ included somewhere in the scope of ff.h. */ + + +#define _WORD_ACCESS 1 /* 0 or 1 */ +/* The _WORD_ACCESS option is an only platform dependent option. It defines +/ which access method is used to the word data on the FAT volume. +/ +/ 0: Byte-by-byte access. Always compatible with all platforms. +/ 1: Word access. Do not choose this unless under both the following conditions. +/ +/ * Address misaligned memory access is always allowed for ALL instructions. +/ * Byte order on the memory is little-endian. +/ +/ If it is the case, _WORD_ACCESS can also be set to 1 to improve performance and +/ reduce code size. Following table shows an example of some processor types. +/ +/ ARM7TDMI 0 ColdFire 0 V850E2 0 +/ Cortex-M3 0 Z80 0/1 V850ES 0/1 +/ Cortex-M0 0 RX600(LE) 0/1 TLCS-870 0/1 +/ AVR 0/1 RX600(BE) 0 TLCS-900 0/1 +/ AVR32 0 RL78 0 R32C 0 +/ PIC18 0/1 SH-2 0 M16C 0/1 +/ PIC24 0 H8S 0 MSP430 0 +/ PIC32 0 H8/300H 0 x86 0/1 +*/ + +#define FF_USE_STRINGLIB 0 /* 0 or 1 */ +/* + * if 1 Use standard string.h for memcpy, memcmp, memset, strchr + * if 0 use own + */ + +/*--- End of configuration options ---*/ diff --git a/Font6x11.c b/Font6x11.c new file mode 100644 index 0000000..aba6718 --- /dev/null +++ b/Font6x11.c @@ -0,0 +1,3482 @@ +/* + * 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 6 pixels + * Check 0 byte of char bitmap data for get width + */ + +#if 1 +// Font definitions for header +#define FONT_START_CHAR 0x17 +#define FONT_MAX_WIDTH 8 +#define FONT_WIDTH 6 +#define FONT_GET_HEIGHT 11 +#define FONT_STR_HEIGHT 11 +#define FONT_GET_DATA(ch) ( &x6x11_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]) +#define FONT_GET_WIDTH(ch) (8-(x6x11_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 + +#if FONT_START_CHAR!=0x17 +#error "Need set correct offset in x6x11_bits font" +#endif + +/* Font character bitmap data. */ +const uint8_t x6x11_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, +#endif +// FONT_START_CHAR = 23 + /* Character 23 (0x17): + width 8 + +-------+ + | | + | * | + | * | + | * * | + | * * | + | * * | + | * * | + |* *| + |* *| + |*******| + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_8px, + 0b00010000, + 0b00010000, + 0b00101000, + 0b00101000, + 0b01000100, + 0b01000100, + 0b10000010, + 0b10000010, + 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, + 0b10001001, + 0b11011011, + 0b01110110, + 0b00000000, + 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, + 0b01111100, + 0b00101000, + 0b00101000, + 0b00101000, + 0b10101000, + 0b11001000, + 0b00000000, + + /* Character 29 (0x1d): + width 8 + +-------+ + | | + | | + | | + | | + |* * | + |* * | + |* * | + |* ** | + |** * * | + |* * * | + |* | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_7px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10000100, + 0b10000100, + 0b10000100, + 0b10001100, + 0b11010100, + 0b10100100, + 0b10000000, + + /* Character 30 (0x1e): + width 7 + +-------+ + | | + | **** | + |* * | + |* * | + |* * | + |* * | + |* * | + | * * | + | * * | + |** ** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_7px, + 0b01111000, + 0b10000100, + 0b10000100, + 0b10000100, + 0b10000100, + 0b10000100, + 0b01001000, + 0b01001000, + 0b11001100, + 0b00000000, + + /* Character 31 (0x1f): + width 6 + +-------+ + | | + | ** | + |* * | + |* * | + | ** | + | | + | | + | | + | | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_5px, + 0b01100000, + 0b10010000, + 0b10010000, + 0b01100000, + 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, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + 0b01000000, + 0b00000000, + + /* Character 34 (0x22): + width 6 + +-------+ + | | + |* * | + |* * | + |* * | + | | + | | + | | + | | + | | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_5px, + 0b10010000, + 0b10010000, + 0b10010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + + /* Character 35 (0x23): + width 6 + +-------+ + | | + | | + | * * | + | * * | + |***** | + | * * | + | * * | + |***** | + | * * | + | * * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b01010000, + 0b01010000, + 0b11111000, + 0b01010000, + 0b01010000, + 0b11111000, + 0b01010000, + 0b01010000, + 0b00000000, + + /* Character 36 (0x24): + width 8 + +-------+ + | | + | * | + | **** | + |* * | + |* * | + | *** | + | * * | + | * * | + |**** | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_7px, + 0b00100000, + 0b01111000, + 0b10100000, + 0b10100000, + 0b01110000, + 0b00101000, + 0b00101000, + 0b11110000, + 0b00100000, + 0b00000000, + + /* Character 37 (0x25): + width 8 + +-------+ + | ** | + |* * | + |* * * | + | ** * | + | * | + | * | + | * ** | + |* * * | + | * * | + | ** | + | | + +-------+ */ + 0b01100000|CHAR7x11_WIDTH_7px, + 0b10010000, + 0b10010100, + 0b01101000, + 0b00010000, + 0b00100000, + 0b01011000, + 0b10100100, + 0b00100100, + 0b00011000, + 0b00000000, + + /* Character 38 (0x26): + width 8 + +-------+ + | | + | | + | ** | + | * * | + | * * | + | * *| + | * * * | + |* * | + |* * * | + | ** *| + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_8px, + 0b00000000, + 0b00110000, + 0b01001000, + 0b01010000, + 0b00100010, + 0b01010100, + 0b10001000, + 0b10010100, + 0b01100010, + 0b00000000, + + /* Character 39 (0x27): + width 5 + +-------+ + | | + | ** | + | ** | + |** | + | | + | | + | | + | | + | | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b01100000, + 0b01100000, + 0b11000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + + /* Character 40 (0x28): + width 5 + +-------+ + | | + | * | + | * | + | * | + |* | + |* | + |* | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b00100000, + 0b01000000, + 0b01000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b01000000, + 0b01000000, + 0b00100000, + 0b00000000, + + /* Character 41 (0x29): + width 5 + +-------+ + | | + |* | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + |* | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b10000000, + 0b01000000, + 0b01000000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b01000000, + 0b01000000, + 0b10000000, + 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, + 0b00100000, + 0b00100000, + 0b11111000, + 0b00100000, + 0b00100000, + 0b00000000, + 0b00000000, + 0b00000000, + + /* Character 44 (0x2c): + width 4 + +-------+ + | | + | | + | | + | | + | | + | | + | | + | | + | ** | + | * | + | * | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_5px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01100000, + 0b00100000, + 0b01000000, + + /* Character 45 (0x2d): + width 7 + +-------+ + | | + | | + | | + | | + | | + |***** | + | | + | | + | | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_7px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11111000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + + /* Character 46 (0x2e): + width 4 + +-------+ + | | + | | + | | + | | + | | + | | + | | + | | + | ** | + | ** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_5px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01100000, + 0b01100000, + 0b00000000, + + /* Character 47 (0x2f): + width 7 + +-------+ + | | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + |* | + |* | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00001000, + 0b00001000, + 0b00010000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b01000000, + 0b10000000, + 0b10000000, + 0b00000000, + + /* Character 48 (0x30): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + |* ** | + |* * * | + |** * | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10011000, + 0b10101000, + 0b11001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 49 (0x31): + width 7 + +-------+ + | | + | * | + | ** | + | * * | + | * | + | * | + | * | + | * | + | * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00010000, + 0b00110000, + 0b01010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00010000, + 0b00111000, + 0b00000000, + + /* Character 50 (0x32): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + | * | + | * | + | * | + | * | + |* | + |***** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b11111000, + 0b00000000, + + /* Character 51 (0x33): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + | * | + | ** | + | * | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b00001000, + 0b00110000, + 0b00001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 52 (0x34): + width 7 + +-------+ + | | + | * | + | ** | + | * * | + |* * | + |* * | + |* * | + |***** | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00010000, + 0b00110000, + 0b01010000, + 0b10010000, + 0b10010000, + 0b10010000, + 0b11111000, + 0b00010000, + 0b00010000, + 0b00000000, + + /* Character 53 (0x35): + width 7 + +-------+ + | | + |***** | + |* | + |* | + |**** | + |* * | + | * | + | * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11111000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b10001000, + 0b00001000, + 0b00001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 54 (0x36): + width 7 + +-------+ + | | + | *** | + |* * | + |* | + |**** | + |* * | + |* * | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10000000, + 0b11110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 55 (0x37): + width 7 + +-------+ + | | + |***** | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11111000, + 0b00001000, + 0b00001000, + 0b00010000, + 0b00010000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + + /* Character 56 (0x38): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + |* * | + | *** | + |* * | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 57 (0x39): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + |* * | + |* * | + | **** | + | * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01111000, + 0b00001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 58 (0x3a): + width 4 + +-------+ + | | + | | + | | + |** | + |** | + | | + | | + |** | + |** | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b00000000, + 0b00000000, + 0b11000000, + 0b11000000, + 0b00000000, + 0b00000000, + 0b11000000, + 0b11000000, + 0b00000000, + 0b00000000, + + /* Character 59 (0x3b): + width 4 + +-------+ + | | + | | + | | + |** | + |** | + | | + |** | + | * | + |* | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b00000000, + 0b00000000, + 0b11000000, + 0b11000000, + 0b00000000, + 0b00000000, + 0b11000000, + 0b01000000, + 0b10000000, + 0b00000000, + + /* Character 60 (0x3c): + width 7 + +-------+ + | | + | * | + | * | + | * | + | * | + |* | + | * | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00000000, + + /* Character 61 (0x3d): + width 7 + +-------+ + | | + | | + | | + | | + |***** | + | | + | | + |***** | + | | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11111000, + 0b00000000, + 0b00000000, + 0b11111000, + 0b00000000, + 0b00000000, + 0b00000000, + + /* Character 62 (0x3e): + width 7 + +-------+ + | | + |* | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + |* | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10000000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b00000000, + + /* Character 63 (0x3f): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + | * | + | * | + | * | + | * | + | | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b00001000, + 0b00010000, + 0b00100000, + 0b00100000, + 0b00000000, + 0b00100000, + 0b00000000, + + /* Character 64 (0x40): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + |* ** | + |* * * | + |* * | + |* | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10011000, + 0b10101000, + 0b10010000, + 0b10000000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 65 (0x41): + width 7 + +-------+ + | | + | **** | + |* * | + |* * | + |* * | + |***** | + |* * | + |* * | + |* * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01111000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b11111000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b00000000, + + /* Character 66 (0x42): + width 7 + +-------+ + | | + |**** | + |* * | + |* * | + |* * | + |**** | + |* * | + |* * | + |* * | + |**** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b11110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b11110000, + 0b00000000, + + /* Character 67 (0x43): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + |* | + |* | + |* | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 68 (0x44): + width 7 + +-------+ + | | + |**** | + |* * | + |* * | + |* * | + |* * | + |* * | + |* * | + |* * | + |**** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b11110000, + 0b00000000, + + /* Character 69 (0x45): + width 7 + +-------+ + | | + |***** | + |* | + |* | + |* | + |**** | + |* | + |* | + |* | + |***** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11111000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b11111000, + 0b00000000, + + /* Character 70 (0x46): + width 7 + +-------+ + | | + |***** | + |* | + |* | + |* | + |**** | + |* | + |* | + |* | + |* | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11111000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b11110000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b00000000, + + /* Character 71 (0x47): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + |* | + |* | + |* ** | + |* * | + |* ** | + | ** * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10000000, + 0b10000000, + 0b10011000, + 0b10001000, + 0b10011000, + 0b01101000, + 0b00000000, + + /* Character 72 (0x48): + width 7 + +-------+ + | | + |* * | + |* * | + |* * | + |* * | + |***** | + |* * | + |* * | + |* * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b11111000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b00000000, + + /* Character 73 (0x49): + width 5 + +-------+ + | | + |*** | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + |*** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b11100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + + /* Character 74 (0x4a): + width 7 + +-------+ + | | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 75 (0x4b): + width 7 + +-------+ + | | + |* * | + |* * | + |* * | + |* * | + |*** | + |* * | + |* * | + |* * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10010000, + 0b11100000, + 0b10010000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b00000000, + + /* Character 76 (0x4c): + width 7 + +-------+ + | | + |* | + |* | + |* | + |* | + |* | + |* | + |* | + |* | + |***** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b11111000, + 0b00000000, + + /* Character 77 (0x4d): + width 8 + +-------+ + | | + |* *| + |** **| + |* * * *| + |* * * *| + |* * *| + |* * *| + |* * *| + |* *| + |* *| + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_8px, + 0b10000010, + 0b11000110, + 0b10101010, + 0b10101010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10000010, + 0b10000010, + 0b00000000, + + /* Character 78 (0x4e): + width 7 + +-------+ + | | + |* * | + |** * | + |** * | + |* * * | + |* * * | + |* * * | + |* ** | + |* ** | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10001000, + 0b11001000, + 0b11001000, + 0b10101000, + 0b10101000, + 0b10011000, + 0b10011000, + 0b10001000, + 0b10001000, + 0b00000000, + + /* Character 79 (0x4f): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + |* * | + |* * | + |* * | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 80 (0x50): + width 7 + +-------+ + | | + |**** | + |* * | + |* * | + |* * | + |**** | + |* | + |* | + |* | + |* | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b11110000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b00000000, + + /* Character 81 (0x51): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + |* * | + |* * | + |* * | + |* * * | + |* * | + | ** * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10101000, + 0b10010000, + 0b01101000, + 0b00000000, + + /* Character 82 (0x52): + width 7 + +-------+ + | | + |**** | + |* * | + |* * | + |* * | + |**** | + |* * | + |* * | + |* * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b11110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b00000000, + + /* Character 83 (0x53): + width 7 + +-------+ + | | + | *** | + |* * | + |* * | + | * | + | * | + | * | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01110000, + 0b10001000, + 0b10001000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 84 (0x54): + width 7 + +-------+ + | | + |***** | + |* * * | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11111000, + 0b10101000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + + /* Character 85 (0x55): + width 7 + +-------+ + | | + |* * | + |* * | + |* * | + |* * | + |* * | + |* * | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 86 (0x56): + width 8 + +-------+ + | | + |* * | + |* * | + |* * | + | * * | + | * * | + | * * | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01010000, + 0b01010000, + 0b01010000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + + /* Character 87 (0x57): + width 7 + +-------+ + | | + |* *| + |* *| + |* *| + |* * *| + |* * *| + |* * *| + |* * *| + |* * *| + | ** ** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_8px, + 0b10000010, + 0b10000010, + 0b10000010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b01101100, + 0b00000000, + + /* Character 88 (0x58): + width 7 + +-------+ + | | + |* * | + |* * | + |* * | + | * * | + | * | + | * * | + |* * | + |* * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01010000, + 0b00100000, + 0b01010000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b00000000, + + /* Character 89 (0x59):Y + width 7 + +-------+ + | | + |* * | + |* * | + |* * | + |* * | + | *** | + | * | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00000000, + + /* Character 90 (0x5a): + width 7 + +-------+ + | | + |***** | + | * | + | * | + | * | + | * | + | * | + |* | + |* | + |***** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b11111000, + 0b00001000, + 0b00001000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b10000000, + 0b11111000, + 0b00000000, + + /* Character 91 (0x5b): + width 5 + +-------+ + | | + | *** | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b11100000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b11100000, + 0b00000000, + + /* Character 92 (0x5c): + width 7 + +-------+ + | | + |* | + |* | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10000000, + 0b10000000, + 0b01000000, + 0b01000000, + 0b00100000, + 0b00010000, + 0b00010000, + 0b00001000, + 0b00001000, + 0b00000000, + + /* Character 93 (0x5d): + width 5 + +-------+ + | | + |*** | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + |*** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b11100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b11100000, + 0b00000000, + + /* Character 94 (0x5e): + width 7 + +-------+ + | | + | * | + | * * | + |* * | + | | + | | + | | + | | + | | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00100000, + 0b01010000, + 0b10001000, + 0b00000000, + 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_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01110000, + 0b00001000, + 0b01111000, + 0b10001000, + 0b10001000, + 0b01111000, + 0b00000000, + + /* Character 98 (0x62): + width 7 + +-------+ + | | + |* | + |* | + |* | + |* ** | + |** * | + |* * | + |* * | + |** * | + |* ** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10110000, + 0b11001000, + 0b10001000, + 0b10001000, + 0b11001000, + 0b10110000, + 0b00000000, + + /* Character 99 (0x63): + width 7 + +-------+ + | | + | | + | | + | | + | *** | + |* * | + |* | + |* | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01110000, + 0b10001000, + 0b10000000, + 0b10000000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 100 (0x64): + width 7 + +-------+ + | | + | * | + | * | + | * | + | ** * | + |* ** | + |* * | + |* * | + |* ** | + | ** * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00001000, + 0b00001000, + 0b00001000, + 0b01101000, + 0b10011000, + 0b10001000, + 0b10001000, + 0b10011000, + 0b01101000, + 0b00000000, + + /* Character 101 (0x65): + width 7 + +-------+ + | | + | | + | | + | | + | *** | + |* * | + |***** | + |* | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01110000, + 0b10001000, + 0b11111000, + 0b10000000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 102 (0x66): + width 7 + +-------+ + | | + | ** | + | * * | + | * | + | * | + |*** | + | * | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00110000, + 0b01001000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + + /* Character 103 (0x67):g + width 7 + +-------+ + | | + | | + | | + | | + | ** * | + |* ** | + |* * | + |* * | + | **** | + | * | + | *** | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01101000, + 0b10011000, + 0b10001000, + 0b10001000, + 0b01111000, + 0b00001000, + 0b01110000, + + /* Character 104 (0x68): + width 7 + +-------+ + | | + |* | + |* | + |* | + |* ** | + |** * | + |* * | + |* * | + |* * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10110000, + 0b11001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b00000000, + + /* Character 105 (0x69): + width 7 + +-------+ + | | + | | + | * | + | | + |** | + | * | + | * | + | * | + | * | + |*** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b00000000, + 0b01000000, + 0b00000000, + 0b11000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b00000000, + + /* Character 106 (0x6a): + width 7 + +-------+ + | | + | | + | * | + | | + | * | + | * | + | * | + | * | + | * | + |* * | + | *** | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00001000, + 0b00000000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b00001000, + 0b10001000, + 0b01110000, + + /* Character 107 (0x6b): + width 7 + +-------+ + | | + |* | + |* | + |* | + |* * | + |* * | + |* * | + |*** | + |* * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10001000, + 0b10010000, + 0b10100000, + 0b11100000, + 0b10010000, + 0b10001000, + 0b00000000, + + /* Character 108 (0x6c): + width 7 + +-------+ + | | + | ** | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + |***** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b11111000, + 0b00000000, + + /* Character 109 (0x6d): + width 7 + +-------+ + | | + | | + | | + | | + |*** ** | + |* * *| + |* * *| + |* * *| + |* * *| + |* * *| + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_8px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11101100, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b00000000, + + /* Character 110 (0x6e): + width 7 + +-------+ + | | + | | + | | + | | + |* ** | + |** * | + |* * | + |* * | + |* * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10110000, + 0b11001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b00000000, + + /* Character 111 (0x6f): + width 7 + +-------+ + | | + | | + | | + | | + | *** | + |* * | + |* * | + |* * | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01110000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 112 (0x70): + width 7 + +-------+ + | | + | | + | | + | | + |* ** | + |** * | + |* * | + |* * | + |**** | + |* | + |* | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10110000, + 0b11001000, + 0b10001000, + 0b10001000, + 0b11110000, + 0b10000000, + 0b10000000, + + /* Character 113 (0x71): + width 7 + +-------+ + | | + | | + | | + | | + | ** * | + |* ** | + |* * | + |* * | + | **** | + | * | + | * | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01101000, + 0b10011000, + 0b10001000, + 0b10001000, + 0b01111000, + 0b00001000, + 0b00001000, + + /* Character 114 (0x72): + width 7 + +-------+ + | | + | | + | | + | | + |* ** | + |** * | + |* | + |* | + |* | + |* | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10110000, + 0b11001000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b10000000, + 0b00000000, + + /* Character 115 (0x73): + width 7 + +-------+ + | | + | | + | | + | | + | *** | + |* * | + | ** | + | ** | + |* * | + | *** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b01110000, + 0b10001000, + 0b01100000, + 0b00110000, + 0b10001000, + 0b01110000, + 0b00000000, + + /* Character 116 (0x74): + width 7 + +-------+ + | | + | | + | * | + | * | + |*** | + | * | + | * | + | * | + | * | + | ** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_5px, + 0b00000000, + 0b01000000, + 0b01000000, + 0b11100000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00110000, + 0b00000000, + + /* Character 117 (0x75): + width 7 + +-------+ + | | + | | + | | + | | + |* * | + |* * | + |* * | + |* * | + |* ** | + | ** * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b10011000, + 0b01101000, + 0b00000000, + + /* Character 118 (0x76): + width 7 + +-------+ + | | + | | + | | + | | + |* * | + |* * | + | * * | + | * * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10001000, + 0b10001000, + 0b01010000, + 0b01010000, + 0b00100000, + 0b00100000, + 0b00000000, + + /* Character 119 (0x77): + width 7 + +-------+ + | | + | | + | | + | | + |* *| + |* *| + |* * *| + |* * *| + |* * *| + | ** ** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_8px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10000010, + 0b10000010, + 0b10010010, + 0b10010010, + 0b10010010, + 0b01101100, + 0b00000000, + + /* Character 120 (0x78): + width 7 + +-------+ + | | + | | + | | + | | + |* * | + | * * | + | * | + | * | + | * * | + |* * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10001000, + 0b01010000, + 0b00100000, + 0b00100000, + 0b01010000, + 0b10001000, + 0b00000000, + + /* Character 121 (0x79): + width 7 + +-------+ + | | + | | + | | + | | + |* * | + |* * | + |* * | + | **** | + | * | + |* * | + | *** | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b10001000, + 0b10001000, + 0b10001000, + 0b01111000, + 0b00001000, + 0b10001000, + 0b01110000, + + /* Character 122 (0x7a): + width 7 + +-------+ + | | + | | + | | + | | + |**** | + | * | + | * | + | * | + |* | + |**** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_5px, + 0b00000000, + 0b00000000, + 0b00000000, + 0b11110000, + 0b00010000, + 0b00100000, + 0b01000000, + 0b10000000, + 0b11110000, + 0b00000000, + + /* Character 123 (0x7b): + width 6 + +-------+ + | | + | ** | + | * | + | * | + | * | + |* | + | * | + | * | + | * | + | ** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_5px, + 0b00110000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b10000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00110000, + 0b00000000, + + /* Character 124 (0x7c): + width 5 + +-------+ + | | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_4px, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b01000000, + 0b00000000, + + /* Character 125 (0x7d): + width 6 + +-------+ + | | + |** | + | * | + | * | + | * | + | * | + | * | + | * | + | * | + |** | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_5px, + 0b11000000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b00010000, + 0b00100000, + 0b00100000, + 0b00100000, + 0b11000000, + 0b00000000, + + /* Character 126 (0x7e): + width 7 + +-------+ + | | + | * * | + |* * * | + |* * | + | | + | | + | | + | | + | | + | | + | | + +-------+ */ + 0b00000000|CHAR7x11_WIDTH_6px, + 0b01001000, + 0b10101000, + 0b10010000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, + 0b00000000, +}; diff --git a/Font7x13b.c b/Font7x11b.c similarity index 100% rename from Font7x13b.c rename to Font7x11b.c diff --git a/Makefile b/Makefile index 69bfbf8..e5bb7be 100644 --- a/Makefile +++ b/Makefile @@ -7,15 +7,16 @@ ifeq ($(TARGET),) TARGET = F072 endif -#TARGET=F303 +TARGET=F303 # Compiler options here. ifeq ($(USE_OPT),) ifeq ($(TARGET),F303) -USE_OPT = -O2 -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11 -DLCD_DRIVER_ST7796S -DLCD_480x320 -D__VNA_ENABLE_DAC__ -D__LCD_BRIGHTNESS__ -DPOINTS_COUNT=401 +USE_OPT = -O2 -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11 -DLCD_DRIVER_ST7796S -DLCD_480x320 -D__VNA_ENABLE_DAC__ -D__LCD_BRIGHTNESS__ -DPOINTS_COUNT=401 -D_USE_FONT_=1 -D_USE_BIG_MARKER_=1 #USE_OPT+=-fstack-protector-strong else -USE_OPT = -O2 -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11 -DLCD_DRIVER_ILI9341 -DLCD_320x240 -D__DFU_SOFTWARE_MODE__ -DPOINTS_COUNT=101 +USE_OPT = -O2 -fno-inline-small-functions -ggdb -fomit-frame-pointer -falign-functions=16 --specs=nano.specs -fstack-usage -std=c11 -DLCD_DRIVER_ILI9341 -DLCD_320x240 -D__DFU_SOFTWARE_MODE__ -DPOINTS_COUNT=101 -D_USE_FONT_=1 -D_USE_BIG_MARKER_=1 + endif endif @@ -147,7 +148,7 @@ CSRC = $(STARTUPSRC) \ FatFs/ff.c \ FatFs/ffunicode.c \ usbcfg.c \ - main.c si5351.c tlv320aic3204.c dsp.c plot.c ui.c ili9341.c numfont20x22.c Font5x7.c Font7x13b.c Font10x14.c flash.c adc.c rtc.c vna_math.c + main.c si5351.c tlv320aic3204.c dsp.c plot.c ui.c ili9341.c numfont20x22.c Font5x7.c Font7x11b.c Font10x14.c Font6x11.c flash.c adc.c rtc.c vna_math.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global # setting. diff --git a/doc/Schematic_NanoVNA-H4_REV4_3.pdf b/doc/Schematic_NanoVNA-H4_REV4_3.pdf new file mode 100644 index 0000000..21b7927 Binary files /dev/null and b/doc/Schematic_NanoVNA-H4_REV4_3.pdf differ diff --git a/lc_matching.c b/lc_matching.c index 3be7f7e..b9fd398 100644 --- a/lc_matching.c +++ b/lc_matching.c @@ -27,6 +27,105 @@ static void match_quadratic_equation(float a, float b, float c, float *x) x[1] = (-b - sd) / a_x_2; } +// Search functions +// Type of get value function +typedef float (*get_value_t)(uint16_t idx); + +// Search point get_value(x) = y +// Used bilinear interpolation, return value = frequency of this point +#define MEASURE_SEARCH_LEFT -1 +#define MEASURE_SEARCH_RIGHT 1 +static float measure_search_value(uint16_t *idx, float y, get_value_t get, int16_t mode){ + uint16_t x = *idx; + float y1, y2, y3; + y1 = y2 = y3 = get(x); + bool result = (y3 > y); // current position depend from start point + for(; x < sweep_points; x+=mode) { + y3 = get(x); + if(result != (y3 > y)) break; + y1 = y2; + y2 = y3; + } + if (x >= sweep_points) return 0; + x-=mode; + *idx = x; + // Now y1 > y, y2 > y, y3 <= y or y1 < y, y2 < y, y3 >= y + const float a = 0.5f * (y1 + y3) - y2; + const float b = 0.5f * (y3 - y1); + const float c = y2 - y; + float r[2]; + match_quadratic_equation(a, b, c, r); + // Select result in middle 0 and 1 (in middle y2 and y3 result) + float res = (r[0] > 0 && r[0] < 1.0) ? r[0] : r[1]; + // for search left need swap y1 and y3 points (use negative result) + if (mode < 0) res=-res; + return getFrequency(x) + getFrequencyStep() * res; +} + +// Peak search, use bilinear interpolation for peak detect +#define MEASURE_SEARCH_MIN 0 +#define MEASURE_SEARCH_MAX 1 +static bool _greaterf(float x, float y) { return x > y; } +static bool _lesserf(float x, float y) { return x < y; } +static float search_peak_value(uint16_t *xp, get_value_t get, bool mode){ + bool (*compare)(float x, float y) = mode ? _greaterf : _lesserf; + uint16_t x = 0; + float y2 = get(x), ytemp; + for(int i = 1; i < sweep_points; i++) { + if(compare(ytemp = get(i), y2)) { + y2 = ytemp; + x = i; + } + } + if (x < 1 || x >= sweep_points - 1) return y2; + *xp = x; + float y1 = get(x-1); + float y3 = get(x+1); + if (y1 == y3) return y2; +// const float a = 0.5f * (y1 + y3) - y2; +// const float b = 0.5f * (y3 - y1); +// const float c = y2; +// return c - b*b/(4*a); + const float a = 8*(y1 - 2*y2 + y3); + const float b = y3 - y1; + const float c = y2; + return c - b * b / a; +} + +static float bilinear_interpolation(float y1, float y2, float y3, float k1){ + const float a = 0.5f * (y1 + y3) - y2; + const float b = 0.5f * (y3 - y1); + const float c = y2; + return a * k1*k1 + b * k1 + c; +} + +static bool measure_get_value(uint16_t ch, freq_t f, float *data){ + if (f < frequency0 || f > frequency1) + return false; + // Search k1 + uint16_t _points = sweep_points - 1; + freq_t span = frequency1 - frequency0; + uint32_t idx = (uint64_t)(f - frequency0) * (uint64_t)_points / span; + if (idx < 1 && idx > _points) + return false; + uint64_t v = (uint64_t)span * idx + _points/2; + freq_t src_f0 = frequency0 + (v ) / _points; + freq_t src_f1 = frequency0 + (v + span) / _points; + freq_t delta = src_f1 - src_f0; + float k1 = (delta == 0) ? 0.0 : (float)(f - src_f0) / delta; +#if 1 + // Bilinear interpolation by k1 + data[0] = bilinear_interpolation(measured[ch][idx-1][0], measured[ch][idx ][0], measured[ch][idx+1][0],k1); + data[1] = bilinear_interpolation(measured[ch][idx-1][1], measured[ch][idx ][1], measured[ch][idx+1][1],k1); +#else + // Linear Interpolate by k1 + float k0 = 1.0 - k1; + data[0] = measured[ch][idx][0] * k0 + measured[ch][idx+1][0] * k1; + data[1] = measured[ch][idx][1] * k0 + measured[ch][idx+1][1] * k1; +#endif + return true; +} + #ifdef __USE_LC_MATCHING__ // calculate physical component values to match an impendace to 'ref_impedance' (ie 50R) typedef struct @@ -226,5 +325,223 @@ static void draw_lc_match(int x0, int y0) } } #endif // __USE_LC_MATCHING__ +#ifdef __S21_MEASURE__ +typedef struct { + char *header; + freq_t freq; // resonant frequency + freq_t freq1; // fp + float l; + float c; + float c1; // capacitor parallel + float r; + float q; // Q factor + +// freq_t f1; +// freq_t f2; +// float tan45; +} s21_analysis_t; +static s21_analysis_t *s21_measure = (s21_analysis_t *)measure_memory; + +static float s21pow2(uint16_t i) { + const float re = measured[1][i][0]; // S21 real + const float im = measured[1][i][1]; // S21 imaginary + return re*re+im*im; // S21^2 +} + +static float s21tan(uint16_t i) { + const float re = measured[1][i][0]; // S21 real + const float im = measured[1][i][1]; // S21 imaginary + return im/re; // tan(S21) +} + +// Phase Shift Measurement +// https://www.mikrocontroller.net/attachment/473317/Crystal_Motional_Parameters.pdf +static void analysis_lcshunt(void) { + uint16_t xp = 0, x2; + s21_measure->header = "LC-SHUNT"; + // Minimum search + float ypeak = search_peak_value(&xp, s21pow2, MEASURE_SEARCH_MIN); + // peak frequency, R + float att = vna_sqrtf(ypeak); + s21_measure->r = config._measure_r * att / (2 * (1 - att)); + if(s21_measure->r < 0) return; + set_marker_index(0, xp); + + float tan45 = config._measure_r/(config._measure_r + 4 * s21_measure->r); +// s21_measure->tan45 = tan45; + // -45 degree search at left + x2 = xp; + float f1 = measure_search_value(&x2, -tan45, s21tan, MEASURE_SEARCH_LEFT); + if (f1 == 0) return; + set_marker_index(1, x2); + + // +45 degree search at right + x2 = xp; + float f2 = measure_search_value(&x2, tan45, s21tan, MEASURE_SEARCH_RIGHT); + if (f2 == 0) return; + set_marker_index(2, x2); + + // L,C,Q calculations + float bw = f2 - f1; + float fpeak = vna_sqrtf(f2 * f1); + s21_measure->freq = fpeak; + s21_measure->q = fpeak / bw; + s21_measure->l = s21_measure->q * s21_measure->r / ((2 * VNA_PI) * fpeak); + s21_measure->c = 1 / ((2 * VNA_PI) * fpeak * s21_measure->q * s21_measure->r); +} + +static void analysis_lcseries(void) { + uint16_t xp=0, x2; + s21_measure->header = "LC-SERIES"; + // Peak value and it frequency index search + float ypeak = search_peak_value(&xp, s21pow2, MEASURE_SEARCH_MAX); + if (xp == 0) return; // peak not found + // motional resistance, Rm + s21_measure->r = 2 * config._measure_r * (1.0f / vna_sqrtf(ypeak) - 1.0f); + if(s21_measure->r < 0) return; + set_marker_index(0, xp); + + const float tan45 = 1.0f; // tand(45) = 1.0f + // Lookup +45 phase at left of xp index + x2 = xp; + float f1 = measure_search_value(&x2, tan45, s21tan, MEASURE_SEARCH_LEFT); + if (f1 == 0) return; // not found + set_marker_index(1, x2); + + // Lookup -45 phase at right of xp index + x2 = xp; + float f2 = measure_search_value(&x2, -tan45, s21tan, MEASURE_SEARCH_RIGHT); + if (f2 == 0) return; // not found + set_marker_index(2, x2); + + // L,C,Q calculation + float bw = f2 - f1; + float fpeak = vna_sqrtf(f2*f1); + // The total resistance, REFF, seen by the crystal is the sum of the load resistance (input and output) and the motional resistance, Rm: + float reff = 2 * config._measure_r + s21_measure->r; + + s21_measure->freq = fpeak; + s21_measure->l = reff / ((2 * VNA_PI) * bw); + s21_measure->c = bw / ((2 * VNA_PI) * fpeak * fpeak * reff); + // q = 2*pi * Fp * Ls / R + s21_measure->q = (2 * VNA_PI) * fpeak * s21_measure->l / s21_measure->r; + +// s21_measure->f1 = f1; +// s21_measure->f2 = f2; +} + +static void analysis_xtalseries(void) { + analysis_lcseries(); + s21_measure->header = "XTAL-SERIES"; + // search S21 min + uint16_t xp=0; + search_peak_value(&xp, s21pow2, MEASURE_SEARCH_MIN); + if (xp == 0) return; + set_marker_index(3, xp); + + freq_t freq1 = getFrequency(xp); + if(freq1 < s21_measure->freq) return; + s21_measure->freq1 = freq1; + // df = f * c / (2*c1) => c1 = f * c / (2*df) + s21_measure->c1 = s21_measure->c * s21_measure->freq / (2*(s21_measure->freq1 - s21_measure->freq)); +} + +static void draw_serial_result(int x0, int y0){ + int xp = STR_MEASURE_X - x0; + int yp = STR_MEASURE_Y - y0; + cell_printf(xp, yp, s21_measure->header); + if (s21_measure->freq == 0 && s21_measure->freq1 == 0) { + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Not found"); + return; + } + if (s21_measure->freq) + { + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Fs=%qHz", s21_measure->freq); + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Ls=%FH Cs=%FF Rs=%F" S_OHM, s21_measure->l, s21_measure->c, s21_measure->r); + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Q=%.3f", s21_measure->q); +// cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "tan45=%.4f", s21_measure->tan45); +// cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "F1=%qHz F2=%qHz", s21_measure->f1, s21_measure->f2); + } + if (s21_measure->freq1){ + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Fp=%qHz", s21_measure->freq1); + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Cp=%FF", s21_measure->c1); + } +} + +static void prepare_series(uint8_t type, uint8_t update_mask) +{ + (void)update_mask; + uint16_t n; + // for detect completion + s21_measure->freq = 0; + s21_measure->freq1 = 0; + switch (type){ + case MEASURE_SHUNT_LC: n = 4; analysis_lcshunt(); break; + case MEASURE_SERIES_LC: n = 4; analysis_lcseries(); break; + case MEASURE_SERIES_XTAL: n = 6; analysis_xtalseries(); break; + default: return; + } + // Prepare for update + invalidate_rect(STR_MEASURE_X , STR_MEASURE_Y, + STR_MEASURE_X + 3 * STR_MEASURE_WIDTH, STR_MEASURE_Y + n * STR_MEASURE_HEIGHT); + markmap_all_markers(); +} +#endif // __S21_MEASURE__ + +#ifdef __S11_CABLE_MEASURE__ +typedef struct { + float R; + float len; + float loss; + float C0; + float a, b, c; +} s11_cable_measure_t; +static s11_cable_measure_t *s11_cable = (s11_cable_measure_t *)measure_memory; + +static float s11imag(uint16_t i) { + return measured[0][i][1]; +} + +static void draw_s11_cable(int x0, int y0){ + int xp = STR_MEASURE_X - x0; + int yp = STR_MEASURE_Y - y0; + cell_printf(xp, yp, "S11 CABLE"); + if (s11_cable->R){ + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Z0 = %F" S_OHM, s11_cable->R); +// cell_printf(xp, yp+=FONT_STR_HEIGHT, "C0 = %FF", s11_cable->C0); + } + if (s11_cable->len) + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Length = %Fm (K=%d%%)", s11_cable->len, velocity_factor); + cell_printf(xp, yp+=STR_MEASURE_HEIGHT, "Loss = %FdB", s11_cable->loss); +} + +static void prepare_s11_cable(uint8_t type, uint8_t update_mask) +{ + (void)type; + freq_t f1; + if (update_mask & MEASURE_UPD_SWEEP) { + s11_cable->R = 0.0f; + s11_cable->len = 0.0f; + uint16_t x = 0; + f1 = measure_search_value(&x, 0, s11imag, MEASURE_SEARCH_RIGHT); + if (f1){ + s11_cable->len = velocity_factor * (SPEED_OF_LIGHT / 400.0f) / f1; + float data[2]; + if (measure_get_value(0, f1/2, data)){ + s11_cable->R = vna_fabsf(reactance(0, data)); +// s11_cable->C0 = velocity_factor / (100.0f * SPEED_OF_LIGHT * s11_cable->R); + } + } + } + if (update_mask & MEASURE_UPD_ALL && active_marker != MARKER_INVALID) { + int idx = markers[active_marker].index; + s11_cable->loss = vna_fabsf(logmag(idx, measured[0][idx]) / 2); + } + // Prepare for update + invalidate_rect(STR_MEASURE_X , STR_MEASURE_Y, + STR_MEASURE_X + 3 * STR_MEASURE_WIDTH, STR_MEASURE_Y + 4 * STR_MEASURE_HEIGHT); +} + +#endif // __S11_CABLE_MEASURE__ #endif // __VNA_MEASURE__ diff --git a/main.c b/main.c index 04d53ae..06e4e5b 100644 --- a/main.c +++ b/main.c @@ -129,7 +129,7 @@ static float kaiser_data[FFT_SIZE]; #endif #undef VERSION -#define VERSION "1.0.70" +#define VERSION "1.0.71" // Version text, displayed in Config->Version menu, also send by info command const char *info_about[]={ @@ -910,6 +910,7 @@ config_t config = { ._measure_r = MEASURE_DEFAULT_R, ._lever_mode = LM_MARKER, ._digit_separator = '.', + ._band_mode = 0, }; properties_t current_props; diff --git a/nanovna.h b/nanovna.h index 2490e9d..3aa24a2 100644 --- a/nanovna.h +++ b/nanovna.h @@ -80,9 +80,9 @@ // Add LC match function #define __USE_LC_MATCHING__ // Enable Series measure option -//#define __S21_MEASURE__ +#define __S21_MEASURE__ // Enable S11 cable measure option -//#define __S11_CABLE_MEASURE__ +#define __S11_CABLE_MEASURE__ #endif /* @@ -93,7 +93,7 @@ // Maximum frequency set #define STOP_MAX 2000000000U // Frequency threshold (max frequency for si5351, harmonic mode after) -#define FREQUENCY_THRESHOLD 280000100U +#define FREQUENCY_THRESHOLD 290000100U // XTAL frequency on si5351 #define XTALFREQ 26000000U // Define i2c bus speed, add predefined for 400k, 600k, 900k @@ -103,21 +103,30 @@ // Define ADC sample rate in kilobyte (can be 48k, 96k, 192k, 384k) //#define AUDIO_ADC_FREQ_K 768 -//#define AUDIO_ADC_FREQ_K 384 +#ifdef ARM_MATH_CM4 +#define AUDIO_ADC_FREQ_K 384 +#else #define AUDIO_ADC_FREQ_K 192 +#endif //#define AUDIO_ADC_FREQ_K 96 //#define AUDIO_ADC_FREQ_K 48 // Define sample count for one step measure +#ifndef ARM_MATH_CM4 #define AUDIO_SAMPLES_COUNT (48) -//#define AUDIO_SAMPLES_COUNT (96) +#else +#define AUDIO_SAMPLES_COUNT (96) +#endif //#define AUDIO_SAMPLES_COUNT (192) // Frequency offset, depend from AUDIO_ADC_FREQ settings (need aligned table) // Use real time build table (undef for use constant, see comments) // Constant tables build only for AUDIO_SAMPLES_COUNT = 48 -//#define USE_VARIABLE_OFFSET -//#define USE_VARIABLE_OFFSET_MENU +#define USE_VARIABLE_OFFSET +// Add IF select menu in expert settings +#ifdef USE_VARIABLE_OFFSET +#define USE_VARIABLE_OFFSET_MENU +#endif #if AUDIO_ADC_FREQ_K == 768 #define FREQUENCY_OFFSET_STEP 16000 @@ -190,15 +199,15 @@ typedef uint32_t freq_t; #if POINTS_COUNT >=401 #define POINTS_SET_COUNT 5 #define POINTS_SET {51, 101, 201, 301, POINTS_COUNT} -#define POINTS_COUNT_DEFAULT POINTS_COUNT +#define POINTS_COUNT_DEFAULT 101 #elif POINTS_COUNT >=301 #define POINTS_SET_COUNT 4 #define POINTS_SET {51, 101, 201, POINTS_COUNT} -#define POINTS_COUNT_DEFAULT POINTS_COUNT +#define POINTS_COUNT_DEFAULT 101 #elif POINTS_COUNT >=201 #define POINTS_SET_COUNT 3 #define POINTS_SET {51, 101, POINTS_COUNT} -#define POINTS_COUNT_DEFAULT POINTS_COUNT +#define POINTS_COUNT_DEFAULT 101 #elif POINTS_COUNT >=101 #define POINTS_SET_COUNT 2 #define POINTS_SET {51, POINTS_COUNT} @@ -404,9 +413,9 @@ void tlv320aic3204_write_reg(uint8_t page, uint8_t reg, uint8_t data); // Define maximum distance in pixel for pickup marker (can be bigger for big displays) #define MARKER_PICKUP_DISTANCE 20 // Used marker size settings -#define _USE_BIG_MARKER_ 1 +//#define _USE_BIG_MARKER_ 1 // Used font settings -#define _USE_FONT_ 1 +//#define _USE_FONT_ 3 // Offset of plot area (size of additional info at left side) #if _USE_FONT_== 1 @@ -416,14 +425,25 @@ void tlv320aic3204_write_reg(uint8_t page, uint8_t reg, uint8_t data); // HEIGHT = 8*GRIDY #define HEIGHT 224 #define FREQUENCIES_XPOS2 176 +#define FREQUENCIES_XPOS3 155 +#define MENU_BUTTON_WIDTH 84 +#elif _USE_FONT_== 3 +#define OFFSETX 12 +// WIDTH better be n*(POINTS_COUNT-1) +#define WIDTH 298 +// HEIGHT = 8*GRIDY +#define HEIGHT 224 +#define FREQUENCIES_XPOS2 193 +#define FREQUENCIES_XPOS3 144 #define MENU_BUTTON_WIDTH 84 -#elif +#else #define OFFSETX 10 // WIDTH better be n*(POINTS_COUNT-1) #define WIDTH 300 // HEIGHT = 8*GRIDY #define HEIGHT 232 #define FREQUENCIES_XPOS2 206 +#define FREQUENCIES_XPOS3 135 #define MENU_BUTTON_WIDTH 66 #endif #define OFFSETY 0 @@ -435,7 +455,7 @@ void tlv320aic3204_write_reg(uint8_t page, uint8_t reg, uint8_t data); #define FREQUENCIES_XPOS1 OFFSETX -#define FREQUENCIES_XPOS3 135 + #define FREQUENCIES_YPOS (LCD_HEIGHT-FONT_GET_HEIGHT) // GRIDX calculated depends from frequency span @@ -503,9 +523,9 @@ void tlv320aic3204_write_reg(uint8_t page, uint8_t reg, uint8_t data); // Define maximum distance in pixel for pickup marker (can be bigger for big displays) #define MARKER_PICKUP_DISTANCE 30 // Used marker size settings -#define _USE_BIG_MARKER_ 1 +//#define _USE_BIG_MARKER_ 1 // Used font settings -#define _USE_FONT_ 1 +//#define _USE_FONT_ 1 // Offset of plot area (size of additional info at left side) #define OFFSETX 15 @@ -614,6 +634,17 @@ extern const uint8_t x10x14_bits[]; #define FONT_STR_HEIGHT 16 #define FONT_GET_DATA(ch) ( &x10x14_bits[(ch-FONT_START_CHAR)*2*FONT_GET_HEIGHT ]) #define FONT_GET_WIDTH(ch) (14-(x10x14_bits[(ch-FONT_START_CHAR)*2*FONT_GET_HEIGHT+1]&0x7)) + +#elif _USE_FONT_ == 3 +extern const uint8_t x6x11_bits[]; +#define FONT_START_CHAR 0x17 +#define FONT_MAX_WIDTH 8 +#define FONT_WIDTH 6 +#define FONT_GET_HEIGHT 11 +#define FONT_STR_HEIGHT 11 +#define FONT_GET_DATA(ch) ( &x6x11_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]) +#define FONT_GET_WIDTH(ch) (8-(x6x11_bits[(ch-FONT_START_CHAR)*FONT_GET_HEIGHT]&7)) +#define HZ14 #endif extern const uint8_t numfont16x22[]; @@ -789,6 +820,7 @@ typedef struct config { float _measure_r; uint8_t _lever_mode; uint8_t _digit_separator; + uint8_t _band_mode; uint32_t checksum; } config_t; diff --git a/numfont20x22.c b/numfont20x22.c index a91d873..ab1a34b 100644 --- a/numfont20x22.c +++ b/numfont20x22.c @@ -551,4 +551,27 @@ 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 26048f7..56a7dd3 100644 --- a/plot.c +++ b/plot.c @@ -720,10 +720,11 @@ static inline void markmap_upperarea(void) { // Hardcoded, Text info from upper area -#if LCD_WIDTH == 480 || _USE_FONT_== 0 - invalidate_rect(0, 0, AREA_WIDTH_NORMAL, ((MARKERS_MAX+1)/2 + 1)*FONT_STR_HEIGHT); +#if LCD_WIDTH == 320 && _USE_FONT_== 1 + invalidate_rect(0, 0, AREA_WIDTH_NORMAL, (MARKERS_MAX+ 1)*FONT_STR_HEIGHT); #else - invalidate_rect(0, 0, AREA_WIDTH_NORMAL, (MARKERS_MAX+ 1)*FONT_STR_HEIGHT); + invalidate_rect(0, 0, AREA_WIDTH_NORMAL, ((MARKERS_MAX+1)/2 + 1)*FONT_STR_HEIGHT); + #endif } @@ -1584,10 +1585,11 @@ draw_cell(int m, int n) #if 1 int cnt = t_count > m_count ? t_count : m_count; // Get max marker/trace string count add one string for edelay/marker freq -#if LCD_WIDTH == 480 || _USE_FONT_== 0 - if (n <= (((cnt+1)/2 + 1)*FONT_STR_HEIGHT)/CELLHEIGHT) +#if LCD_WIDTH == 320 && _USE_FONT_== 1 + if (n <= ((cnt+ 1)*FONT_STR_HEIGHT)/CELLHEIGHT) #else - if (n <= ((cnt+ 1)*FONT_STR_HEIGHT)/CELLHEIGHT) + if (n <= (((cnt+1)/2 + 1)*FONT_STR_HEIGHT)/CELLHEIGHT) + #endif cell_draw_marker_info(x0, y0); #endif @@ -1711,28 +1713,29 @@ redraw_marker(int8_t marker) } // Marker and trace data position -#if LCD_WIDTH == 480 || _USE_FONT_== 0 +#if LCD_WIDTH == 320 && _USE_FONT_== 1 static const struct {uint16_t x, y;} marker_pos[]={ {1 + CELLOFFSETX, 1 }, - {1 + (WIDTH/2) + CELLOFFSETX, 1 }, {1 + CELLOFFSETX, 1 + FONT_STR_HEIGHT}, - {1 + (WIDTH/2) + CELLOFFSETX, 1 + FONT_STR_HEIGHT}, {1 + CELLOFFSETX, 1 + 2*FONT_STR_HEIGHT}, - {1 + (WIDTH/2) + CELLOFFSETX, 1 + 2*FONT_STR_HEIGHT}, {1 + CELLOFFSETX, 1 + 3*FONT_STR_HEIGHT}, - {1 + (WIDTH/2) + CELLOFFSETX, 1 + 3*FONT_STR_HEIGHT}, + {1 + CELLOFFSETX, 1 + 4*FONT_STR_HEIGHT}, + {1 + CELLOFFSETX, 1 + 5*FONT_STR_HEIGHT}, + {1 + CELLOFFSETX, 1 + 6*FONT_STR_HEIGHT}, + {1 + CELLOFFSETX, 1 + 7*FONT_STR_HEIGHT}, }; #else + static const struct {uint16_t x, y;} marker_pos[]={ {1 + CELLOFFSETX, 1 }, + {1 + (WIDTH/2) + CELLOFFSETX, 1 }, {1 + CELLOFFSETX, 1 + FONT_STR_HEIGHT}, + {1 + (WIDTH/2) + CELLOFFSETX, 1 + FONT_STR_HEIGHT}, {1 + CELLOFFSETX, 1 + 2*FONT_STR_HEIGHT}, + {1 + (WIDTH/2) + CELLOFFSETX, 1 + 2*FONT_STR_HEIGHT}, {1 + CELLOFFSETX, 1 + 3*FONT_STR_HEIGHT}, - {1 + CELLOFFSETX, 1 + 4*FONT_STR_HEIGHT}, - {1 + CELLOFFSETX, 1 + 5*FONT_STR_HEIGHT}, - {1 + CELLOFFSETX, 1 + 6*FONT_STR_HEIGHT}, - {1 + CELLOFFSETX, 1 + 7*FONT_STR_HEIGHT}, + {1 + (WIDTH/2) + CELLOFFSETX, 1 + 3*FONT_STR_HEIGHT}, }; #endif @@ -1807,12 +1810,13 @@ cell_draw_marker_info(int x0, int y0) lcd_set_foreground(LCD_FG_COLOR); // Marker frequency data print -#if LCD_WIDTH == 480 || _USE_FONT_== 0 - xpos = 3 + (WIDTH/2) + CELLOFFSETX - x0; - ypos = 1 + ((j+1)/2)*FONT_STR_HEIGHT - y0; -#else +#if LCD_WIDTH == 320 && _USE_FONT_== 1 xpos = 12+(WIDTH/2) + CELLOFFSETX - x0; ypos = 1 + j*FONT_STR_HEIGHT - y0; +#else + + xpos = 3 + (WIDTH/2) + CELLOFFSETX - x0; + ypos = 1 + ((j+1)/2)*FONT_STR_HEIGHT - y0; #endif if (previous_marker != MARKER_INVALID && current_trace != TRACE_INVALID) { @@ -1848,12 +1852,12 @@ cell_draw_marker_info(int x0, int y0) if (electrical_delay != 0.0f) { // draw electrical delay -#if LCD_WIDTH == 480 || _USE_FONT_== 0 +#if LCD_WIDTH == 320 && _USE_FONT_== 1 + xpos = 1 - x0; + ypos = 1 + (j)*FONT_STR_HEIGHT - y0; +#else xpos = 1 + 18 + CELLOFFSETX - x0; ypos = 1 + ((j+1)/2)*FONT_STR_HEIGHT - y0; -#else - xpos = 1 - x0; - ypos = 1 + (j)*FONT_STR_HEIGHT - y0; #endif if (lever_mode == LM_EDELAY) @@ -1900,6 +1904,9 @@ draw_frequencies(void) #if LCD_WIDTH == 480 || _USE_FONT_== 0 lcd_set_foreground(LCD_BW_TEXT_COLOR); lcd_printf(FREQUENCIES_XPOS3, FREQUENCIES_YPOS,"bw:%uHz %up", get_bandwidth_frequency(config._bandwidth), sweep_points); +#elif LCD_WIDTH == 320 && _USE_FONT_== 3 + lcd_set_foreground(LCD_BW_TEXT_COLOR); + lcd_printf(FREQUENCIES_XPOS3, FREQUENCIES_YPOS,"bw:%uHz", get_bandwidth_frequency(config._bandwidth)); #endif } diff --git a/si5351.c b/si5351.c index e557864..60fd86e 100644 --- a/si5351.c +++ b/si5351.c @@ -157,6 +157,7 @@ si5351_init(void) si5351_bulk_write(p, len); p += len; } + si5351_set_band_mode(config._band_mode); // Set any (let it be XTALFREQ) frequency for AIC can run si5351_set_frequency(XTALFREQ, 0); } @@ -389,68 +390,77 @@ typedef struct { #define SI5351_FIXED_PLL 1 #define SI5351_FIXED_MULT 2 #define SI5351_MIXED 3 - +#define CONST_BAND const +#ifndef CONST_BAND #define CONST_BAND +static band_strategy_t *band_s; +void si5351_update_band_config(int idx, uint32_t pidx, uint32_t v){ + CONST_BAND band_strategy_t *b = &band_s[idx]; + switch(pidx){ + case 0:b->mode = v;break; + case 1:b->freq = v;break; + case 2:b->div = v;break; + case 3:b->mul = v;break; + case 4:b->omul = v;break; + case 5:b->pow = v;break; + case 6:b->opow = v;break; + case 7:b->l_gain = v;break; + case 8:b->r_gain = v;break; + case 9:b->l_gain = b->r_gain = v;break; + case 10:b->freq_align = v;break; + } +} +#else +static const band_strategy_t *band_s; +#endif + /* * Frequency generation divide on band */ -#define THRESHOLD 300000100U -static -#ifdef CONST_BAND -const -#endif -band_strategy_t band_s[] = { +#define THRESHOLD 290000100U +// Mode for H board v3.3 and SI5351 installed +CONST_BAND band_strategy_t band_strategy_33H_SI5351[] = { { 0U, 0, { 0}, 0, 0, -1, -1, -1, -1, 1}, // 0 { 26000U, SI5351_FIXED_PLL, { 8}, 1, 1, SI5351_CLK_DRIVE_STRENGTH_2MA, SI5351_CLK_DRIVE_STRENGTH_2MA, 0, 0, 1}, // 1 { 100000000U, SI5351_FIXED_PLL, {32}, 1, 1, SI5351_CLK_DRIVE_STRENGTH_2MA, SI5351_CLK_DRIVE_STRENGTH_2MA, 0, 0, 1}, // 2 - { 130000000U, SI5351_FIXED_MULT,{ 8}, 1, 1, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 0, 0, 1}, // 3 { 180000000U, SI5351_FIXED_MULT,{ 6}, 1, 1, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 0, 0, 1}, // 4 { 1, SI5351_FIXED_MULT,{ 4}, 1, 1, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 0, 0, 1}, // 5 - { 460000000U, SI5351_FIXED_MULT,{ 6}, 3, 5, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 40, 40, 1}, // 6 { 600000000U, SI5351_FIXED_MULT,{ 4}, 3, 5, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 40, 40, 1}, // 7 { 3, SI5351_FIXED_MULT,{ 4}, 3, 5, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 50, 50, 1}, // 8 - { 1200000000U, SI5351_FIXED_MULT,{ 4}, 5, 7, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 70, 70, 1}, // 9 { 5, SI5351_FIXED_MULT,{ 4}, 5, 7, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 70, 70, 1}, //10 - { 1800000000U, SI5351_FIXED_MULT,{ 4}, 7, 9, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_8MA, 70, 70, 7*9*4}, //11 { 7, SI5351_FIXED_MULT,{ 4}, 7, 9, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_8MA, 70, 70, 7*9*4}, //12 - { 2400000000U, SI5351_FIXED_MULT,{ 4}, 9,11, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_8MA, 85, 85, 9*11*4}, //13 { 9, SI5351_FIXED_MULT,{ 4}, 9,11, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_8MA, 95, 95, 9*11*4}, //14 { 11, SI5351_FIXED_MULT,{ 4},11,12, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_8MA, 95, 95, 11*12*4} //15 }; +// Mode for board v3.6 and MS5351 installed +CONST_BAND band_strategy_t band_strategy_36H_MS5351[] = { + { 0U, 0, { 0}, 0, 0, -1, -1, -1, -1, 1}, // 0 + { 24000U, SI5351_FIXED_PLL, {16}, 1, 1, SI5351_CLK_DRIVE_STRENGTH_2MA, SI5351_CLK_DRIVE_STRENGTH_2MA, 0, 0, 1}, // 1 + { 130000000U, SI5351_FIXED_PLL, {32}, 1, 1, SI5351_CLK_DRIVE_STRENGTH_2MA, SI5351_CLK_DRIVE_STRENGTH_2MA, 0, 0, 1}, // 2 + { 1, SI5351_FIXED_MULT,{ 4}, 1, 1, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 0, 0, 1}, // 3 + { 460000000U, SI5351_FIXED_MULT,{ 8}, 3, 3, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 0, 0, 1}, // 4 + { 3, SI5351_FIXED_MULT,{ 4}, 3, 3, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 0, 0, 1}, // 5 + { 5, SI5351_FIXED_MULT,{ 4}, 5, 7, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_6MA, 20, 25, 1}, // 6 + { 7, SI5351_FIXED_MULT,{ 4}, 7, 9, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_8MA, 40, 45, 7*9*4}, // 7 + { 9, SI5351_FIXED_MULT,{ 4}, 9,11, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_8MA, 50, 80, 9*11*4}, // 8 + { 11, SI5351_FIXED_MULT,{ 4},11,12, SI5351_CLK_DRIVE_STRENGTH_8MA, SI5351_CLK_DRIVE_STRENGTH_8MA, 60, 90, 11*12*4} // 9 +}; -void si5351_update_band_config(int idx, uint32_t pidx, uint32_t v){ -#ifdef CONST_BAND - (void)idx; - (void)pidx; - (void)v; -#else - band_strategy_t *b = &band_s[idx]; - switch(pidx){ - case 0:b->mode = v;break; - case 1:b->freq = v;break; - case 2:b->div = v;break; - case 3:b->mul = v;break; - case 4:b->omul = v;break; - case 5:b->pow = v;break; - case 6:b->opow = v;break; - case 7:b->l_gain = v;break; - case 8:b->r_gain = v;break; - case 9:b->l_gain = b->r_gain = v;break; - case 10:b->freq_align = v;break; - } -#endif +void si5351_set_band_mode(uint16_t t) { + band_s = t ? band_strategy_36H_MS5351 : band_strategy_33H_SI5351; } + uint32_t si5351_get_harmonic_lvl(uint32_t freq){ uint16_t i; - for (i = 0; i < ARRAY_COUNT(band_s); i++){ + for (i = 0; ; i++){ uint32_t f = band_s[i].freq; if (f < 20) f*=config._harmonic_freq_threshold; if (freq <= f) return i; diff --git a/si5351.h b/si5351.h index d20d4b9..8758d35 100644 --- a/si5351.h +++ b/si5351.h @@ -79,6 +79,7 @@ void si5351_enable_output(void); void si5351_set_frequency_offset(int32_t offset); int si5351_set_frequency(uint32_t freq, uint8_t drive_strength); void si5351_set_power(uint8_t drive_strength); +void si5351_set_band_mode(uint16_t t); // Defug use functions void si5351_bulk_write(const uint8_t *buf, int len); diff --git a/ui.c b/ui.c index bd8b80d..55b1501 100644 --- a/ui.c +++ b/ui.c @@ -69,6 +69,10 @@ enum { #endif #ifdef __VNA_Z_RENORMALIZATION__ KM_Z_PORT, +#endif +#ifdef __USE_RTC__ + KM_RTC_DATE, + KM_RTC_TIME, #endif KM_NONE }; @@ -429,44 +433,40 @@ touch_wait_pressed(void) #define TOUCH_MARK_X 4 #define TOUCH_MARK_Y 4 static const uint8_t touch_bitmap[]={ -_BMP16(0b0000100000000000), -_BMP16(0b0100100100000000), -_BMP16(0b0010101000000000), -_BMP16(0b0000100000000000), -_BMP16(0b1111011110000000), -_BMP16(0b0000100000000000), -_BMP16(0b0010101000000000), -_BMP16(0b0100100100000000), -_BMP16(0b0000100000000000), + _BMP16(0b0000100000000000), + _BMP16(0b0100100100000000), + _BMP16(0b0010101000000000), + _BMP16(0b0000100000000000), + _BMP16(0b1111011110000000), + _BMP16(0b0000100000000000), + _BMP16(0b0010101000000000), + _BMP16(0b0100100100000000), + _BMP16(0b0000100000000000), }; +static void getTouchPoint(uint16_t x, uint16_t y, const char *name) { + lcd_set_foreground(LCD_FG_COLOR); + lcd_set_background(LCD_BG_COLOR); + lcd_clear_screen(); + + lcd_blitBitmap(x, y, TOUCH_MARK_W, TOUCH_MARK_H, touch_bitmap); + lcd_printf((LCD_WIDTH-18*FONT_WIDTH)/2, (LCD_HEIGHT-FONT_GET_HEIGHT)/2, "TOUCH %s *", name); + touch_wait_release(); +} + void touch_cal_exec(void) { - int x1, x2, y1, y2; - - lcd_set_foreground(LCD_FG_COLOR); - lcd_set_background(LCD_BG_COLOR); - lcd_clear_screen(); - lcd_blitBitmap(CALIBRATION_OFFSET-TOUCH_MARK_X, CALIBRATION_OFFSET-TOUCH_MARK_Y, TOUCH_MARK_W, TOUCH_MARK_H, touch_bitmap); - lcd_printf((LCD_WIDTH-18*FONT_WIDTH)/2, (LCD_HEIGHT-FONT_GET_HEIGHT)/2, "TOUCH UPPER LEFT *"); - - touch_wait_release(); - x1 = last_touch_x; - y1 = last_touch_y; - - lcd_clear_screen(); - lcd_blitBitmap(LCD_WIDTH-1-CALIBRATION_OFFSET-TOUCH_MARK_X, LCD_HEIGHT-1-CALIBRATION_OFFSET-TOUCH_MARK_Y, TOUCH_MARK_W, TOUCH_MARK_H, touch_bitmap); - lcd_printf((LCD_WIDTH-18*FONT_WIDTH)/2, (LCD_HEIGHT-FONT_GET_HEIGHT)/2, "TOUCH LOWER RIGHT *"); - - touch_wait_release(); - x2 = last_touch_x; - y2 = last_touch_y; - - config._touch_cal[0] = x1; - config._touch_cal[1] = y1; - config._touch_cal[2] = x2; - config._touch_cal[3] = y2; + const uint16_t x1 = CALIBRATION_OFFSET - TOUCH_MARK_X; + const uint16_t y1 = CALIBRATION_OFFSET - TOUCH_MARK_Y; + const uint16_t x2 = LCD_WIDTH - 1 - CALIBRATION_OFFSET - TOUCH_MARK_X; + const uint16_t y2 = LCD_HEIGHT - 1 - CALIBRATION_OFFSET - TOUCH_MARK_Y; + getTouchPoint(x1, y1, "UPPER LEFT"); + config._touch_cal[0] = last_touch_x; + config._touch_cal[1] = last_touch_y; + getTouchPoint(x2, y2, "LOWER RIGHT"); + config._touch_cal[2] = last_touch_x; + config._touch_cal[3] = last_touch_y; } void @@ -509,12 +509,13 @@ static void show_version(void) { int x = 5, y = 5, i = 1; - lcd_set_foreground(LCD_FG_COLOR); + lcd_set_foreground(LCD_TRACE_2_COLOR); lcd_set_background(LCD_BG_COLOR); lcd_clear_screen(); uint16_t shift = 0b00010101000; lcd_drawstring_size(BOARD_NAME, x , y, 3); + lcd_set_foreground(LCD_FG_COLOR); y+=FONT_GET_HEIGHT*3+3-5; #if LCD_WIDTH == 480 || _USE_FONT_== 0 while (info_about[i]) { @@ -1427,6 +1428,18 @@ static UI_FUNCTION_CALLBACK(menu_sdcard_cb) } #endif +static UI_FUNCTION_ADV_CALLBACK(menu_band_sel_acb) +{ + (void)data; + if (b){ + b->p1.text = config._band_mode == 0 ? "Si5351" : "MS5351"; + return; + } + config._band_mode = config._band_mode == 0 ? 1 : 0; + si5351_set_band_mode(config._band_mode); +} + + #ifdef __DIGIT_SEPARATOR__ static UI_FUNCTION_ADV_CALLBACK(menu_separator_acb) { @@ -1829,12 +1842,17 @@ const menuitem_t menu_offset[] = { #endif const menuitem_t menu_device[] = { +#if LCD_WIDTH == 480 || _USE_FONT_== 0 { MT_ADV_CALLBACK, KM_THRESHOLD, "THRESHOLD\n%.6q", menu_keyboard_acb }, +#else + { MT_ADV_CALLBACK, KM_THRESHOLD, "THRESHOLD", menu_keyboard_acb }, +#endif { MT_ADV_CALLBACK, KM_XTAL, "TCXO\n%.6q", menu_keyboard_acb }, { MT_ADV_CALLBACK, KM_VBAT, "VBAT OFFSET\n %umV", menu_keyboard_acb }, #ifdef USE_VARIABLE_OFFSET_MENU { MT_ADV_CALLBACK, 0, "IF OFFSET\n %dHz", menu_offset_sel_acb }, #endif + { MT_ADV_CALLBACK, 0, "MODE\n %s", menu_band_sel_acb }, #ifdef __DIGIT_SEPARATOR__ { MT_ADV_CALLBACK, 0, "SEPARATOR\n%s", menu_separator_acb }, #endif @@ -1845,6 +1863,10 @@ const menuitem_t menu_device[] = { { MT_CALLBACK, MENU_CONFIG_LOAD, "LOAD\nCONFIG.INI", menu_config_cb }, #endif { MT_SUBMENU, 0, "CLEAR\nCONFIG", menu_clear }, +#ifdef __USE_RTC__ + { MT_ADV_CALLBACK, KM_RTC_DATE, "SET DATE", (const void *)menu_keyboard_acb }, + { MT_ADV_CALLBACK, KM_RTC_TIME, "SET TIME", (const void *)menu_keyboard_acb }, +#endif { MT_NONE, 0, NULL, menu_back } // next-> menu_back }; @@ -1994,6 +2016,7 @@ menu_invoke(int item) #define KP_KEYPAD 20 #define KP_N 21 #define KP_P 22 +#define KP_ENTER 23 // Stop #define KP_NONE 255 @@ -2029,7 +2052,7 @@ static const keypads_t keypads_scale[] = { { 0, 0, KP_7 }, { 1, 0, KP_8 }, { 2, 0, KP_9 }, - { 3, 3, KP_X1 }, + { 3, 3, KP_ENTER }, { 2, 3, KP_BS }, { 0, 0, KP_NONE } }; @@ -2047,7 +2070,7 @@ static const keypads_t keypads_ref[] = { { 1, 0, KP_8 }, { 2, 0, KP_9 }, { 3, 2, KP_MINUS }, - { 3, 3, KP_X1 }, + { 3, 3, KP_ENTER }, { 2, 3, KP_BS }, { 0, 0, KP_NONE } }; @@ -2092,11 +2115,17 @@ static const keypads_list keypads_mode_tbl[KM_NONE] = { #ifdef __VNA_Z_RENORMALIZATION__ [KM_Z_PORT] = {keypads_scale, "PORT Z 50" S_RARROW }, // Port Z renormalization impedance #endif +#ifdef __USE_RTC__ +[KM_RTC_DATE] = {keypads_scale, "SET DATE\n YYMMDD"}, // Date +[KM_RTC_TIME] = {keypads_scale, "SET TIME\n HHMMSS"}, // Time +#endif }; static void -set_numeric_value(float f_val, freq_t u_val) +set_numeric_value(void) { + float f_val = my_atof(kp_buf); + freq_t u_val = my_atoui(kp_buf); switch (keypad_mode) { case KM_START: set_sweep_frequency(ST_START, u_val); break; case KM_STOP: set_sweep_frequency(ST_STOP, u_val); break; @@ -2117,6 +2146,46 @@ set_numeric_value(float f_val, freq_t u_val) #endif #ifdef __VNA_Z_RENORMALIZATION__ case KM_Z_PORT: current_props._portz = f_val; break; +#endif +#ifdef __USE_RTC__ + case KM_RTC_DATE: + case KM_RTC_TIME: + { + int i = 0; + uint32_t dt_buf[2]; + dt_buf[0] = rtc_get_tr_bcd(); // TR should be read first for sync + dt_buf[1] = rtc_get_dr_bcd(); // DR should be read second + // 0 1 2 4 5 6 + // time[] ={sec, min, hr, 0, day, month, year, 0} + uint8_t *time = (uint8_t*)dt_buf; + for (; i < 6 && kp_buf[i]!=0; i++) kp_buf[i]-= '0'; + for (; i < 6 ; i++) kp_buf[i] = 0; + for (i = 0; i < 3; i++) kp_buf[i] = (kp_buf[2*i]<<4) | kp_buf[2*i+1]; // BCD format + if (keypad_mode == KM_RTC_DATE) { + // Month limit 1 - 12 (in BCD) + if (kp_buf[1] < 1) kp_buf[1] = 1; + else if (kp_buf[1] > 0x12) kp_buf[1] = 0x12; + // Day limit (depend from month): + uint8_t day_max = 28 + ((0b11101100000000000010111110111011001100>>(kp_buf[1]<<1))&3); + day_max = ((day_max/10)<<4)|(day_max%10); // to BCD + if (kp_buf[2] < 1) kp_buf[2] = 1; + else if (kp_buf[2] > day_max) kp_buf[2] = day_max; + time[6] = kp_buf[0]; // year + time[5] = kp_buf[1]; // month + time[4] = kp_buf[2]; // day + } + else { + // Hour limit 0 - 23, min limit 0 - 59, sec limit 0 - 59 (in BCD) + if (kp_buf[0] > 0x23) kp_buf[0] = 0x23; + if (kp_buf[1] > 0x59) kp_buf[1] = 0x59; + if (kp_buf[2] > 0x59) kp_buf[2] = 0x59; + time[2] = kp_buf[0]; // hour + time[1] = kp_buf[1]; // min + time[0] = kp_buf[2]; // sec + } + rtc_set_time(dt_buf[1], dt_buf[0]); + } + break; #endif } } @@ -2202,7 +2271,13 @@ draw_numeric_input(const char *buf) bool focused = FALSE; uint16_t x = 14 + 10 * FONT_WIDTH; uint16_t y = LCD_HEIGHT-(NUM_FONT_GET_HEIGHT+NUM_INPUT_HEIGHT)/2; - uint16_t xsim = (0b00100100100100100 >>(2-(period_pos()%3)))&(~1); + uint16_t xsim; +#ifdef __USE_RTC__ + if ((1<>(2-(period_pos()%3)))&(~1); int c; while(*buf) { c = *buf++; @@ -2629,6 +2704,7 @@ static int keypad_click(int key) { int c = keypads[key].c; + if (c == KP_ENTER) c = KP_X1; if ((c >= KP_X1 && c <= KP_G) || c == KP_N || c == KP_P) { if (kp_index == 0) return KP_CANCEL; @@ -2646,7 +2722,7 @@ keypad_click(int key) } } // numeric input done - set_numeric_value(my_atof(kp_buf), my_atoui(kp_buf)); + set_numeric_value(); return KP_DONE; }