initial check in based on SVN revision 575

This commit is contained in:
2025-05-14 12:57:39 -05:00
commit a3ef12e24a
217 changed files with 95547 additions and 0 deletions

280
source/AppChangeLog.txt Normal file
View File

@@ -0,0 +1,280 @@
Changed dID response to "UM_TX_LOADER"
Trouble connecting from UM_Setup. Connects to Realterm OK.
Found that setting vcp.DtsEnable = true in C# allows connection
New problem: Data larger than 64 bytes throws semaphore exception in C#
Believe this is because of the max USB packet size in usb_device_config.h
11/5/2023 - Started with TX_Loader project with USB and FLASH support
REVERT BOOTLOADER CHANGES
Changed dID response to "UM_TX"
Revert bootloader changes in ctimer_match0_callback()
Left USB_Update() call
Main.c
Removed bootloader function calls
Enabled all code from application
PROGRAM FLASH SETTINGS
Changes MCU Settings: FLASH start @ 0x10000, size 0x30000
This gives 192kB for the Application program in FLASH
Application builds to 105kB without optimization
UM SETUP SUPPORT
Added support for pLoaderRunRequest and pClearProgramFlag
Added USB_ProcessFrequencyCommand() for handling UM Setup frequency commands
SYSTEM
Added system.c/h for system strings
UMTX v0.90 11/10/2023
SYSTEM
Added SYSTEM_DATA_t struct with system data
EEPROM ISSUE
Found a conflict with the CTIMER0 interrupt - interrupts corrupt EEPROM data
Solved by stopping CTIMER0 during EEPROM data transfers
Added TMR_Start() and TMR_Start() to control the timer from eeprom.c
EEPROM
Added support for UINT32 and uint8_t[] read and write to EEPROM
Filled out eeprom.c/h
Added EE_LoadData() and EE_SaveData()
Call load on startup, call save on power down
Load / save support for system data only.
TODO: Add frequencies and operating states
UM SETUP SUPPORT
Added support for system info
UMTX v0.91 11/11/2023
MERGE
Pulled in Keith's changes from 10/21/23 through 11/10/23
UMTX v0.92 11/15/2023
Unit to Italy, Normal running mode, 263Hz reduced.
UMTX v0.93 11/16/2023
Test Mode for Yao.
UMTX v0.94 11/16/2023
Fixed bug in Test Mode caused by 2nd DDS intermittent turn on.
UMTX v0.95 12/06/2023
Fixed bug in causing DDS incorrect initial power up errors.
UMTX v0.96 12/08/2023
Softer shut down when using clamp. Improved Overcurrent implemented.
UMTX v1.0 12/12/2023
Improved HV blocking HF always blocked. Over power bug fixed.
UMTX v1.1 12/xx/2023
MENU
ON_OFF_KEY press exits to main screen from any menu
Changed menu order so that optional menu lines are last and can be hidden easily
Updated Main menu text in MENU_Init()
Updated submenu calls in Menu_Main()
Updated menu line display in MENU_DisplayMain()
Hid Language menu (until language support is ready)
Hid Link Radio and Regulatory menus for Tx10
Added Diagnostics screen
Added SystemInfoMenu() to control DisplaySystemInfo() and DisplayDiagnostics()
Fixed BC cycling issue. Clamp blocking fixed, Clamp overwrite of BC display fixed.
Frequency init fixed. Time delay between modes and power off improved, Taps issue fixed,
Clamp measurements removed from display.
UMTX v1.1b 12/xx/2023
Fixes to Display of V,I,R.
Added additional filtering slower k factor.
Fixed divide by zero in Ohms calculation
UMTX v1.2b 12/27/2023
Fixed, Adc faster measurements, added catchup for power adjustment, Taps forced,
lowered trickle,current limits trimmed.System checking delayed after adjustment.
UMTX v1.2c 12/27/2023
Fixed ESTOP.
UMTX v1.2d 12/28/2023
Disabled H/W when USB connected, Reset power level to zero when switching modes, reduced
power in broadcast.
UMTX v1.2e 01/02/2023
Fixed USB connected during run time, fixed s/c current and power adjust after keypress.
Changed PSU sequencing when switching.
UMTX v1.2f 01/03/2023
Fixed stuck power increase, missing taps case, overcurrent standby in very low impedance improved.
UMTX v1.2g 01/03/2023
Trickle current increased, current adjust held off in PL1
UMTX v1.2j 01/03/2023
AB amp limited to 500mA.
UMTX v1.2k 01/04/2023
Fixed step from Blocking cap transition on PL1.
UMTX v1.2l 01/04/2023
ADC offset fixed.
UMTX v1.2 01/04/2024
ADC offset fixed.
UMTX v1.2aa 01/05/24
ADC
Applied current offset (was not turned on)
Remove ADC channel 9 - was USB VBUS = not used
Added voltage offset measurement at startup
Apply voltage offset in ADC_Update()
Added error detection to vos and ios measurements
ISSUE: If debugging program from running program, outputs keep running and offsets will measure them!
DIAGNOSTICS
Added voltage and current offsets
Added vos and ios measurements and error status
UMTX v1.2ab
ADC
Updated voltage and current offsets to use OK instead of error flags
Check for +/- 30 counts from midScale (was only checking one side)
MENU
Updated to use OK flag
UMTX v1.2ac
Checked out from new svn repo: https://yuriykc.dyndns.info:48443/svn/utility/TX/App/Trunk
Build to make sure it's all working
Had to add libpower_cm4_hardabi.a and _softabi.a
UMTX v1.3 01/09/24
same as v1.2ac except USB turned on in main.
UMTX v1.3M 02/09/24
Updated with adc improvement plus usb additional peripherals inits removed.
Also contains Alakline battery fixes, new battery calculator for lithium. Class AB protection.
ADC_REF change.
UMTX v1.3R 03/06/24
Gain key lock out. PSU Monitor,Blocking cap moved,Safe output after changing hi/lo ,lo hi frequencies.
System timer fixed. Short detection sped up.
UMTX v1.3S 03/08/24
Improved gain handling, improved PSU monitor, improved wrap around.Updated alkaline selection.
UMTX v1.3T 03/14/24
Battery voltage changed, Blocking cap operation changed. PL1 on start, Clamp Dc display bug fixed.
USB plug in fixed, Error 2 fix, Error 1 fix.
UMTX v1.3U 03/22/24
Temporary incomplete save.
UMTX v1.3V 03/27/24
System timer, fixed. Lowered current steps in HF, increased protection of AB amp. Taps bug fix.
Improved regulation. HF current measurement fixed. Frequency initial fixed. Improved display software.
UMTX v1.3W 03/28/24
Contains battery fix plus selectable hidden menu for recording H/w changes.
UMTX v1.3X 04/02/24
Contains battery life changes, updated live voltage check, updated battery eol check, updated
current demand limitation in high frequencies.
UMTX v1.3X1 04/03/24
Contains additional menus to select between ASSY changes.
UMTX v1.3X2 04/03/24
Fixes battery scaling error, fixes clamp auto adjustment error.
UMTX v1.3X3 04/03/24
Fixes 29K, amplitude, and H/W board p/n fix
UMTX v1.3X4 04/08/24
HF measurement fix in LOW gain, Ohms display updated to k Ohms.
UMTX v1.6 04/09/24
HF measurement fix in LOW gain(Not complete) , Ohms display updated to k Ohms. Not recommended for HF
due to current measurement error.
v1.7A 04/xx/2024
CURRENT SCALING
Changed 208023 tables to 208025
208023 does NOT use high frequencies and tables are almost identical up to 45k
208023 and 208025 will both use 208025 tables
Renamed MeasureXxxCurrent208023 -> 208025
v1.7 04/12/24
Updated lowcurrent table. Changes adcinit til after the splash screen, added power up delay for high voltage
adc reading.
v1.8A 05/30/24
Supports 200K and 132K. Allows user to cycle frequencies without forcing zero when transitioning from
High to Low frequency and vice versa.
v1.8B 05/30/24
Changed 132K to 132110Hz.
v1.8C 05/31/24
MODE Key used to toggle HI_GAIN.
v1.8D 06/03/24
Updated coefficient for low gain in 200KHz in 208025.
v1.8E 06/03/24
Same as 1.8D.
v1.8F 06/05/24
Updated Coefficients for 131K and 200KHz.
v1.8J 07/17/24
Updated Coefficients for 131K and 200KHz.
v1.8K 07/17/24
Updated Coefficients for 131K and 200KHz.
v1.8L 07/31/24
Released 12K and 16K to Leica for testing purposes.
v1.8M 08/02/24
Released Rewrites H/W Assy number to 208025 if 208021 found in EEPROM
Released to Leica for testing purposes.
v1.8N 09/06/24
Default Language fix, LD disabled, TX10 changed to 10W.
v1.8P 09/06/24
Updated Leica P/n and System info menu and splash screen.
v1.8R 09/09/24
High frequency Power monitor updated.
v1.8S 09/09/24
High frequency Power monitor updated and Leica PN updated.
v1.9 09/09/24
Released version of v1.8S.
v1.9X 09/09/24
Not released, contains updated High Voltage protection, LD but disabled, Ext 12V, 25W Enabled.
v1.9Y 04/23/25
Not released, contains updated High Voltage protection, LD but disabled, Ext 12V, 25W Enabled.
Updated but not complete Clamp changes.
v1.9Z 04/23/25
Not released, contains updated High Voltage protection, LD but disabled, Ext 12V, 25W Enabled.
Updated but not complete Further updated Clamp changes.
DIAGNOSTICS
Added main PCBA PN to Diagnostics1 screen
HWFIXES
Changed HWF_MAX_MAIN_PCBA_PN to 208025
>>>>>>>>>>>>>>>>>>>>>>>>>>>> TX_App Debugging and Bootloader compatible builds <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Debugging requires that the application be built to run at FLASH address 0
The bootloader requires that the application be built at 0x10000
To change this: Project > Properties > C/C++ Build > MCU Settings >
TX_App: PROGRAM_FLASH Location = 0x10000 Size = 0x30000
TX_Loader: PROGRAM FLASH Location = 0x0 Size = 0x10000
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TODO: Add support for UM Setup "pEraseAllData" command
Needs to erase all EEPROM data except the bootloader section

View File

@@ -0,0 +1,714 @@
/*******************************************************************************
* *
* This file is generated by BitFontCreator Pro v3.8 *
* by Iseatech Software http://www.iseasoft.com/bitfontcreator.html *
* support@iseasoft.com *
* *
* Font name: Calibri *
* Font width: 0 (proportional font) *
* Font height: 15 *
* Encode: Unicode *
* Data length: 8 bits *
* Invert bits: No *
* Data format: Big Endian, Row based, Row preferred, Packed *
* *
* Create time: 17:17 04-07-2023 *
*******************************************************************************/
#include "bfcfont.h"
/* The following line needs to be included in any file selecting the
font.
*/
extern const BFC_FONT fontCalibriBoldBasic10_15h;
const UCHAR abc_fontCalibriBoldBasic10_15h_000A[ 14] = { /* code 000A */
0x00, 0x00, 0x00, 0x0F, 0xD0, 0xAD, 0x4A, 0xB5,
0x4A, 0x17, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_000D[ 14] = { /* code 000D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0020[ 6] = { /* code 0020 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0021[ 8] = { /* code 0021 */
0x00, 0x06, 0x66, 0x66, 0x60, 0x66, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0022[ 12] = { /* code 0022 */
0x00, 0x00, 0x36, 0xDB, 0x60, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0023[ 12] = { /* code 0023 */
0x00, 0x00, 0x00, 0x28, 0xAF, 0xCA, 0x53, 0xF5,
0x14, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0024[ 14] = { /* code 0024 */
0x00, 0x00, 0x00, 0x87, 0x98, 0xB0, 0x38, 0x38,
0x1A, 0x33, 0xC2, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0025[ 17] = { /* code 0025 */
0x00, 0x00, 0x00, 0x00, 0x06, 0x24, 0xA2, 0x50,
0xD0, 0x16, 0x14, 0x8A, 0x48, 0xC0, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0026[ 17] = { /* code 0026 */
0x00, 0x00, 0x00, 0x00, 0x01, 0xC1, 0xB0, 0xD8,
0x38, 0x3D, 0x33, 0x98, 0xC7, 0xB0, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0027[ 6] = { /* code 0027 */
0x00, 0x6D, 0x80, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0028[ 8] = { /* code 0028 */
0x00, 0x02, 0x64, 0xCC, 0xCC, 0xC4, 0x62, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0029[ 8] = { /* code 0029 */
0x00, 0x08, 0xC4, 0x66, 0x66, 0x64, 0xC8, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_002A[ 12] = { /* code 002A */
0x00, 0x00, 0x08, 0xA9, 0xC7, 0x2A, 0x20, 0x00,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_002B[ 12] = { /* code 002B */
0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0xF8, 0x82,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_002C[ 6] = { /* code 002C */
0x00, 0x00, 0x00, 0x01, 0xB7, 0x80
};
const UCHAR abc_fontCalibriBoldBasic10_15h_002D[ 8] = { /* code 002D */
0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_002E[ 6] = { /* code 002E */
0x00, 0x00, 0x00, 0x03, 0x60, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_002F[ 12] = { /* code 002F */
0x00, 0x00, 0x01, 0x08, 0x21, 0x04, 0x20, 0x84,
0x10, 0x82, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0030[ 14] = { /* code 0030 */
0x00, 0x00, 0x00, 0x07, 0x99, 0xB3, 0x66, 0xCD,
0x9B, 0x33, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0031[ 14] = { /* code 0031 */
0x00, 0x00, 0x00, 0x03, 0x0E, 0x2C, 0x18, 0x30,
0x60, 0xC7, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0032[ 14] = { /* code 0032 */
0x00, 0x00, 0x00, 0x07, 0x91, 0x83, 0x06, 0x18,
0x61, 0x87, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0033[ 14] = { /* code 0033 */
0x00, 0x00, 0x00, 0x07, 0x91, 0x83, 0x3C, 0x0C,
0x1A, 0x33, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0034[ 14] = { /* code 0034 */
0x00, 0x00, 0x00, 0x03, 0x87, 0x16, 0x2C, 0x99,
0xF8, 0x60, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0035[ 14] = { /* code 0035 */
0x00, 0x00, 0x00, 0x0F, 0xD8, 0x30, 0x7C, 0x0C,
0x1A, 0x33, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0036[ 14] = { /* code 0036 */
0x00, 0x00, 0x00, 0x03, 0x8C, 0x30, 0x7C, 0xCD,
0x9B, 0x33, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0037[ 14] = { /* code 0037 */
0x00, 0x00, 0x00, 0x0F, 0xC1, 0x86, 0x0C, 0x30,
0x61, 0x83, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0038[ 14] = { /* code 0038 */
0x00, 0x00, 0x00, 0x07, 0x99, 0xB3, 0x3C, 0xCD,
0x9B, 0x33, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0039[ 14] = { /* code 0039 */
0x00, 0x00, 0x00, 0x07, 0x99, 0xB3, 0x66, 0x7C,
0x18, 0x67, 0x80, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_003A[ 8] = { /* code 003A */
0x00, 0x00, 0x00, 0xCC, 0x00, 0xCC, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_003B[ 8] = { /* code 003B */
0x00, 0x00, 0x00, 0x66, 0x00, 0x66, 0x6C, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_003C[ 12] = { /* code 003C */
0x00, 0x00, 0x00, 0x00, 0x01, 0x98, 0x81, 0x81,
0x80, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_003D[ 12] = { /* code 003D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x03, 0xE0,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_003E[ 12] = { /* code 003E */
0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x08, 0xCC,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_003F[ 12] = { /* code 003F */
0x00, 0x00, 0x1C, 0x98, 0x61, 0x9C, 0x60, 0x06,
0x18, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0040[ 23] = { /* code 0040 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x81,
0x04, 0x26, 0xA4, 0x9A, 0x51, 0x25, 0x32, 0x4D,
0xC2, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0041[ 15] = { /* code 0041 */
0x00, 0x00, 0x00, 0x00, 0x38, 0x38, 0x6C, 0x6C,
0x6C, 0xFE, 0xC6, 0xC6, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0042[ 14] = { /* code 0042 */
0x00, 0x00, 0x00, 0x07, 0xCC, 0xD9, 0xBE, 0x66,
0xCD, 0x9B, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0043[ 14] = { /* code 0043 */
0x00, 0x00, 0x00, 0x03, 0xCC, 0x58, 0x30, 0x60,
0xC1, 0x89, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0044[ 15] = { /* code 0044 */
0x00, 0x00, 0x00, 0x00, 0x7C, 0x66, 0x66, 0x66,
0x66, 0x66, 0x66, 0x7C, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0045[ 12] = { /* code 0045 */
0x00, 0x00, 0x00, 0x7D, 0x86, 0x1F, 0x61, 0x86,
0x1F, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0046[ 12] = { /* code 0046 */
0x00, 0x00, 0x00, 0x7D, 0x86, 0x1F, 0x61, 0x86,
0x18, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0047[ 15] = { /* code 0047 */
0x00, 0x00, 0x00, 0x00, 0x3C, 0x62, 0x60, 0x60,
0x6E, 0x66, 0x66, 0x3E, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0048[ 15] = { /* code 0048 */
0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x7E,
0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0049[ 6] = { /* code 0049 */
0x00, 0x0D, 0xB6, 0xDB, 0x60, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_004A[ 8] = { /* code 004A */
0x00, 0x00, 0x33, 0x33, 0x33, 0x3E, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_004B[ 14] = { /* code 004B */
0x00, 0x00, 0x00, 0x06, 0x6D, 0x9B, 0x3C, 0x78,
0xD9, 0xB3, 0x30, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_004C[ 12] = { /* code 004C */
0x00, 0x00, 0x00, 0x61, 0x86, 0x18, 0x61, 0x86,
0x1F, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_004D[ 21] = { /* code 004D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0C, 0xE3,
0x9C, 0x73, 0xDE, 0x6A, 0xCD, 0xD9, 0x93, 0x32,
0x60, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_004E[ 17] = { /* code 004E */
0x00, 0x00, 0x00, 0x00, 0x06, 0x33, 0x99, 0xCC,
0xD6, 0x6B, 0x33, 0x99, 0xCC, 0x60, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_004F[ 17] = { /* code 004F */
0x00, 0x00, 0x00, 0x00, 0x03, 0xE3, 0x19, 0x8C,
0xC6, 0x63, 0x31, 0x98, 0xC7, 0xC0, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0050[ 14] = { /* code 0050 */
0x00, 0x00, 0x00, 0x07, 0xCC, 0xD9, 0xB3, 0x7C,
0xC1, 0x83, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0051[ 17] = { /* code 0051 */
0x00, 0x00, 0x00, 0x00, 0x03, 0xE3, 0x19, 0x8C,
0xC6, 0x63, 0x31, 0x98, 0xC7, 0xC0, 0x18, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0052[ 14] = { /* code 0052 */
0x00, 0x00, 0x00, 0x07, 0xCC, 0xD9, 0xBE, 0x6C,
0xCD, 0x9B, 0x30, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0053[ 12] = { /* code 0053 */
0x00, 0x00, 0x00, 0x73, 0x2C, 0x3C, 0x78, 0x69,
0x9C, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0054[ 12] = { /* code 0054 */
0x00, 0x00, 0x00, 0xFC, 0xC3, 0x0C, 0x30, 0xC3,
0x0C, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0055[ 15] = { /* code 0055 */
0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66,
0x66, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0056[ 15] = { /* code 0056 */
0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x6C,
0x6C, 0x6C, 0x38, 0x38, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0057[ 23] = { /* code 0057 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x3C,
0x63, 0x6F, 0x66, 0x96, 0x69, 0x63, 0x9C, 0x30,
0xC3, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0058[ 14] = { /* code 0058 */
0x00, 0x00, 0x00, 0x0C, 0x6D, 0x9B, 0x1C, 0x38,
0xD9, 0xB6, 0x30, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0059[ 14] = { /* code 0059 */
0x00, 0x00, 0x00, 0x0C, 0xD9, 0x9E, 0x3C, 0x30,
0x60, 0xC1, 0x80, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_005A[ 12] = { /* code 005A */
0x00, 0x00, 0x00, 0xFC, 0x31, 0x8C, 0x31, 0x8C,
0x3F, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_005B[ 8] = { /* code 005B */
0x00, 0x07, 0x66, 0x66, 0x66, 0x66, 0x67, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_005C[ 12] = { /* code 005C */
0x00, 0x00, 0x20, 0x81, 0x04, 0x08, 0x20, 0x41,
0x02, 0x08, 0x10, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_005D[ 8] = { /* code 005D */
0x00, 0x0E, 0x66, 0x66, 0x66, 0x66, 0x6E, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_005E[ 12] = { /* code 005E */
0x00, 0x00, 0x00, 0x30, 0xC7, 0x92, 0xCC, 0x00,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_005F[ 12] = { /* code 005F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0xF0, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0061[ 12] = { /* code 0061 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0x06, 0x7B, 0x6D,
0x9E, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0062[ 14] = { /* code 0062 */
0x00, 0x00, 0x06, 0x0C, 0x18, 0x3E, 0x66, 0xCD,
0x9B, 0x37, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0063[ 10] = { /* code 0063 */
0x00, 0x00, 0x00, 0x01, 0xD8, 0xC6, 0x30, 0xE0,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0064[ 14] = { /* code 0064 */
0x00, 0x00, 0x00, 0x60, 0xC1, 0x9F, 0x66, 0xCD,
0x9B, 0x33, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0065[ 14] = { /* code 0065 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x66, 0xFD,
0x83, 0x03, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0066[ 10] = { /* code 0066 */
0x00, 0x00, 0x76, 0x33, 0xCC, 0x63, 0x18, 0xC0,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0067[ 12] = { /* code 0067 */
0x00, 0x00, 0x00, 0x00, 0x07, 0xF6, 0xD9, 0xCC,
0x1E, 0xDB, 0xC0, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0068[ 14] = { /* code 0068 */
0x00, 0x00, 0x06, 0x0C, 0x18, 0x3E, 0x66, 0xCD,
0x9B, 0x36, 0x60, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0069[ 6] = { /* code 0069 */
0x00, 0x6C, 0x36, 0xDB, 0x60, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_006A[ 6] = { /* code 006A */
0x00, 0x36, 0x1B, 0x6D, 0xB7, 0x80
};
const UCHAR abc_fontCalibriBoldBasic10_15h_006B[ 12] = { /* code 006B */
0x00, 0x00, 0x30, 0xC3, 0x0D, 0xB6, 0xF3, 0xCD,
0xB6, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_006C[ 6] = { /* code 006C */
0x00, 0x6D, 0xB6, 0xDB, 0x60, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_006D[ 21] = { /* code 006D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x3E, 0xE6, 0x66, 0xCC, 0xD9, 0x9B, 0x33, 0x66,
0x60, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_006E[ 14] = { /* code 006E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x66, 0xCD,
0x9B, 0x36, 0x60, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_006F[ 14] = { /* code 006F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x66, 0xCD,
0x9B, 0x33, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0070[ 14] = { /* code 0070 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x66, 0xCD,
0x9B, 0x37, 0xCC, 0x18, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0071[ 14] = { /* code 0071 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x66, 0xCD,
0x9B, 0x33, 0xE0, 0xC1, 0x80, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0072[ 10] = { /* code 0072 */
0x00, 0x00, 0x00, 0x03, 0xD8, 0xC6, 0x31, 0x80,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0073[ 10] = { /* code 0073 */
0x00, 0x00, 0x00, 0x01, 0xD8, 0xE3, 0x8D, 0xC0,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0074[ 10] = { /* code 0074 */
0x00, 0x00, 0x06, 0x33, 0xCC, 0x63, 0x18, 0x60,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0075[ 14] = { /* code 0075 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66, 0xCD,
0x9B, 0x33, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0076[ 12] = { /* code 0076 */
0x00, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xD9, 0x47,
0x1C, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0077[ 19] = { /* code 0077 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0x9B, 0x76, 0xD5, 0x9D, 0xC6, 0x31, 0x8C, 0x00,
0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0078[ 12] = { /* code 0078 */
0x00, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0x71, 0xCD,
0xB6, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0079[ 12] = { /* code 0079 */
0x00, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xD9, 0x47,
0x0C, 0x61, 0x80, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_007A[ 10] = { /* code 007A */
0x00, 0x00, 0x00, 0x03, 0xC6, 0x63, 0x31, 0xE0,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_007B[ 8] = { /* code 007B */
0x00, 0x03, 0x66, 0x66, 0xC6, 0x66, 0x63, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_007C[ 12] = { /* code 007C */
0x00, 0x00, 0x08, 0x20, 0x82, 0x08, 0x20, 0x82,
0x08, 0x20, 0x80, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_007D[ 8] = { /* code 007D */
0x00, 0x0C, 0x66, 0x66, 0x36, 0x66, 0x6C, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_00E7[ 10] = { /* code 00E7 */
0x00, 0x00, 0x00, 0x01, 0xD8, 0xC6, 0x30, 0xE2,
0x30, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_00F1[ 14] = { /* code 00F1 */
0x00, 0x00, 0x01, 0xA5, 0x80, 0x3E, 0x66, 0xCD,
0x9B, 0x36, 0x60, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0438[ 14] = { /* code 0438 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xB7, 0x6E,
0xED, 0xDB, 0x30, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0439[ 14] = { /* code 0439 */
0x00, 0x00, 0x01, 0x11, 0xC0, 0x19, 0xB7, 0x6E,
0xED, 0xDB, 0x30, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_043A[ 12] = { /* code 043A */
0x00, 0x00, 0x00, 0x00, 0x06, 0xDB, 0x69, 0xC6,
0x9B, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0441[ 10] = { /* code 0441 */
0x00, 0x00, 0x00, 0x01, 0xD9, 0xC6, 0x32, 0xE0,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_0443[ 14] = { /* code 0443 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x3B, 0xB6, 0x6C,
0x50, 0xE1, 0xC3, 0x06, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic10_15h_2126[ 17] = { /* code 2126 */
0x00, 0x00, 0x00, 0x00, 0x01, 0xE1, 0x99, 0x86,
0xC3, 0x61, 0xB0, 0xCC, 0xCE, 0x70, 0x00, 0x00,
0x00
};
const BFC_CHARINFO fontCalibriBoldBasic10_15h_CharInfo[103] = {
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_000A} }, /* code 000A */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_000D} }, /* code 000D */
{ 3, 6, {abc_fontCalibriBoldBasic10_15h_0020} }, /* code 0020 */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_0021} }, /* code 0021 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0022} }, /* code 0022 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0023} }, /* code 0023 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0024} }, /* code 0024 */
{ 9, 17, {abc_fontCalibriBoldBasic10_15h_0025} }, /* code 0025 */
{ 9, 17, {abc_fontCalibriBoldBasic10_15h_0026} }, /* code 0026 */
{ 3, 6, {abc_fontCalibriBoldBasic10_15h_0027} }, /* code 0027 */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_0028} }, /* code 0028 */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_0029} }, /* code 0029 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_002A} }, /* code 002A */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_002B} }, /* code 002B */
{ 3, 6, {abc_fontCalibriBoldBasic10_15h_002C} }, /* code 002C */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_002D} }, /* code 002D */
{ 3, 6, {abc_fontCalibriBoldBasic10_15h_002E} }, /* code 002E */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_002F} }, /* code 002F */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0030} }, /* code 0030 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0031} }, /* code 0031 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0032} }, /* code 0032 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0033} }, /* code 0033 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0034} }, /* code 0034 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0035} }, /* code 0035 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0036} }, /* code 0036 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0037} }, /* code 0037 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0038} }, /* code 0038 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0039} }, /* code 0039 */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_003A} }, /* code 003A */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_003B} }, /* code 003B */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_003C} }, /* code 003C */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_003D} }, /* code 003D */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_003E} }, /* code 003E */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_003F} }, /* code 003F */
{ 12, 23, {abc_fontCalibriBoldBasic10_15h_0040} }, /* code 0040 */
{ 8, 15, {abc_fontCalibriBoldBasic10_15h_0041} }, /* code 0041 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0042} }, /* code 0042 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0043} }, /* code 0043 */
{ 8, 15, {abc_fontCalibriBoldBasic10_15h_0044} }, /* code 0044 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0045} }, /* code 0045 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0046} }, /* code 0046 */
{ 8, 15, {abc_fontCalibriBoldBasic10_15h_0047} }, /* code 0047 */
{ 8, 15, {abc_fontCalibriBoldBasic10_15h_0048} }, /* code 0048 */
{ 3, 6, {abc_fontCalibriBoldBasic10_15h_0049} }, /* code 0049 */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_004A} }, /* code 004A */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_004B} }, /* code 004B */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_004C} }, /* code 004C */
{ 11, 21, {abc_fontCalibriBoldBasic10_15h_004D} }, /* code 004D */
{ 9, 17, {abc_fontCalibriBoldBasic10_15h_004E} }, /* code 004E */
{ 9, 17, {abc_fontCalibriBoldBasic10_15h_004F} }, /* code 004F */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0050} }, /* code 0050 */
{ 9, 17, {abc_fontCalibriBoldBasic10_15h_0051} }, /* code 0051 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0052} }, /* code 0052 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0053} }, /* code 0053 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0054} }, /* code 0054 */
{ 8, 15, {abc_fontCalibriBoldBasic10_15h_0055} }, /* code 0055 */
{ 8, 15, {abc_fontCalibriBoldBasic10_15h_0056} }, /* code 0056 */
{ 12, 23, {abc_fontCalibriBoldBasic10_15h_0057} }, /* code 0057 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0058} }, /* code 0058 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0059} }, /* code 0059 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_005A} }, /* code 005A */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_005B} }, /* code 005B */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_005C} }, /* code 005C */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_005D} }, /* code 005D */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_005E} }, /* code 005E */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_005F} }, /* code 005F */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0061} }, /* code 0061 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0062} }, /* code 0062 */
{ 5, 10, {abc_fontCalibriBoldBasic10_15h_0063} }, /* code 0063 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0064} }, /* code 0064 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0065} }, /* code 0065 */
{ 5, 10, {abc_fontCalibriBoldBasic10_15h_0066} }, /* code 0066 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0067} }, /* code 0067 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0068} }, /* code 0068 */
{ 3, 6, {abc_fontCalibriBoldBasic10_15h_0069} }, /* code 0069 */
{ 3, 6, {abc_fontCalibriBoldBasic10_15h_006A} }, /* code 006A */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_006B} }, /* code 006B */
{ 3, 6, {abc_fontCalibriBoldBasic10_15h_006C} }, /* code 006C */
{ 11, 21, {abc_fontCalibriBoldBasic10_15h_006D} }, /* code 006D */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_006E} }, /* code 006E */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_006F} }, /* code 006F */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0070} }, /* code 0070 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0071} }, /* code 0071 */
{ 5, 10, {abc_fontCalibriBoldBasic10_15h_0072} }, /* code 0072 */
{ 5, 10, {abc_fontCalibriBoldBasic10_15h_0073} }, /* code 0073 */
{ 5, 10, {abc_fontCalibriBoldBasic10_15h_0074} }, /* code 0074 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0075} }, /* code 0075 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0076} }, /* code 0076 */
{ 10, 19, {abc_fontCalibriBoldBasic10_15h_0077} }, /* code 0077 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0078} }, /* code 0078 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_0079} }, /* code 0079 */
{ 5, 10, {abc_fontCalibriBoldBasic10_15h_007A} }, /* code 007A */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_007B} }, /* code 007B */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_007C} }, /* code 007C */
{ 4, 8, {abc_fontCalibriBoldBasic10_15h_007D} }, /* code 007D */
{ 5, 10, {abc_fontCalibriBoldBasic10_15h_00E7} }, /* code 00E7 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_00F1} }, /* code 00F1 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0438} }, /* code 0438 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0439} }, /* code 0439 */
{ 6, 12, {abc_fontCalibriBoldBasic10_15h_043A} }, /* code 043A */
{ 5, 10, {abc_fontCalibriBoldBasic10_15h_0441} }, /* code 0441 */
{ 7, 14, {abc_fontCalibriBoldBasic10_15h_0443} }, /* code 0443 */
{ 9, 17, {abc_fontCalibriBoldBasic10_15h_2126} } /* code 2126 */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop10 = {
0x2126, /* first character */
0x2126, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 102], /* address of first character */
(const BFC_FONT_PROP *)0 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop9 = {
0x0443, /* first character */
0x0443, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 101], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop10 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop8 = {
0x0441, /* first character */
0x0441, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 100], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop9 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop7 = {
0x0438, /* first character */
0x043A, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 97], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop8 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop6 = {
0x00F1, /* first character */
0x00F1, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 96], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop7 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop5 = {
0x00E7, /* first character */
0x00E7, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 95], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop6 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop4 = {
0x0061, /* first character */
0x007D, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 66], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop5 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop3 = {
0x0020, /* first character */
0x005F, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 2], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop4 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop2 = {
0x000D, /* first character */
0x000D, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 1], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop3 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic10_15h_Prop1 = {
0x000A, /* first character */
0x000A, /* last character */
&fontCalibriBoldBasic10_15h_CharInfo[ 0], /* address of first character */
&fontCalibriBoldBasic10_15h_Prop2 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT fontCalibriBoldBasic10_15h = {
0x01020802, /* font type = FONTTYPE_PROP | DATA_PACKED | ENCODING_UNICODE | DATALENGTH_8 */
15, /* font height in pixels */
12, /* font ascent (baseline) in pixels */
0 , /* reversed, =0 */
{&fontCalibriBoldBasic10_15h_Prop1}
};

View File

@@ -0,0 +1,766 @@
/*******************************************************************************
* *
* This file is generated by BitFontCreator Pro v3.8 *
* by Iseatech Software http://www.iseasoft.com/bitfontcreator.html *
* support@iseasoft.com *
* *
* Font name: Calibri *
* Font width: 0 (proportional font) *
* Font height: 18 *
* Encode: Unicode *
* Data length: 8 bits *
* Invert bits: No *
* Data format: Big Endian, Row based, Row preferred, Packed *
* *
* Create time: 17:17 04-07-2023 *
*******************************************************************************/
#include "bfcfont.h"
/* The following line needs to be included in any file selecting the
font.
*/
extern const BFC_FONT fontCalibriBoldBasic11_18h;
const UCHAR abc_fontCalibriBoldBasic11_18h_000A[ 18] = { /* code 000A */
0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x82, 0xBA,
0x8A, 0x9A, 0x82, 0x92, 0x82, 0xFE, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_000D[ 18] = { /* code 000D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0020[ 7] = { /* code 0020 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0021[ 12] = { /* code 0021 */
0x00, 0x00, 0x06, 0x31, 0x8C, 0x63, 0x18, 0x06,
0x30, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0022[ 16] = { /* code 0022 */
0x00, 0x00, 0x00, 0x06, 0xCD, 0x9B, 0x36, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0023[ 16] = { /* code 0023 */
0x00, 0x00, 0x00, 0x00, 0x04, 0x89, 0x7F, 0x24,
0x49, 0x27, 0xF4, 0x89, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0024[ 16] = { /* code 0024 */
0x00, 0x00, 0x00, 0x81, 0x0F, 0x31, 0x60, 0xE0,
0xF0, 0x70, 0x68, 0xCF, 0x08, 0x10, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0025[ 25] = { /* code 0025 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x22,
0x24, 0x84, 0x90, 0x64, 0x01, 0x30, 0x49, 0x09,
0x22, 0x24, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0026[ 25] = { /* code 0026 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C,
0x0C, 0xC1, 0x98, 0x1E, 0x07, 0x99, 0x9B, 0x31,
0xC6, 0x38, 0x7D, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0027[ 9] = { /* code 0027 */
0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0028[ 12] = { /* code 0028 */
0x00, 0x00, 0x01, 0x98, 0xCC, 0x63, 0x18, 0xC6,
0x18, 0xC3, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0029[ 12] = { /* code 0029 */
0x00, 0x00, 0x0C, 0x31, 0x86, 0x31, 0x8C, 0x63,
0x31, 0x98, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_002A[ 16] = { /* code 002A */
0x00, 0x00, 0x00, 0x01, 0x0A, 0x8E, 0x1C, 0x54,
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_002B[ 16] = { /* code 002B */
0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08, 0x11,
0xFC, 0x40, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_002C[ 9] = { /* code 002C */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x6C,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_002D[ 12] = { /* code 002D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_002E[ 9] = { /* code 002E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_002F[ 14] = { /* code 002F */
0x00, 0x00, 0x03, 0x0C, 0x61, 0x86, 0x30, 0xC3,
0x18, 0x61, 0x8C, 0x30, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0030[ 16] = { /* code 0030 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0x33, 0x66, 0xCD,
0x9B, 0x36, 0x6C, 0xCF, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0031[ 16] = { /* code 0031 */
0x00, 0x00, 0x00, 0x00, 0x06, 0x1C, 0x58, 0x30,
0x60, 0xC1, 0x83, 0x1F, 0x80, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0032[ 16] = { /* code 0032 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0x23, 0x06, 0x0C,
0x30, 0xC3, 0x0C, 0x1F, 0x80, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0033[ 16] = { /* code 0033 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0x23, 0x06, 0x0C,
0xF0, 0x30, 0x68, 0xCF, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0034[ 16] = { /* code 0034 */
0x00, 0x00, 0x00, 0x00, 0x03, 0x0E, 0x1C, 0x58,
0xB2, 0x67, 0xE1, 0x83, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0035[ 16] = { /* code 0035 */
0x00, 0x00, 0x00, 0x00, 0x1F, 0xB0, 0x60, 0xF8,
0x18, 0x30, 0x68, 0xCF, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0036[ 16] = { /* code 0036 */
0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x60, 0xF9,
0x9B, 0x36, 0x6C, 0xCF, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0037[ 16] = { /* code 0037 */
0x00, 0x00, 0x00, 0x00, 0x1F, 0x83, 0x0C, 0x18,
0x60, 0xC1, 0x86, 0x0C, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0038[ 16] = { /* code 0038 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0x33, 0x66, 0xCC,
0xF3, 0x36, 0x6C, 0xCF, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0039[ 16] = { /* code 0039 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0x33, 0x66, 0xCD,
0x99, 0xF0, 0x61, 0x9E, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_003A[ 9] = { /* code 003A */
0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x66, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_003B[ 9] = { /* code 003B */
0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x66, 0x6C,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_003C[ 16] = { /* code 003C */
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0C, 0x61,
0x01, 0x80, 0xC0, 0x40, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_003D[ 16] = { /* code 003D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE,
0x00, 0x07, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_003E[ 16] = { /* code 003E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x0C,
0x04, 0x31, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_003F[ 16] = { /* code 003F */
0x00, 0x00, 0x00, 0x03, 0x89, 0x83, 0x06, 0x38,
0x60, 0xC0, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0040[ 30] = { /* code 0040 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xE0, 0x60, 0xC6, 0x03, 0x37, 0xDB, 0x66,
0xDB, 0x66, 0xDB, 0x26, 0x6E, 0x30, 0x00, 0xC1,
0x03, 0xF0, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0041[ 21] = { /* code 0041 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x70,
0x6C, 0x36, 0x31, 0x98, 0xCF, 0xEC, 0x1E, 0x0C,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0042[ 18] = { /* code 0042 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x66, 0x66,
0x66, 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0043[ 18] = { /* code 0043 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x31, 0x60,
0x60, 0x60, 0x60, 0x60, 0x31, 0x1E, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0044[ 21] = { /* code 0044 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xE1, 0x98,
0xC6, 0x63, 0x31, 0x98, 0xCC, 0x66, 0x63, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0045[ 16] = { /* code 0045 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0xD8, 0x30, 0x60,
0xF9, 0x83, 0x06, 0x0F, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0046[ 16] = { /* code 0046 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0xD8, 0x30, 0x60,
0xF9, 0x83, 0x06, 0x0C, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0047[ 23] = { /* code 0047 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC3,
0x09, 0x80, 0x60, 0x19, 0xE6, 0x19, 0x86, 0x31,
0x87, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0048[ 21] = { /* code 0048 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x19, 0x8C,
0xC6, 0x63, 0x3F, 0x98, 0xCC, 0x66, 0x33, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0049[ 9] = { /* code 0049 */
0x00, 0x00, 0x06, 0x66, 0x66, 0x66, 0x66, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_004A[ 12] = { /* code 004A */
0x00, 0x00, 0x00, 0x18, 0xC6, 0x31, 0x8C, 0x63,
0x70, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_004B[ 18] = { /* code 004B */
0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x66, 0x66,
0x6C, 0x78, 0x6C, 0x66, 0x66, 0x63, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_004C[ 14] = { /* code 004C */
0x00, 0x00, 0x00, 0x01, 0x86, 0x18, 0x61, 0x86,
0x18, 0x61, 0xF0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_004D[ 30] = { /* code 004D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x38, 0x39, 0xC1, 0xCF, 0x1E, 0x68, 0xB3, 0x6D,
0x9B, 0x6C, 0xCA, 0x66, 0x73, 0x33, 0x98, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_004E[ 23] = { /* code 004E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x67,
0x19, 0xE6, 0x69, 0x9B, 0x66, 0x59, 0x9E, 0x63,
0x98, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_004F[ 23] = { /* code 004F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x83,
0x31, 0x86, 0x61, 0x98, 0x66, 0x19, 0x86, 0x33,
0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0050[ 18] = { /* code 0050 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x66, 0x66,
0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0051[ 23] = { /* code 0051 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x83,
0x31, 0x86, 0x61, 0x98, 0x66, 0x19, 0x86, 0x33,
0x07, 0xC0, 0x18, 0x03, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0052[ 18] = { /* code 0052 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x66, 0x66,
0x66, 0x7C, 0x6C, 0x66, 0x66, 0x66, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0053[ 16] = { /* code 0053 */
0x00, 0x00, 0x00, 0x00, 0x07, 0x19, 0x30, 0x70,
0x70, 0x70, 0x64, 0xC7, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0054[ 16] = { /* code 0054 */
0x00, 0x00, 0x00, 0x00, 0x1F, 0x8C, 0x18, 0x30,
0x60, 0xC1, 0x83, 0x06, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0055[ 23] = { /* code 0055 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x66,
0x19, 0x86, 0x61, 0x98, 0x66, 0x19, 0x86, 0x33,
0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0056[ 21] = { /* code 0056 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0F, 0x06,
0xC6, 0x63, 0x31, 0x8D, 0x86, 0xC1, 0xC0, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0057[ 32] = { /* code 0057 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x0C, 0x3C, 0x30, 0xF1, 0xE3, 0x67, 0x99,
0xB3, 0x66, 0xCD, 0x8E, 0x1C, 0x38, 0x70, 0xC0,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0058[ 18] = { /* code 0058 */
0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x66, 0x66,
0x3C, 0x18, 0x3C, 0x66, 0x66, 0xC3, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0059[ 18] = { /* code 0059 */
0x00, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x66, 0x66,
0x3C, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_005A[ 16] = { /* code 005A */
0x00, 0x00, 0x00, 0x00, 0x1F, 0xC1, 0x86, 0x18,
0x30, 0xC3, 0x0C, 0x1F, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_005B[ 12] = { /* code 005B */
0x00, 0x00, 0x07, 0x31, 0x8C, 0x63, 0x18, 0xC6,
0x31, 0x8E, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_005C[ 14] = { /* code 005C */
0x00, 0x00, 0x30, 0xC1, 0x86, 0x18, 0x30, 0xC3,
0x06, 0x18, 0x60, 0xC3, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_005D[ 12] = { /* code 005D */
0x00, 0x00, 0x07, 0x18, 0xC6, 0x31, 0x8C, 0x63,
0x18, 0xCE, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_005E[ 16] = { /* code 005E */
0x00, 0x00, 0x00, 0x00, 0x07, 0x0E, 0x36, 0x6D,
0x8F, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_005F[ 16] = { /* code 005F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0061[ 16] = { /* code 0061 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x8C,
0x19, 0xF6, 0x6C, 0xCF, 0x80, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0062[ 18] = { /* code 0062 */
0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x7C,
0x66, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0063[ 14] = { /* code 0063 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x65, 0x86,
0x18, 0x64, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0064[ 18] = { /* code 0064 */
0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x3E,
0x66, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0065[ 18] = { /* code 0065 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C,
0x66, 0x66, 0x7E, 0x60, 0x62, 0x3C, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0066[ 12] = { /* code 0066 */
0x00, 0x00, 0x03, 0xB1, 0x9E, 0x63, 0x18, 0xC6,
0x30, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0067[ 16] = { /* code 0067 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x6C,
0xD9, 0xB1, 0xC6, 0x07, 0x99, 0xB3, 0x3C, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0068[ 18] = { /* code 0068 */
0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x7C,
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0069[ 9] = { /* code 0069 */
0x00, 0x00, 0x66, 0x06, 0x66, 0x66, 0x66, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_006A[ 9] = { /* code 006A */
0x00, 0x00, 0x66, 0x06, 0x66, 0x66, 0x66, 0x66,
0xC0
};
const UCHAR abc_fontCalibriBoldBasic11_18h_006B[ 16] = { /* code 006B */
0x00, 0x00, 0x00, 0x06, 0x0C, 0x18, 0x33, 0x6C,
0xF1, 0xE3, 0x66, 0xCC, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_006C[ 9] = { /* code 006C */
0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_006D[ 27] = { /* code 006D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0xDC, 0x66, 0x66, 0x66, 0x66,
0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_006E[ 18] = { /* code 006E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C,
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_006F[ 18] = { /* code 006F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C,
0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0070[ 18] = { /* code 0070 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C,
0x66, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60,
0x60, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0071[ 18] = { /* code 0071 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E,
0x66, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x06, 0x06,
0x06, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0072[ 12] = { /* code 0072 */
0x00, 0x00, 0x00, 0x00, 0x0F, 0x63, 0x18, 0xC6,
0x30, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0073[ 14] = { /* code 0073 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x61, 0xC3,
0x86, 0x19, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0074[ 12] = { /* code 0074 */
0x00, 0x00, 0x00, 0x31, 0x9F, 0x63, 0x18, 0xC6,
0x1C, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0075[ 18] = { /* code 0075 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66,
0x66, 0x66, 0x66, 0x66, 0x66, 0x3E, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0076[ 16] = { /* code 0076 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xC6,
0xD9, 0xB3, 0x63, 0x87, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0077[ 25] = { /* code 0077 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x06, 0x23, 0xCE, 0x6D, 0xD9, 0xAB, 0x3D,
0xE3, 0x18, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0078[ 16] = { /* code 0078 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x6C,
0xD8, 0xE3, 0x66, 0xD8, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0079[ 16] = { /* code 0079 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xC6,
0xD9, 0xB3, 0x63, 0x87, 0x06, 0x18, 0x30, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_007A[ 14] = { /* code 007A */
0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x18, 0xC3,
0x0C, 0x61, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_007B[ 12] = { /* code 007B */
0x00, 0x00, 0x66, 0x31, 0x8C, 0x66, 0x18, 0xC6,
0x31, 0x86, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_007C[ 16] = { /* code 007C */
0x00, 0x00, 0x01, 0x83, 0x06, 0x0C, 0x18, 0x30,
0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_007D[ 12] = { /* code 007D */
0x00, 0x00, 0xC3, 0x18, 0xC6, 0x30, 0xCC, 0x63,
0x18, 0xCC, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_00E7[ 14] = { /* code 00E7 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x65, 0x86,
0x18, 0x64, 0xE1, 0x02, 0x30, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_00F1[ 18] = { /* code 00F1 */
0x00, 0x00, 0x00, 0x00, 0x1A, 0x2C, 0x00, 0x7C,
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0438[ 18] = { /* code 0438 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63,
0x67, 0x6F, 0x7B, 0x7B, 0x73, 0x63, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0439[ 18] = { /* code 0439 */
0x00, 0x00, 0x00, 0x00, 0x36, 0x1C, 0x00, 0x63,
0x67, 0x6F, 0x7B, 0x7B, 0x73, 0x63, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_043A[ 16] = { /* code 043A */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66,
0xD9, 0xE3, 0x66, 0x6C, 0xC0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0441[ 14] = { /* code 0441 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x65, 0x86,
0x18, 0x64, 0xE0, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_0443[ 16] = { /* code 0443 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x6C,
0xD9, 0xB1, 0x43, 0x87, 0x04, 0x18, 0x30, 0x00
};
const UCHAR abc_fontCalibriBoldBasic11_18h_2126[ 23] = { /* code 2126 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC3,
0x19, 0x83, 0x60, 0xD8, 0x36, 0x0D, 0x83, 0x31,
0x9E, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00
};
const BFC_CHARINFO fontCalibriBoldBasic11_18h_CharInfo[103] = {
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_000A} }, /* code 000A */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_000D} }, /* code 000D */
{ 3, 7, {abc_fontCalibriBoldBasic11_18h_0020} }, /* code 0020 */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_0021} }, /* code 0021 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0022} }, /* code 0022 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0023} }, /* code 0023 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0024} }, /* code 0024 */
{ 11, 25, {abc_fontCalibriBoldBasic11_18h_0025} }, /* code 0025 */
{ 11, 25, {abc_fontCalibriBoldBasic11_18h_0026} }, /* code 0026 */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_0027} }, /* code 0027 */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_0028} }, /* code 0028 */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_0029} }, /* code 0029 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_002A} }, /* code 002A */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_002B} }, /* code 002B */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_002C} }, /* code 002C */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_002D} }, /* code 002D */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_002E} }, /* code 002E */
{ 6, 14, {abc_fontCalibriBoldBasic11_18h_002F} }, /* code 002F */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0030} }, /* code 0030 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0031} }, /* code 0031 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0032} }, /* code 0032 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0033} }, /* code 0033 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0034} }, /* code 0034 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0035} }, /* code 0035 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0036} }, /* code 0036 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0037} }, /* code 0037 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0038} }, /* code 0038 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0039} }, /* code 0039 */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_003A} }, /* code 003A */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_003B} }, /* code 003B */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_003C} }, /* code 003C */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_003D} }, /* code 003D */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_003E} }, /* code 003E */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_003F} }, /* code 003F */
{ 13, 30, {abc_fontCalibriBoldBasic11_18h_0040} }, /* code 0040 */
{ 9, 21, {abc_fontCalibriBoldBasic11_18h_0041} }, /* code 0041 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0042} }, /* code 0042 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0043} }, /* code 0043 */
{ 9, 21, {abc_fontCalibriBoldBasic11_18h_0044} }, /* code 0044 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0045} }, /* code 0045 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0046} }, /* code 0046 */
{ 10, 23, {abc_fontCalibriBoldBasic11_18h_0047} }, /* code 0047 */
{ 9, 21, {abc_fontCalibriBoldBasic11_18h_0048} }, /* code 0048 */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_0049} }, /* code 0049 */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_004A} }, /* code 004A */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_004B} }, /* code 004B */
{ 6, 14, {abc_fontCalibriBoldBasic11_18h_004C} }, /* code 004C */
{ 13, 30, {abc_fontCalibriBoldBasic11_18h_004D} }, /* code 004D */
{ 10, 23, {abc_fontCalibriBoldBasic11_18h_004E} }, /* code 004E */
{ 10, 23, {abc_fontCalibriBoldBasic11_18h_004F} }, /* code 004F */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0050} }, /* code 0050 */
{ 10, 23, {abc_fontCalibriBoldBasic11_18h_0051} }, /* code 0051 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0052} }, /* code 0052 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0053} }, /* code 0053 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0054} }, /* code 0054 */
{ 10, 23, {abc_fontCalibriBoldBasic11_18h_0055} }, /* code 0055 */
{ 9, 21, {abc_fontCalibriBoldBasic11_18h_0056} }, /* code 0056 */
{ 14, 32, {abc_fontCalibriBoldBasic11_18h_0057} }, /* code 0057 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0058} }, /* code 0058 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0059} }, /* code 0059 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_005A} }, /* code 005A */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_005B} }, /* code 005B */
{ 6, 14, {abc_fontCalibriBoldBasic11_18h_005C} }, /* code 005C */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_005D} }, /* code 005D */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_005E} }, /* code 005E */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_005F} }, /* code 005F */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0061} }, /* code 0061 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0062} }, /* code 0062 */
{ 6, 14, {abc_fontCalibriBoldBasic11_18h_0063} }, /* code 0063 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0064} }, /* code 0064 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0065} }, /* code 0065 */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_0066} }, /* code 0066 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0067} }, /* code 0067 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0068} }, /* code 0068 */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_0069} }, /* code 0069 */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_006A} }, /* code 006A */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_006B} }, /* code 006B */
{ 4, 9, {abc_fontCalibriBoldBasic11_18h_006C} }, /* code 006C */
{ 12, 27, {abc_fontCalibriBoldBasic11_18h_006D} }, /* code 006D */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_006E} }, /* code 006E */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_006F} }, /* code 006F */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0070} }, /* code 0070 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0071} }, /* code 0071 */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_0072} }, /* code 0072 */
{ 6, 14, {abc_fontCalibriBoldBasic11_18h_0073} }, /* code 0073 */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_0074} }, /* code 0074 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0075} }, /* code 0075 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0076} }, /* code 0076 */
{ 11, 25, {abc_fontCalibriBoldBasic11_18h_0077} }, /* code 0077 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0078} }, /* code 0078 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0079} }, /* code 0079 */
{ 6, 14, {abc_fontCalibriBoldBasic11_18h_007A} }, /* code 007A */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_007B} }, /* code 007B */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_007C} }, /* code 007C */
{ 5, 12, {abc_fontCalibriBoldBasic11_18h_007D} }, /* code 007D */
{ 6, 14, {abc_fontCalibriBoldBasic11_18h_00E7} }, /* code 00E7 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_00F1} }, /* code 00F1 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0438} }, /* code 0438 */
{ 8, 18, {abc_fontCalibriBoldBasic11_18h_0439} }, /* code 0439 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_043A} }, /* code 043A */
{ 6, 14, {abc_fontCalibriBoldBasic11_18h_0441} }, /* code 0441 */
{ 7, 16, {abc_fontCalibriBoldBasic11_18h_0443} }, /* code 0443 */
{ 10, 23, {abc_fontCalibriBoldBasic11_18h_2126} } /* code 2126 */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop10 = {
0x2126, /* first character */
0x2126, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 102], /* address of first character */
(const BFC_FONT_PROP *)0 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop9 = {
0x0443, /* first character */
0x0443, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 101], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop10 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop8 = {
0x0441, /* first character */
0x0441, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 100], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop9 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop7 = {
0x0438, /* first character */
0x043A, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 97], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop8 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop6 = {
0x00F1, /* first character */
0x00F1, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 96], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop7 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop5 = {
0x00E7, /* first character */
0x00E7, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 95], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop6 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop4 = {
0x0061, /* first character */
0x007D, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 66], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop5 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop3 = {
0x0020, /* first character */
0x005F, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 2], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop4 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop2 = {
0x000D, /* first character */
0x000D, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 1], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop3 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic11_18h_Prop1 = {
0x000A, /* first character */
0x000A, /* last character */
&fontCalibriBoldBasic11_18h_CharInfo[ 0], /* address of first character */
&fontCalibriBoldBasic11_18h_Prop2 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT fontCalibriBoldBasic11_18h = {
0x01020802, /* font type = FONTTYPE_PROP | DATA_PACKED | ENCODING_UNICODE | DATALENGTH_8 */
18, /* font height in pixels */
14, /* font ascent (baseline) in pixels */
0 , /* reversed, =0 */
{&fontCalibriBoldBasic11_18h_Prop1}
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,912 @@
/*******************************************************************************
* *
* This file is generated by BitFontCreator Pro v3.8 *
* by Iseatech Software http://www.iseasoft.com/bitfontcreator.html *
* support@iseasoft.com *
* *
* Font name: Calibri *
* Font width: 0 (proportional font) *
* Font height: 23 *
* Encode: Unicode *
* Data length: 8 bits *
* Invert bits: No *
* Data format: Big Endian, Row based, Row preferred, Packed *
* *
* Create time: 17:16 04-07-2023 *
*******************************************************************************/
#include "bfcfont.h"
/* The following line needs to be included in any file selecting the
font.
*/
extern const BFC_FONT fontCalibriBoldBasic14_23h;
const UCHAR abc_fontCalibriBoldBasic14_23h_000A[ 29] = { /* code 000A */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
0xFA, 0x02, 0xBC, 0xA1, 0xA8, 0x6A, 0x1A, 0x9C,
0xA0, 0x29, 0x8A, 0x62, 0x80, 0xBF, 0xE0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_000D[ 29] = { /* code 000D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0020[ 12] = { /* code 0020 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0021[ 18] = { /* code 0021 */
0x00, 0x00, 0x00, 0x00, 0xC3, 0x0C, 0x30, 0xC3,
0x0C, 0x30, 0xC3, 0x00, 0x30, 0xC0, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0022[ 23] = { /* code 0022 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x6C, 0x6C,
0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0023[ 26] = { /* code 0023 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC,
0x66, 0x33, 0x7F, 0xFF, 0xE6, 0x66, 0x67, 0xFF,
0xFE, 0xCC, 0x66, 0x33, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0024[ 29] = { /* code 0024 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x01, 0x81,
0xF0, 0xFE, 0x60, 0x98, 0x07, 0x00, 0xF0, 0x0F,
0x00, 0xE0, 0x19, 0x06, 0x7F, 0x0F, 0x81, 0x80,
0x60, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0025[ 41] = { /* code 0025 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0x83, 0x33, 0x18, 0xCC, 0x63,
0x33, 0x0C, 0xD8, 0x1E, 0xC0, 0x03, 0x78, 0x1B,
0x30, 0xCC, 0xC6, 0x33, 0x18, 0xCC, 0xC1, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0026[ 38] = { /* code 0026 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0F, 0x80, 0xFE, 0x06, 0x30, 0x31, 0x81, 0xDC,
0x07, 0xC0, 0x7C, 0x67, 0x73, 0x31, 0xD9, 0x87,
0x8E, 0x1C, 0x3F, 0xF8, 0xF8, 0xC0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0027[ 12] = { /* code 0027 */
0x00, 0x00, 0x06, 0x66, 0x66, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0028[ 18] = { /* code 0028 */
0x00, 0x00, 0x00, 0x00, 0x63, 0x0C, 0x31, 0x86,
0x18, 0x61, 0x86, 0x18, 0x60, 0xC3, 0x0C, 0x18,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0029[ 18] = { /* code 0029 */
0x00, 0x00, 0x00, 0x01, 0x83, 0x0C, 0x30, 0x61,
0x86, 0x18, 0x61, 0x86, 0x18, 0xC3, 0x0C, 0x60,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_002A[ 26] = { /* code 002A */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x68,
0xEC, 0x18, 0x3B, 0x16, 0x83, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_002B[ 26] = { /* code 002B */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0C, 0x06, 0x03, 0x0F, 0xF7, 0xF8,
0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_002C[ 15] = { /* code 002C */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x31, 0x8C, 0xC6, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_002D[ 18] = { /* code 002D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x79, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_002E[ 15] = { /* code 002E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_002F[ 23] = { /* code 002F */
0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x06, 0x06,
0x06, 0x0C, 0x0C, 0x18, 0x18, 0x18, 0x30, 0x30,
0x60, 0x60, 0x60, 0xC0, 0xC0, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0030[ 29] = { /* code 0030 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0xE0, 0xFC, 0x73, 0x98, 0x66, 0x19, 0x86, 0x61,
0x98, 0x66, 0x19, 0xCE, 0x3F, 0x07, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0031[ 29] = { /* code 0031 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xC0, 0xF0, 0x7C, 0x13, 0x00, 0xC0, 0x30, 0x0C,
0x03, 0x00, 0xC0, 0x30, 0x7F, 0x9F, 0xE0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0032[ 29] = { /* code 0032 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0xE1, 0xFC, 0x43, 0x00, 0xC0, 0x30, 0x18, 0x06,
0x03, 0x01, 0x80, 0xC0, 0x7F, 0x9F, 0xE0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0033[ 29] = { /* code 0033 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0xE1, 0xFC, 0x43, 0x00, 0xC0, 0x30, 0xF8, 0x3E,
0x00, 0xC0, 0x31, 0x0C, 0x7F, 0x0F, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0034[ 29] = { /* code 0034 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0x3C, 0x0B, 0x06, 0xC3, 0x30, 0xCC, 0x63,
0x1F, 0xE7, 0xF8, 0x0C, 0x03, 0x00, 0xC0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0035[ 29] = { /* code 0035 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0xF1, 0xFC, 0x60, 0x18, 0x07, 0xE1, 0xFC, 0x03,
0x80, 0x60, 0x19, 0x0E, 0x7F, 0x0F, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0036[ 29] = { /* code 0036 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xF0, 0xFC, 0x30, 0x18, 0x06, 0xE1, 0xFC, 0x73,
0x98, 0x66, 0x19, 0xCE, 0x3F, 0x07, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0037[ 29] = { /* code 0037 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0xF9, 0xFE, 0x01, 0x80, 0xC0, 0x30, 0x18, 0x0E,
0x03, 0x01, 0xC0, 0x60, 0x38, 0x0C, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0038[ 29] = { /* code 0038 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0xF1, 0xFE, 0x61, 0x98, 0x67, 0x30, 0xF8, 0x1F,
0x0C, 0xE6, 0x19, 0x86, 0x7F, 0x8F, 0xC0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0039[ 29] = { /* code 0039 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0xE0, 0xFC, 0x73, 0x98, 0x66, 0x19, 0xCE, 0x3F,
0x87, 0x60, 0x18, 0x0C, 0x7F, 0x1F, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_003A[ 15] = { /* code 003A */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xC0,
0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_003B[ 15] = { /* code 003B */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xC0,
0x00, 0x00, 0x63, 0x19, 0x8C, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_003C[ 26] = { /* code 003C */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x03, 0x87, 0x8F, 0x06, 0x03, 0xC0,
0x78, 0x0E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_003D[ 26] = { /* code 003D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3F, 0xDF, 0xE0, 0x00, 0x03,
0xFD, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_003E[ 26] = { /* code 003E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x40, 0x38, 0x0F, 0x01, 0xE0, 0x30, 0x78,
0xF0, 0xE0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_003F[ 26] = { /* code 003F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE1, 0xF8,
0x8E, 0x03, 0x01, 0x81, 0xC3, 0xC1, 0x80, 0xC0,
0x00, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0040[ 49] = { /* code 0040 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x1F,
0xFC, 0x1C, 0x06, 0x1C, 0xD9, 0x8C, 0xFC, 0xCC,
0xCE, 0x66, 0x66, 0x33, 0x33, 0x39, 0x9F, 0xF8,
0xC7, 0x78, 0x70, 0x00, 0x1C, 0x08, 0x07, 0xFC,
0x01, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0041[ 35] = { /* code 0041 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0E, 0x00, 0xE0, 0x1B, 0x01, 0xB0, 0x1B,
0x03, 0x18, 0x31, 0x87, 0xFC, 0x7F, 0xC6, 0x0C,
0xC0, 0x6C, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0042[ 32] = { /* code 0042 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1F, 0xE3, 0xFE, 0x60, 0xCC, 0x19, 0x83, 0x3F,
0xC7, 0xFC, 0xC1, 0x98, 0x33, 0x06, 0x7F, 0xCF,
0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0043[ 29] = { /* code 0043 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xF8, 0xFF, 0x30, 0x58, 0x06, 0x01, 0x80, 0x60,
0x18, 0x06, 0x00, 0xC1, 0x3F, 0xC3, 0xE0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0044[ 35] = { /* code 0044 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7F, 0x07, 0xFC, 0x60, 0xC6, 0x06, 0x60,
0x66, 0x06, 0x60, 0x66, 0x06, 0x60, 0x66, 0x0C,
0x7F, 0xC7, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0045[ 26] = { /* code 0045 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFC,
0xFE, 0x60, 0x30, 0x18, 0x0F, 0xC7, 0xE3, 0x01,
0x80, 0xC0, 0x7F, 0x3F, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0046[ 26] = { /* code 0046 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFC,
0xFE, 0x60, 0x30, 0x18, 0x0F, 0xC7, 0xE3, 0x01,
0x80, 0xC0, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0047[ 35] = { /* code 0047 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0F, 0xC3, 0xFE, 0x30, 0x26, 0x00, 0x60,
0x06, 0x3E, 0x63, 0xE6, 0x06, 0x60, 0x63, 0x06,
0x3F, 0xE0, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0048[ 35] = { /* code 0048 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x66, 0x06, 0x60, 0x66, 0x06, 0x60,
0x67, 0xFE, 0x7F, 0xE6, 0x06, 0x60, 0x66, 0x06,
0x60, 0x66, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0049[ 15] = { /* code 0049 */
0x00, 0x00, 0x00, 0x01, 0x8C, 0x63, 0x18, 0xC6,
0x31, 0x8C, 0x63, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_004A[ 18] = { /* code 004A */
0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0x18, 0x61,
0x86, 0x18, 0x61, 0xA6, 0xF9, 0xC0, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_004B[ 29] = { /* code 004B */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
0x0D, 0x87, 0x63, 0x99, 0xC6, 0xE1, 0xF0, 0x7C,
0x1B, 0x86, 0x71, 0x9C, 0x63, 0x98, 0x70, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_004C[ 23] = { /* code 004C */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60,
0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60,
0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_004D[ 49] = { /* code 004D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0xC0, 0x38, 0xE0,
0x1C, 0x78, 0x1E, 0x3C, 0x0F, 0x1B, 0x0D, 0x8D,
0x86, 0xC6, 0x66, 0x63, 0x33, 0x31, 0x8F, 0x18,
0xC7, 0x8C, 0x61, 0x86, 0x30, 0xC3, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_004E[ 38] = { /* code 004E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xC0, 0xCF, 0x06, 0x78, 0x33, 0x61,
0x9B, 0x8C, 0xCC, 0x66, 0x33, 0x31, 0xD9, 0x86,
0xCC, 0x1E, 0x60, 0xF3, 0x03, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_004F[ 38] = { /* code 004F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3E, 0x07, 0xFC, 0x30, 0x63, 0x01,
0x98, 0x0C, 0xC0, 0x66, 0x03, 0x30, 0x19, 0x80,
0xC6, 0x0C, 0x3F, 0xE0, 0x7C, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0050[ 29] = { /* code 0050 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0xE1, 0xFC, 0x63, 0x98, 0x66, 0x19, 0x8E, 0x7F,
0x1F, 0x86, 0x01, 0x80, 0x60, 0x18, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0051[ 38] = { /* code 0051 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3E, 0x07, 0xFC, 0x30, 0x63, 0x01,
0x98, 0x0C, 0xC0, 0x66, 0x03, 0x30, 0x19, 0x80,
0xC6, 0x0C, 0x3F, 0xC0, 0x7F, 0x00, 0x1E, 0x00,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0052[ 32] = { /* code 0052 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1F, 0xC3, 0xFC, 0x61, 0x8C, 0x31, 0x86, 0x3F,
0x87, 0xE0, 0xC6, 0x18, 0x63, 0x0C, 0x60, 0xCC,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0053[ 26] = { /* code 0053 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78,
0x7E, 0x61, 0x30, 0x1C, 0x07, 0x81, 0xE0, 0x38,
0x0C, 0x86, 0x7E, 0x1E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0054[ 26] = { /* code 0054 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFD,
0xFE, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0,
0x60, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0055[ 35] = { /* code 0055 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x66, 0x06, 0x60, 0x66, 0x06, 0x60,
0x66, 0x06, 0x60, 0x66, 0x06, 0x60, 0x67, 0x0E,
0x3F, 0xC1, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0056[ 32] = { /* code 0056 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x30, 0x1E, 0x03, 0x60, 0xCC, 0x19, 0x83, 0x18,
0xC3, 0x18, 0x36, 0x06, 0xC0, 0xD8, 0x0E, 0x01,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0057[ 49] = { /* code 0057 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x82, 0x0C, 0xC3,
0x86, 0x61, 0xC3, 0x18, 0xE3, 0x0C, 0xD9, 0x86,
0x6C, 0xC1, 0xB6, 0xC0, 0xF1, 0xE0, 0x78, 0xF0,
0x1C, 0x70, 0x0C, 0x18, 0x06, 0x0C, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0058[ 29] = { /* code 0058 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
0x19, 0x8C, 0x63, 0x0D, 0x83, 0x60, 0x70, 0x1C,
0x0D, 0x83, 0x61, 0x8C, 0x63, 0x30, 0x60, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0059[ 29] = { /* code 0059 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
0x19, 0x86, 0x33, 0x0C, 0xC1, 0xE0, 0x78, 0x0C,
0x03, 0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_005A[ 26] = { /* code 005A */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF,
0xFF, 0x03, 0x83, 0x83, 0x83, 0x81, 0x81, 0xC1,
0xC1, 0xC0, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_005B[ 18] = { /* code 005B */
0x00, 0x00, 0x00, 0x01, 0xE7, 0x98, 0x61, 0x86,
0x18, 0x61, 0x86, 0x18, 0x61, 0x86, 0x1E, 0x78,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_005C[ 23] = { /* code 005C */
0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x60, 0x60,
0x60, 0x30, 0x30, 0x18, 0x18, 0x18, 0x0C, 0x0C,
0x06, 0x06, 0x06, 0x03, 0x03, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_005D[ 18] = { /* code 005D */
0x00, 0x00, 0x00, 0x01, 0xE7, 0x86, 0x18, 0x61,
0x86, 0x18, 0x61, 0x86, 0x18, 0x61, 0x9E, 0x78,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_005E[ 26] = { /* code 005E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
0x7C, 0x36, 0x31, 0x98, 0xD8, 0x3C, 0x18, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_005F[ 26] = { /* code 005F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xF8,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0061[ 26] = { /* code 0061 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1F, 0x1F, 0xC8, 0x60, 0x31, 0xF9,
0x8C, 0xC6, 0x7F, 0x1D, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0062[ 29] = { /* code 0062 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x06,
0x01, 0x80, 0x60, 0x1B, 0x87, 0xF1, 0xCE, 0x61,
0x98, 0x66, 0x19, 0xCE, 0x7F, 0x1B, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0063[ 23] = { /* code 0063 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1C, 0x3E, 0x72, 0x60, 0x60, 0x60, 0x72,
0x3E, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0064[ 29] = { /* code 0064 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x18, 0x06, 0x01, 0x87, 0x63, 0xF9, 0xCE, 0x61,
0x98, 0x66, 0x19, 0xCE, 0x3F, 0x87, 0x60, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0065[ 29] = { /* code 0065 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x83, 0xF1, 0xCE, 0x61,
0x9F, 0xE6, 0x01, 0xC2, 0x3F, 0x87, 0xC0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0066[ 18] = { /* code 0066 */
0x00, 0x00, 0x00, 0x00, 0x73, 0xCC, 0x31, 0xF7,
0xCC, 0x30, 0xC3, 0x0C, 0x30, 0xC0, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0067[ 26] = { /* code 0067 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1F, 0x9F, 0xCC, 0xC6, 0x63, 0xF0,
0xF0, 0xC0, 0x7E, 0x7F, 0xB0, 0xDF, 0xE7, 0xC0,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0068[ 29] = { /* code 0068 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x06,
0x01, 0x80, 0x60, 0x1B, 0xC7, 0xF9, 0xC6, 0x61,
0x98, 0x66, 0x19, 0x86, 0x61, 0x98, 0x60, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0069[ 15] = { /* code 0069 */
0x00, 0x00, 0x00, 0x01, 0x8C, 0x03, 0x18, 0xC6,
0x31, 0x8C, 0x63, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_006A[ 15] = { /* code 006A */
0x00, 0x00, 0x00, 0x00, 0xC6, 0x01, 0x8C, 0x63,
0x18, 0xC6, 0x31, 0x8D, 0xEE, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_006B[ 26] = { /* code 006B */
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x80,
0xC0, 0x60, 0x31, 0xD9, 0xCD, 0xC7, 0xC3, 0xE1,
0xB8, 0xCE, 0x63, 0xB0, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_006C[ 15] = { /* code 006C */
0x00, 0x00, 0x00, 0x31, 0x8C, 0x63, 0x18, 0xC6,
0x31, 0x8C, 0x63, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_006D[ 44] = { /* code 006D */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xDC, 0xE1, 0xFF, 0xE3, 0x9C, 0xC6, 0x31,
0x8C, 0x63, 0x18, 0xC6, 0x31, 0x8C, 0x63, 0x18,
0xC6, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_006E[ 29] = { /* code 006E */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1B, 0xC7, 0xF9, 0xC6, 0x61,
0x98, 0x66, 0x19, 0x86, 0x61, 0x98, 0x60, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_006F[ 29] = { /* code 006F */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x83, 0xF1, 0xCE, 0x61,
0x98, 0x66, 0x19, 0xCE, 0x3F, 0x07, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0070[ 29] = { /* code 0070 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1B, 0x87, 0xF1, 0xCE, 0x61,
0x98, 0x66, 0x19, 0xCE, 0x7F, 0x1B, 0x86, 0x01,
0x80, 0x60, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0071[ 29] = { /* code 0071 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x63, 0xF9, 0xCE, 0x61,
0x98, 0x66, 0x19, 0xCE, 0x3F, 0x87, 0x60, 0x18,
0x06, 0x01, 0x80, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0072[ 21] = { /* code 0072 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xD9, 0xF3, 0x86, 0x0C, 0x18, 0x30, 0x60, 0xC0,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0073[ 23] = { /* code 0073 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3C, 0x7E, 0x62, 0x70, 0x3C, 0x0E, 0x46,
0x7E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0074[ 21] = { /* code 0074 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30,
0xF9, 0xF1, 0x83, 0x06, 0x0C, 0x18, 0x3C, 0x38,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0075[ 29] = { /* code 0075 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0x66, 0x19, 0x86, 0x61,
0x98, 0x66, 0x19, 0x8E, 0x7F, 0x8F, 0x60, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0076[ 26] = { /* code 0076 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x60, 0xF0, 0x6C, 0x66, 0x33, 0x18,
0xD8, 0x6C, 0x1C, 0x0E, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0077[ 41] = { /* code 0077 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x0C, 0x3C, 0x30, 0xD9, 0xE6, 0x67, 0x99, 0x92,
0x63, 0xCF, 0x0F, 0x3C, 0x18, 0x60, 0x61, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0078[ 26] = { /* code 0078 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x31, 0x98, 0xC6, 0xC3, 0xE0, 0xE0,
0xF8, 0x6C, 0x63, 0x31, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0079[ 26] = { /* code 0079 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x60, 0xF0, 0x6C, 0x66, 0x33, 0x18,
0xD8, 0x6C, 0x1C, 0x06, 0x03, 0x03, 0x01, 0x80,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_007A[ 23] = { /* code 007A */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7E, 0x7E, 0x06, 0x0C, 0x18, 0x30, 0x60,
0x7E, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_007B[ 21] = { /* code 007B */
0x00, 0x00, 0x00, 0x00, 0x01, 0xC7, 0x8C, 0x18,
0x30, 0x60, 0xC7, 0x0E, 0x06, 0x0C, 0x18, 0x30,
0x60, 0xF0, 0xE0, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_007C[ 26] = { /* code 007C */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x60,
0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80, 0xC0,
0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x80,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_007D[ 21] = { /* code 007D */
0x00, 0x00, 0x00, 0x00, 0x1C, 0x3C, 0x18, 0x30,
0x60, 0xC1, 0x81, 0xC3, 0x8C, 0x18, 0x30, 0x60,
0xC7, 0x8E, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_00E7[ 23] = { /* code 00E7 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1C, 0x3E, 0x72, 0x60, 0x60, 0x60, 0x72,
0x3E, 0x1C, 0x0C, 0x3C, 0x38, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_00F1[ 29] = { /* code 00F1 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x43,
0xF0, 0x98, 0x00, 0x1B, 0xC7, 0xF9, 0xC6, 0x61,
0x98, 0x66, 0x19, 0x86, 0x61, 0x98, 0x60, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0438[ 32] = { /* code 0438 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0C, 0x31, 0x8E, 0x33,
0xC6, 0xF8, 0xDB, 0x1E, 0x63, 0xCC, 0x71, 0x8C,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0439[ 32] = { /* code 0439 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63,
0x0F, 0xE0, 0xF8, 0x00, 0x0C, 0x31, 0x8E, 0x33,
0xC6, 0xF8, 0xDB, 0x1E, 0x63, 0xCC, 0x71, 0x8C,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_043A[ 26] = { /* code 043A */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x30, 0xD8, 0xCC, 0xE7, 0xE3, 0xF1,
0x9C, 0xC6, 0x63, 0xB0, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0441[ 23] = { /* code 0441 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1E, 0x3F, 0x71, 0x60, 0x60, 0x60, 0x71,
0x3F, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_0443[ 26] = { /* code 0443 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x61, 0xD8, 0xCC, 0x67, 0x71, 0xB0,
0xD8, 0x7C, 0x1C, 0x0E, 0x07, 0x03, 0x81, 0xC0,
0x00, 0x00
};
const UCHAR abc_fontCalibriBoldBasic14_23h_2126[ 38] = { /* code 2126 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3E, 0x03, 0xFC, 0x38, 0x63, 0x81,
0x98, 0x0C, 0xC0, 0x66, 0x03, 0x30, 0x18, 0xC1,
0x87, 0x1C, 0x7D, 0xF3, 0xEF, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const BFC_CHARINFO fontCalibriBoldBasic14_23h_CharInfo[103] = {
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_000A} }, /* code 000A */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_000D} }, /* code 000D */
{ 4, 12, {abc_fontCalibriBoldBasic14_23h_0020} }, /* code 0020 */
{ 6, 18, {abc_fontCalibriBoldBasic14_23h_0021} }, /* code 0021 */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_0022} }, /* code 0022 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0023} }, /* code 0023 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0024} }, /* code 0024 */
{ 14, 41, {abc_fontCalibriBoldBasic14_23h_0025} }, /* code 0025 */
{ 13, 38, {abc_fontCalibriBoldBasic14_23h_0026} }, /* code 0026 */
{ 4, 12, {abc_fontCalibriBoldBasic14_23h_0027} }, /* code 0027 */
{ 6, 18, {abc_fontCalibriBoldBasic14_23h_0028} }, /* code 0028 */
{ 6, 18, {abc_fontCalibriBoldBasic14_23h_0029} }, /* code 0029 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_002A} }, /* code 002A */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_002B} }, /* code 002B */
{ 5, 15, {abc_fontCalibriBoldBasic14_23h_002C} }, /* code 002C */
{ 6, 18, {abc_fontCalibriBoldBasic14_23h_002D} }, /* code 002D */
{ 5, 15, {abc_fontCalibriBoldBasic14_23h_002E} }, /* code 002E */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_002F} }, /* code 002F */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0030} }, /* code 0030 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0031} }, /* code 0031 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0032} }, /* code 0032 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0033} }, /* code 0033 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0034} }, /* code 0034 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0035} }, /* code 0035 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0036} }, /* code 0036 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0037} }, /* code 0037 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0038} }, /* code 0038 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0039} }, /* code 0039 */
{ 5, 15, {abc_fontCalibriBoldBasic14_23h_003A} }, /* code 003A */
{ 5, 15, {abc_fontCalibriBoldBasic14_23h_003B} }, /* code 003B */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_003C} }, /* code 003C */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_003D} }, /* code 003D */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_003E} }, /* code 003E */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_003F} }, /* code 003F */
{ 17, 49, {abc_fontCalibriBoldBasic14_23h_0040} }, /* code 0040 */
{ 12, 35, {abc_fontCalibriBoldBasic14_23h_0041} }, /* code 0041 */
{ 11, 32, {abc_fontCalibriBoldBasic14_23h_0042} }, /* code 0042 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0043} }, /* code 0043 */
{ 12, 35, {abc_fontCalibriBoldBasic14_23h_0044} }, /* code 0044 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0045} }, /* code 0045 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0046} }, /* code 0046 */
{ 12, 35, {abc_fontCalibriBoldBasic14_23h_0047} }, /* code 0047 */
{ 12, 35, {abc_fontCalibriBoldBasic14_23h_0048} }, /* code 0048 */
{ 5, 15, {abc_fontCalibriBoldBasic14_23h_0049} }, /* code 0049 */
{ 6, 18, {abc_fontCalibriBoldBasic14_23h_004A} }, /* code 004A */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_004B} }, /* code 004B */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_004C} }, /* code 004C */
{ 17, 49, {abc_fontCalibriBoldBasic14_23h_004D} }, /* code 004D */
{ 13, 38, {abc_fontCalibriBoldBasic14_23h_004E} }, /* code 004E */
{ 13, 38, {abc_fontCalibriBoldBasic14_23h_004F} }, /* code 004F */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0050} }, /* code 0050 */
{ 13, 38, {abc_fontCalibriBoldBasic14_23h_0051} }, /* code 0051 */
{ 11, 32, {abc_fontCalibriBoldBasic14_23h_0052} }, /* code 0052 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0053} }, /* code 0053 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0054} }, /* code 0054 */
{ 12, 35, {abc_fontCalibriBoldBasic14_23h_0055} }, /* code 0055 */
{ 11, 32, {abc_fontCalibriBoldBasic14_23h_0056} }, /* code 0056 */
{ 17, 49, {abc_fontCalibriBoldBasic14_23h_0057} }, /* code 0057 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0058} }, /* code 0058 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0059} }, /* code 0059 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_005A} }, /* code 005A */
{ 6, 18, {abc_fontCalibriBoldBasic14_23h_005B} }, /* code 005B */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_005C} }, /* code 005C */
{ 6, 18, {abc_fontCalibriBoldBasic14_23h_005D} }, /* code 005D */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_005E} }, /* code 005E */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_005F} }, /* code 005F */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0061} }, /* code 0061 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0062} }, /* code 0062 */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_0063} }, /* code 0063 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0064} }, /* code 0064 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0065} }, /* code 0065 */
{ 6, 18, {abc_fontCalibriBoldBasic14_23h_0066} }, /* code 0066 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0067} }, /* code 0067 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0068} }, /* code 0068 */
{ 5, 15, {abc_fontCalibriBoldBasic14_23h_0069} }, /* code 0069 */
{ 5, 15, {abc_fontCalibriBoldBasic14_23h_006A} }, /* code 006A */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_006B} }, /* code 006B */
{ 5, 15, {abc_fontCalibriBoldBasic14_23h_006C} }, /* code 006C */
{ 15, 44, {abc_fontCalibriBoldBasic14_23h_006D} }, /* code 006D */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_006E} }, /* code 006E */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_006F} }, /* code 006F */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0070} }, /* code 0070 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0071} }, /* code 0071 */
{ 7, 21, {abc_fontCalibriBoldBasic14_23h_0072} }, /* code 0072 */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_0073} }, /* code 0073 */
{ 7, 21, {abc_fontCalibriBoldBasic14_23h_0074} }, /* code 0074 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_0075} }, /* code 0075 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0076} }, /* code 0076 */
{ 14, 41, {abc_fontCalibriBoldBasic14_23h_0077} }, /* code 0077 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0078} }, /* code 0078 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0079} }, /* code 0079 */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_007A} }, /* code 007A */
{ 7, 21, {abc_fontCalibriBoldBasic14_23h_007B} }, /* code 007B */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_007C} }, /* code 007C */
{ 7, 21, {abc_fontCalibriBoldBasic14_23h_007D} }, /* code 007D */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_00E7} }, /* code 00E7 */
{ 10, 29, {abc_fontCalibriBoldBasic14_23h_00F1} }, /* code 00F1 */
{ 11, 32, {abc_fontCalibriBoldBasic14_23h_0438} }, /* code 0438 */
{ 11, 32, {abc_fontCalibriBoldBasic14_23h_0439} }, /* code 0439 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_043A} }, /* code 043A */
{ 8, 23, {abc_fontCalibriBoldBasic14_23h_0441} }, /* code 0441 */
{ 9, 26, {abc_fontCalibriBoldBasic14_23h_0443} }, /* code 0443 */
{ 13, 38, {abc_fontCalibriBoldBasic14_23h_2126} } /* code 2126 */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop10 = {
0x2126, /* first character */
0x2126, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 102], /* address of first character */
(const BFC_FONT_PROP *)0 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop9 = {
0x0443, /* first character */
0x0443, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 101], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop10 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop8 = {
0x0441, /* first character */
0x0441, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 100], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop9 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop7 = {
0x0438, /* first character */
0x043A, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 97], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop8 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop6 = {
0x00F1, /* first character */
0x00F1, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 96], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop7 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop5 = {
0x00E7, /* first character */
0x00E7, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 95], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop6 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop4 = {
0x0061, /* first character */
0x007D, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 66], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop5 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop3 = {
0x0020, /* first character */
0x005F, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 2], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop4 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop2 = {
0x000D, /* first character */
0x000D, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 1], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop3 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT_PROP fontCalibriBoldBasic14_23h_Prop1 = {
0x000A, /* first character */
0x000A, /* last character */
&fontCalibriBoldBasic14_23h_CharInfo[ 0], /* address of first character */
&fontCalibriBoldBasic14_23h_Prop2 /* pointer to next BFC_FONT_PROP */
};
const BFC_FONT fontCalibriBoldBasic14_23h = {
0x01020802, /* font type = FONTTYPE_PROP | DATA_PACKED | ENCODING_UNICODE | DATALENGTH_8 */
23, /* font height in pixels */
18, /* font ascent (baseline) in pixels */
0 , /* reversed, =0 */
{&fontCalibriBoldBasic14_23h_Prop1}
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

137
source/Fonts/bfcfont.h Normal file
View File

@@ -0,0 +1,137 @@
/****************************************************************************
* *
* Copyright (c) 2012, Iseatech Software. All rights reserved. *
* Internet: http://www.iseasoft.com/bitfontcreator.htm *
* Support: support@iseatech.com *
* *
*****************************************************************************
* *
* @file bfcfont.h *
* @version 0.3.1.0 *
* @date Mar-28-2016 *
* @brief BitFontCreator (Pro & Grayscale) font header include file *
* *
*****************************************************************************/
#ifndef _BFC_FONT_H_
#define _BFC_FONT_H_
#define UCHAR unsigned char
#define USHORT unsigned short
#define ULONG unsigned long
#define FONTTYPE_MONO (1<<0) /* Is monospaced font */
#define FONTTYPE_PROP (1<<1) /* Is proportional font */
#define FONTTYPE_MONO_AA2 (1<<2) /* Is an antialiased mono font, 2bpp */
#define FONTTYPE_MONO_AA4 (1<<3) /* Is an antialiased mono font, 4bpp */
#define FONTTYPE_MONO_AA8 (1<<4) /* Is an antialiased mono font, 8bpp */
#define FONTTYPE_PROP_AA2 (1<<5) /* Is an antialiased prop font, 2bpp */
#define FONTTYPE_PROP_AA4 (1<<6) /* Is an antialiased prop font, 4bpp */
#define FONTTYPE_PROP_AA8 (1<<7) /* Is an antialiased prop font, 8bpp */
/* the following 4 flags are added since BitFontCreator Pro v3.7 & Grayscale v4.5 */
#define LITTLEENDIAN (1<<8) /* Is Little Endian if set, or is Big Endian (default) */ //LITTLE_ENDIAN already defined. 2/9/22 bkb
#define COLUMN_BASED (1<<9) /* Is Column if set, or is Row (default) */
#define COLUMN_PREFERRED (1<<10) /* Is Column if set, or is Row (default) */
#define DATA_PACKED (1<<11) /* Is Packed if set, or is Unpacked (default) */
#define ENCODING_ASCII (1<<16) /* Character encoding: Ascii + ISO8859 */
#define ENCODING_UNICODE (1<<17) /* Character encoding: Unicode */
#define ENCODING_SHIFTJIS (1<<18) /* Character encoding: Shift_JIS */
#define ENCODING_BIG5 (1<<19) /* Character encoding: Big5 */
#define ENCODING_GBK (1<<20) /* Character encoding: GBK */
#define ENCODING_JOHAB (1<<21) /* Character encoding: Johab */
#define DATALENGTH_8 (1<<24) /* Data length: 8 bits per unit (1 byte) */
#define DATALENGTH_16 (1<<25) /* Data length: 16 bits per unit (2 bytes) */
#define DATALENGTH_32 (1<<26) /* Data length: 32 bits per unit (4 bytes) */
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
* C font structures
**********************************************************************/
typedef struct BFC_CHARINFO
{
USHORT Width; /* character width in pixels */
USHORT DataSize; /* # bytes/words/dwords of pixel data */
union
{
const void *pData;
const UCHAR *pData8; /* pixel data in bytes */
const USHORT *pData16; /* pixel data in words */
const ULONG *pData32; /* pixel data in dwords */
} p;
} BFC_CHARINFO;
typedef struct BFC_FONT_PROP //proportional font
{
USHORT FirstChar; /* index of first character */
USHORT LastChar; /* index of last character */
const BFC_CHARINFO *pFirstCharInfo; /* address of first character */
const struct BFC_FONT_PROP *pNextProp; /* pointer to next BFC_FONT_PROP */
} BFC_FONT_PROP;
typedef struct BFC_FONT_MONO //monospace font
{
USHORT FirstChar; /* index of first character */
USHORT LastChar; /* index of last character */
USHORT FontWidth; /* font width in pixels */
USHORT DataSize; /* # bytes/words/dwords data of single character */
union
{
const void *pData;
const UCHAR *pData8; /* pixel data in bytes */
const USHORT *pData16; /* pixel data in words */
const ULONG *pData32; /* pixel data in dwords */
} p;
} BFC_FONT_MONO;
typedef struct
{
ULONG FontType; /* font type */
USHORT FontHeight; /* font height in pixels */
USHORT Baseline; /* font ascent (baseline) in pixels */
ULONG Reversed; /* reversed, =0 */
union
{
const void * pData;
const BFC_FONT_MONO * pMono; /* point to Monospaced font */
const BFC_FONT_PROP * pProp; /* point to proportional font */
} p;
} BFC_FONT;
/*********************************************************************
* Binary font structures (BIN)
**********************************************************************/
typedef struct
{
ULONG FontType; /* font type */
USHORT FontHeight; /* font height in pixels */
USHORT Baseline; /* font ascent (baseline) in pixels */
USHORT Reversed; /* reversed, =0 */
USHORT NumRanges; /* number of character ranges */
} BFC_BIN_FONT;
typedef struct
{
USHORT FirstChar; /* index of first character */
USHORT LastChar; /* index of last charcter */
} BFC_BIN_CHARRANGE;
typedef struct
{
USHORT Width; /* character width in pixels */
USHORT DataSize; /* # bytes/words/dwords of pixel data */
ULONG OffData; /* Offset of pixel data */
} BFC_BIN_CHARINFO;
#ifdef __cplusplus
}
#endif
#endif //#ifndef _BFC_FONT_H_

278
source/Fonts/fontLibrary.c Normal file
View File

@@ -0,0 +1,278 @@
/*
* fontLibrary.c
*
* Created on: Feb 9, 2022
* Author: Brian.Bailey
*/
#include <stdint.h>
#include <string.h>
#include "fontLibrary.h"
#include "translate.h"
#include "lcd.h"
#include "System/system.h"
//UTF8 Decode
// Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
#define UTF8_ACCEPT 0
#define UTF8_REJECT 1
static const uint8_t utf8d[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 40..5f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 60..7f
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, // 80..9f
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, // a0..bf
8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, // c0..df
0xa,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x4,0x3,0x3, // e0..ef
0xb,0x6,0x6,0x6,0x5,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, // f0..ff
0x0,0x1,0x2,0x3,0x5,0x8,0x7,0x1,0x1,0x1,0x4,0x6,0x1,0x1,0x1,0x1, // s0..s0
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,1,1,1,1, // s1..s2
1,2,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1, // s3..s4
1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,3,1,1,1,1,1,1, // s5..s6
1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // s7..s8
};
uint32_t FL_Decode(uint32_t* state, uint32_t* codep, uint32_t byte) //removed inline to make compiler happy
{
uint32_t type = utf8d[byte];
*codep = (*state != UTF8_ACCEPT) ?
(byte & 0x3fu) | (*codep << 6) :
(0xff >> type) & (byte);
*state = utf8d[256 + *state*16 + type];
return *state;
}
/**
* Get information about first codepoint in a UTF8-encoded string
*
* \param str UTF8-encoded string
* \param codepoint Font to draw string in
* \param charCount number of characters in the codepoint
* \return UTF8_ACCEPT if valid, UTF8_REJECT otherwise
*/
uint32_t FL_GetCodepointInfo(const char * str, uint32_t * codepoint, uint32_t * charCount)
{
uint32_t state = 0;
uint32_t count = 0; //character count
for(; *str; ++str)
{
count++;
if(!FL_Decode(&state, codepoint, *str))
{
//found the codepoint
*charCount = count;
return state;
}
}
}
uint32_t FL_GetFontHeight(const BFC_FONT * font)
{
return font->FontHeight;
}
//
void FL_DrawTranslatedString(const char *str, int16_t x, int16_t y, const BFC_FONT *pFont, LCD_DRAWMODE_t drawMode, FL_ALIGN align)
{
if(SYS_GetLanguage() < LANG_CHINESE) //Use normal fonts if language NOT Chinese or Korean
{
FL_DrawString(Translate(str), x, y, pFont, drawMode, align);
}
else //Chinese or Korean - Use simsun font
{
//if translate returns different pointer, the translation was not found.
char * strTranslated = 0;
strTranslated = (char *)Translate(str);
if(strTranslated == str)
{
//Translation string not found. Use English (So we can see the problem!)
FL_DrawString(Translate(str), x, y, pFont, drawMode, align);
}
else
{
//Translation successful
FL_DrawString(Translate(str), x, y, fontSimsun, drawMode, align);
}
}
//FL_DrawString(Translate(str), x, y, pFont, drawMode, align);
}
//Draw a null terminated UTF8 encoded string
void FL_DrawString(const char *str, int16_t x, int16_t y, const BFC_FONT *pFont, LCD_DRAWMODE_t drawMode, FL_ALIGN align)
{
switch(align)
{
case FL_ALIGN_LEFT:
break;
case FL_ALIGN_CENTER:
x -= (FL_GetStringLengthInPixels(str, pFont)) >> 1;
break;
case FL_ALIGN_RIGHT:
x -= FL_GetStringLengthInPixels(str, pFont);
break;
default:
break;
}
uint32_t error = 0;
uint32_t index = 0;
while(str[index] != '\0' && !error)
{
uint32_t codepoint; //UTF8 code
uint32_t charCount; //number of chars in the current codepoint
if(FL_GetCodepointInfo(&str[index], &codepoint, &charCount))
{
codepoint = 0x000A; //not valid UTF8 codepoint so return a distinctive char
charCount = 1; //assume 1 byte consumed. It might be wrong but we won't skip any bytes
}
index += charCount; //Advance index by number of chars consumed from string
x += FL_DrawChar(codepoint, x, y, pFont, drawMode); //advance x coordinate by glyph width
}
}
/* Draw a character to the framebuffer
* Encode: Unicode
* Data length: 8 bits
* Invert bits: No
* 1 bpp
* Data format: Big Endian, Row based, Row preferred, Packed
*/
uint32_t FL_DrawChar(uint16_t codepoint, int x0, int y0, const BFC_FONT *pFont, LCD_DRAWMODE_t drawMode)
{
// 1. find the character information first
const BFC_CHARINFO *pCharInfo = FL_GetCharInfo(pFont, (unsigned short)codepoint); //cast for this function
if( pCharInfo != 0 )
{
int height = pFont->FontHeight;
int width = pCharInfo->Width;
int data_size = pCharInfo->DataSize; // # bytes of the data array
const unsigned char *pData = pCharInfo->p.pData8; // pointer to data array
int x, y; //pixel coordinates within the glyph
unsigned char data;
uint32_t packedDataSize = 8; //8-bit data ONLY
uint32_t bitPosition = packedDataSize-1; //bit position in the byte
uint32_t byteIndex = 0;
unsigned char bitMask[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
// 2. draw all the pixels in this character
for(y=0; y<height; y++)
{
for(x=0; x<width; x++)
{
data = pData[byteIndex];
if(data & bitMask[bitPosition])
{
LCD_DrawPixel(x0+x, y0+y, drawMode);
}
if(bitPosition == 0)
{
bitPosition = packedDataSize-1;
byteIndex++;
}
else
{
bitPosition--;
}
}
}
return width;
}
return 0;
}
uint32_t FL_GetStringLengthInPixels(const char * str, const BFC_FONT *pFont)
{
uint32_t widthInPixels = 0;
uint32_t error = 0;
uint32_t index = 0;
while(str[index] != '\0' && !error)
{
uint32_t codepoint; //UTF8 code
uint32_t charCount; //number of chars in the current codepoint
if(FL_GetCodepointInfo(&str[index], &codepoint, &charCount))
{
while(1); //not valid UTF8 codepoint
}
index += charCount; //Advance index by number of chars consumed from string
widthInPixels += FL_GetCharInfo(pFont, str[index])->Width;
}
return widthInPixels;
}
const BFC_CHARINFO* FL_GetCharInfo(const BFC_FONT *pFont, unsigned short ch)
{
const BFC_CHARINFO *pCharInfo = 0;
const BFC_FONT_PROP *pProp = pFont->p.pProp;
unsigned short first_char, last_char;
if(pFont == 0 || pFont->p.pProp == 0)
return 0;
while(pProp != 0)
{
first_char = pProp->FirstChar;
last_char = pProp->LastChar;
pCharInfo = pProp->pFirstCharInfo;
if( ch >= first_char && ch <= last_char )
{
// the character "ch" is inside this range,
// return this char info, and not search anymore.
pCharInfo = pCharInfo + (ch - first_char);
return pCharInfo;
}
else
{
// the character "ch" is not in this range
// so search it in the next range
pProp = pProp->pNextProp;
}
}
// if the character "ch" is not rendered in this font,
// we use the first character in this font as the default one.
if( pCharInfo == 0 )
{
pProp = pFont->p.pProp;
pCharInfo = pProp->pFirstCharInfo;
}
return pCharInfo;
}

View File

@@ -0,0 +1,54 @@
/*
* fontLibrary.h
*
* Created on: Feb 9, 2022
* Author: Brian.Bailey
*/
#ifndef FONTS_FONTLIBRARY_H_
#define FONTS_FONTLIBRARY_H_
#include <Fonts/bfcfont.h>
#include "../lcd.h" //include for LCD_DRAW_MODE_t
#include "translate.h"
//extern all fonts (required)
extern const BFC_FONT fontCalibriBoldBasic10_15h[];
extern const BFC_FONT fontCalibriBoldBasic11_18h[];
extern const BFC_FONT fontCalibriBoldBasic12_19h[];
extern const BFC_FONT fontCalibriBoldBasic14_23h[];
extern const BFC_FONT fontCalibriBoldBasic16_26h[];
extern const BFC_FONT fontCalibriBoldBasic18_29h[];
extern const BFC_FONT fontSimSunBold12_19h[];
//quick names for fonts (optional)
#define font10Bold fontCalibriBoldBasic10_15h
#define font11Bold fontCalibriBoldBasic11_18h
#define font12Bold fontCalibriBoldBasic12_19h
#define font14Bold fontCalibriBoldBasic14_23h
#define font16Bold fontCalibriBoldBasic16_26h
#define font18Bold fontCalibriBoldBasic18_29h
#define fontSimsun fontSimSunBold12_19h
typedef enum {
FL_ALIGN_LEFT,
FL_ALIGN_CENTER,
FL_ALIGN_RIGHT,
FL_ALIGN_NUM
} FL_ALIGN;
uint32_t FL_GetCodepointInfo(const char * str, uint32_t * codepoint, uint32_t * charCount);
uint32_t FL_GetFontHeight(const BFC_FONT * font);
void FL_DrawTranslatedString(const char *str, int16_t x, int16_t y, const BFC_FONT *pFont, LCD_DRAWMODE_t drawMode, FL_ALIGN align);
void FL_DrawString(const char *str, int16_t x, int16_t y, const BFC_FONT *font, LCD_DRAWMODE_t drawMode, FL_ALIGN align);
uint32_t FL_DrawChar(uint16_t codepoint, int x0, int y0, const BFC_FONT *pFont, LCD_DRAWMODE_t drawMode);
uint32_t FL_GetStringLengthInPixels(const char * str, const BFC_FONT *pFont);
const BFC_CHARINFO* FL_GetCharInfo(const BFC_FONT *pFont, unsigned short ch);
#endif /* FONTS_FONTLIBRARY_H_ */

35
source/Fonts/languages.h Normal file
View File

@@ -0,0 +1,35 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
#ifndef FONTS_LANGUAGES_H_
#define FONTS_LANGUAGES_H_
extern const char * textEnglish[];
extern const char * textSpanish[];
extern const char * textFrench[];
extern const char * textGerman[];
extern const char * textItalian[];
extern const char * textPolish[];
extern const char * textDutch[];
extern const char * textPortuguese[];
extern const char * textRussian[];
extern const char * textSwedish[];
extern const char * textDanish[];
extern const char * textEstonian[];
extern const char * textLatvian[];
extern const char * textLithuanian[];
extern const char * textCzech[];
extern const char * textFinnish[];
extern const char * textGreek[];
extern const char * textNorwegian[];
extern const char * textHungarian[];
extern const char * textRomanian[];
extern const char * textChinese[];
extern const char * textKorean[];
#endif /* FONTS_LANGUAGES_H_ */

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textChinese[] =
{
"1 小时",
"2 小时",
"自动关机",
"包含",
"频率",
"频率",
"小时数",
"语言",
"无线连接",
"语言",
"无线连接",
"加载程序版本",
"生产日期",
"型号名称",
"从不",
"监管信息",
"监管",
"设置",
"系统信息",
"序列号",
"软件版本",
"系统信息",
};

34
source/Fonts/textCzech.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 6/26/2024
* Author: Brian.Bailey
*/
const char * textCzech[] =
{
"1 HODINA",
"2 HODINY",
"Auto. vypnutí",
"Obsahuje",
"FREKVENCE",
"Frekvence",
"Počet hodin",
"JAZYK",
"RÁDIOVÉ SPOJENÍ",
"Jazyk",
"Rádiové spojení",
"Verze zavaděče",
"Datum výroby",
"Název modelu",
"NIKDY",
"REGULAČNÍ INFORMACE",
"Právní předpisy",
"NASTAVENÍ",
"SYSTÉMOVÉ INFO",
"Sériové číslo",
"Verze softwaru",
"Systém. infor.",
};

34
source/Fonts/textDanish.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textDanish[] =
{
"1 TIME",
"2 TIMER",
"Auto nedlukning",
"Indeholder",
"FREKVENSER",
"Frekvenser",
"Antal timer",
"SPROG",
"LINK RADIO",
"Sprog",
"Link radio",
"Loader-version",
"Fremst.dato",
"Modelnavn",
"ALDRIG",
"LOVGIVNINGSMÆSSIGE OPLYSNINGER",
"Lovgivning",
"INDSTILLINGER",
"SYSTEMOPLYSNINGER",
"Serienummer",
"Softwarev.",
"Systeminfo",
};

34
source/Fonts/textDutch.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textDutch[] =
{
"1 UUR",
"2 UUR",
"Automatisch uit",
"Bevat",
"FREQUENTIES",
"Frequenties",
"Aantal uur",
"TAAL",
"LINKRADIO",
"Taal",
"Linkradio",
"Versie loader",
"Productiedatum",
"Modelnaam",
"NOOIT",
"WETTELIJKE INFORMATIE",
"Wettelijke info",
"INSTELLINGEN",
"SYSTEEMINFORMATIE",
"Serienummer",
"Softwareversie",
"Systeeminformatie",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textEnglish[] =
{
"1 HOUR",
"2 HOURS",
"Auto Shutdown",
"Contains",
"FREQUENCIES",
"Frequencies",
"Hour Count",
"LANGUAGE",
"LINK RADIO",
"Language",
"Link Radio",
"Loader Version",
"Manufacture Date",
"Model Name",
"NEVER",
"REGULATORY INFO",
"Regulatory",
"SETTINGS",
"SYSTEM INFO",
"Serial Number",
"Software Version",
"System Information",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textEstonian[] =
{
"1 TUND",
"2 TUNDI",
"Autom. väljalülitus",
"Sisaldab",
"SAGEDUSED",
"Sagedused",
"Töötunnid",
"KEEL",
"SEO RAADIO",
"Keel",
"Seo raadio",
"Laaduri versioon",
"Tootmise kuup.",
"Mudeli nimi",
"POLE",
"NORMATIIVTEAVE",
"Normatiivteave",
"SEADED",
"SÜSTEEMI TEAVE",
"Seerianumber",
"Tarkvara versioon",
"Süsteemi teave",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textFinnish[] =
{
"1 TUNTI",
"2 TUNTIA",
"Autom. sammutus",
"Sisältää",
"TAAJUUDET",
"Taajuudet",
"Tuntimäärä",
"KIELI",
"LANGATON YHTEYS",
"Kieli",
"Langaton yhteys",
"Käynnist.ohj. versio",
"Valmistuspäivä",
"Mallin nimi",
"EI KOSK.",
"SÄÄNTELYTIEDOT",
"Sääntely",
"ASETUKSET",
"JÄRJESTELMÄN TIEDOT",
"Sarjanumero",
"Ohjelmiston versio",
"Järjestelmän tiedot",
};

34
source/Fonts/textFrench.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 6/26/2024
* Author: Brian.Bailey
*/
const char * textFrench[] =
{
"1 HEURE",
"2 HEURES",
"Arrêt automatique",
"Contient",
"FRÉQUENCES",
"Fréquences",
"Décompte horaire",
"LANGUE",
"LIAISON RADIO",
"Langue",
"Liaison radio",
"Vers. charg. dém.",
"Date de fabrication",
"Nom du modèle",
"JAMAIS",
"INFOS RÉGLEMENTAIRES",
"Réglementation",
"PARAMÈTRES",
"INFORMATIONS SUR LE SYSTÈME",
"Numéro de série",
"Version du logiciel",
"Infos système",
};

34
source/Fonts/textGerman.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 6/26/2024
* Author: Brian.Bailey
*/
const char * textGerman[] =
{
"1 STD.",
"2 STDN.",
"Auto-Abschaltung",
"Enthält",
"FREQUENZEN",
"Frequenzen",
"Stundenzahl",
"SPRACHE",
"FUNKANBINDUNG",
"Sprache",
"Funkanbindung",
"Bootloader-Version",
"Herstellungsdatum",
"Modellname",
"NIEMALS",
"REGULATORISCHE INFORMATION",
"Regulatorische Info",
"EINSTELLUNGEN",
"SYSTEMINFO",
"Seriennummer",
"Softwareversion",
"Systeminformation",
};

34
source/Fonts/textGreek.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textGreek[] =
{
"1 ΩΡΑ",
"2 ΩΡΕΣ",
"Αυτόματη απενεργ.",
"Περιέχει",
"ΣΥΧΝΟΤΗΤΕΣ",
"Συχνότητες",
"Μέτρηση ωρών",
"ΓΛΩΣΣΑ",
"ΣΥΝΔΕΣΗ ΑΣΥΡΜΑΤΟΥ",
"Γλώσσα",
"Σύνδ. ασυρμ.",
"Έκδ. προγρ. εκκίν.",
"Ημ/α κατασκευής",
"Όνομα μοντέλου",
"ΠΟΤΕ",
"ΚΑΝΟΝΙΣΤΙΚΕΣ ΠΛΗΡΟΦΟΡΙΕΣ",
"Κανονιστικά",
"ΡΥΘΜΙΣΕΙΣ",
"ΠΛΗΡΟΦΟΡΙΕΣ ΣΥΣΤΗΜΑΤΟΣ",
"Σειριακός αριθμός",
"Έκδοση λογισμικού",
"Πληροφορίες συστ.",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textHungarian[] =
{
"1 ÓRA",
"2 ÓRA",
"Automatikus leállítás",
"Tartalom",
"FREKVENCIÁK",
"Frekvenciák",
"Óraszám",
"NYELV",
"RÁDIÓKAPCSOLAT",
"Nyelv",
"Rádiókapcsolat",
"Betöltő verziója",
"Gyártás dátuma",
"Modellnév",
"SOHA",
"SZABÁLYOZÁSI INFORMÁCIÓK",
"Szabályozás",
"BEÁLLÍTÁSOK",
"RENDSZERINFÓ",
"Sorozatszám",
"Szoftververzió",
"Rendszerinformáció",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textItalian[] =
{
"1 ORA",
"2 ORE",
"Spegnim. auto",
"Contiene",
"FREQUENZE",
"Frequenze",
"Conteggio ore",
"LINGUA",
"LINK RADIO",
"Lingua",
"Link radio",
"Versione caricatore",
"Data prod.",
"Nome modello",
"MAI",
"INFO NORMATIVE",
"Cont. norm.",
"IMPOSTAZIONI",
"INFO SISTEMA",
"Numero serie",
"Vers. software",
"Info sistema",
};

34
source/Fonts/textKorean.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textKorean[] =
{
"1시간",
"2시간",
"자동 종료",
"포함",
"주파수",
"주파수",
"시간 수",
"언어",
"링크 라디오",
"언어",
"링크 라디오",
"로더 버전",
"제조 날짜",
"모델 이름",
"안 함",
"규정 정보",
"규정",
"설정",
"시스템 정보",
"일련번호",
"SW 버전",
"시스템 정보",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textLatvian[] =
{
"1 ST.",
"2 ST.",
"Autom. izslēgšanās",
"Satur",
"FREKVENCES",
"Frekvences",
"Stundu skaits",
"VALODA",
"RADIOLĪNIJA",
"Valoda",
"Radiolīnija",
"Sākn. ielādēt. vers.",
"Izgatavoš. datums",
"Modeļa nosaukums",
"NEKAD",
"REGULĒJUMA INFORM.",
"Regulējums",
"IESTATĪJUMI",
"SISTĒMAS INFORM.",
"Sērijas numurs",
"Programmat. vers.",
"Sistēmas informācija",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textLithuanian[] =
{
"1 VAL.",
"2 VAL.",
"Automat. išjun.",
"Sudaro",
"DAŽNIAI",
"Dažniai",
"Val. skaičiav.",
"KALBA",
"SUSIETI RADIJĄ",
"Kalba",
"Susieti radiją",
"Krautuvo versija",
"Pagaminimo data",
"Model. pavad.",
"NIEKADA",
"REGLAMENTAVIMO INFORMACIJA",
"Reglamentavimas",
"NUOSTATOS",
"SISTEMOS INFORMACIJA",
"Serijos numeris",
"Progr. įr. versija",
"Sistemos informacija",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textNorwegian[] =
{
"1 TIME",
"2 TIMER",
"Auto-avslåing",
"Inneholder",
"FREKVENSER",
"Frekvenser",
"Antall timer",
"SPRÅK",
"TILKNYTT RADIO",
"Språk",
"Tilknytt radio",
"Innlastervers.",
"Prod.dato",
"Modellnavn",
"ALDRI",
"REGULATORISK INFORMASJON",
"Regulatorisk",
"INNSTILLINGER",
"SYSTEMINFO",
"Serienummer",
"Pr.vareversj.",
"Systeminfo",
};

34
source/Fonts/textPolish.c Normal file
View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textPolish[] =
{
"1 GODZ",
"2 GODZ",
"Autom. wyłączanie",
"Zawiera",
"CZĘSTOTLIWOŚCI",
"Częstotliwości",
"Liczba godzin",
"JĘZYK",
"POWIĄŻ RADIO",
"Język",
"Powiąż radio",
"Wersja ładowarki",
"Data produkcji",
"Nazwa modelu",
"NIGDY",
"INFORMACJE PRAWNE",
"Prawne",
"USTAWIENIA",
"INFO O SYSTEMIE",
"Numer seryjny",
"Wersja oprogr.",
"Info o systemie",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textPortuguese[] =
{
"1 HORA",
"2 HORAS",
"Encerramento auto.",
"Contém",
"FREQUÊNCIAS",
"Frequências",
"Contagem de horas",
"IDIOMA",
"LIGAR RÁDIO",
"Idioma",
"Ligar rádio",
"V. carregador",
"Data de fabrico",
"Nome do modelo",
"NUNCA",
"INFORMAÇÕES REGULAMENTARES",
"Regulamentar",
"DEFINIÇÕES",
"INFO. SISTEMA",
"Número de série",
"Versão do software",
"Info. do sistema",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textRomanian[] =
{
"1 HOUR",
"2 HOURS",
"Oprire automată",
"Conținut",
"FRECVENȚE",
"Frecvențe",
"Număr de ore",
"LIMBĂ",
"LEGĂTURĂ RADIO",
"Limbă",
"Legătură radio",
"Versiune încărcător",
"Data de fabricație",
"Numele modelului",
"NICIODATĂ",
"INFO REGLEMENTARE",
"Reglementare",
"SETĂRI",
"INFO SISTEM",
"Număr de serie",
"Versiune software",
"Informații de sistem",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textRussian[] =
{
"1 ЧАС",
"2 ЧАСА",
"Автовыкл.",
"Содержит",
"ЧАСТОТЫ",
"Частоты",
"Счетчик часов",
"ЯЗЫК",
"РАДИОКАНАЛ УПРАВЛЕНИЯ",
"Язык",
"Радиоканал",
"Верс. загрузч.",
"Дата произв.",
"Назв. модели",
"НИКОГ.",
"НОРМАТИВНАЯ ИНФОРМАЦИЯ",
"Нормативы",
"НАСТРОЙКИ",
"ИНФОРМАЦИЯ О СИСТЕМЕ",
"Серийный №",
"Версия ПО",
"Инфо о сист.",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textSpanish[] =
{
"1 H",
"2 H",
"Apagado auto.",
"Contiene",
"FRECUENCIAS",
"Frecuencias",
"Rcto. de horas",
"IDIOMA",
"ENL. RADIO",
"Idioma",
"Enl. radio",
"Versión cargador",
"Fecha fabricación",
"Nombre modelo",
"NUNCA",
"INFO. NORMA",
"Norma",
"AJUSTES",
"INFO. SISTEMA",
"Número serie",
"Versión software",
"Info. sistema",
};

View File

@@ -0,0 +1,34 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
const char * textSwedish[] =
{
"1 TIMME",
"2 TIMMAR",
"Autom. avst.",
"Innehåller",
"FREKVENSER",
"Frekvenser",
"Antal timmar",
"SPRÅK",
"RADIOLÄNK",
"Språk",
"Radiolänk",
"Version av laddare",
"Datum för tillv.",
"Modellnamn",
"ALDRIG",
"INFO OM REGLERING",
"Regelverk",
"INSTÄLLNINGAR",
"SYSTEMINFO",
"Serienummer",
"Programvaruv.",
"Systeminfo.",
};

204
source/Fonts/translate.c Normal file
View File

@@ -0,0 +1,204 @@
/*
* translate.c
*
* Created on: Feb 12, 2022
* Author: Brian.Bailey
*/
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "System/system.h"
#include "languages.h"
#include "translate.h"
//Language names (in the language)
const char *languageNames[] =
{
"English", //English
"Español", //Spanish
"Français", //French
"Deutsch", //German
"Italiano", //Italian
"Polski", //Polish
"Nederlands", //Dutch
"Português", //Portuguese
"Русский", //Russian
"Svenska", //Swedish
"Dansk", //Danish
"Eesti", //Estonian
"Latviski", //Latvian
"Lietuvių kalba", //Lithuanian
"Čeština", //Czech
"Suomi", //Finnish
"Ελληνικά", //Greek
"Norsk", //Norwegian
"Magyar", //Hungarian
"Română", //Romanian
"简体中文", //Chinese
"한국어", //Korean
};
const char* Translate(const char *input)
{
//find the index of the input string in textEnglish[]
int16_t low = 0;
int16_t high = NUM_TRANSLATION_STRINGS - 1;
int16_t mid;
int16_t compare; //result of strcmp()
int16_t index; //index of the input string in textEnglish[]
bool done = false;
const char *translatedString;
//bisection algorithm
while ((low <= high) && !done)
{
mid = (low + high) / 2;
compare = strcmp(input, textEnglish[mid]);
if (compare == 0) //strings match
{
done = true;
}
else if (compare < 0) //correct string is "lower" than result
{
high = mid - 1;
}
else //correct string is "higher" than result
{
low = mid + 1;
}
}
index = mid;
if (done == false) //string not found in array
{
translatedString = input; //return the input string (no translation)
}
else
{
switch (SYS_GetLanguage()) //language currently used
{
case LANG_SPANISH:
translatedString = textSpanish[index];
break;
case LANG_FRENCH:
translatedString = textFrench[index];
break;
case LANG_GERMAN:
translatedString = textGerman[index];
break;
case LANG_ITALIAN:
translatedString = textItalian[index];
break;
case LANG_POLISH:
translatedString = textPolish[index];
break;
case LANG_DUTCH:
translatedString = textDutch[index];
break;
case LANG_PORTUGUESE:
translatedString = textPortuguese[index];
break;
case LANG_RUSSIAN:
translatedString = textRussian[index];
break;
case LANG_SWEDISH:
translatedString = textSwedish[index];
break;
case LANG_DANISH:
translatedString = textDanish[index];
break;
case LANG_ESTONIAN:
translatedString = textEstonian[index];
break;
case LANG_LATVIAN:
translatedString = textLatvian[index];
break;
case LANG_LITHUANIAN:
translatedString = textLithuanian[index];
break;
case LANG_CZECH:
translatedString = textCzech[index];
break;
case LANG_FINNISH:
translatedString = textFinnish[index];
break;
case LANG_GREEK:
translatedString = textGreek[index];
break;
case LANG_NORWEGIAN:
translatedString = textNorwegian[index];
break;
case LANG_HUNGARIAN:
translatedString = textHungarian[index];
break;
case LANG_ROMANIAN:
translatedString = textRomanian[index];
break;
case LANG_CHINESE:
translatedString = textChinese[index];
break;
case LANG_KOREAN:
translatedString = textKorean[index];
break;
default:
translatedString = textEnglish[index];
break;
}
}
return translatedString;
}
#if 0
//returns the index of the input string in textEnglish[]
//returns -1 if input string not found
uint16_t GetTranslationIndex(const char *input)
{
int16_t low = 0;
int16_t high = NUM_TRANSLATION_STRINGS - 1;
int16_t mid;
int16_t compare;
bool done = false;
//bisection algorithm
while ((low <= high) && !done)
{
mid = (low + high) / 2;
compare = strcmp(input, textEnglish[mid]);
if (compare == 0) //strings match
{
done = true;
}
else if (compare < 0) //correct string is "lower" than result
{
high = mid - 1;
}
else //correct string is "higher" than result
{
low = mid + 1;
}
}
int16_t retval = mid;
if (done == false) //string not found in array
{
retval = -1;
}
return retval;
}
#endif

46
source/Fonts/translate.h Normal file
View File

@@ -0,0 +1,46 @@
/*
* languages.h
*
* Created on: 5/24/2024
* Author: Brian.Bailey
*/
#ifndef FONTS_TRANSLATE_H_
#define FONTS_TRANSLATE_H_
#define NUM_TRANSLATION_STRINGS 22
typedef enum {
LANG_ENGLISH,
LANG_SPANISH,
LANG_FRENCH,
LANG_GERMAN,
LANG_ITALIAN,
LANG_POLISH,
LANG_DUTCH,
LANG_PORTUGUESE,
LANG_RUSSIAN,
LANG_SWEDISH,
LANG_DANISH,
LANG_ESTONIAN,
LANG_LATVIAN,
LANG_LITHUANIAN,
LANG_CZECH,
LANG_FINNISH,
LANG_GREEK,
LANG_NORWEGIAN,
LANG_HUNGARIAN,
LANG_ROMANIAN,
LANG_CHINESE,
LANG_KOREAN,
LANG_NUM,
}LANGUAGE_t;
extern const char * languageNames[];
const char * Translate(const char * input);
#endif /* FONTS_LANGUAGES_H_ */

View File

@@ -0,0 +1,855 @@
/*
* graphicsLibrary.c
*
* Created on: Feb 12, 2022
* Author: Brian.Bailey
*/
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <stddef.h>
#include <stdint.h>
#include "fsl_common.h"
#include "..\lcd.h"
#include "..\Fonts\fontLibrary.h"
#include "lcd.h"
#include "graphicsLibrary.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define BMP_WIDTH_INDEX 0 //Location of xSize in bitmap array
#define BMP_HEIGHT_INDEX 1 //Location of ySize in bitmap array
#define BMP_DATA_INDEX 2 //Location of data in bitmap array
#define ABS(x) ((x) > 0 ? (x) : -(x))
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
static void DrawHLine(int16_t x0, int16_t y0, uint16_t width, LCD_DRAWMODE_t drawMode);
static void DrawVLine(int16_t x0, int16_t y0, uint16_t height, LCD_DRAWMODE_t drawMode);
static void xLine(int16_t x1, int16_t x2, int16_t y, LCD_DRAWMODE_t drawMode);
static void yLine(int16_t x, int16_t y1, int16_t y2, LCD_DRAWMODE_t drawMode);
/*******************************************************************************
* Static Functions
******************************************************************************/
/*
* Draw a horizontal line with given color
*/
static void DrawHLine(int16_t x0, int16_t y0, uint16_t width, LCD_DRAWMODE_t drawMode)
{
for(int16_t x = x0; x < (x0+width); x++)
{
LCD_DrawPixel(x, y0, drawMode);
}
}
/*
* Draw a vertical line with given color
*/
static void DrawVLine(int16_t x0, int16_t y0, uint16_t height, LCD_DRAWMODE_t drawMode)
{
for(int16_t y = y0; y < (y0+height); y++)
{
LCD_DrawPixel(x0, y, drawMode);
}
}
//Supporting functions for GL_DrawCircle2
static void xLine(int16_t x1, int16_t x2, int16_t y, LCD_DRAWMODE_t drawMode)
{
while (x1 <= x2)
{
LCD_DrawPixel(x1++, y, drawMode);
}
}
static void yLine(int16_t x, int16_t y1, int16_t y2, LCD_DRAWMODE_t drawMode)
{
while (y1 <= y2)
{
LCD_DrawPixel(x, y1++, drawMode);
}
}
/*******************************************************************************
* Public Functions
******************************************************************************/
/*
* Draw a line using Bresenham's algorithm with given color. //ADD WIDTH
*/
void GL_DrawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t thickness, LCD_DRAWMODE_t drawMode)
{
int16_t dx; //width
int16_t sx; //x increment direction
int16_t dy; //height
int16_t sy; //y increment direction
int16_t err;
int16_t e2;
int16_t widthOffsetLow; //line thickness low offset for perpendicular line
int16_t widthOffsetHigh; //line thickness high offset for perpendicular line
dx = ABS(x1 - x0);
sx = x0 < x1 ? 1 : -1;
dy = ABS(y1 - y0);
sy = y0 < y1 ? 1 : -1;
err = (dx > dy ? dx : -dy) / 2;
while (1)
{
if (x0 == x1 && y0 == y1)
{
break;
}
//Draw a line perpendicular to the first with length "thickness"
widthOffsetLow = ((thickness-1)*-1) >> 1;
widthOffsetHigh = thickness >> 1;
for(int16_t i =widthOffsetLow; i <= widthOffsetHigh; i++)
{
if(dy > dx) //if line is more horizontal, draw horizontal line
{
LCD_DrawPixel(x0 + i, y0, drawMode);
}
else //vertical line
{
LCD_DrawPixel(x0, y0 + i, drawMode);
}
}
e2 = err + err;
if (e2 > -dx)
{
err -= dy;
x0 += sx;
}
if (e2 < dy)
{
err += dx;
y0 += sy;
}
}
}
/*
* Draw a rectangle with given color and thickness.
* Corners will move outward with increasing thickness
*/
void GL_DrawRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t thickness, LCD_DRAWMODE_t drawMode)
{
/* Make sure x0 is smaller than x1. */
if (x0 > x1)
{
x0 = x0 + x1;
x1 = x0 - x1;
x0 = x0 - x1;
}
/* Make sure y0 is smaller than y1. */
if (y0 > y1)
{
y0 = y0 + y1;
y1 = y0 - y1;
y0 = y0 - y1;
}
uint16_t width = x1 - x0 + 1;
uint16_t height = y1 - y0 + 1;
//Draw concentric rectangles to increase thickness
//This overwrites the corner pixels
int16_t thicknessOffsetLow = ((thickness-1)*-1) >> 1; //line thickness low offset
int16_t thicknessOffsetHigh = thickness >> 1; //line thickness high offset
for(int16_t i = thicknessOffsetLow; i <= thicknessOffsetHigh; i++)
{
DrawHLine(x0 + i, y0 + i, width + 2*i*-1, drawMode); //top horizontal
DrawHLine(x0 - i, y1 + i, width + 2*i, drawMode); //bottom horizontal
DrawVLine(x0 + i, y0 + i, height + 2*i*-1, drawMode); //left vertical
DrawVLine(x1 + i, y0 - i, height + 2*i, drawMode); //right vertical
}
}
/*
* Draw a filled rectangle with given color.
*/
void GL_DrawFilledRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, LCD_DRAWMODE_t drawMode)
{
/* Make sure x0 is smaller than x1. */
if (x0 > x1)
{
x0 = x0 + x1;
x1 = x0 - x1;
x0 = x0 - x1;
}
/* Make sure y0 is smaller than y1. */
if (y0 > y1)
{
y0 = y0 + y1;
y1 = y0 - y1;
y0 = y0 - y1;
}
uint16_t width = x1 - x0 + 1;
uint16_t height = y1 - y0 + 1;
for (uint16_t i = 0; i < height; i++)
{
DrawHLine(x0, y0 + i, width, drawMode);
}
}
void GL_DrawCircle(int16_t xc, int16_t yc, int16_t r, LCD_DRAWMODE_t drawMode)
{
int16_t x = 0;
int16_t y = r;
int16_t d = 3 - 2 * r;
LCD_DrawPixel(xc + x, yc + y, drawMode);
LCD_DrawPixel(xc - x, yc + y, drawMode);
LCD_DrawPixel(xc + x, yc - y, drawMode);
LCD_DrawPixel(xc - x, yc - y, drawMode);
LCD_DrawPixel(xc + y, yc + x, drawMode);
LCD_DrawPixel(xc - y, yc + x, drawMode);
LCD_DrawPixel(xc + y, yc - x, drawMode);
LCD_DrawPixel(xc - y, yc - x, drawMode);
while (y >= x)
{
x++;
if (d > 0)
{
y--;
d = d + 4 * (x - y) + 10;
}
else
{
d = d + 4 * x + 6;
}
LCD_DrawPixel(xc + x, yc + y, drawMode);
LCD_DrawPixel(xc - x, yc + y, drawMode);
LCD_DrawPixel(xc + x, yc - y, drawMode);
LCD_DrawPixel(xc - x, yc - y, drawMode);
LCD_DrawPixel(xc + y, yc + x, drawMode);
LCD_DrawPixel(xc - y, yc + x, drawMode);
LCD_DrawPixel(xc + y, yc - x, drawMode);
LCD_DrawPixel(xc - y, yc - x, drawMode);
}
}
//Draw two circles with fill between them (circle with thickness)
//uses midpoint circle algorithm
// from https://stackoverflow.com/questions/27755514/circle-with-thickness-drawing-algorithm
void GL_DrawCircle2(int16_t xc, int16_t yc, int16_t rInner, int16_t rOuter, LCD_DRAWMODE_t drawMode)
{
if(rInner > rOuter) //exit if inner circle radius larger than rOuter
{
return;
}
int16_t xo = rOuter; //rOuter circle radius
int16_t xi = rInner; //rInner circle radius
int16_t y = 0;
int16_t erro = 1 - xo; //rOuter circle error
int16_t erri = 1 - xi; //rInner circle error
while(xo >= y)
{
xLine(xc + xi, xc + xo, yc + y, drawMode);
yLine(xc + y, yc + xi, yc + xo, drawMode);
xLine(xc - xo, xc - xi, yc + y, drawMode);
yLine(xc - y, yc + xi, yc + xo, drawMode);
xLine(xc - xo, xc - xi, yc - y, drawMode);
yLine(xc - y, yc - xo, yc - xi, drawMode);
xLine(xc + xi, xc + xo, yc - y, drawMode);
yLine(xc + y, yc - xo, yc - xi, drawMode);
y++;
if (erro < 0)
{
erro += 2 * y + 1;
}
else
{
xo--;
erro += 2 * (y - xo + 1);
}
if (y > rInner)
{
xi = y;
}
else
{
if (erri < 0)
{
erri += 2 * y + 1;
}
else
{
xi--;
erri += 2 * (y - xi + 1);
}
}
}
}
void GL_DrawFilledCircle(int16_t x0, int16_t y0, int16_t r, LCD_DRAWMODE_t drawMode)
{
int16_t x = 0;
int16_t y = r;
int16_t d = 3 - 2 * r;
while (y >= x)
{
DrawHLine(x0 - x, y0 + y, x * 2, drawMode);
DrawHLine(x0 - x, y0 - y, x * 2, drawMode);
DrawHLine(x0 - y, y0 + x, y * 2, drawMode);
DrawHLine(x0 - y, y0 - x, y * 2, drawMode);
x++;
if (d > 0)
{
y--;
d = d + 4 * (x - y) + 10;
}
else
{
d = d + 4 * x + 6;
}
}
}
void GL_DrawEllipse(int16_t x0, int16_t y0, int16_t a, int16_t b,
LCD_DRAWMODE_t drawMode)
{
int16_t wx, wy;
int32_t xa, ya;
int32_t t;
int32_t asq = a * a;
int32_t bsq = b * b;
LCD_DrawPixel(x0, y0 + b, drawMode);
LCD_DrawPixel(x0, y0 - b, drawMode);
wx = 0;
wy = b;
xa = 0;
ya = asq * 2 * b;
t = asq / 4 - asq * b;
while (1)
{
t += xa + bsq;
if (t >= 0)
{
ya -= asq * 2;
t -= ya;
wy--;
}
xa += bsq * 2;
wx++;
if (xa >= ya)
{
break;
}
LCD_DrawPixel(x0 + wx, y0 - wy, drawMode);
LCD_DrawPixel(x0 - wx, y0 - wy, drawMode);
LCD_DrawPixel(x0 + wx, y0 + wy, drawMode);
LCD_DrawPixel(x0 - wx, y0 + wy, drawMode);
}
LCD_DrawPixel(x0 + a, y0, drawMode);
LCD_DrawPixel(x0 - a, y0, drawMode);
wx = a;
wy = 0;
xa = bsq * 2 * a;
ya = 0;
t = bsq / 4 - bsq * a;
while (1)
{
t += ya + asq;
if (t >= 0)
{
xa -= bsq * 2;
t = t - xa;
wx--;
}
ya += asq * 2;
wy++;
if (ya > xa)
{
break;
}
LCD_DrawPixel(x0 + wx, y0 - wy, drawMode);
LCD_DrawPixel(x0 - wx, y0 - wy, drawMode);
LCD_DrawPixel(x0 + wx, y0 + wy, drawMode);
LCD_DrawPixel(x0 - wx, y0 + wy, drawMode);
}
}
void GL_DrawFilledEllipse(int16_t x0, int16_t y0, int16_t a, int16_t b,
LCD_DRAWMODE_t drawMode)
{
int16_t wx, wy;
int32_t xa, ya;
int32_t t;
int32_t asq = a * a;
int32_t bsq = b * b;
LCD_DrawPixel(x0, y0 + b, drawMode);
LCD_DrawPixel(x0, y0 - b, drawMode);
wx = 0;
wy = b;
xa = 0;
ya = asq * 2 * b;
t = asq / 4 - asq * b;
while (1)
{
t += xa + bsq;
if (t >= 0)
{
ya -= asq * 2;
t -= ya;
wy--;
}
xa += bsq * 2;
wx++;
if (xa >= ya)
{
break;
}
DrawHLine(x0 - wx, y0 - wy, wx * 2, drawMode);
DrawHLine(x0 - wx, y0 + wy, wx * 2, drawMode);
}
DrawHLine(x0 - a, y0, a * 2, drawMode);
wx = a;
wy = 0;
xa = bsq * 2 * a;
ya = 0;
t = bsq / 4 - bsq * a;
while (1)
{
t += ya + asq;
if (t >= 0)
{
xa -= bsq * 2;
t = t - xa;
wx--;
}
ya += asq * 2;
wy++;
if (ya > xa)
{
break;
}
DrawHLine(x0 - wx, y0 - wy, wx * 2, drawMode);
DrawHLine(x0 - wx, y0 + wy, wx * 2, drawMode);
}
}
void GL_DrawPolygon(int16_t numVertices, int16_t *vertices, int16_t thickness, LCD_DRAWMODE_t drawMode)
{
for (int16_t i = 0; i < numVertices - 1; i++)
{
GL_DrawLine(vertices[(i << 1) + 0], vertices[(i << 1) + 1],
vertices[(i << 1) + 2], vertices[(i << 1) + 3], thickness, drawMode);
}
GL_DrawLine(vertices[0], vertices[1], vertices[(numVertices << 1) - 2],
vertices[(numVertices << 1) - 1], thickness, drawMode);
}
/* Adapted from http://alienryderflex.com/polygon_fill/ */
void GL_DrawFilledPolygon(int16_t numVertices, int16_t *vertices, LCD_DRAWMODE_t drawMode)
{
uint16_t nodes[64];
int16_t y;
float x0;
float y0;
float x1;
float y1;
int16_t miny = LCD_HEIGHT_PIXELS;
int16_t maxy = 0;
for (uint8_t i = 0; i < numVertices; i++)
{
if (miny > vertices[(i << 1) + 1])
{
miny = vertices[(i << 1) + 1];
}
if (maxy < vertices[(i << 1) + 1])
{
maxy = vertices[(i << 1) + 1];
}
}
/* Loop through the rows of the image. */
for (y = miny; y < maxy; y++)
{
/* Build a list of nodes. */
int16_t count = 0;
int16_t j = numVertices - 1;
for (int16_t i = 0; i < numVertices; i++)
{
x0 = vertices[(i << 1) + 0];
y0 = vertices[(i << 1) + 1];
x1 = vertices[(j << 1) + 0];
y1 = vertices[(j << 1) + 1];
if ((y0 < (float) y && y1 >= (float) y)
|| (y1 < (float) y && y0 >= (float) y))
{
nodes[count] =
(int16_t) (x0 + (y - y0) / (y1 - y0) * (x1 - x0));
count++;
}
j = i;
}
/* Sort the nodes, via a simple “Bubble” sort. */
int16_t i = 0;
while (i < count - 1)
{
if (nodes[i] > nodes[i + 1])
{
int16_t swap = nodes[i];
nodes[i] = nodes[i + 1];
nodes[i + 1] = swap;
if (i)
{
i--;
}
}
else
{
i++;
}
}
/* Draw lines between nodes. */
for (int16_t i = 0; i < count; i += 2)
{
int16_t width = nodes[i + 1] - nodes[i];
DrawHLine(nodes[i], y, width, drawMode);
}
}
}
void GL_DrawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t thickness, LCD_DRAWMODE_t drawMode)
{
int16_t vertices[6] =
{ x0, y0, x1, y1, x2, y2 };
GL_DrawPolygon(3, vertices, thickness, drawMode);
}
void GL_DrawFilledTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, LCD_DRAWMODE_t drawMode)
{
int16_t vertices[6] =
{ x0, y0, x1, y1, x2, y2 };
GL_DrawFilledPolygon(3, vertices, drawMode);
}
void GL_DrawRoundedRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t r, LCD_DRAWMODE_t drawMode)
{
uint16_t width, height;
int16_t x, y, d;
/* Make sure x0 is smaller than x1. */
if (x0 > x1)
{
x0 = x0 + x1;
x1 = x0 - x1;
x0 = x0 - x1;
}
/* Make sure y0 is smaller than y1. */
if (y0 > y1)
{
y0 = y0 + y1;
y1 = y0 - y1;
y0 = y0 - y1;
}
/* Max radius is half of shortest edge. */
width = x1 - x0 + 1;
height = y1 - y0 + 1;
r = MIN(r, MIN(width / 2, height / 2));
DrawHLine(x0 + r, y0, width - 2 * r, drawMode);
DrawHLine(x0 + r, y1, width - 2 * r, drawMode);
DrawVLine(x0, y0 + r, height - 2 * r, drawMode);
DrawVLine(x1, y0 + r, height - 2 * r, drawMode);
x = 0;
y = r;
d = 3 - 2 * r;
while (y >= x)
{
x++;
if (d > 0)
{
y--;
d = d + 4 * (x - y) + 10;
}
else
{
d = d + 4 * x + 6;
}
/* Top right */
LCD_DrawPixel(x1 - r + x, y0 + r - y, drawMode);
LCD_DrawPixel(x1 - r + y, y0 + r - x, drawMode);
/* Top left */
LCD_DrawPixel(x0 + r - x, y0 + r - y, drawMode);
LCD_DrawPixel(x0 + r - y, y0 + r - x, drawMode);
/* Bottom right */
LCD_DrawPixel(x1 - r + x, y1 - r + y, drawMode);
LCD_DrawPixel(x1 - r + y, y1 - r + x, drawMode);
/* Bottom left */
LCD_DrawPixel(x0 + r - x, y1 - r + y, drawMode);
LCD_DrawPixel(x0 + r - y, y1 - r + x, drawMode);
}
}
;
void GL_DrawFilledRoundedRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t r, LCD_DRAWMODE_t drawMode)
{
uint16_t width, height;
int16_t rx0, ry0, rx1, x, y, d;
/* Make sure x0 is smaller than x1. */
if (x0 > x1)
{
x0 = x0 + x1;
x1 = x0 - x1;
x0 = x0 - x1;
}
/* Make sure y0 is smaller than y1. */
if (y0 > y1)
{
y0 = y0 + y1;
y1 = y0 - y1;
y0 = y0 - y1;
}
/* Max radius is half of shortest edge. */
width = x1 - x0 + 1;
height = y1 - y0 + 1;
r = MIN(r, MIN(width / 2, height / 2));
x = 0;
y = r;
d = 3 - 2 * r;
while (y >= x)
{
x++;
if (d > 0)
{
y--;
d = d + 4 * (x - y) + 10;
}
else
{
d = d + 4 * x + 6;
}
/* Top */
ry0 = y0 + r - x;
rx0 = x0 + r - y;
rx1 = x1 - r + y;
width = rx1 - rx0;
DrawHLine(rx0, ry0, width, drawMode);
ry0 = y0 + r - y;
rx0 = x0 + r - x;
rx1 = x1 - r + x;
width = rx1 - rx0;
DrawHLine(rx0, ry0, width, drawMode);
/* Bottom */
ry0 = y1 - r + y;
rx0 = x0 + r - x;
rx1 = x1 - r + x;
width = rx1 - rx0;
DrawHLine(rx0, ry0, width, drawMode);
ry0 = y1 - r + x;
rx0 = x0 + r - y;
rx1 = x1 - r + y;
width = rx1 - rx0;
DrawHLine(rx0, ry0, width, drawMode);
}
/* Center */
GL_DrawFilledRectangle(x0, y0 + r, x1, y1 - r, drawMode);
}
;
uint16_t GL_GetColorBitmapWidth(const uint16_t *bitmap)
{
return bitmap[BMP_WIDTH_INDEX];
}
uint16_t GL_GetColorBitmapHeight(const uint16_t *bitmap)
{
return bitmap[BMP_HEIGHT_INDEX];
}
/**
* Draw a bitmap in RGB565 color at the specified location
*
* \param *bitmap pointer to bitmap
* \param x0 x coordinate of bitmap (top left)
* \param y0 y coordinate of bitmap (top left)
* \return void
*/
void GL_DrawColorBitmap(const uint16_t *bitmap, uint16_t x0, uint16_t y0)
{
uint16_t xSize = bitmap[BMP_WIDTH_INDEX]; //bitmap width in pixels
uint16_t ySize = bitmap[BMP_HEIGHT_INDEX]; //bitmap height in pixels
bitmap += BMP_DATA_INDEX; //increment the bitmap pointer to the start of bitmap data
for (uint16_t y = 0; y < ySize; y++)
{
for (uint16_t x = 0; x < xSize; x++)
{
LCD_DrawPixel(x + x0, y + y0, bitmap[(y * xSize) + x]);
}
}
}
uint32_t GL_GetMonoBitmapWidth(const uint32_t *bitmap)
{
return bitmap[BMP_WIDTH_INDEX];
}
uint32_t GL_GetMonoBitmapHeight(const uint32_t *bitmap)
{
return bitmap[BMP_HEIGHT_INDEX];
}
/**
* Draw mono bitmap in a single RGB565 color at the specified location
* "1" pixels are drawn, "0" pixels are not drawn
*
* Data packed in uint16_t array, 1bpp, MSb first
*
* \param *bitmap pointer to bitmap
* \param x0 x coordinate of bitmap (top left)
* \param y0 y coordinate of bitmap (top left)
* \return void
*/
void GL_DrawMonoBitmap(const uint32_t *bitmap, uint16_t x0, uint16_t y0, LCD_DRAWMODE_t drawMode)
{
uint32_t xSize = bitmap[BMP_WIDTH_INDEX]; //bitmap width in pixels
uint32_t ySize = bitmap[BMP_HEIGHT_INDEX]; //bitmap height in pixels
const uint32_t *pData = &bitmap[BMP_DATA_INDEX];//data starts @ bitmap[2]
uint32_t startingBitMask = 0x80000000; //32-bit data, MDb first
uint32_t bitMask = startingBitMask;
for (uint16_t y = 0; y < ySize; y++)
{
for (uint16_t x = 0; x < xSize; x++)
{
if (bitMask == 0)
{
bitMask = startingBitMask;
pData++;
}
if (*pData & bitMask)
{
LCD_DrawPixel(x + x0, y + y0, drawMode);
}
bitMask = (bitMask >> 1);
}
}
}
/*
* Draw mono bitmap centered on screen
* \param *bitmap pointer to bitmap
* \param color color to draw bitmap
*/
void GL_DrawMonoBitmapCentered(const uint32_t *bitmap, LCD_DRAWMODE_t drawMode)
{
uint16_t x = LCD_X_MID - GL_GetMonoBitmapWidth(bitmap) / 2;
uint16_t y = LCD_Y_MID - GL_GetMonoBitmapHeight(bitmap) / 2;
GL_DrawMonoBitmap(bitmap, x, y, drawMode);
}

View File

@@ -0,0 +1,226 @@
/*
* graphicsLibrary.h
*
* Created on: Feb 12, 2022
* Author: Brian.Bailey
*/
#include <stdint.h>
#include <stddef.h>
#ifndef GRAPHICS_GRAPHICSLIBRARY_H_
#define GRAPHICS_GRAPHICSLIBRARY_H_
//include all bitmap headers
#include "testIconsMono.h"
/**
* Draw a line
*
* Output will be clipped to the current clip window.
*
* @param x0
* @param y0
* @param x1
* @param y1
* @param color
*/
void GL_DrawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t thickness, LCD_DRAWMODE_t drawMode);
/**
* Draw a rectangle
*
* Output will be clipped to the current clip window.
*
* @param x0
* @param y0
* @param x1
* @param y1
* @param thickness
* @param color
*/
void GL_DrawRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t thickness, LCD_DRAWMODE_t drawMode);
/**
* Draw a filled rectangle
*
* Output will be clipped to the current clip window.
*
* @param x0
* @param y0
* @param x1
* @param y1
* @param color
*/
void GL_DrawFilledRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, LCD_DRAWMODE_t drawMode);
/**
* Draw a circle
*
* Output will be clipped to the current clip window.
*
* @param x0 center X
* @param y0 center Y
* @param r radius
* @param color
*/
void GL_DrawCircle(int16_t x0, int16_t y0, int16_t r, LCD_DRAWMODE_t drawMode);
void GL_DrawCircle2(int16_t xc, int16_t yc, int16_t rInner, int16_t rOuter, LCD_DRAWMODE_t drawMode);
/**
* Draw a filled circle
*
* Output will be clipped to the current clip window.
*
* @param x0 center X
* @param y0 center Y
* @param r radius
* @param color
*/
void GL_DrawFilledCircle(int16_t x0, int16_t y0, int16_t r, LCD_DRAWMODE_t drawMode);
/**
* Draw an ellipse
*
* Output will be clipped to the current clip window.
*
* @param x0 center X
* @param y0 center Y
* @param a vertical radius
* @param b horizontal radius
* @param color
*/
void GL_DrawEllipse(int16_t x0, int16_t y0, int16_t a, int16_t b, LCD_DRAWMODE_t drawMode);
/**
* Draw a filled ellipse
*
* Output will be clipped to the current clip window.
*
* @param x0 center X
* @param y0 center Y
* @param a vertical radius
* @param b horizontal radius
* @param color
*/
void GL_DrawFilledEllipse(int16_t x0, int16_t y0, int16_t a, int16_t b, LCD_DRAWMODE_t drawMode);
/**
* Draw a polygon
*
* Output will be clipped to the current clip window. Polygon does
* not need to be convex. They can also be concave or complex.
*
* COLOR_t color = hagl_color(0, 255, 0);
* int16_t vertices[10] = {x0, y0, x1, y1, x2, y2, x3, y3, x4, y4};
* hagl_draw_polygon(5, vertices, color);
*
* @param numVertices number of vertices
* @param vertices pointer to (an array) of vertices
* @param thickness thickness in pixels
* @param color
*/
void GL_DrawPolygon(int16_t numVertices, int16_t *vertices, int16_t thickness, LCD_DRAWMODE_t drawMode);
/**
* Draw a filled polygon
*
* Output will be clipped to the current clip window. Polygon does
* not need to be convex. They can also be concave or complex.
*
* COLOR_t color = hagl_color(0, 255, 0);
* int16_t vertices[10] = {x0, y0, x1, y1, x2, y2, x3, y3, x4, y4};
* hagl_draw_polygon(5, vertices, color);
*
* @param numVertices number of vertices
* @param vertices pointer to (an array) of vertices
* @param thickness thickness in pixels
* @param color
*/
void GL_DrawFilledPolygon(int16_t numVertices, int16_t *vertices, LCD_DRAWMODE_t drawMode);
/**
* Draw a triangle
*
* Output will be clipped to the current clip window. Internally
* uses hagl_draw_polygon() to draw the triangle.
*
* @param x0
* @param y0
* @param x1
* @param y1
* @param x2
* @param y3
* @param thickness
* @param color
*/
void GL_DrawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t thickness, LCD_DRAWMODE_t drawMode);
/**
* Draw a filled triangle
*
* Output will be clipped to the current clip window. Internally
* uses hagl_fill_polygon() to draw the triangle.
*
* @param x0
* @param y0
* @param x1
* @param y1
* @param x2
* @param y3
* @param color
*/
void GL_DrawFilledTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, LCD_DRAWMODE_t drawMode);
/**
* Draw a rounded rectangle
*
* Output will be clipped to the current clip window.
*
* @param x0
* @param y0
* @param x0
* @param y0
* @param r corner radius
* @param color
*/
void GL_DrawRoundedRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t r, LCD_DRAWMODE_t drawMode);
/**
* Draw a filled rounded rectangle
*
* Output will be clipped to the current clip window.
*
* @param x0
* @param y0
* @param x1
* @param y1
* @param r corner radius
* @param color
*/
void GL_DrawFilledRoundedRectangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t r, LCD_DRAWMODE_t drawMode);
uint16_t GL_GetColorBitmapWidth(const uint16_t *bitmap);
uint16_t GL_GetColorBitmapHeight(const uint16_t *bitmap);
void GL_DrawColorBitmap(const uint16_t *bitmap, uint16_t x0, uint16_t y0);
uint32_t GL_GetMonoBitmapWidth(const uint32_t *bitmap);
uint32_t GL_GetMonoBitmapHeight(const uint32_t *bitmap);
void GL_DrawMonoBitmap(const uint32_t *bitmap, uint16_t x0, uint16_t y0, LCD_DRAWMODE_t drawMode);
void GL_DrawMonoBitmapCentered(const uint32_t *bitmap, LCD_DRAWMODE_t drawMode);
#endif /* GRAPHICS_GRAPHICSLIBRARY_H_ */

564
source/Graphics/icons.c Normal file
View File

@@ -0,0 +1,564 @@
// Generated by MonoBitmapConverter
// Bitmap Format:
// [0] bitmap width in pixels
// [1] bitmap height in pixels
// [2] bitmap data
#include <stdint.h>
uint32_t battery0[] =
{ 20, 25,
0x00000000, 0x0003fc00, 0x3fc03fff, 0xc2000420, 0x00420004, 0x20004200, 0x04200042, 0x00042000,
0x42000420, 0x00420004, 0x20004200, 0x04200042, 0x00042000, 0x4200043f, 0xffc00000, 0x00000000,
};
uint32_t battery1[] =
{ 20, 25,
0x00000000, 0x0003fc00, 0x3fc03fff, 0xc2000420, 0x00420004, 0x20004200, 0x04200042, 0x00042000,
0x42000420, 0x00420004, 0x20004200, 0x042fff42, 0xfff42fff, 0x4200043f, 0xffc00000, 0x00000000,
};
uint32_t battery2[] =
{ 20, 25,
0x00000000, 0x0003fc00, 0x3fc03fff, 0xc2000420, 0x00420004, 0x20004200, 0x04200042, 0x00042000,
0x4200042f, 0xff42fff4, 0x2fff4200, 0x042fff42, 0xfff42fff, 0x4200043f, 0xffc00000, 0x00000000,
};
uint32_t battery3[] =
{ 20, 25,
0x00000000, 0x0003fc00, 0x3fc03fff, 0xc2000420, 0x00420004, 0x20004200, 0x042fff42, 0xfff42fff,
0x4200042f, 0xff42fff4, 0x2fff4200, 0x042fff42, 0xfff42fff, 0x4200043f, 0xffc00000, 0x00000000,
};
uint32_t battery4[] =
{ 20, 25,
0x00000000, 0x0003fc00, 0x3fc03fff, 0xc200042f, 0xff42fff4, 0x2fff4200, 0x042fff42, 0xfff42fff,
0x4200042f, 0xff42fff4, 0x2fff4200, 0x042fff42, 0xfff42fff, 0x4200043f, 0xffc00000, 0x00000000,
};
uint32_t border60x60[] =
{ 60, 60,
0x03ffffff, 0xfffffc01, 0xc0000000, 0x00003820, 0x00000000, 0x00004400, 0x00000000, 0x00024000,
0x00000000, 0x00240000, 0x00000000, 0x02800000, 0x00000000, 0x18000000, 0x00000001, 0x80000000,
0x00000018, 0x00000000, 0x00000180, 0x00000000, 0x00001800, 0x00000000, 0x00018000, 0x00000000,
0x00180000, 0x00000000, 0x01800000, 0x00000000, 0x18000000, 0x00000001, 0x80000000, 0x00000018,
0x00000000, 0x00000180, 0x00000000, 0x00001800, 0x00000000, 0x00018000, 0x00000000, 0x00180000,
0x00000000, 0x01800000, 0x00000000, 0x18000000, 0x00000001, 0x80000000, 0x00000018, 0x00000000,
0x00000180, 0x00000000, 0x00001800, 0x00000000, 0x00018000, 0x00000000, 0x00180000, 0x00000000,
0x01800000, 0x00000000, 0x18000000, 0x00000001, 0x80000000, 0x00000018, 0x00000000, 0x00000180,
0x00000000, 0x00001800, 0x00000000, 0x00018000, 0x00000000, 0x00180000, 0x00000000, 0x01800000,
0x00000000, 0x18000000, 0x00000001, 0x80000000, 0x00000018, 0x00000000, 0x00000180, 0x00000000,
0x00001800, 0x00000000, 0x00018000, 0x00000000, 0x00180000, 0x00000000, 0x01800000, 0x00000000,
0x18000000, 0x00000001, 0x80000000, 0x00000018, 0x00000000, 0x00000180, 0x00000000, 0x00001800,
0x00000000, 0x00018000, 0x00000000, 0x00180000, 0x00000000, 0x01400000, 0x00000000, 0x24000000,
0x00000002, 0x40000000, 0x00000022, 0x00000000, 0x0000041c, 0x00000000, 0x0003803f, 0xffffffff,
0xffc00000,
};
uint32_t box_checked[] =
{ 18, 18,
0x00000fff, 0xc7ffe180, 0x00600058, 0x00360019, 0x900c6606, 0x18c30619, 0x8983c660, 0x61980066,
0x0019fffe, 0x3fff0000, 0x00000000,
};
uint32_t box_unchecked[] =
{ 18, 18,
0x00000fff, 0xc7fff980, 0x06600198, 0x00660019, 0x80066001, 0x98006600, 0x19800660, 0x01980066,
0x0019fffe, 0x3fff0000, 0x00000000,
};
uint32_t clamp2[] =
{ 48, 48,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006,
0x00000000, 0x001fe000, 0x0000000f, 0xfe000000, 0x0007ff00, 0x00000003, 0xff800000, 0x00003f80,
0x00000300, 0x1fc00000, 0x07800fc0, 0x00000780, 0x07c00000, 0x078007f0, 0x00000780, 0x07f80000,
0x038007f8, 0x000003c0, 0x0efc0000, 0x03c00c7c, 0x000001f0, 0x187c0000, 0x01fcf07f, 0xc00000ff,
0xf77ff000, 0x00ffe77f, 0xfc00007f, 0xe7fffe00, 0x003fe0ff, 0xf700000f, 0xe0c0ef80, 0x0001e0c0,
0x32c00001, 0xf0c01be0, 0x0001f8c0, 0x0d600000, 0x7dc007e0, 0x00001fc0, 0x03e00000, 0x1fc00000,
0x00000fc0, 0x00000000, 0x07e00000, 0x000007f0, 0x00000000, 0x03fc0000, 0x000003dc, 0x00000000,
0x01ee0000, 0x000000f6, 0x00000000, 0x007f0000, 0x0000003f, 0x00000000, 0x001e0000, 0x0000000c,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
};
uint32_t clampIcon[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000ff, 0xf0000000, 0x00003fff,
0xc0000000, 0x000fffff, 0x00000000, 0x01fffff8, 0x00000000, 0x3fffffc0, 0x00000007, 0xf801fe00,
0x000000fe, 0x0007f000, 0x00000fc0, 0x003f0000, 0x0001f800, 0x01f80000, 0x001f0000, 0x0f800000,
0x03f00000, 0xfc000000, 0x3e000007, 0xc0000007, 0xe000007c, 0x0000007e, 0x000007c0, 0x00000fe0,
0x00007c00, 0x0001fe00, 0x0007c000, 0x003fe000, 0x007c7fff, 0xfffe0000, 0x07c7ffff, 0xffe00000,
0x7c7fffff, 0xff00000f, 0xc7ffffff, 0xf00000f8, 0x7fffffff, 0x80001f80, 0x00001ffc, 0x0003f000,
0x0001ffe0, 0x007f0000, 0x001fff80, 0x1fe00000, 0x03ffffff, 0xfc000000, 0x7fffffff, 0x8000000f,
0xfffffff0, 0x000001fe, 0x03fffc00, 0x00003fc0, 0x0fff0000, 0x0007f800, 0x00000000, 0x00ff0000,
0x00000000, 0x1fe00000, 0x00000003, 0xfc000000, 0x0000007f, 0x80000000, 0x00000ff0, 0x00000000,
0x0001fe00, 0x00000000, 0x003fc000, 0x00000000, 0x07f80000, 0x00000000, 0xff000000, 0x00000007,
0xe0000000, 0x0000007e, 0x00000000, 0x000003c0, 0x00000000, 0x00001800, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t clampIcon2[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x0007ff00, 0x00000000, 0x01fffc00, 0x00000000, 0x7ffff000,
0xc000000f, 0xffff800f, 0x000001ff, 0xfffc01fc, 0x00003fc0, 0x1fe01ff0, 0x0007f000, 0x7f03ffe0,
0x00fe0003, 0xf80fff80, 0x0fc0001f, 0x803ffe01, 0xf80000fc, 0x007ff83f, 0x000007c0, 0x01fffff0,
0x00007e00, 0x07fffe00, 0x0003e000, 0x1fffe000, 0x003e0000, 0x3f1e0000, 0x03e00000, 0xeee00000,
0x3e000000, 0xe0000000, 0x0000002e, 0xe000003e, 0x0000071e, 0x000003e0, 0x0000ffe0, 0x00003e00,
0x003ffe00, 0x0003e000, 0x0ffff000, 0x007e0003, 0xffff0000, 0x07c000ff, 0xe1f80000, 0xfc003ff8,
0x0fc0001f, 0x800ffe00, 0xfe0003f8, 0x03ffc007, 0xf0007f00, 0xfff0003f, 0xc01fe03f, 0xfc0001ff,
0xfffc03ff, 0x00000fff, 0xff801fc0, 0x00007fff, 0xf000f800, 0x0001fffc, 0x00060000, 0x0007ff00,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t dangerousVoltage68x60[] =
{ 68, 60,
0x00000000, 0xf0000000, 0x00000000, 0x1f800000, 0x00000000, 0x03fc0000, 0x00000000, 0x0070e000,
0x00000000, 0x00070e00, 0x00000000, 0x0000e070, 0x00000000, 0x00000c03, 0x00000000, 0x000001c0,
0x38000000, 0x00000038, 0x01c00000, 0x00000003, 0x801c0000, 0x00000000, 0x7000e000, 0x00000000,
0x07000e00, 0x00000000, 0x00e00070, 0x00000000, 0x001c0003, 0x80000000, 0x0001c000, 0x38000000,
0x00003800, 0x01c00000, 0x00000380, 0x001c0000, 0x00000070, 0x0000e000, 0x00000007, 0x00000e00,
0x00000000, 0xe0000070, 0x00000000, 0x1c000003, 0x80000000, 0x01c03ffc, 0x38000000, 0x003803ff,
0x81c00000, 0x0003807f, 0xf81c0000, 0x00007007, 0xff00e000, 0x00000600, 0x7ff00600, 0x000000e0,
0x0ffe0070, 0x0000001c, 0x00ffc003, 0x80000001, 0xc00ffc00, 0x38000000, 0x3801ff80, 0x01c00000,
0x03801ff0, 0x001c0000, 0x007001ff, 0xf800e000, 0x000e003f, 0xff800700, 0x0000e003, 0xfff80070,
0x00001c00, 0x3fff0003, 0x800001c0, 0x07fff000, 0x38000038, 0x007ffe00, 0x01c00003, 0x000fffc0,
0x001c0000, 0x7000fffc, 0x0000e000, 0x0e00007f, 0x80000700, 0x00e00007, 0xf0000070, 0x001c0000,
0xff000003, 0x8001c000, 0x0fe00000, 0x38003800, 0x00fc0000, 0x01c00300, 0x000fc000, 0x000e0070,
0x0001f800, 0x0000e00e, 0x00001f00, 0x00000700, 0xe00001f0, 0x00000070, 0x1c00001e, 0x00000003,
0x81c00003, 0xc0000000, 0x38380000, 0x3c000000, 0x01c70000, 0x03800000, 0x000e7000, 0x00300000,
0x0000ee00, 0x00000000, 0x000007e0, 0x00000000, 0x0000007c, 0x00000000, 0x00000003, 0xe0000000,
0x00000000, 0x7f000000, 0x00000000, 0x0f7fffff, 0xffffffff, 0xffe3ffff, 0xffffffff, 0xfffc0000,
};
uint32_t DC1[] =
{ 28, 28,
0x00000000, 0x001dc000, 0x03de0000, 0x38e00003, 0x8e000078, 0xf000078f, 0x000078f0, 0x0007ff00,
0x00471000, 0x0c710000, 0xfff8000f, 0xff8000f0, 0x78001e03, 0x8001e03c, 0x001e03c0, 0x03e03efe,
0x3c03efe3, 0xc03e023c, 0x01e023c0, 0x1e023c01, 0xe023c01e, 0x02180000, 0x21800003, 0xf8000000,
0x00000000,
};
uint32_t directConnectIcon[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00380000, 0x00000000,
0x03e00000, 0x00000000, 0x1f800000, 0x00000000, 0xfe000000, 0x00000007, 0xf8000000, 0x0000007f,
0xe0000000, 0x000003ff, 0x80000000, 0x00001ffe, 0x00000000, 0x0000fff0, 0x00000000, 0x000ffff0,
0x00000000, 0x00ffffe0, 0x00000000, 0x1ffffe00, 0x000001e1, 0xff87e000, 0x3fffffff, 0xfc060003,
0xffffffff, 0xff00003f, 0xffffffff, 0xfe0001ff, 0xffffffff, 0xe0001fff, 0xfffffffe, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t directConnectIcon2[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000038,
0x00000000, 0x000003e0, 0x00000000, 0x00001f80, 0x00000000, 0x0000fe00, 0x00000000, 0x0007f800,
0x00000000, 0x007fe000, 0x00000000, 0x03ff8000, 0x00000000, 0x1ffe0000, 0x00000000, 0xfff00000,
0x0000000f, 0xfff00000, 0x000000ff, 0xffe00000, 0x00001fff, 0xfe000000, 0x01e1ff87, 0xe0003fff,
0xfffffc06, 0x0003ffff, 0xffffff00, 0x003fffff, 0xfffffe00, 0x01ffffff, 0xffffe000, 0x1fffffff,
0xfffe0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000038, 0x00000000, 0x00000360, 0x00000000,
0x00001b80, 0x00000000, 0x0000ce00, 0x00000000, 0x00043800, 0x00000000, 0x0060e000, 0x00000000,
0x03038000, 0x00000000, 0x180e0000, 0x00000000, 0x80300000, 0x00000008, 0x01f00000, 0x00000080,
0x01e00000, 0x0000180f, 0xc2000000, 0x01e10087, 0xe0003fff, 0xf3f00c06, 0x00020000, 0x00007f00,
0x00300000, 0x00001e00, 0x01000000, 0x00002000, 0x1fffffff, 0xfffe0000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t directConnectIcon3[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000038,
0x00000000, 0x000003e0, 0x00000000, 0x00001f80, 0x00000000, 0x0000fe00, 0x00000000, 0x0007f800,
0x00000000, 0x007fe000, 0x00000000, 0x03ff8000, 0x00000000, 0x1ffe0000, 0x00000000, 0xfff00000,
0x0000000f, 0xfff00000, 0x000000ff, 0xffe00000, 0x00001fff, 0xfe000000, 0x01e1ff77, 0x60003fff,
0xfffffaaa, 0x0003ffff, 0xffffddc0, 0x003fffff, 0xfffffe00, 0x01ffffff, 0xffffe000, 0x1fffffff,
0xfffe0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000038, 0x00000000, 0x00000360, 0x00000000,
0x00001b80, 0x00000000, 0x0000ce00, 0x00000000, 0x00043800, 0x00000000, 0x0060e000, 0x00000000,
0x03038000, 0x00000000, 0x180e0000, 0x00000000, 0x80300000, 0x00000008, 0x01f00000, 0x00000080,
0x01e00000, 0x00001800, 0x02000000, 0x01e10088, 0xa0003fff, 0xf3f00556, 0x00020000, 0x00002220,
0x00300000, 0x00000200, 0x01000000, 0x00002000, 0x1fffffff, 0xfffe0000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t directConnectIcon4[] =
{ 60, 60,
0x03ffffff, 0xfffffc01, 0xc0000000, 0x00003820, 0x00000000, 0x00004400, 0x00000000, 0x00024000,
0x00000000, 0x00240000, 0x00000000, 0x02800000, 0x00000000, 0x18000000, 0x00000001, 0x80000038,
0x00000018, 0x000003e0, 0x00000180, 0x00001f80, 0x00001800, 0x0000fe00, 0x00018000, 0x0007f800,
0x00180000, 0x007fe000, 0x01800000, 0x03ff8000, 0x18000000, 0x1ffe0001, 0x80000000, 0xfff00018,
0x0000000f, 0xfff00180, 0x000000ff, 0xffe01800, 0x00001fff, 0xfe018000, 0x01e1ff77, 0x60183fff,
0xfffffaaa, 0x0183ffff, 0xffffddc0, 0x183fffff, 0xfffffe01, 0x81ffffff, 0xffffe018, 0x1fffffff,
0xfffe0180, 0x00000000, 0x00001800, 0x00000000, 0x00018000, 0x00000000, 0x00180000, 0x00000000,
0x01800000, 0x00000000, 0x18000000, 0x00000001, 0x80000038, 0x00000018, 0x00000360, 0x00000180,
0x00001b80, 0x00001800, 0x0000ce00, 0x00018000, 0x00043800, 0x00180000, 0x0060e000, 0x01800000,
0x03038000, 0x18000000, 0x180e0001, 0x80000000, 0x80300018, 0x00000008, 0x01f00180, 0x00000080,
0x01e01800, 0x00001800, 0x02018000, 0x01e10088, 0xa0183fff, 0xf3f00556, 0x01820000, 0x00002220,
0x18300000, 0x00000201, 0x81000000, 0x00002018, 0x1fffffff, 0xfffe0180, 0x00000000, 0x00001800,
0x00000000, 0x00018000, 0x00000000, 0x00180000, 0x00000000, 0x01400000, 0x00000000, 0x24000000,
0x00000002, 0x40000000, 0x00000022, 0x00000000, 0x0000041c, 0x00000000, 0x0003803f, 0xffffffff,
0xffc00000,
};
uint32_t directConnectIcon5[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00380000, 0x00000000,
0x03e00000, 0x00000000, 0x1f800000, 0x00000000, 0xfe000000, 0x00000007, 0xf8000000, 0x0000007f,
0xe0000000, 0x000003ff, 0x80000000, 0x00001ffe, 0x00000000, 0x0000fff0, 0x00000000, 0x000ffff0,
0x00000000, 0x00ffffe0, 0x00000000, 0x1ffffe00, 0x000001e1, 0xff776000, 0x3fffffff, 0xfaaa0003,
0xffffffff, 0xddc0003f, 0xffffffff, 0xfe0001ff, 0xffffffff, 0xe0001fff, 0xfffffffe, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t highVoltageIcon[] =
{ 15, 25,
0x00000ff8, 0x1fe07f80, 0xff01fc07, 0xf00fc01f, 0xfc7ff8ff, 0xe1ffc7ff, 0x0ffc01f0, 0x07e00f80,
0x1e007c00, 0xf001e007, 0x800e0018, 0x00200000,
};
uint32_t inductionIcon[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000001f, 0xffffffff, 0xfff003ff,
0xffffffff, 0xff007fff, 0xffffffff, 0xf007f800, 0x001fffff, 0x00df0000, 0x00f01ff0, 0x0ef00000,
0x07fe0200, 0xf7000000, 0xffffe01f, 0xbc00001f, 0xfffc01fd, 0xf80003ff, 0xffe03fef, 0xfe00ffff,
0xfe03feff, 0xffffffff, 0xf03ff7ff, 0xffffffff, 0x03ff81ff, 0xfffffff0, 0x3fffe001, 0xffffff01,
0xffffffe0, 0x3ffff81f, 0xffffffff, 0xffff81ff, 0xffffffff, 0xfff81fff, 0xffffffff, 0xffc1ffff,
0xffffffff, 0xfc1fffff, 0xffffffff, 0xc1ffffff, 0xfffffffc, 0x1fffffff, 0xffffffe1, 0xffffffff,
0xfffffe1f, 0xc7ffffff, 0xffffe1fe, 0xafffffff, 0xfffe1fed, 0xffffffff, 0xffe0feaf, 0xffffffff,
0xfc07ffff, 0xffffffff, 0x803fffff, 0xfffffff0, 0x01ffffff, 0xfffffe00, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000060, 0x00000030, 0x00000380,
0x00000e00, 0x00001fc0, 0x001fc000, 0x00007fff, 0xfff00000, 0x00003fff, 0xe0000000, 0x60000000,
0x00300007, 0x00000000, 0x0700003c, 0x00000001, 0xe00001f8, 0x000000fc, 0x000007fc, 0x0001ff00,
0x006007ff, 0xffff0030, 0x070003ff, 0xfe000700, 0x38000000, 0x0000e001, 0xe0000000, 0x003c0007,
0xc0000000, 0x1f00001f, 0x8000000f, 0xc000007f, 0xc0001ff0, 0x0000007f, 0xfffff000, 0x0000003f,
0xffe00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t lamp[] =
{ 28, 28,
0x00000000, 0x00000000, 0x00000000, 0x60000006, 0x00000060, 0x00000f00, 0x0003fc00, 0x00606000,
0x0fff0001, 0xfff80010, 0x00800100, 0x08003fff, 0xc003fffc, 0x00010800, 0x00198000, 0x00f00000,
0x06000006, 0x060000e6, 0x70001c63, 0x80018618, 0x00006000, 0x00060000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t ld[] =
{ 21, 18,
0x3e0001f0, 0x000f8000, 0x780007c0, 0x003e0001, 0xf0ff0f0f, 0xfc787ff7, 0xc3efbfff, 0x3fff00ff,
0xf8077ffc, 0xf803efc0, 0x1ffc00ff, 0xc00ffc00,
};
uint32_t ld2[] =
{ 20, 18,
0xf0000f00, 0x00f0000f, 0x0000f000, 0x0f0000f0, 0xff0f0ffc, 0xf0ffef0f, 0x3efff1ff, 0xf00fff00,
0xffff1f00, 0xf3e00ffe, 0x00ffc00f, 0xf0000000,
};
uint32_t menuMore[] =
{ 19, 14,
0xf0780f07, 0x80f0780f, 0x0780f078, 0x0f0780f0, 0x781e0f07, 0x83c1e0f0, 0x783c1e0f, 0x0783c1e0,
0xf0000000,
};
uint32_t power0[] =
{ 81, 42,
0x00000000, 0x00000000, 0x00018000, 0x00000000, 0x00000003, 0xc0000000, 0x00000000, 0x0007e000,
0x00000000, 0x0000000f, 0xf0000000, 0x00000000, 0x001f9800, 0x00000000, 0x0000003f, 0x0c000000,
0x00000000, 0x007e0600, 0x00000000, 0x000000fc, 0x03000000, 0x00000000, 0x01f80180, 0x00000000,
0x000000f0, 0x00c00000, 0x00000000, 0x0c600060, 0x00000000, 0x00001e30, 0x00300000, 0x00000000,
0x3f180018, 0x00000000, 0x00007f8c, 0x000c0000, 0x00000000, 0xfcc60006, 0x00000000, 0x0001f863,
0x00030000, 0x00000003, 0xf0318001, 0x80000000, 0x0007e018, 0xc000c000, 0x0000000f, 0xc00c6000,
0x60000000, 0x00078006, 0x30003000, 0x00000063, 0x00031800, 0x18000000, 0x00f18001, 0x8c000c00,
0x000001f8, 0xc000c600, 0x06000000, 0x03fc6000, 0x63000300, 0x000007e6, 0x30003180, 0x01800000,
0x0fc31800, 0x18c000c0, 0x00001f81, 0x8c000c60, 0x00600000, 0x3f00c600, 0x06300030, 0x00007e00,
0x63000318, 0x00180000, 0x3c003180, 0x018c000c, 0x00031800, 0x18c000c6, 0x00060007, 0x8c000c60,
0x00630003, 0x000fc600, 0x06300031, 0x8001801f, 0xe3000318, 0x0018c000, 0xc03f3180, 0x018c000c,
0x6000607e, 0x18c000c6, 0x00063000, 0x30fc0c60, 0x00630003, 0x180019f8, 0x06300031, 0x80018c00,
0x0ff00318, 0x0018c000, 0xc60007e0, 0x018c000c, 0x60006300, 0x03ffffc7, 0xfffe3fff, 0xf1ffffff,
0xffe3ffff, 0x1ffff8ff, 0xffc00000,
};
uint32_t power1[] =
{ 81, 42,
0x00000000, 0x00000000, 0x00018000, 0x00000000, 0x00000003, 0xc0000000, 0x00000000, 0x0007e000,
0x00000000, 0x0000000f, 0xf0000000, 0x00000000, 0x001f9800, 0x00000000, 0x0000003f, 0x0c000000,
0x00000000, 0x007e0600, 0x00000000, 0x000000fc, 0x03000000, 0x00000000, 0x01f80180, 0x00000000,
0x000000f0, 0x00c00000, 0x00000000, 0x0c600060, 0x00000000, 0x00001e30, 0x00300000, 0x00000000,
0x3f180018, 0x00000000, 0x00007f8c, 0x000c0000, 0x00000000, 0xfcc60006, 0x00000000, 0x0001f863,
0x00030000, 0x00000003, 0xf0318001, 0x80000000, 0x0007e018, 0xc000c000, 0x0000000f, 0xc00c6000,
0x60000000, 0x00078006, 0x30003000, 0x00000063, 0x00031800, 0x18000000, 0x00f18001, 0x8c000c00,
0x000001f8, 0xc000c600, 0x06000000, 0x03fc6000, 0x63000300, 0x000007e6, 0x30003180, 0x01800000,
0x0fc31800, 0x18c000c0, 0x00001f81, 0x8c000c60, 0x00600000, 0x3f00c600, 0x06300030, 0x00007e00,
0x63000318, 0x00180000, 0x3c003180, 0x018c000c, 0x00031800, 0x18c000c6, 0x00060007, 0x8c000c60,
0x00630003, 0x000fc600, 0x06300031, 0x8001801f, 0xe3000318, 0x0018c000, 0xc03ff180, 0x018c000c,
0x6000607f, 0xf8c000c6, 0x00063000, 0x30fffc60, 0x00630003, 0x180019ff, 0xfe300031, 0x80018c00,
0x0fffff18, 0x0018c000, 0xc60007ff, 0xff8c000c, 0x60006300, 0x03ffffc7, 0xfffe3fff, 0xf1ffffff,
0xffe3ffff, 0x1ffff8ff, 0xffc00000,
};
uint32_t power2[] =
{ 81, 42,
0x00000000, 0x00000000, 0x00018000, 0x00000000, 0x00000003, 0xc0000000, 0x00000000, 0x0007e000,
0x00000000, 0x0000000f, 0xf0000000, 0x00000000, 0x001f9800, 0x00000000, 0x0000003f, 0x0c000000,
0x00000000, 0x007e0600, 0x00000000, 0x000000fc, 0x03000000, 0x00000000, 0x01f80180, 0x00000000,
0x000000f0, 0x00c00000, 0x00000000, 0x0c600060, 0x00000000, 0x00001e30, 0x00300000, 0x00000000,
0x3f180018, 0x00000000, 0x00007f8c, 0x000c0000, 0x00000000, 0xfcc60006, 0x00000000, 0x0001f863,
0x00030000, 0x00000003, 0xf0318001, 0x80000000, 0x0007e018, 0xc000c000, 0x0000000f, 0xc00c6000,
0x60000000, 0x00078006, 0x30003000, 0x00000063, 0x00031800, 0x18000000, 0x00f18001, 0x8c000c00,
0x000001f8, 0xc000c600, 0x06000000, 0x03fc6000, 0x63000300, 0x000007fe, 0x30003180, 0x01800000,
0x0fff1800, 0x18c000c0, 0x00001fff, 0x8c000c60, 0x00600000, 0x3fffc600, 0x06300030, 0x00007fff,
0xe3000318, 0x00180000, 0x3ffff180, 0x018c000c, 0x00031fff, 0xf8c000c6, 0x00060007, 0x8ffffc60,
0x00630003, 0x000fc7ff, 0xfe300031, 0x8001801f, 0xe3ffff18, 0x0018c000, 0xc03ff1ff, 0xff8c000c,
0x6000607f, 0xf8ffffc6, 0x00063000, 0x30fffc7f, 0xffe30003, 0x180019ff, 0xfe3ffff1, 0x80018c00,
0x0fffff1f, 0xfff8c000, 0xc60007ff, 0xff8ffffc, 0x60006300, 0x03ffffc7, 0xfffe3fff, 0xf1ffffff,
0xffe3ffff, 0x1ffff8ff, 0xffc00000,
};
uint32_t power3[] =
{ 81, 42,
0x00000000, 0x00000000, 0x00018000, 0x00000000, 0x00000003, 0xc0000000, 0x00000000, 0x0007e000,
0x00000000, 0x0000000f, 0xf0000000, 0x00000000, 0x001f9800, 0x00000000, 0x0000003f, 0x0c000000,
0x00000000, 0x007e0600, 0x00000000, 0x000000fc, 0x03000000, 0x00000000, 0x01f80180, 0x00000000,
0x000000f0, 0x00c00000, 0x00000000, 0x0c600060, 0x00000000, 0x00001e30, 0x00300000, 0x00000000,
0x3f180018, 0x00000000, 0x00007f8c, 0x000c0000, 0x00000000, 0xffc60006, 0x00000000, 0x0001ffe3,
0x00030000, 0x00000003, 0xfff18001, 0x80000000, 0x0007fff8, 0xc000c000, 0x0000000f, 0xfffc6000,
0x60000000, 0x0007fffe, 0x30003000, 0x00000063, 0xffff1800, 0x18000000, 0x00f1ffff, 0x8c000c00,
0x000001f8, 0xffffc600, 0x06000000, 0x03fc7fff, 0xe3000300, 0x000007fe, 0x3ffff180, 0x01800000,
0x0fff1fff, 0xf8c000c0, 0x00001fff, 0x8ffffc60, 0x00600000, 0x3fffc7ff, 0xfe300030, 0x00007fff,
0xe3ffff18, 0x00180000, 0x3ffff1ff, 0xff8c000c, 0x00031fff, 0xf8ffffc6, 0x00060007, 0x8ffffc7f,
0xffe30003, 0x000fc7ff, 0xfe3ffff1, 0x8001801f, 0xe3ffff1f, 0xfff8c000, 0xc03ff1ff, 0xff8ffffc,
0x6000607f, 0xf8ffffc7, 0xfffe3000, 0x30fffc7f, 0xffe3ffff, 0x180019ff, 0xfe3ffff1, 0xffff8c00,
0x0fffff1f, 0xfff8ffff, 0xc60007ff, 0xff8ffffc, 0x7fffe300, 0x03ffffc7, 0xfffe3fff, 0xf1ffffff,
0xffe3ffff, 0x1ffff8ff, 0xffc00000,
};
uint32_t power4[] =
{ 81, 42,
0x00000000, 0x00000000, 0x00018000, 0x00000000, 0x00000003, 0xc0000000, 0x00000000, 0x0007e000,
0x00000000, 0x0000000f, 0xf0000000, 0x00000000, 0x001ff800, 0x00000000, 0x0000003f, 0xfc000000,
0x00000000, 0x007ffe00, 0x00000000, 0x000000ff, 0xff000000, 0x00000000, 0x01ffff80, 0x00000000,
0x000000ff, 0xffc00000, 0x00000000, 0x0c7fffe0, 0x00000000, 0x00001e3f, 0xfff00000, 0x00000000,
0x3f1ffff8, 0x00000000, 0x00007f8f, 0xfffc0000, 0x00000000, 0xffc7fffe, 0x00000000, 0x0001ffe3,
0xffff0000, 0x00000003, 0xfff1ffff, 0x80000000, 0x0007fff8, 0xffffc000, 0x0000000f, 0xfffc7fff,
0xe0000000, 0x0007fffe, 0x3ffff000, 0x00000063, 0xffff1fff, 0xf8000000, 0x00f1ffff, 0x8ffffc00,
0x000001f8, 0xffffc7ff, 0xfe000000, 0x03fc7fff, 0xe3ffff00, 0x000007fe, 0x3ffff1ff, 0xff800000,
0x0fff1fff, 0xf8ffffc0, 0x00001fff, 0x8ffffc7f, 0xffe00000, 0x3fffc7ff, 0xfe3ffff0, 0x00007fff,
0xe3ffff1f, 0xfff80000, 0x3ffff1ff, 0xff8ffffc, 0x00031fff, 0xf8ffffc7, 0xfffe0007, 0x8ffffc7f,
0xffe3ffff, 0x000fc7ff, 0xfe3ffff1, 0xffff801f, 0xe3ffff1f, 0xfff8ffff, 0xc03ff1ff, 0xff8ffffc,
0x7fffe07f, 0xf8ffffc7, 0xfffe3fff, 0xf0fffc7f, 0xffe3ffff, 0x1ffff9ff, 0xfe3ffff1, 0xffff8fff,
0xffffff1f, 0xfff8ffff, 0xc7ffffff, 0xff8ffffc, 0x7fffe3ff, 0xffffffc7, 0xfffe3fff, 0xf1ffffff,
0xffe3ffff, 0x1ffff8ff, 0xffc00000,
};
uint32_t teacup[] =
{ 120, 116,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10000000, 0x00000000, 0x00000000,
0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0x00000000, 0x00000000, 0x00000000,
0x000c0000, 0x00000000, 0x00000000, 0x00000000, 0x0c000000, 0x00000000, 0x00000000, 0x0000000e,
0x00000000, 0x00000000, 0x00000000, 0x00000e00, 0x00000000, 0x00000000, 0x00000000, 0x000e0000,
0x00000000, 0x00000000, 0x00000000, 0x0e000000, 0x00000000, 0x00000000, 0x0000000e, 0x00000000,
0x00000000, 0x00000000, 0x00000e00, 0x00000000, 0x00000000, 0x00000000, 0x000e0000, 0x00000000,
0x00000000, 0x00000000, 0x1e000000, 0x00000000, 0x00000000, 0x0000001e, 0x00000000, 0x00000000,
0x00000000, 0x00001e00, 0x00000000, 0x00000000, 0x00000000, 0x003c0000, 0x00000000, 0x00000000,
0x00000000, 0x3c000000, 0x00000000, 0x00000000, 0x0000003c, 0x00000000, 0x00000000, 0x00000000,
0x00007800, 0x00000000, 0x00000000, 0x00000000, 0x00780000, 0x00000000, 0x00000000, 0x00000000,
0x70000000, 0x00000000, 0x00000000, 0x00000070, 0x00000000, 0x00000000, 0x00000000, 0x0000f000,
0x00000000, 0x00000000, 0x00000000, 0x00e00000, 0x00000000, 0x00000000, 0x00000000, 0xe0000000,
0x00000000, 0x00000000, 0x000000c0, 0x00000000, 0x00000000, 0x00000000, 0x0000c000, 0x00000000,
0x00000000, 0x00000000, 0x00c00000, 0x00000000, 0x00000000, 0x00000000, 0x80000000, 0x00000000,
0x00000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0x00008000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07ffffff, 0xfffe0000,
0x00000000, 0x000003ff, 0xffffffff, 0xfff80000, 0x00000000, 0x00ffffff, 0xffffffff, 0xffe00000,
0x00000007, 0xffffffff, 0xffffffff, 0xfc000000, 0x00001fff, 0xffffffff, 0xffffffff, 0x80000000,
0x001fffff, 0xffffffff, 0xfffffe00, 0x00000000, 0x07ffffc0, 0x0000003f, 0xfffc0000, 0x00000040,
0x3e000000, 0x0000001f, 0xe0600000, 0x00007000, 0x00000000, 0x00000000, 0x60000000, 0x007e0000,
0x00000000, 0x000001e0, 0x00000000, 0x7f800000, 0x00000000, 0x001ffff8, 0x0000007f, 0xfc000000,
0x00000001, 0xfffffe00, 0x00007fff, 0xf8000000, 0x000fffff, 0xffff0000, 0x007fffff, 0xffffffff,
0xffffffff, 0xff800000, 0x7fffffff, 0xffffffff, 0xffffffff, 0xc000003f, 0xffffffff, 0xffffffff,
0xfff83fe0, 0x00003fff, 0xffffffff, 0xffffffff, 0xe007e000, 0x003fffff, 0xffffffff, 0xffffffe0,
0x03f00000, 0x3fffffff, 0xffffffff, 0xffffc001, 0xf800003f, 0xffffffff, 0xffffffff, 0xffc001f8,
0x00003fff, 0xffffffff, 0xffffffff, 0xc000f800, 0x003fffff, 0xffffffff, 0xffffff80, 0x00fc0000,
0x3fffffff, 0xffffffff, 0xffff8000, 0xfe00003f, 0xffffffff, 0xffffffff, 0xff80007e, 0x00003fff,
0xffffffff, 0xffffffff, 0x80007e00, 0x001fffff, 0xffffffff, 0xffffff00, 0x007e0000, 0x1fffffff,
0xffffffff, 0xffff0000, 0x7e00001f, 0xffffffff, 0xffffffff, 0xff00007e, 0x00001fff, 0xffffffff,
0xfffffffe, 0x00007e00, 0x000fffff, 0xffffffff, 0xfffffe00, 0x00fe0000, 0x0fffffff, 0xffffffff,
0xfffe0000, 0xfe000007, 0xffffffff, 0xffffffff, 0xfc0000fc, 0x000007ff, 0xffffffff, 0xfffffffc,
0x0001f800, 0x0003ffff, 0xffffffff, 0xfffffc00, 0x03f80000, 0x03ffffff, 0xffffffff, 0xfff80007,
0xf0000001, 0xffffffff, 0xffffffff, 0xf8000ff0, 0x000001ff, 0xffffffff, 0xfffffffc, 0x001fe000,
0x0000ffff, 0xffffffff, 0xffffff00, 0x7fc00000, 0x1fffffff, 0xffffffff, 0xffffe1ff, 0x800000f0,
0x7fffffff, 0xffffffff, 0xffffff00, 0x001f003f, 0xffffffff, 0xffffffff, 0xfffe0000, 0x78003fff,
0xffffffff, 0xffff8fff, 0xfc0003c0, 0x001fffff, 0xffffffff, 0xff07fff8, 0x000f0000, 0x0fffffff,
0xfffffffe, 0x01ffce00, 0x1c000007, 0xffffffff, 0xfffffc00, 0x00030038, 0x000003ff, 0xffffffff,
0xfff80000, 0x01807000, 0x0001ffff, 0xffffffff, 0xf0000000, 0xc0e00000, 0x00ffffff, 0xffffffe0,
0x000000e0, 0xe0000000, 0x7fffffff, 0xffffc000, 0x0000e0e0, 0x0000003f, 0xffffffff, 0xff000000,
0x00e06000, 0x00001fff, 0xfffffffc, 0x00000000, 0xc0700000, 0x0007ffff, 0xfffff800, 0x000001c0,
0x78000000, 0x01ffffff, 0xffe00000, 0x0003803c, 0x00000000, 0xffffffff, 0xe0000000, 0x0f001f00,
0x0000003f, 0xffffffc0, 0x0000003e, 0x000fc000, 0x00001fff, 0xffff0000, 0x0000fc00, 0x03fc0000,
0x0007ffff, 0xfc000000, 0x07f80001, 0xff000000, 0x007fffc0, 0x0000007f, 0xf00000ff, 0xf8000000,
0x00000000, 0x0007ffc0, 0x00003fff, 0xc0000000, 0x00000007, 0xffff8000, 0x000fffff, 0xff000000,
0x00ffffff, 0xfe000000, 0x03ffffff, 0xffffffff, 0xfffffff0, 0x00000000, 0xffffffff, 0xffffffff,
0xffffc000, 0x0000001f, 0xffffffff, 0xffffffff, 0xfe000000, 0x000001ff, 0xffffffff, 0xfffffff0,
0x00000000, 0x00000fff, 0xffffffff, 0xfffe0000, 0x00000000, 0x0000ffff, 0xffffffff, 0xc0000000,
0x00000000, 0x003fffff, 0xffffff00, 0x00000000, 0x00000000, 0x07ffffff, 0xfffc0000, 0x00000000,
0x00000000, 0xffffffff, 0xc0000000, 0x00000000, 0x0000000f, 0xfffff800, 0x00000000, 0x00000000,
0x00000003, 0xf0000000, 0x00000000,
};
uint32_t Turtle1[] =
{ 147, 147,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000007, 0xe0000000, 0x00000000, 0x00000000, 0x00000000,
0x01e0fff0, 0x00000000, 0x00000000, 0x00000000, 0x000001fc, 0x1ffff000, 0x00000000, 0x00000000,
0x00000000, 0x00ff83ff, 0xffc00000, 0x00000000, 0x00000000, 0x0000007f, 0xf07fffff, 0x00000000,
0x00000000, 0x00000000, 0x003ffe0f, 0xffffe000, 0x00000000, 0x00000000, 0x0000001f, 0xffc1ffff,
0xfc100000, 0x00000000, 0x00000000, 0x0007fff8, 0x3fffff03, 0xc0000000, 0x00000000, 0x00000003,
0xffff07ff, 0xffe0fe00, 0x00000000, 0x00000000, 0x0000ffff, 0xe0fffff8, 0x1ff00000, 0x00000000,
0x00000000, 0x3ffffc1f, 0xfffc07ff, 0xc0000000, 0x00000000, 0x000003ff, 0xff83fffe, 0x007ffe00,
0x00000000, 0x00000000, 0x001fffc0, 0x1fff0007, 0xfff00000, 0x0f800000, 0x00000001, 0xff8000ff,
0x80007ffc, 0x000003fc, 0x00000000, 0x00200f00, 0x0003c004, 0x03ff0000, 0x01ffc000, 0x0000000f,
0x00000000, 0x0003c03f, 0xc040003f, 0xf8000000, 0x0003f000, 0x00700001, 0xfe03f01e, 0x001fff80,
0x00000000, 0xff8000ff, 0x8000ffe0, 0x3c07f007, 0xfff00000, 0x00003ff8, 0x00fffe00, 0x7ffe0301,
0xff01fe7e, 0x00000000, 0x07ff81ff, 0xfff03fff, 0xe0007ff0, 0x7f87c000, 0x000001ff, 0xf07fffff,
0x07fffe00, 0x1ffc0ff0, 0xf8000000, 0x007ffe1f, 0xffffe0ff, 0xfff007ff, 0x03fe1e00, 0x0000001f,
0xff83ffff, 0xfc1ffffe, 0x01ffc0ff, 0xe7c00000, 0x0003fff0, 0x7fffff83, 0xffff807f, 0xf81ffff0,
0x00000000, 0xfffe0fff, 0xfff07fff, 0xc01ffe07, 0xfffe0000, 0x00003fff, 0xc1fffffe, 0x0ffff00f,
0xff81ffff, 0x80000000, 0x07fff83f, 0xffffc1ff, 0xf803ffe0, 0x7fffe000, 0x000001ff, 0xfe0fffff,
0xf83ffe00, 0xfff80fff, 0xf8000000, 0x007fffc1, 0xffffff07, 0xff007ffe, 0x03fffe00, 0x0000000f,
0xfff83fff, 0xffe0ff80, 0x1fff80ff, 0xff800000, 0x0003ffff, 0x07fffffc, 0x1fc00fff, 0xf03fffe0,
0x00000000, 0x7fffe0ff, 0xffff83e0, 0x07fff80f, 0xfff80000, 0x00001fff, 0xfc3fffff, 0xf07001ff,
0xfe03fffe, 0x00000000, 0x07ffff07, 0xfffffe00, 0x00ffff80, 0x0fff0000, 0x000000ff, 0xffe0ffff,
0xffc0007f, 0xffe0007f, 0xc0000000, 0x003ffffc, 0x1fffffe0, 0x003ffff8, 0x0007f000, 0x00000007,
0xffff83ff, 0xffc0003f, 0xfffe0000, 0x3c000000, 0x000001ff, 0xf07ffe00, 0x001fffff, 0x00f80200,
0x00000000, 0x00000c0f, 0x8000001f, 0xffffc03f, 0xc0000000, 0x00000000, 0x00000000, 0x001fffff,
0xf00ffe00, 0x00000000, 0x00000000, 0x0000003f, 0xfffff807, 0xffe00000, 0x00000078, 0x00000000,
0x007fffff, 0xfe01fffe, 0x00000000, 0x000ffe00, 0x000007ff, 0xffffff00, 0x7fffe000, 0x00000001,
0xffffffff, 0xffffffff, 0xff801fff, 0xfe000000, 0x00007fff, 0xffffffff, 0xffffffc0, 0x03ffffc0,
0x00000000, 0x0fffffff, 0xffffffff, 0xffe0007f, 0xfffc0000, 0x000003ff, 0xffffffff, 0xfffffff0,
0x020fffff, 0x80000000, 0x007fffff, 0xffffffff, 0xfff000c1, 0xfffff800, 0x0000000f, 0xffffffff,
0xfffffff0, 0x00783fff, 0xff000000, 0x00007fff, 0xffffffff, 0xfff0003f, 0x07ffffe0, 0x00000000,
0x007fffff, 0xfffffff0, 0x001fe07f, 0xfffc0000, 0x00000000, 0xffffffff, 0xffc0001f, 0xfe07ffff,
0xc0000000, 0x0000001f, 0xfffffe00, 0x000fffc0, 0x0ffff800, 0x00000040, 0x00000000, 0x0000000f,
0xfffc003f, 0xff000000, 0x000e0000, 0x00000000, 0x000fffff, 0xc003ffe0, 0x00000001, 0xc0000000,
0x0000001f, 0xfffffc00, 0x3ffc0000, 0x0000703e, 0x00000000, 0x007fffff, 0xffe003ff, 0x80000000,
0x080fc1e0, 0x000007ff, 0xffffffff, 0xe03ff000, 0x00000003, 0xf83fffff, 0xffffffff, 0xfffffc07,
0xfe000000, 0x0000ff0f, 0xffffffff, 0xffffffff, 0xfe00ffc0, 0x00000000, 0x3fc1ffff, 0xffffffff,
0xffffff00, 0x0ff80000, 0x00000ff8, 0x3fffffff, 0xffffffff, 0xff8001ff, 0x00000000, 0x01ff01ff,
0xffffffff, 0xffffff80, 0x003fe000, 0x0000003f, 0xe00fffff, 0xffffffff, 0xff800007, 0xfc000000,
0x0007fc00, 0xffffffff, 0xffffff80, 0x0000fff8, 0x00000000, 0xff800fff, 0xffffffff, 0xff000000,
0x1fffc000, 0x00001ffe, 0x000fffff, 0xfffffc00, 0x000003ff, 0xfc000000, 0x03fff800, 0x007fffff,
0x80000000, 0x003fffc0, 0x0000007f, 0xff800000, 0x00000000, 0x00000007, 0xfff80000, 0x0007fff8,
0x00000000, 0x00000000, 0x00007fff, 0x80000000, 0xffff0000, 0x00000000, 0x00000000, 0x03fff000,
0x00000fff, 0xf0000000, 0x00000000, 0x00000000, 0x00000000, 0x007ffe00, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
};
uint32_t turtle2[] =
{ 48, 48,
0x00000000, 0x00000000, 0x3fc00000, 0x0000ffe0, 0x00000001, 0xfff00000, 0x0003fff0, 0x00000000,
0x1ff00000, 0x00000200, 0x07c00000, 0x00781fc0, 0x000007ff, 0x8fc00000, 0x07ffe7c0, 0x000077ff,
0xf3c00000, 0xf3fff180, 0x0003f3ff, 0xe4800007, 0xfbffce00, 0x000ff9ff, 0x9e00000f, 0xf83f3f00,
0x001ff306, 0x7f00003f, 0xe7f0ff00, 0x003fcffc, 0xff80001f, 0x9ffcff80, 0x00033ffe, 0xffb800f8,
0x7ffeffbc, 0x00fe7ffe, 0x7fbe00fe, 0x7ffe7fbe, 0x1cff7fff, 0x7f3e3cff, 0x7fff3f3e, 0x7cff3ffe,
0x073e7cff, 0x3ffce03e, 0x7cffbff9, 0xfc1e1eff, 0x9ff3fc1e, 0x04ff03e7, 0xfc1c00fe, 0x700ff81c,
0x007cff1f, 0xf0180079, 0xffdff010, 0x0033ffcf, 0xe0000007, 0xffef8000, 0x0007ffef, 0x00000007,
0xffe60000, 0x0003ffe0, 0x00000000, 0xffc00000, 0x00000000, 0x00000000, 0x20000000, 0x00007f00,
0x00000000, 0x3f000000, 0x00003f00, 0x00000000, 0x1e000000, 0x00001c00, 0x00000000, 0x00000000,
};
uint32_t txControl[] =
{ 32, 25,
0x00000000, 0x00000000, 0x000003c0, 0x000000f0, 0x7ffc0038, 0x7ffc0618, 0x7ffc038c, 0x038000cc,
0x03800044, 0x038c0664, 0x038e0e20, 0x038f1e00, 0x0387bc00, 0x0383f800, 0x0381f000, 0x0380e000,
0x0380e000, 0x0381f000, 0x0383f800, 0x0387bc00, 0x038f1e00, 0x038e0e00, 0x038c0600, 0x00000000,
0x00000000,
};
uint32_t usbIconSmall[] =
{ 40, 20,
0x00000000, 0x00000001, 0xc0000000, 0x7fe00000, 0x00ffe000, 0x0001c1c0, 0x00000380, 0x00003c07,
0x0000007e, 0x0e000010, 0xff1c0000, 0x18ffffff, 0xfffeffff, 0xfffffe7e, 0x00600018, 0x3c003000,
0x10000018, 0x00000000, 0x0c0e0000, 0x0007ff00, 0x000003ff, 0x00000000, 0x0e000000, 0x00000000,
0x00000000,
};

41
source/Graphics/icons.h Normal file
View File

@@ -0,0 +1,41 @@
// Generated by MonoBitmapConverter
extern const uint32_t battery0[];
extern const uint32_t battery1[];
extern const uint32_t battery2[];
extern const uint32_t battery3[];
extern const uint32_t battery4[];
extern const uint32_t border60x60[];
extern const uint32_t box_checked[];
extern const uint32_t box_unchecked[];
extern const uint32_t clamp2[];
extern const uint32_t clampIcon[];
extern const uint32_t clampIcon2[];
extern const uint32_t dangerousVoltage68x60[];
extern const uint32_t DC1[];
extern const uint32_t directConnectIcon[];
extern const uint32_t directConnectIcon2[];
extern const uint32_t directConnectIcon3[];
extern const uint32_t directConnectIcon4[];
extern const uint32_t directConnectIcon5[];
extern const uint32_t highVoltageIcon[];
extern const uint32_t inductionIcon[];
extern const uint32_t lamp[];
extern const uint32_t ld[];
extern const uint32_t ld2[];
extern const uint32_t menuMore[];
extern const uint32_t power0[];
extern const uint32_t power1[];
extern const uint32_t power2[];
extern const uint32_t power3[];
extern const uint32_t power4[];
extern const uint32_t teacup[];
extern const uint32_t Turtle1[];
extern const uint32_t turtle2[];
extern const uint32_t txControl[];
extern const uint32_t usbIconSmall[];

156
source/Graphics/splash.c Normal file
View File

@@ -0,0 +1,156 @@
// Generated by MonoBitmapConverter
// Bitmap Format:
// [0] bitmap width in pixels
// [1] bitmap height in pixels
// [2] bitmap data
#include <stdint.h>
uint32_t goldenlandLogo98x60[] =
{ 95, 60,
0x007fffff, 0xffffffff, 0xfffffe00, 0x03ffffff, 0xffffffff, 0xffffff00, 0x1fffffff, 0xffffffff,
0xffffff00, 0x7fffffff, 0xffffffff, 0xffffff01, 0xffffffff, 0xffffffff, 0xffffff07, 0xffffffff,
0xffffffff, 0xffffff1f, 0xf8000000, 0x000fff80, 0x0003fe3f, 0xc0000000, 0x001fff00, 0x0001feff,
0x00000000, 0x003ffe00, 0x0001fdfc, 0x00000000, 0x007ffc00, 0x0001fff8, 0x00000000, 0x00fff800,
0x0003ffe0, 0x0001f000, 0x01fff000, 0x0003ffc0, 0x007fff00, 0x03ffe000, 0x0007ff80, 0x07ffff80,
0x07ffc000, 0x000fff00, 0x3fffff80, 0x0fff8000, 0x001ffe00, 0xffffffc0, 0x1fff0000, 0x003ffc03,
0xffffffc0, 0x3ffe0000, 0x007ff80f, 0xffffffc0, 0x7ffc0000, 0x00fff03f, 0xffffffc0, 0xfff80000,
0x01ffe07f, 0xffffff81, 0xfff00000, 0x03ffc1ff, 0xf81fff83, 0xffe00000, 0x07ff83ff, 0xc00fff07,
0xffc00000, 0x0fff0fff, 0x000ffe0f, 0xff800000, 0x1ffe1ffe, 0x000f801f, 0xff000000, 0x3ffc7ff8,
0x0000003f, 0xfe000000, 0x7ff8fff0, 0x0000007f, 0xfc000000, 0xfff1ffe0, 0x000000ff, 0xf8000001,
0xffe3ff80, 0x000001ff, 0xf0000003, 0xffc7ff00, 0x7fff83ff, 0xe0000007, 0xff8ffe01, 0xffff07ff,
0xc000000f, 0xff1ffc03, 0xfffe0fff, 0x8000001f, 0xfe3ff807, 0xfffc1fff, 0x0000003f, 0xfc7ff00f,
0xfff83ffe, 0x0000007f, 0xf8ffe01f, 0xfff07ffc, 0x000000ff, 0xf1ffe03f, 0xffe0fff8, 0x000001ff,
0xe3ffc03f, 0xffc1fff0, 0x000003ff, 0xc7ff8001, 0xff83ffe0, 0x000007ff, 0x87ff8003, 0xff07ffc0,
0x00000fff, 0x0fff8007, 0xfe0fff80, 0x00001ffe, 0x0fff000f, 0xfc1fffff, 0xfff03ffc, 0x1fff803f,
0xf83fffff, 0xffe07ff8, 0x1fffffff, 0xf07fffff, 0xffc0fff0, 0x3fffffff, 0xe0ffffff, 0xff81ffe0,
0x3fffffff, 0xc1ffffff, 0xff03ffc0, 0x3fffffff, 0x83ffffff, 0xfe07ff80, 0x3fffffff, 0x07ffffff,
0xfc0fff00, 0x1ffffff8, 0x0fffffff, 0xf81ffe00, 0x1fffffc0, 0x1fffffff, 0xf03ffc00, 0x07fffc00,
0x00000000, 0x007ffc00, 0x007e0000, 0x00000000, 0x01fff800, 0x00000000, 0x00000000, 0x03fbf800,
0x00000000, 0x00000000, 0x0ff7f800, 0x00000000, 0x00000000, 0x3fc7fc00, 0x00000000, 0x00000001,
0xff8fffff, 0xffffffff, 0xffffffff, 0xfe0fffff, 0xffffffff, 0xffffffff, 0xf80fffff, 0xffffffff,
0xffffffff, 0xe00fffff, 0xffffffff, 0xffffffff, 0x800fffff, 0xffffffff, 0xfffffffc, 0x0007ffff,
0xffffffff, 0xffffffe0, 0x00000000,
};
uint32_t leicaSplash[] =
{ 192, 124,
0x00000000, 0x0000007f, 0xf0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003ff,
0xfc000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000fff, 0xfe000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00001fff, 0xff000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00007fff, 0xff800000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000fffc,
0x3fc00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0001fff0, 0x0fc00000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x0003ffe0, 0x0fc00000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x0007ffc0, 0x07e00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000fffc0,
0x07e00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x001fff80, 0x07e00000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x001fff80, 0x07e00000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x003fff00, 0x07e00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003fff00,
0x07e00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x007ffe00, 0x07c00000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x007ffe00, 0x07c00000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00fffc00, 0x0fc00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00fffc00,
0x0fc00000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01fffc00, 0x0f800000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x01fff800, 0x1f800000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x01fff800, 0x1f000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03fff800,
0x3f000000, 0x03fc0000, 0x00000000, 0x00000000, 0x00000000, 0x03fff000, 0x7f000000, 0x0fff0000,
0x00000000, 0x00000000, 0x00000000, 0x03fff000, 0x7e000000, 0x0fff8000, 0x00000000, 0x00000000,
0x00000000, 0x07fff000, 0xfc000000, 0x1fff8000, 0x00000000, 0x00000000, 0x00000000, 0x07fff001,
0xf8000000, 0x1fffc000, 0x00000000, 0x00000000, 0x00000000, 0x07ffe003, 0xf8000000, 0x1fffc000,
0x00000000, 0x00000000, 0x00000000, 0x07ffe007, 0xf0000000, 0x1fffc000, 0x00000000, 0x00000000,
0x00000000, 0x0fffe01f, 0xe0000000, 0x1fff8000, 0x00000000, 0x00000000, 0x00000000, 0x0fffe03f,
0xc0000000, 0x0fff0000, 0x00000000, 0x00000000, 0x00000000, 0x0fffc0ff, 0x80000000, 0x03fe0000,
0x00000000, 0x00000000, 0x00000000, 0x0fffc3ff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x1fffcffc, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000f8, 0x1ffffff8,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000001ff, 0xffffffe0, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x000001ff, 0xffffff80, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x000000ff, 0xfffffc00, 0x03fe0000, 0x00000000, 0x03800000, 0x3e000000, 0x0000000f, 0xffffe000,
0x7fffc000, 0x7ffc0000, 0x7ffc0003, 0xffc3ffc0, 0x00000000, 0x7fff0001, 0xfffff000, 0xfff80003,
0xffff000f, 0xffe3ffc0, 0x00000000, 0x7fff0007, 0xfffff800, 0xfff80007, 0xffff003f, 0xfff7ff80,
0x00000000, 0x7fff001f, 0xff07fc01, 0xfff8001f, 0xffff00ff, 0xffffff80, 0x00000000, 0x7ffe003f,
0xfe03fe01, 0xfff8003f, 0xff3f01ff, 0xfcffff80, 0x00000000, 0x7ffe007f, 0xfc03fe01, 0xfff0007f,
0xfc0603ff, 0xf03fff80, 0x00000000, 0xfffe00ff, 0xf803fe01, 0xfff000ff, 0xf80207ff, 0xe01fff00,
0x00000000, 0xfffe01ff, 0xf803fe03, 0xfff001ff, 0xf0000fff, 0xc01fff00, 0x00000000, 0xfffc01ff,
0xf007fe03, 0xfff003ff, 0xf0000fff, 0x801fff00, 0x00000000, 0xfffc03ff, 0xf007fc03, 0xffe007ff,
0xe0001fff, 0x801ffe00, 0x00000001, 0xfffc07ff, 0xe00ffc07, 0xffe007ff, 0xe0001fff, 0x801ffe00,
0x00000001, 0xfff807ff, 0xe01ff807, 0xffe00fff, 0xc0003fff, 0x001ffe00, 0x00000001, 0xfff807ff,
0xe07ff007, 0xffc00fff, 0xc0003fff, 0x003ffe00, 0x00000003, 0xfff80fff, 0xffffe007, 0xffc00fff,
0xc0007ffe, 0x003ffc00, 0x00000003, 0xfff00fff, 0xffffc00f, 0xffc01fff, 0x80007ffe, 0x003ffc00,
0x00000003, 0xfff00fff, 0xffff000f, 0xffc01fff, 0x80007ffe, 0x007ffc00, 0x00000007, 0xfff00fff,
0xfff8000f, 0xff801fff, 0x80007ffe, 0x007ffc00, 0x00000007, 0xffe00fff, 0xc000001f, 0xff801fff,
0x80007ffe, 0x007ff800, 0x00000007, 0xffe00fff, 0xc000007f, 0xff801fff, 0x8000fffe, 0x00fff800,
0x0000000f, 0xffe00fff, 0xc00001ff, 0xff803fff, 0x8001fffe, 0x00fff800, 0x0000000f, 0xffc007ff,
0xc00007ff, 0xff80ffff, 0xc007fffe, 0x01fff800, 0x0000001f, 0xffc007ff, 0xe0003fff, 0xff83ffff,
0xc00ffffe, 0x03fff800, 0x0000001f, 0xff8003ff, 0xf801ffff, 0xffffffff, 0xe03fffff, 0x07fffc78,
0x01ffc01f, 0xff8003ff, 0xffffff9f, 0xfffff7ff, 0xffffbfff, 0xdffffff8, 0x07fffe3f, 0xff0001ff,
0xfffffe0f, 0xffffe3ff, 0xfffe1fff, 0xfffffff8, 0x1fffffff, 0xff0000ff, 0xfffff80f, 0xffff81ff,
0xfffc0fff, 0xfffffff8, 0x3fffffff, 0xfe00003f, 0xffffe007, 0xfffe00ff, 0xfff007ff, 0xfe7fffe0,
0x7fffffff, 0xfc00001f, 0xffff0003, 0xfff8007f, 0xffc003ff, 0xf83fff80, 0x7f83ffff, 0xfc000003,
0xfff80001, 0xffe0001f, 0xff0001ff, 0xe01ffe00, 0xfe003fff, 0xffc00000, 0x00000000, 0x1c000003,
0xf000003f, 0x0007f000, 0xfc0007ff, 0xfff80000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xfc0007ff, 0xffff8000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7c000fff, 0xfffff800,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x7e003fff, 0xffffff80, 0x00000000, 0x00000000,
0x00000000, 0x0000000e, 0x7f80ffff, 0xbffffff8, 0x00000000, 0x00000000, 0x00000000, 0x000001ff,
0x3ffffffe, 0x07ffffff, 0xc0000000, 0x00000000, 0x00000000, 0x00003fff, 0x1ffffffc, 0x00ffffff,
0xff000000, 0x00000000, 0x00000000, 0x000fffff, 0x0ffffff0, 0x001fffff, 0xfffc0000, 0x00000000,
0x00000000, 0x07fffffc, 0x03ffffc0, 0x0007ffff, 0xfffffe00, 0x00000000, 0x0000000f, 0xffffffe0,
0x00fffc00, 0x00007fff, 0xffffffff, 0xff800000, 0x0fffffff, 0xfffffc00, 0x00030000, 0x00000fff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffc000, 0x00000000, 0x000000ff, 0xffffffff, 0xffffffff,
0xffffffff, 0xfff80000, 0x00000000, 0x0000000f, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xc0000000, 0x00000000, 0x00000000,
0x07ffffff, 0xffffffff, 0xfffffff8, 0x00000000, 0x00000000, 0x00000000, 0x003fffff, 0xffffffff,
0xfffffc00, 0x00000000, 0x00000000, 0x00000000, 0x0001ffff, 0xffffffff, 0xfffc0000, 0x00000000,
0x00000000, 0x00000000, 0x000003ff, 0xffffffff, 0xf0000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x3ffff000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000001, 0xf0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x0000000f, 0xfc000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000001f, 0xfe000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000003f, 0x3e000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x0000003c, 0x1f000000, 0x00000000, 0x00000780, 0x00000000, 0x00000000,
0x0000007c, 0x1f000000, 0x00000000, 0x00000f80, 0x00000000, 0x00000000, 0x00000078, 0x1e000000,
0x00000000, 0x00000f80, 0x00000000, 0x00000000, 0x000000f8, 0x0003f003, 0xf00fe1e0, 0xf0fc3fc1,
0xfc0f3c7c, 0x07e00000, 0x000000f8, 0x000ffc0f, 0xf81ff1e1, 0xe3ff3fc3, 0xfe0ffefe, 0x1ff00000,
0x000000f0, 0x001ffc1f, 0xfc3cf1e1, 0xe7df3fc7, 0xff0ffffe, 0x3ef80000, 0x000000f0, 0x001e3c3e,
0x3c78f1e1, 0xc78f1f0f, 0x0f1f1e3e, 0x7c780000, 0x000001f1, 0xfc3c3c3c, 0x3c7871e3, 0xc78f1e0f,
0x0f1e1e3e, 0x78700000, 0x000001f1, 0xfc3c3c7c, 0x3c7c01e3, 0x87c01e1f, 0x0f1e1e3c, 0x7c000000,
0x000001e1, 0xfc3ffc78, 0x3c7f01e7, 0x87e01e1f, 0xff1e3e3c, 0x7f000000, 0x000001e0, 0x7c7ffc78,
0x7c3f81e7, 0x03f81e1f, 0xff3e3c3c, 0x3fc00000, 0x000001e0, 0x787ffc78, 0x781fe1e7, 0x01fc3e1f,
0xfe3c3c3c, 0x0fe00000, 0x000003e0, 0x78780078, 0x7807e1ee, 0x007e3c3e, 0x003c3c7c, 0x03e00000,
0x000003e0, 0x787800f8, 0x7801e0fe, 0x003e3c3e, 0x003c3c78, 0x01f00000, 0x000003e0, 0xf87878f8,
0xf9e1e0fc, 0x1e1e3c3c, 0x3e3c7c78, 0xf1f00000, 0x000001f0, 0xf878f8f8, 0xf1e1e0fc, 0x1e3e3c3e,
0x3c7c7878, 0xf1e00000, 0x000001ff, 0xf07ff07f, 0xe1f7c0f8, 0x1f7c3e3f, 0xf8787878, 0xfbe00000,
0x000001ff, 0xf07fe07f, 0xe1ff80f8, 0x1ff83e1f, 0xf07878f8, 0xffc00000, 0x0000007f, 0xf01f803f,
0x807f00f0, 0x0fe01e0f, 0xe07870f0, 0x7f000000, 0x00000000, 0x00000000, 0x000000f0, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000001f0, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x000001e0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x000003e0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003c0, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000780, 0x00000000, 0x00000000, 0x00000000,
};
uint32_t UMLogo68x64[] =
{ 68, 64,
0xfffe00ff, 0xffc01fff, 0xffffe00f, 0xfffc01ff, 0xfffffe00, 0xffffc01f, 0xffffffe0, 0x0ffffc01,
0xfffffffe, 0x00ffffc0, 0x1fffffff, 0xe00ffffc, 0x01ffffff, 0xfe00ffff, 0xc01fffff, 0xffe00fff,
0xfc01ffff, 0xfffe00ff, 0xffc01fff, 0xffffe00f, 0xfffc01ff, 0xfffffe00, 0xffffc01f, 0xffffffe0,
0x0ffffc01, 0xfffffffe, 0x00ffffc0, 0x1fffffff, 0xe00ffffc, 0x01ffffff, 0xfe00ffff, 0xc01fffff,
0xffe00fff, 0xfc01ffff, 0xfffe00ff, 0xffc01fff, 0xffffe00f, 0xfffc01ff, 0xfffffe00, 0xffffc01f,
0xffffffe0, 0x0ffffc01, 0xfffffffe, 0x00ffffc0, 0x1fffffff, 0xe007fff8, 0x01ffffff, 0xfe007fff,
0x801fffff, 0xfff003ff, 0xf003ffff, 0xffff001f, 0xfe003fff, 0xfffff000, 0xffc003ff, 0xffffff00,
0x03f0003f, 0xfffffff8, 0x00000007, 0xffffffff, 0xc0000000, 0xffffffff, 0xfc000000, 0x0fffffff,
0xffe00000, 0x01ffffff, 0xffff0000, 0x003fffff, 0xfffff800, 0x0007ffff, 0xffffffe0, 0x0001ffff,
0xffffffff, 0x00003fff, 0xffffffff, 0xfe001fff, 0xffffffff, 0xfffe1fff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffefff, 0xfffffdff, 0xfffffe7f, 0xffffff9f, 0xffffffe3, 0xfffffff1, 0xfffffffe, 0x1ffffffe,
0x1fffffff, 0xe0ffffff, 0xc1ffffff, 0xfe03ffff, 0xf01fffff, 0xffe007ff, 0xf801ffff, 0xfffe0000,
0x00001fff, 0xffffe000, 0x000001ff, 0xfffffe00, 0x0000001f, 0xffffffe0, 0x00000001, 0xfffffffe,
0x00000000, 0x1fffffff, 0xe0000000, 0x01ffffff, 0xfe000000, 0x001fffff, 0xffe00000, 0x0001ffff,
};

10
source/Graphics/splash.h Normal file
View File

@@ -0,0 +1,10 @@
// Generated by MonoBitmapConverter
extern const uint32_t goldenlandLogo98x60[];
extern const uint32_t leicaSplash[];
extern const uint32_t UMLogo68x64[];

View File

@@ -0,0 +1,126 @@
// Generated by MonoBitmapConverter
// Bitmap Format:
// [0] bitmap width in pixels
// [1] bitmap height in pixels
// [2] bitmap data
#include <stdint.h>
uint32_t dvdLogo[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00fffffc, 0x007fffe0, 0x1fffffe0, 0x0fffff81,
0xfffffe01, 0xfffffc00, 0x03ffe01f, 0x000fe000, 0x0fff03e0, 0x003e1f00, 0xfdf07c7c, 0x03f3f00f,
0xdf0f8fc0, 0x3f3e00fc, 0xf8f0fc03, 0xe3e01f8f, 0x9f0f803e, 0x3e01f0ff, 0xe0f807c7, 0xe07f07fc,
0x1f80f87e, 0x3fc07f81, 0xf83f07ff, 0xf807f01f, 0xffe0fffe, 0x003e03ff, 0xf80ffe00, 0x03c01ff8,
0x00000000, 0x38000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00ffffff, 0xf000000f, 0xffffffff, 0xff000fff, 0xffffffff, 0xff03ffff, 0xffffffff, 0xfc7fffff,
0x000fffff, 0xefffffe0, 0x007fffff, 0x7ffffe00, 0x07ffffe3, 0xfffffe07, 0xfffffc0f, 0xffffffff,
0xffff000f, 0xffffffff, 0xff000003, 0xfffffffc, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t internet_bw[] =
{ 96, 96,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x003ffc00, 0x00000000, 0x00000000, 0x07ffffe0,
0x00000000, 0x00000000, 0x3ffffffc, 0x00000000, 0x00000000, 0xfffbdfff, 0x00000000, 0x00000003,
0xffe3c7ff, 0xc0000000, 0x0000000f, 0xef83c1f7, 0xf0000000, 0x0000003f, 0x1f03c0f8, 0xfc000000,
0x0000007c, 0x1e03c078, 0x3e000000, 0x000001f8, 0x3c03c03c, 0x1f800000, 0x000003e0, 0x7c03c03e,
0x07c00000, 0x000007c0, 0x7803c01e, 0x03e00000, 0x00000f80, 0xf003c00f, 0x01f00000, 0x00001f00,
0xf003c00f, 0x00f80000, 0x00003c01, 0xe003c007, 0x807c0000, 0x00007c01, 0xe003c007, 0x803e0000,
0x00007803, 0xc003c003, 0xc01e0000, 0x0000f003, 0xc003c003, 0xc00f0000, 0x0001e003, 0xc003c003,
0xc0078000, 0x0001c007, 0x8003c001, 0xe0038000, 0x0003ffff, 0xffffffff, 0xffffc000, 0x0003ffff,
0xffffffff, 0xffffc000, 0x0007ffff, 0xffffffff, 0xffffe000, 0x0007ffff, 0xffffffff, 0xffffe000,
0x000e000f, 0x0003c000, 0xf0007000, 0x000e000e, 0x0003c000, 0x70007000, 0x001e001e, 0x0003c000,
0x78007800, 0x001c001e, 0x0003c000, 0x78003800, 0x001c001e, 0x0003c000, 0x78003800, 0x0038001e,
0x0003c000, 0x78001c00, 0x0038001c, 0x0003c000, 0x38001c00, 0x0038001c, 0x0003c000, 0x38001c00,
0x0038001c, 0x0003c000, 0x38001c00, 0x0030001c, 0x0003c000, 0x38000c00, 0x0070003c, 0x0003c000,
0x3c000e00, 0x0070003c, 0x0003c000, 0x3c000e00, 0x0070003c, 0x0003c000, 0x3c000e00, 0x0070003c,
0x0003c000, 0x3c000e00, 0x007fffff, 0xffffffff, 0xc0fffe00, 0x007fffff, 0xffffffff, 0x003ffe00,
0x007fffff, 0xfffffffe, 0x001ffe00, 0x007fffff, 0xfffffffe, 0x000ffe00, 0x0070003c, 0x0003c000,
0x1e000e00, 0x0070003c, 0x0003c000, 0x3f000e00, 0x0070003c, 0x0003c000, 0x3f800e00, 0x0070003c,
0x0003c000, 0x3fc00e00, 0x0030001c, 0x0003c000, 0x3fe00c00, 0x0038001c, 0x0003c000, 0x3ff01c00,
0x0038001c, 0x0003c000, 0x3df81c00, 0x0038001c, 0x0003c000, 0x3cfc0c00, 0x0038001e, 0x0003c000,
0x3c7e0000, 0x001c001e, 0x0003c000, 0x3c1f0000, 0x001c001e, 0x0003c000, 0x3c0fc000, 0x001e001e,
0x0003c000, 0x3c07e000, 0x000e000e, 0x0003c000, 0x3c03f000, 0x000e000f, 0x0003c000, 0x3c01f000,
0x0007ffff, 0xfffffffc, 0x3c00f800, 0x0007ffff, 0xfffffffc, 0x3c007c00, 0x0003ffff, 0xfffffffc,
0x3c003e00, 0x0003ffff, 0xfffffffc, 0x3c001f00, 0x0001c007, 0x8003c000, 0x3c000f80, 0x0001e003,
0x8003c000, 0x3c0007c0, 0x0000f003, 0xc003c000, 0x3c0003e0, 0x00007803, 0xc003c000, 0x3c0001f0,
0x00007801, 0xe003c004, 0x3c0000f8, 0x00003c01, 0xe003c004, 0x3c00003c, 0x00001e00, 0xf003c00c,
0x3c00003e, 0x00000f80, 0xf003c00c, 0x3c007fff, 0x000007c0, 0x7803c01c, 0x3c007ffe, 0x000003e0,
0x7c03c03c, 0x3c003ff0, 0x000001f8, 0x3c03c03c, 0x3c0c3e00, 0x0000007c, 0x1e03c078, 0x3c3c1c00,
0x0000003f, 0x1f03c0f8, 0x3c7e1c00, 0x0000000f, 0xef83c1f0, 0x3cfe1e00, 0x00000003, 0xffe3c7fc,
0x3dfe0e00, 0x00000000, 0xfffbdffc, 0x3fef0f00, 0x00000000, 0x3ffffffc, 0x1fc70700, 0x00000000,
0x07ffffe0, 0x1f878780, 0x00000000, 0x003ffc00, 0x1f038380, 0x00000000, 0x00000000, 0x1e03c380,
0x00000000, 0x00000000, 0x0001c3c0, 0x00000000, 0x00000000, 0x0001e1c0, 0x00000000, 0x00000000,
0x0000e7e0, 0x00000000, 0x00000000, 0x0000ffc0, 0x00000000, 0x00000000, 0x0000ff00, 0x00000000,
0x00000000, 0x00007c00, 0x00000000, 0x00000000, 0x00007000, 0x00000000, 0x00000000, 0x00002000,
};
uint32_t reboot[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x1f800000, 0x0000001f, 0xff800000, 0x00000fff,
0xff000000, 0x0003ffff, 0xfc040000, 0x007f000f, 0xe0c00000, 0x1fc0003f, 0x9c000003, 0xf00000ff,
0xc000007c, 0x000003fc, 0x00000f80, 0x00001fc0, 0x0001f000, 0x0001fc00, 0x001e0000, 0x003fc000,
0x03c00000, 0x07fc0000, 0x78000000, 0xffc00007, 0x8000001f, 0xfc0000f0, 0x00000000, 0x00000f00,
0x00000000, 0x0000e000, 0x00000000, 0x001e0000, 0x00000000, 0x01c00000, 0x00000000, 0x1c000000,
0x00000001, 0xc0000000, 0x0000003c, 0x00000000, 0x000003c0, 0x00000000, 0x00003c00, 0x00000001,
0x8003c000, 0x0000003c, 0x003c0000, 0x000003c0, 0x03c00000, 0x00003c00, 0x1c000000, 0x00038001,
0xc0000000, 0x0038001c, 0x00000000, 0x038001e0, 0x00000000, 0x78000e00, 0x00000007, 0x0000f000,
0x000000f0, 0x000f0000, 0x00000f00, 0x00780000, 0x0001e000, 0x07800000, 0x001e0000, 0x3c000000,
0x03c00001, 0xe0000000, 0x7800001f, 0x0000000f, 0x800000f8, 0x000001f0, 0x000007c0, 0x00003e00,
0x00003f00, 0x000fc000, 0x0001fc00, 0x03f80000, 0x0007f000, 0xfe000000, 0x003fffff, 0xc0000000,
0x00fffff0, 0x00000000, 0x01fff800, 0x00000000, 0x01f80000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t restart[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x03800000, 0x00000000, 0x7f800000, 0x00000007,
0xff000000, 0x003f803f, 0xfc000000, 0x7ff8000f, 0xe0000003, 0xff80003f, 0x8000001f, 0xf00000fc,
0x000001ff, 0x000003e0, 0x00000ff0, 0x00001f00, 0x0001ff00, 0x0000f800, 0x001fe000, 0x00078000,
0x03fe0000, 0x003c0000, 0x78e00000, 0x01e00007, 0x8c000000, 0x1e0000f0, 0x40000000, 0xf0000f00,
0x0000000f, 0x0000e000, 0x00000070, 0x001e0000, 0x00000780, 0x01e00000, 0x00003800, 0x1c000000,
0x00038001, 0xc0000000, 0x0038003c, 0x00000000, 0x03c003c0, 0x00000000, 0x3c003c00, 0x00000003,
0xc003c000, 0x0000003c, 0x003c0000, 0x000003c0, 0x03c00000, 0x00003c00, 0x1c000000, 0x00038001,
0xc0000000, 0x0038001c, 0x00000000, 0x038001e0, 0x00000000, 0x78000e00, 0x00000007, 0x0000f000,
0x000000f0, 0x000f0000, 0x00000f00, 0x00780000, 0x0001e000, 0x07800000, 0x001e0000, 0x3c000000,
0x03c00001, 0xe0000000, 0x7800001f, 0x0000000f, 0x800000f8, 0x000001f0, 0x000007c0, 0x00003e00,
0x00003f00, 0x000fc000, 0x0001fc00, 0x03f80000, 0x0007f000, 0xfe000000, 0x003fffff, 0xc0000000,
0x00fffff0, 0x00000000, 0x01fff800, 0x00000000, 0x01f80000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};
uint32_t shutdown[] =
{ 60, 60,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x60000000, 0x0000000f,
0x00000000, 0x000380f0, 0x1c000000, 0x007c0f03, 0xe0000000, 0x0f80f01f, 0x00000003, 0xf00f00fc,
0x0000007c, 0x00f003e0, 0x00000f80, 0x0f001f00, 0x0001f000, 0xf000f800, 0x001e000f, 0x00078000,
0x03c000f0, 0x003c0000, 0x78000f00, 0x01e00007, 0x8000f000, 0x1e0000f0, 0x000f0000, 0xf0000f00,
0x00f0000f, 0x0000e000, 0x0f000070, 0x001e0000, 0xf0000780, 0x01c0000f, 0x00003800, 0x1c0000f0,
0x00038001, 0xc0000f00, 0x0038003c, 0x0000f000, 0x03c003c0, 0x000f0000, 0x3c003c00, 0x00f00003,
0xc003c000, 0x0600003c, 0x003c0000, 0x000003c0, 0x03c00000, 0x00003c00, 0x1c000000, 0x00038001,
0xc0000000, 0x0038001c, 0x00000000, 0x038001e0, 0x00000000, 0x78000e00, 0x00000007, 0x0000f000,
0x000000f0, 0x000f0000, 0x00000f00, 0x00780000, 0x0001e000, 0x07800000, 0x001e0000, 0x3c000000,
0x03c00001, 0xe0000000, 0x7800001f, 0x0000000f, 0x800000f8, 0x000001f0, 0x000007c0, 0x00003e00,
0x00003f00, 0x000fc000, 0x0001fc00, 0x03f80000, 0x0007f000, 0xfe000000, 0x003fffff, 0xc0000000,
0x00fffff0, 0x00000000, 0x01fff800, 0x00000000, 0x01f80000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000,
};

View File

@@ -0,0 +1,12 @@
// Generated by MonoBitmapConverter
extern const uint32_t dvdLogo[];
extern const uint32_t internet_bw[];
extern const uint32_t reboot[];
extern const uint32_t restart[];
extern const uint32_t shutdown[];

200
source/Loader/bootloader.c Normal file
View File

@@ -0,0 +1,200 @@
/*
* bootloader.c
*
* Created on: Oct 22, 2023
* Author: Brian.Bailey
*/
#include <Loader/bootloader.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "lcd.h"
#include "Fonts/fontLibrary.h"
#include "timer.h"
#include "utils.h"
#include "keys.h"
#include "init.h"
#include "usbComms.h"
#include "fsl_power.h"
#include "virtual_com.h"
#include "sha256.h"
// #include "bootloader.h"
#include "Loader/iap_jump.h"
#include "eeprom.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
BL_DATA_t blData;
extern uint8_t tempString[40];
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
/*******************************************************************************
* Static Functions
******************************************************************************/
/*******************************************************************************
* Public Functions
******************************************************************************/
void BL_Run(void)
{
Power_ON_OFF(ON); // Hold power on.
Select_Estop(ON); // Ensure output is ISOLATED from connections
SPI0_Chip_Select(CS_HIGH,E2PROM); // Set EEPROM as SPI CS
KEY_Init();
SPI_Init();
//Read bootloader EEPROM data to the blData structure
//Read the EEPROM
// blData.version = 1;
// blData.loaderRunRequest = 0;
// blData.transmitterProgrammed = 1;
#if 0 //for testing blank EEPROM
blData.version = 0xffffffff;
blData.loaderRunRequest = 0xffffffff;
blData.transmitterProgrammed = 0xffffffff;
M95512_WriteMemoryUINT32(BL_VERSION_EEPROM_ADDR, &blData.version);
M95512_WriteMemoryUINT32(BL_LOADERRUNREQUEST_EEPROM_ADDR, &blData.loaderRunRequest);
M95512_WriteMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
#else
EE_ReadMemoryUINT32(BL_VERSION_EEPROM_ADDR, &blData.version);
EE_ReadMemoryUINT32(BL_LOADERRUNREQUEST_EEPROM_ADDR, &blData.loaderRunRequest);
EE_ReadMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
if(blData.version > BL_MAX_VERSION) //Check for bootloader FLASH uninitialized. if uninitialized, this will be 0xffff
{
//Zero out Bootloader EEPROM data
blData.loaderRunRequest = 0;
blData.transmitterProgrammed = 0;
EE_WriteMemoryUINT32(BL_LOADERRUNREQUEST_EEPROM_ADDR, &blData.loaderRunRequest);
EE_WriteMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
//Set correct BL VERSION in EEPROM
blData.version = BL_VERSION;
EE_WriteMemoryUINT32(BL_VERSION_EEPROM_ADDR, &blData.version);
//TODO: Maybe need to read back,verify, and add error information
EE_ReadMemoryUINT32(BL_VERSION_EEPROM_ADDR, &blData.version);
EE_ReadMemoryUINT32(BL_LOADERRUNREQUEST_EEPROM_ADDR, &blData.loaderRunRequest);
EE_ReadMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
}
#endif
if(!blData.transmitterProgrammed) //If NOT programmed, return to run loader
{
return;
}
if(blData.loaderRunRequest) //If loaderRunRequest, return to run loader
{
//Clear the loader run request
blData.loaderRunRequest = 0;
EE_WriteMemoryUINT32(BL_LOADERRUNREQUEST_EEPROM_ADDR, &blData.loaderRunRequest);
return;
}
//if FREQ and UP keys are held, return to run the loader screen
if(KEY_GetUpKeyHeld() && KEY_GetFrequencyKeyHeld())
{
return;
}
//Jump to the application at BL_APP_IMAGE_ADDR
IAP_JumpToApp(BL_APP_IMAGE_ADDR);
}
void BL_ShowScreen(void)
{
float32_t timer = 0.0;
//Init some things
timer_init(); //Needed for Delay_ticks
Init_Ports(); //make sure port expander outputs are in a safe state
LCD_Init();
//Update screen @ 10Hz and listen for USB data
while(1)
{
uint32_t xText = 20;
uint32_t yText = 30;
uint32_t yInc = 10;
LCD_Clear();
//Draw Text to LCD
sprintf(tempString, "TX Loader v%d", BL_VERSION);
FL_DrawString(tempString, LCD_X_MID, 0, font12Bold, LCD_DRAW_SET, FL_ALIGN_CENTER);
//TX Programmed
if(true == blData.transmitterProgrammed)
{
FL_DrawString("TX Programmed", xText, yText, font12Bold, LCD_DRAW_SET, FL_ALIGN_LEFT);
}
else
{
FL_DrawString("TX NOT Programmed", xText, yText, font12Bold, LCD_DRAW_SET, FL_ALIGN_LEFT);
}
yText += yInc;
yText += yInc;
FL_DrawString("Ready for Programming...", xText, yText, font12Bold, LCD_DRAW_SET, FL_ALIGN_LEFT);
yText += yInc;
//show time
timer += 0.1;
sprintf(tempString, "%0.1fs", timer);
FL_DrawString(tempString, 0, LCD_Y_MAX - FL_GetFontHeight(font12Bold), font12Bold, LCD_DRAW_SET, FL_ALIGN_LEFT);
LCD_Update();
//Power off if user presses power key
if(KEY_GetPowerKeyHeld())
{
Power_ON_OFF(OFF);
while(1); //wait for power off
}
Delay_Ticks(10); //100mS delay
}
}
/*
* Read bootloader data from EEPROM
* Have seen issue where first EEPROM read is garbage. throw the first read away.
*/
void BL_ReadInfo(void)
{
EE_ReadMemoryUINT32(BL_VERSION_EEPROM_ADDR, &blData.version);
EE_ReadMemoryUINT32(BL_LOADERRUNREQUEST_EEPROM_ADDR, &blData.loaderRunRequest);
EE_ReadMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
}

View File

@@ -0,0 +1,44 @@
/*
* bootloader.h
*
* Created on: Oct 22, 2023
* Author: Brian.Bailey
*/
#ifndef LOADER_BOOTLOADER_H_
#define LOADER_BOOTLOADER_H_
#include <stdint.h>
#include <stdbool.h>
#include "bootloader.h"
#define BL_VERSION 1 //Bootloader Version (integer)
#define BL_MAX_VERSION 255 //Max version - otherwise FLASH reads as uninitialized
//Locations for bootable image components
//Update these for transmitter.
#define BL_BOOTLOADER_IMAGE_ADDR 0x00000000 //base address for the bootloader image in FLASH
#define BL_APP_IMAGE_ADDR 0x00010000 //base address for the application image in FLASH
//Bootloader EEPROM Addresses
#define BL_RESERVED 0x0000 //Don't use address 0x0
#define BL_VERSION_EEPROM_ADDR 0x0004
#define BL_LOADERRUNREQUEST_EEPROM_ADDR 0x0008
#define BL_PROGRAMMED_EEPROM_ADDR 0x000C
//First 128 addresses (32 entries) in EEPROM are reserved for the bootloader
typedef struct {
uint32_t version; //bootloader version (for application to read)
uint32_t loaderRunRequest; //loader run request for program update
uint32_t transmitterProgrammed; //Transmitter has been programmed
}BL_DATA_t;
void BL_Run(void);
void BL_ShowScreen(void);
void BL_ReadInfo(void); //for application
#endif /* LOADER_BOOTLOADER_H_ */

343
source/Loader/flashUpdate.c Normal file
View File

@@ -0,0 +1,343 @@
/*
* flashUpdate.c
*
* Created on: Oct 23, 2023
* Author: Brian.Bailey
*/
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "usbComms.h"
#include "sha256.h"
#include "flashUpdate.h"
#include "fsl_common.h"
#include "fsl_iap.h"
#include "bootloader.h"
#include "eeprom.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define null 0 //NULL is defined at (void *)0 so it causes errors
//sector0~2 for bootloader, sector3~7 for APP
#define IAP_FLASH_SECTOR_START (3)
#define IAP_FLASH_SECTOR_END (7)
// #define IAP_FLASH_SECTOR_END (3) //for test
/*******************************************************************************
* Variables
******************************************************************************/
FLASH_UPDATE_t fu;
extern USB_t usb;
extern BL_DATA_t blData;
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
/*******************************************************************************
* Static Functions
******************************************************************************/
/*
* Convert the source string to bytes & store in *dst
* Converts 32 ASCII chars to 16 bytes
*/
static void ConvertStringToHalfHash(uint8_t *src, uint8_t *dst)
{
//32 ASCII chars to 16 bytes
for(uint32_t i = 0; i < SHA256_BLOCK_SIZE/2; i++)
{
//sscanf(&src[i*2], "%02hhX", &dst[i]); //This works in the RX but has problems when ASCII is > 127?
uint8_t temp[3];
temp[0] = src[i*2];
temp[1] = src[i*2+1];
temp[3] = 0;
dst[i] = strtol(temp, NULL, 16);
}
}
/*!
* @brief Convert uint8 to uint32.
*
* @param len length of arr8.
*/
static void ConvertUint8ToUint32(uint8_t *arr8, uint32_t *arr32, uint32_t len) {
uint32_t temp;
for (uint32_t i = 0; i < FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES; i++)
{
*(((uint8_t *)arr32) + i) = 0xFF;
}
//get the length of arr32
if(len % 4){
len /= 4;
len += 1;
}
else{
len /= 4;
}
for(uint32_t i = 0; i < len; i++) {
temp = (uint32_t)arr8[3] << 24;
temp |= (uint32_t)arr8[2] << 16;
temp |= (uint32_t)arr8[1] << 8;
temp |= (uint32_t)arr8[0];
arr8 += 4;
arr32[i] = temp;
}
}
/*******************************************************************************
* Public Functions
******************************************************************************/
/* Setup for FLASH programming
* /arg *data: csv string: pProgramSetup,<numBytes>,<hash>
* Use program length to calculate number of FLASH sectors to erase
* Save hash, program size, and calculated parameters
* Set usb.programMode
* Send ACK / NAK
*/
void FU_ProgramSetup(uint8_t *data)
{
//reset variables
fu.imageReceived = false;
fu.flashHashMatch = false;
fu.numBytesToProgram = 0;
fu.numBytesProgrammed = 0;
bool error = false;
//Parse Program message
static uint8_t *p; //pointer for strtok - static so it doesn't get optimized out.
p = strtok(data, ","); //points to "pProgramSetup"
p = strtok(null, ","); //number of bytes in the image
fu.numBytesToProgram = atoi(p);
p = strtok(null, ","); //hash - sent as string
ConvertStringToHalfHash(p, fu.hostHash);
//clear programmed flag in EEPROM
blData.transmitterProgrammed = 0;
EE_WriteMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
//Erase APP flash
//USB_SendString("Erasing flash..."); //or to LCD
IAP_PrepareSectorForWrite(IAP_FLASH_SECTOR_START, IAP_FLASH_SECTOR_END);
IAP_EraseSector(IAP_FLASH_SECTOR_START, IAP_FLASH_SECTOR_END, SystemCoreClock);
//USB_SendString("Erase flash completed"); //OR TO LCD
status_t status;
status = IAP_BlankCheckSector(IAP_FLASH_SECTOR_START, IAP_FLASH_SECTOR_END);
if (status != kStatus_IAP_Success)
{
error = 1;
// PRINTF("\r\nSector erase failed\r\n"); //to LCD
}
//Initialize fu
memset(fu.rxPageData, 0xff, sizeof(fu.rxPageData));
fu.flashProgramTargetAddress = BL_APP_IMAGE_ADDR;
if(error)
{
USB_SendString(NAK);
}
else
{
usb.programMode = true;
USB_SendString(ACK);
}
}
/* Write received data to FLASH using fu struct information
* This function is called repeatedly to write program FLASH
* When all data received, function sends ACK or NACK via USB
*/
void FU_WriteProgramDataToFLASH(void)
{
bool error = false;
//Verify packet: check header and check that size matches
if (USB_PACKET_START_BYTE != usb.rxDataBuffer[USB_PACKET_HEADER_OFFSET])
{
error = true;
}
uint32_t packetSize = usb.rxDataBuffer[USB_PACKET_LENGTH_H_OFFSET] * 256; //high byte
packetSize += usb.rxDataBuffer[USB_PACKET_LENGTH_L_OFFSET]; //low byte
if(packetSize != usb.rxDataIndex) //check that computed packet size matches number of bytes received
{
error = true;
}
//Write data to FLASH
//you can use packetSize. It is the size of the data in bytes
//Best to wait for a whole page or sector of data before writing to FLASH.
//faster this way
uint32_t rxData[64];
if(!error){
//Judge whether it is the last packet
if((packetSize - USB_PACKET_HEADER_SIZE + fu.numBytesProgrammed) == fu.numBytesToProgram)
{
//Judge whether the page is going to be full
if((fu.numBytesInPageData + packetSize - USB_PACKET_HEADER_SIZE) >= FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES)
{
uint16_t numBytesCurrentPage;
numBytesCurrentPage = FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES - fu.numBytesInPageData;
memcpy(&fu.rxPageData[fu.numBytesInPageData], &usb.rxDataBuffer[USB_PACKET_PAYLOAD_OFFSET], numBytesCurrentPage);
ConvertUint8ToUint32(fu.rxPageData, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES);
IAP_PrepareSectorForWrite(IAP_FLASH_SECTOR_START, IAP_FLASH_SECTOR_END);
IAP_CopyRamToFlash(fu.flashProgramTargetAddress, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES, SystemCoreClock);
fu.flashProgramTargetAddress += FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES;
//start the next FLASH page
memset(fu.rxPageData, 0xff, sizeof(fu.rxPageData));
fu.numBytesInPageData = 0;
memcpy(&fu.rxPageData[fu.numBytesInPageData], &usb.rxDataBuffer[USB_PACKET_PAYLOAD_OFFSET + numBytesCurrentPage], (packetSize - USB_PACKET_HEADER_SIZE - numBytesCurrentPage));
fu.numBytesInPageData += (packetSize - USB_PACKET_HEADER_SIZE - numBytesCurrentPage);
//write to FLASH
ConvertUint8ToUint32(fu.rxPageData, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES);
IAP_PrepareSectorForWrite(IAP_FLASH_SECTOR_START, IAP_FLASH_SECTOR_END);
IAP_CopyRamToFlash(fu.flashProgramTargetAddress, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES, SystemCoreClock);
fu.flashProgramTargetAddress += FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES;
}
else
{
//write the final page to FLASH
memcpy(&fu.rxPageData[fu.numBytesInPageData], &usb.rxDataBuffer[USB_PACKET_PAYLOAD_OFFSET], (packetSize - USB_PACKET_HEADER_SIZE)); //copy packet to fu.rxPageData
fu.numBytesInPageData += (packetSize - USB_PACKET_HEADER_SIZE);
ConvertUint8ToUint32(fu.rxPageData, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES);
IAP_PrepareSectorForWrite(IAP_FLASH_SECTOR_START, IAP_FLASH_SECTOR_END);
IAP_CopyRamToFlash(fu.flashProgramTargetAddress, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES, SystemCoreClock);
fu.flashProgramTargetAddress += FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES;
}
}
else{
//Judge whether the page is going to be full
if((fu.numBytesInPageData + packetSize - USB_PACKET_HEADER_SIZE) >= FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES){
uint16_t numBytesCurrentPage;
numBytesCurrentPage = FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES - fu.numBytesInPageData;
memcpy(&fu.rxPageData[fu.numBytesInPageData], &usb.rxDataBuffer[USB_PACKET_PAYLOAD_OFFSET], numBytesCurrentPage);
ConvertUint8ToUint32(fu.rxPageData, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES);
IAP_PrepareSectorForWrite(IAP_FLASH_SECTOR_START, IAP_FLASH_SECTOR_END);
IAP_CopyRamToFlash(fu.flashProgramTargetAddress, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES, SystemCoreClock);
fu.flashProgramTargetAddress += FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES;
//start the next FLASH page
memset(fu.rxPageData, 0xff, sizeof(fu.rxPageData));
fu.numBytesInPageData = 0;
memcpy(&fu.rxPageData[fu.numBytesInPageData], &usb.rxDataBuffer[USB_PACKET_PAYLOAD_OFFSET + numBytesCurrentPage], (packetSize - USB_PACKET_HEADER_SIZE - numBytesCurrentPage));
fu.numBytesInPageData += (packetSize - USB_PACKET_HEADER_SIZE - numBytesCurrentPage);
}
else{
memcpy(&fu.rxPageData[fu.numBytesInPageData], &usb.rxDataBuffer[USB_PACKET_PAYLOAD_OFFSET], (packetSize - USB_PACKET_HEADER_SIZE));
fu.numBytesInPageData += (packetSize - USB_PACKET_HEADER_SIZE);
}
}
fu.numBytesProgrammed += packetSize - USB_PACKET_HEADER_SIZE;
}
//Test for all data transferred
if(fu.numBytesProgrammed >= fu.numBytesToProgram)
{
usb.programMode = false;
fu.imageReceived = true;
}
if(error)
{
USB_SendString(NAK);
}
else
{
USB_SendString(ACK);
}
}
/* Verify FLASH image using sha256 hash
* Compute sha256 hash of program image
* Compare to fu.hostHash
*/
void FU_VerifyImage()
{
//TODO: Compute sha256 hash of program image from FLASH
static uint32_t dstAddr = BL_APP_IMAGE_ADDR;
uint8_t rxData[FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES];
uint32_t i = 0;
SHA256_CTX ctx;
/* EMAMPLE: (Also see sha256_test())
* SHA256_CTX ctx;
* sha256_init(&ctx); //initialize
* sha256_update(&ctx, data, dataLength); //call this for each block of data
* sha256_final(&ctx, fu.flashHash); //finish
*/
sha256_init(&ctx);
for(i = 0; i < (fu.numBytesToProgram / FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES); i++){
//read flash
for(uint32_t j = 0; j < FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES; j++) //read 256 bytes from FLASH to rxData
{
rxData[j] = *(uint8_t *)(dstAddr + FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES * i + j);
}
//calculate sha256
// sha256_update(&ctx, rxData, strlen((char *)rxData));
sha256_update(&ctx, rxData, FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES);
}
for(uint32_t j = 0; j < (fu.numBytesToProgram % FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES); j++){
rxData[j] = *(uint8_t *)(dstAddr + FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES * i + j);
}
sha256_update(&ctx, rxData, (fu.numBytesToProgram % FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES));
sha256_final(&ctx, fu.flashHash);
//Compare fu.flashHash with fu.hostHash - FIRST HALF ONLY!
if(0 == memcmp(fu.hostHash, fu.flashHash, SHA256_BLOCK_SIZE/2)) //Failed, I don't know the reason.
// if(1) //for test, bypass verification and it works
{
//set programmed flag in EEPROM
blData.transmitterProgrammed = true;
EE_WriteMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
USB_SendString(ACK);
}
else
{
USB_SendString(NAK);
}
}
/* Reset the processor
* Works even if in ISR
*/
void FU_ResetProcessor(void)
{
//Disable interrupts.
__disable_irq();
// Memory barriers for good measure.
__ISB();
__DSB();
//Reset
NVIC_SystemReset();
}

View File

@@ -0,0 +1,33 @@
/*
* flashUpdate.h
*
* Created on: Oct 23, 2023
* Author: Brian.Bailey
*/
#ifndef LOADER_FLASHUPDATE_H_
#define LOADER_FLASHUPDATE_H_
#include "sha256.h"
#include "LPC54114_cm4_features.h"
typedef struct {
uint32_t numBytesToProgram; //number of bytes to burn to FLASH
uint32_t flashProgramTargetAddress; //Target address in FLASH to write program
uint32_t numBytesProgrammed; //number of bytes programmed to FLASH
uint8_t hostHash[SHA256_BLOCK_SIZE]; //SHA256 hash of program data from host
uint8_t flashHash[SHA256_BLOCK_SIZE]; //SHA256 hash computed from data in FLASH
bool imageReceived; //Entire program image received (got the number of bytes)
bool flashHashMatch; //flashHash matches hostHash
uint8_t rxPageData[FSL_FEATURE_SYSCON_FLASH_PAGE_SIZE_BYTES]; //save packets data when the number is less then one page
uint16_t numBytesInPageData; //number of bytes saved in rxPageData
bool programCompleted; //Entire program completed
}FLASH_UPDATE_t;
void FU_ProgramSetup(uint8_t *data);
void FU_WriteProgramDataToFLASH(void);
void FU_VerifyImage();
void FU_ResetProcessor();
#endif /* LOADER_FLASHUPDATE_H_ */

85
source/Loader/iap_jump.c Normal file
View File

@@ -0,0 +1,85 @@
/*
* iap_jump.c
*
* Created on: Oct 23, 2023
* Author: Warner
*/
#include <Loader/iap_jump.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "LPC54114_cm4.h"
/*******************************************************************************
* Definitions
******************************************************************************/
typedef void (*IAP_JumpFun)(void);
/*******************************************************************************
* Variables
******************************************************************************/
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
/*******************************************************************************
* Static Functions
******************************************************************************/
/*******************************************************************************
* Public Functions
******************************************************************************/
#if 0
void IAP_JumpToAPP(uint32_t applicationAddress, uint32_t stackPointer){
/* Static variables are needed as we need to ensure the values we are using are not stored on the
previous stack */
static uint32_t s_stackPointer = 0;
s_stackPointer = stackPointer;
static void (*farewellBootloader)(void) = 0;
farewellBootloader = (void (*)(void))applicationAddress;
/* Set the VTOR to the application vector table address */
SCB->VTOR = applicationAddress;
/* Set stack pointers to the application stack pointer */
__set_MSP(s_stackPointer);
__set_PSP(s_stackPointer);
/* Jump to the application */
farewellBootloader();
}
#endif
void IAP_JumpToApp(uint32_t app_addr){
/* Static variables are needed as we need to ensure the values we are using are not stored on the
previous stack */
static uint32_t s_stackPointer = 0;
s_stackPointer = app_addr;
IAP_JumpFun JumpToApp;
JumpToApp=(IAP_JumpFun)*(uint32_t*)(app_addr+4);
/* Set the VTOR to the application vector table address */
SCB->VTOR = app_addr;
/* Set stack pointers to the application stack pointer */
__set_MSP(*(uint32_t*)s_stackPointer);
__set_PSP(*(uint32_t*)s_stackPointer);
/* Jump to the application */
JumpToApp();
}

17
source/Loader/iap_jump.h Normal file
View File

@@ -0,0 +1,17 @@
/*
* iap_jump.h
*
* Created on: Oct 23, 2023
* Author: Warner
*/
#ifndef IAP_JUMP_H_
#define IAP_JUMP_H_
#include <stdint.h>
#include <stdbool.h>
// void IAP_JumpToAPP(uint32_t applicationAddress, uint32_t stackPointer);
void IAP_JumpToApp(uint32_t app_addr);
#endif /* IAP_JUMP_H_ */

204
source/Loader/sha256.c Normal file
View File

@@ -0,0 +1,204 @@
/*********************************************************************
* Filename: sha256.c
* Author: Brad Conte (brad AT bradconte.com)
* Copyright:
* Disclaimer: This code is presented "as is" without any guarantees.
* Details: Implementation of the SHA-256 hashing algorithm.
SHA-256 is one of the three algorithms in the SHA2
specification. The others, SHA-384 and SHA-512, are not
offered in this implementation.
Algorithm specification can be found here:
* http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf
This implementation uses little endian byte order.
* github: https://github.com/B-Con/crypto-algorithms
*********************************************************************/
/*************************** HEADER FILES ***************************/
#include <stdlib.h>
#include <string.h>
#include "sha256.h"
/****************************** MACROS ******************************/
#define ROTLEFT(a,b) (((a) << (b)) | ((a) >> (32-(b))))
#define ROTRIGHT(a,b) (((a) >> (b)) | ((a) << (32-(b))))
#define CH(x,y,z) (((x) & (y)) ^ (~(x) & (z)))
#define MAJ(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
#define EP0(x) (ROTRIGHT(x,2) ^ ROTRIGHT(x,13) ^ ROTRIGHT(x,22))
#define EP1(x) (ROTRIGHT(x,6) ^ ROTRIGHT(x,11) ^ ROTRIGHT(x,25))
#define SIG0(x) (ROTRIGHT(x,7) ^ ROTRIGHT(x,18) ^ ((x) >> 3))
#define SIG1(x) (ROTRIGHT(x,17) ^ ROTRIGHT(x,19) ^ ((x) >> 10))
/**************************** VARIABLES *****************************/
static const WORD k[64] = {
0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,
0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,
0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,
0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967,
0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,
0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,
0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,
0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
};
/*********************** FUNCTION DEFINITIONS ***********************/
void sha256_transform(SHA256_CTX *ctx, const BYTE data[])
{
WORD a, b, c, d, e, f, g, h, i, j, t1, t2, m[64];
for (i = 0, j = 0; i < 16; ++i, j += 4)
m[i] = (data[j] << 24) | (data[j + 1] << 16) | (data[j + 2] << 8) | (data[j + 3]);
for ( ; i < 64; ++i)
m[i] = SIG1(m[i - 2]) + m[i - 7] + SIG0(m[i - 15]) + m[i - 16];
a = ctx->state[0];
b = ctx->state[1];
c = ctx->state[2];
d = ctx->state[3];
e = ctx->state[4];
f = ctx->state[5];
g = ctx->state[6];
h = ctx->state[7];
for (i = 0; i < 64; ++i) {
t1 = h + EP1(e) + CH(e,f,g) + k[i] + m[i];
t2 = EP0(a) + MAJ(a,b,c);
h = g;
g = f;
f = e;
e = d + t1;
d = c;
c = b;
b = a;
a = t1 + t2;
}
ctx->state[0] += a;
ctx->state[1] += b;
ctx->state[2] += c;
ctx->state[3] += d;
ctx->state[4] += e;
ctx->state[5] += f;
ctx->state[6] += g;
ctx->state[7] += h;
}
void sha256_init(SHA256_CTX *ctx)
{
ctx->datalen = 0;
ctx->bitlen = 0;
ctx->state[0] = 0x6a09e667;
ctx->state[1] = 0xbb67ae85;
ctx->state[2] = 0x3c6ef372;
ctx->state[3] = 0xa54ff53a;
ctx->state[4] = 0x510e527f;
ctx->state[5] = 0x9b05688c;
ctx->state[6] = 0x1f83d9ab;
ctx->state[7] = 0x5be0cd19;
}
void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len)
{
WORD i;
for (i = 0; i < len; ++i) {
ctx->data[ctx->datalen] = data[i];
ctx->datalen++;
if (ctx->datalen == 64) {
sha256_transform(ctx, ctx->data);
ctx->bitlen += 512;
ctx->datalen = 0;
}
}
}
void sha256_final(SHA256_CTX *ctx, BYTE hash[])
{
WORD i;
i = ctx->datalen;
// Pad whatever data is left in the buffer.
if (ctx->datalen < 56) {
ctx->data[i++] = 0x80;
while (i < 56)
ctx->data[i++] = 0x00;
}
else {
ctx->data[i++] = 0x80;
while (i < 64)
ctx->data[i++] = 0x00;
sha256_transform(ctx, ctx->data);
memset(ctx->data, 0, 56);
}
// Append to the padding the total message's length in bits and transform.
ctx->bitlen += ctx->datalen * 8;
ctx->data[63] = ctx->bitlen;
ctx->data[62] = ctx->bitlen >> 8;
ctx->data[61] = ctx->bitlen >> 16;
ctx->data[60] = ctx->bitlen >> 24;
ctx->data[59] = ctx->bitlen >> 32;
ctx->data[58] = ctx->bitlen >> 40;
ctx->data[57] = ctx->bitlen >> 48;
ctx->data[56] = ctx->bitlen >> 56;
sha256_transform(ctx, ctx->data);
// Since this implementation uses little endian byte ordering and SHA uses big endian,
// reverse all the bytes when copying the final state to the output hash.
for (i = 0; i < 4; ++i) {
hash[i] = (ctx->state[0] >> (24 - i * 8)) & 0x000000ff;
hash[i + 4] = (ctx->state[1] >> (24 - i * 8)) & 0x000000ff;
hash[i + 8] = (ctx->state[2] >> (24 - i * 8)) & 0x000000ff;
hash[i + 12] = (ctx->state[3] >> (24 - i * 8)) & 0x000000ff;
hash[i + 16] = (ctx->state[4] >> (24 - i * 8)) & 0x000000ff;
hash[i + 20] = (ctx->state[5] >> (24 - i * 8)) & 0x000000ff;
hash[i + 24] = (ctx->state[6] >> (24 - i * 8)) & 0x000000ff;
hash[i + 28] = (ctx->state[7] >> (24 - i * 8)) & 0x000000ff;
}
}
void sha256_ComputeHash(BYTE *data, WORD numBytes, BYTE *hash)
{
SHA256_CTX ctx;
sha256_init(&ctx);
sha256_update(&ctx, data, numBytes);
sha256_final(&ctx, hash);
}
int sha256_test()
{
BYTE text1[] = {"abc"};
BYTE text2[] = {"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"};
BYTE text3[] = {"aaaaaaaaaa"};
BYTE hash1[SHA256_BLOCK_SIZE] = {0xba,0x78,0x16,0xbf,0x8f,0x01,0xcf,0xea,0x41,0x41,0x40,0xde,0x5d,0xae,0x22,0x23,
0xb0,0x03,0x61,0xa3,0x96,0x17,0x7a,0x9c,0xb4,0x10,0xff,0x61,0xf2,0x00,0x15,0xad};
BYTE hash2[SHA256_BLOCK_SIZE] = {0x24,0x8d,0x6a,0x61,0xd2,0x06,0x38,0xb8,0xe5,0xc0,0x26,0x93,0x0c,0x3e,0x60,0x39,
0xa3,0x3c,0xe4,0x59,0x64,0xff,0x21,0x67,0xf6,0xec,0xed,0xd4,0x19,0xdb,0x06,0xc1};
BYTE hash3[SHA256_BLOCK_SIZE] = {0xcd,0xc7,0x6e,0x5c,0x99,0x14,0xfb,0x92,0x81,0xa1,0xc7,0xe2,0x84,0xd7,0x3e,0x67,
0xf1,0x80,0x9a,0x48,0xa4,0x97,0x20,0x0e,0x04,0x6d,0x39,0xcc,0xc7,0x11,0x2c,0xd0};
BYTE buf[SHA256_BLOCK_SIZE];
SHA256_CTX ctx;
int idx;
int pass = 1;
sha256_init(&ctx);
sha256_update(&ctx, text1, strlen((char *)text1));
sha256_final(&ctx, buf);
pass = pass && !memcmp(hash1, buf, SHA256_BLOCK_SIZE);
sha256_init(&ctx);
sha256_update(&ctx, text2, strlen((char *)text2));
sha256_final(&ctx, buf);
pass = pass && !memcmp(hash2, buf, SHA256_BLOCK_SIZE);
sha256_init(&ctx);
for (idx = 0; idx < 100000; ++idx)
sha256_update(&ctx, text3, strlen((char *)text3));
sha256_final(&ctx, buf);
pass = pass && !memcmp(hash3, buf, SHA256_BLOCK_SIZE);
return(pass);
}

37
source/Loader/sha256.h Normal file
View File

@@ -0,0 +1,37 @@
/*********************************************************************
* Filename: sha256.h
* Author: Brad Conte (brad AT bradconte.com)
* Copyright:
* Disclaimer: This code is presented "as is" without any guarantees.
* Details: Defines the API for the corresponding SHA1 implementation.
*********************************************************************/
#ifndef SHA256_H
#define SHA256_H
/*************************** HEADER FILES ***************************/
#include <stddef.h>
/****************************** MACROS ******************************/
#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest
#define SHA256_DIGEST_SIZE 32 // Added for rsa.c
/**************************** DATA TYPES ****************************/
typedef unsigned char BYTE; // 8-bit byte
typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines
typedef struct {
BYTE data[64];
WORD datalen;
unsigned long long bitlen;
WORD state[8];
} SHA256_CTX;
/*********************** FUNCTION DECLARATIONS **********************/
void sha256_init(SHA256_CTX *ctx);
void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len);
void sha256_final(SHA256_CTX *ctx, BYTE hash[]);
void sha256_ComputeHash(BYTE *data, WORD numBytes, BYTE *hash);
int sha256_test();
#endif // SHA256_H

65
source/System/system.c Normal file
View File

@@ -0,0 +1,65 @@
/*
* system.c
*
* Created on: Oct 23, 2023
* Author: Brian.Bailey
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
//Application includes
#include "eeprom.h"
#include "System/system.h"
/*******************************************************************************
* Definitions
******************************************************************************/
SYSTEM_DATA_t sys;
/*******************************************************************************
* Variables
******************************************************************************/
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
/*******************************************************************************
* Static Functions
******************************************************************************/
/*******************************************************************************
* Public Functions
******************************************************************************/
/*
* Load factory default settings
* System info, Data, Frequencies, etc.
*/
void SYS_LoadFactoryDefaults(void)
{
//System info
sprintf(sys.manufacturer, "UM");
sprintf(sys.modelNumber, "N/A");
sprintf(sys.modelName, "N/A");
sprintf(sys.serialNumber, "N/A");
sprintf(sys.mfgDate, "N/A");
//Data
//Frequencies
}
uint32_t SYS_GetLanguage(void)
{
return sys.language;
}

39
source/System/system.h Normal file
View File

@@ -0,0 +1,39 @@
/*
* system.h
*
* Created on: Oct 23, 2023
* Author: Brian.Bailey
*/
#ifndef SYSTEM_SYSTEM_H_
#define SYSTEM_SYSTEM_H_
#define SW_VERSION "1.10A"
#define SYS_INFO_LENGTH 24 //max string length for setup parameters (model, mfg, etc.)
//System data
typedef struct
{
uint8_t manufacturer[SYS_INFO_LENGTH]; //manufacturer
uint8_t modelName[SYS_INFO_LENGTH]; //model name
uint8_t serialNumber[SYS_INFO_LENGTH]; //serial number
uint8_t mfgDate[SYS_INFO_LENGTH]; //manufacture date
uint8_t modelNumber[SYS_INFO_LENGTH]; //model number
uint32_t bootloaderVersion; //bootloader version
uint32_t language; //system language
}SYSTEM_DATA_t;
void SYS_LoadFactoryDefaults(void);
uint32_t SYS_GetLanguage(void);
#endif /* SYSTEM_SYSTEM_H_ */

413
source/USB/usbComms.c Normal file
View File

@@ -0,0 +1,413 @@
/*
* usbComms.c
*
* Created on: May 17, 2023
* Author: Brian.Bailey
*/
/*
* USB Comms
* Data is received by APP_and placed in rxBuffer[]
*/
#include <stdio.h>
#include <stdlib.h>
//Drivers
#include "fsl_gpio.h"
#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
//Application Includes
#include "virtual_com.h"
#include "flashUpdate.h"
#include "bootloader.h"
#include "eeprom.h"
#include "System/system.h"
#include "frq.h"
#include "hwFixes.h"
#include "usbComms.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define USB_DETECT_PORT 1 //USB VBUS on GPIO1_6. Not sure we can read this
#define USB_DETECT_PIN 6
#define CR '\r' //carriage return
#define LF '\n' //line feed
#define null 0 //NULL is defined at (void *)0 so it causes errors
/*******************************************************************************
* Variables
******************************************************************************/
USB_t usb;
extern SYSTEM_DATA_t sys;
extern BL_DATA_t blData;
extern usb_cdc_vcom_struct_t s_cdcVcom;
extern uint8_t frq_update_flag;
extern HARDWARE_FIX_t hwf;
//temp storage for string data
uint8_t usbTempString[USB_RX_BUFFER_SIZE];
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
/*******************************************************************************
* Static Functions
******************************************************************************/
/*******************************************************************************
* Public Functions
******************************************************************************/
uint8_t USB_IsConnected(void)
{
return GPIO_PinRead(GPIO, USB_DETECT_PORT, USB_DETECT_PIN);
}
/* Process incoming USB string
* Commands are LF terminated ASCII text
* @param size number of bytes to process
*/
void USB_ProcessString(uint32_t size)
{
//operates on usb.rxDataBuffer[]
//index is usb.rxCommandIndex
uint32_t usbBusyCount = 0;
usb.rxStringReceived = false;
for(uint32_t i = 0; i < size; i++) //Look for LF character in rxDataBuffer
{
if(LF == usb.rxDataBuffer[i])
{
usb.rxDataBuffer[i] = 0; //replace LF with NULL to terminate string
usb.rxStringReceived = true;
break;
}
}
if(usb.rxStringReceived)
{
//Process the command
USB_ProcessCommand();
}
else
{
//This is an error. search the ringbuffer for the next LF and throw away everything before it.
}
}
/*
* Process Incoming USB commands
*/
void USB_ProcessCommand(void)
{
if(USB_CommandCompare("dID")) //device ID
{
USB_SendString("UM_TX");
}
else if(USB_CommandPrefixCompare("p"))
{
USB_ProcessProgramCommand();
}
else if(USB_CommandPrefixCompare("s"))
{
USB_ProcessSystemCommand();
}
else if(USB_CommandPrefixCompare("f"))
{
USB_ProcessFrequencyCommand();
}
else
{
//Bad Command
USB_SendString(NAK);
}
}
/*
* Process Program commands
*/
void USB_ProcessProgramCommand(void)
{
if (USB_CommandCompare("pLoaderRunRequest")) //Request bootloader run
{
blData.loaderRunRequest = 1;
EE_WriteMemoryUINT32(BL_LOADERRUNREQUEST_EEPROM_ADDR, &blData.loaderRunRequest);
//TESTING: Verify write
EE_ReadMemoryUINT32(BL_LOADERRUNREQUEST_EEPROM_ADDR, &blData.loaderRunRequest);
if(blData.loaderRunRequest == 1)
{
USB_SendString(ACK);
}
else
{
USB_SendString(NAK);
}
}
else if (USB_CommandPrefixCompare("pProgramSetup,")) //Program setup information - RX can ONLY update the bootloader at 0x6000 0000
{
FU_ProgramSetup(usb.rxDataBuffer);
}
else if(USB_CommandCompare("pVerifyImage")) //verify image in FLASH - compare hashes
{
FU_VerifyImage();
}
else if(USB_CommandCompare("pReset"))
{
FU_ResetProcessor();
}
else if (USB_CommandCompare("pClearProgramFlag"))
{
blData.transmitterProgrammed = false;
EE_WriteMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
//TESTING: Verify write
EE_ReadMemoryUINT32(BL_PROGRAMMED_EEPROM_ADDR, &blData.transmitterProgrammed);
if(blData.transmitterProgrammed == false)
{
USB_SendString(ACK);
}
else
{
USB_SendString(NAK);
}
}
else if (USB_CommandCompare("pEraseAllData")) //Erase settings and factory data. Leave bootloader data
{
EE_EraseAllData(); // Erase EEPROM data
USB_SendString(ACK);
}
else
{
USB_SendString(NAK);
}
}
/*
* Process System commands
*/
void USB_ProcessSystemCommand(void)
{
static uint8_t *p; //pointer for strtok - static so it doesn't get optimized out.
if (USB_CommandPrefixCompare("sSetMfg,"))
{
p = strtok(usb.rxDataBuffer, ","); //points to command
p = strtok(null, ","); //points to arg
strncpy(sys.manufacturer, p, SYS_INFO_LENGTH);
USB_SendString(ACK);
}
else if (USB_CommandPrefixCompare("sSetModelNumber,"))
{
char* token = strtok(usb.rxDataBuffer, ",");
token = strtok(null, ","); //points to arg
strncpy(sys.modelNumber, token, SYS_INFO_LENGTH);
USB_SendString(ACK);
}
else if (USB_CommandPrefixCompare("sSetModelName,"))
{
char* token = strtok(usb.rxDataBuffer, ",");
token = strtok(null, ","); //points to arg
strncpy(sys.modelName, token, SYS_INFO_LENGTH);
USB_SendString(ACK);
}
else if (USB_CommandPrefixCompare("sSetSerial,"))
{
char* token = strtok(usb.rxDataBuffer, ",");
token = strtok(null, ","); //points to arg
strncpy(sys.serialNumber, token, SYS_INFO_LENGTH);
USB_SendString(ACK);
}
else if (USB_CommandPrefixCompare("sSetMfgDate,"))
{
char* token = strtok(usb.rxDataBuffer, ",");
token = strtok(null, ","); //points to arg
strncpy(sys.mfgDate, token, SYS_INFO_LENGTH);
USB_SendString(ACK);
}
else if (USB_CommandPrefixCompare("sSetHourCount,"))
{
//do nothing
USB_SendString(ACK);
}
else if(USB_CommandPrefixCompare("sSetMainPcbaPN,"))
{
char* token = strtok(usb.rxDataBuffer, ",");
token = strtok(null, ","); //points to arg
hwf.mainPcbaPN = atoi(token);
EE_WriteUINT32(EE_HWFIX_MAIN_PCBA_PN, hwf.mainPcbaPN);
USB_SendString(ACK);
}
else if (USB_CommandCompare("sSaveSettings"))
{
//Save settings data
EE_SaveData();
frq_update_flag = false;
Change_To_Next_BC_Freq();
USB_SendString(ACK);
}
else if (USB_CommandCompare("sGetSwVersion"))
{
USB_SendString(SW_VERSION);
}
else if (USB_CommandCompare("sGetMfg"))
{
USB_SendString(sys.manufacturer);
}
else if (USB_CommandCompare("sGetModelNumber"))
{
USB_SendString(sys.modelNumber);
}
else if (USB_CommandCompare("sGetModelName"))
{
USB_SendString(sys.modelName);
}
else if (USB_CommandCompare("sGetSerial"))
{
USB_SendString(sys.serialNumber);
}
else if (USB_CommandCompare("sGetMfgDate"))
{
USB_SendString(sys.mfgDate);
}
else if(USB_CommandCompare("sGetMainPcbaPN"))
{
sprintf(usbTempString, "%d", hwf.mainPcbaPN);
USB_SendString(usbTempString);
}
else if(USB_CommandCompare("sGetbootloaderVerion"))
{
sprintf(usbTempString, "%d", sys.bootloaderVersion);
USB_SendString(usbTempString);
}
else //Unknown command
{
USB_SendString(NAK);
}
}
/*
* Process Frequency Commands
*/
void USB_ProcessFrequencyCommand(void)
{
static uint8_t *p; //pointer for strtok - static so it doesn't get optimized out.
if (USB_CommandPrefixCompare("fAdd,"))
{
//Add a frequency to FreqArray[]
//Parse message
p = strtok(usb.rxDataBuffer, ","); //points to "fAdd"
p = strtok(null, ","); //frequency
uint32_t frequency = atoi(p);
p = strtok(null, ","); //type
uint32_t type = atoi(p);
p = strtok(null, ","); //enabled
uint32_t enabled = atoi(p);
p = strtok(null, ","); //inMenu
uint32_t inMenu = atoi(p);
FREQ_AddFrequency(frequency, enabled, inMenu, type);
USB_SendString(ACK);
}
else if (USB_CommandCompare("fClear"))
{
//Clear the frequency list
frq_update_flag = true;
FREQ_ClearFrequencies();
USB_SendString(ACK);
}
else if (USB_CommandCompare("fSave"))
{
//Save frequency data to EEPROM
EE_SaveData();
USB_SendString(ACK);
}
else if (USB_CommandCompare("fGetNum")) //Get number of frequencies in the receiver
{
sprintf(usbTempString, "%d", FREQ_GetNumFrequencies());
USB_SendString(usbTempString);
}
else if (USB_CommandPrefixCompare("fGet,")) //Get string representing a single frequency
{
p = strtok(usb.rxDataBuffer, ","); //points to "fGet"
p = strtok(null, ","); //index
uint32_t index = atoi(p);
FREQUENCY_t frq = FREQ_GetFreqByIndex(index);
sprintf(usbTempString, "%d,%d,%d,%d", frq.frequency1, 0, frq.enabled, 1); //FREQ_TYPE-t always 0, inMenu always 1
USB_SendString(usbTempString);
}
else //Unknown command
{
USB_SendString(NAK);
}
}
/*
* Return true if str matches data in usb.rxDataBuffer
*/
bool USB_CommandCompare(uint8_t *str)
{
return (0 == strncmp(str, usb.rxDataBuffer, USB_RX_BUFFER_SIZE));
}
/* Compare str to contents of usb.rxDataBuffer
* Return true if str matches data in usb.rxDataBuffer
*/
bool USB_CommandPrefixCompare(uint8_t *str)
{
return (0 == strncmp(str, usb.rxDataBuffer, strlen(str)));
}

73
source/USB/usbComms.h Normal file
View File

@@ -0,0 +1,73 @@
/*
* usbComms.h
*
* Created on: May 17, 2023
* Author: Brian.Bailey
*/
#ifndef COMMS_USBCOMMS_H_
#define COMMS_USBCOMMS_H_
#include "virtual_com.h" //required for USB_RX_BUFFER_SIZE
/*******************************************************************************
* Definitions
******************************************************************************/
#define USB_RX_BUFFER_SIZE 512 //Size of rxDataBuffer in bytes (same size as USB_DATA_BUFFER)
#define ACK "ACK"
#define NAK "NAK"
#define OK "ACK"
#define NO "NAK"
//Packet Mode
#define USB_PACKET_START_BYTE 0xA5 //start byte
#define USB_PACKET_HEADER_SIZE 3 //header size in bytes
#define USB_PACKET_MAX_LENGTH 63 //503 //max length of packet including header
#define USB_PACKET_MAX_PAYLOAD 60 //500 //max bytes for packet payload
#define USB_PACKET_HEADER_OFFSET 0 //header byte offset
#define USB_PACKET_LENGTH_H_OFFSET 1 //packet size high byte offset
#define USB_PACKET_LENGTH_L_OFFSET 2 //packet size low byte offset
#define USB_PACKET_PAYLOAD_OFFSET 3 //payload byte offset
//PACKET FORMAT:
//PACKET_START byte
//Size byte high - Size of packet including header
//Size byte low
//Payload
typedef struct
{
uint8_t rxDataBuffer[USB_RX_BUFFER_SIZE]; //buffer for received data (copied from rxBuffer)
uint32_t rxDataIndex; //index in rxDataBuffer
bool rxStringReceived; //string received and ready to process
bool programMode; //USB program mode: use packet format
uint32_t sendErrorCount; //number of times USB_SendString() has failed to send
bool initialized;
}USB_t;
uint8_t USB_IsConnected(void);
void USB_ProcessString(uint32_t size);
void USB_ProcessCommand(void);
void USB_ProcessProgramCommand(void);
void USB_ProcessSystemCommand(void);
void USB_ProcessFrequencyCommand(void);
bool USB_CommandCompare(uint8_t *str);
bool USB_CommandPrefixCompare(uint8_t *str);
void USB_Send(uint8_t * data);
#endif /* COMMS_USBCOMMS_H_ */

View File

@@ -0,0 +1,157 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* Copyright 2016 - 2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _USB_DEVICE_CONFIG_H_
#define _USB_DEVICE_CONFIG_H_
/*******************************************************************************
* Definitions
******************************************************************************/
/*!
* @addtogroup usb_device_configuration
* @{
*/
/*!
* @name Hardware instance define
* @{
*/
/*! @brief KHCI instance count */
#define USB_DEVICE_CONFIG_KHCI (0U)
/*! @brief EHCI instance count */
#define USB_DEVICE_CONFIG_EHCI (0U)
/*! @brief LPC USB IP3511 FS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511FS (1U) //12Mbps, NXP driver - Default setup uses this
/*! @brief LPC USB IP3511 HS instance count */
#define USB_DEVICE_CONFIG_LPCIP3511HS (0U) //480Mbps, NXP driver
/*! @brief Device instance count, the sum of KHCI and EHCI instance counts*/
#define USB_DEVICE_CONFIG_NUM \
(USB_DEVICE_CONFIG_KHCI + USB_DEVICE_CONFIG_EHCI + USB_DEVICE_CONFIG_LPCIP3511FS + USB_DEVICE_CONFIG_LPCIP3511HS)
/* @} */
/*!
* @name class instance define
* @{
*/
/*! @brief HID instance count */
#define USB_DEVICE_CONFIG_HID (0U)
/*! @brief CDC ACM instance count */
#define USB_DEVICE_CONFIG_CDC_ACM (1U)
/*! @brief MSC instance count */
#define USB_DEVICE_CONFIG_MSC (0U)
/*! @brief Audio instance count */
#define USB_DEVICE_CONFIG_AUDIO (0U)
/*! @brief PHDC instance count */
#define USB_DEVICE_CONFIG_PHDC (0U)
/*! @brief Video instance count */
#define USB_DEVICE_CONFIG_VIDEO (0U)
/*! @brief CCID instance count */
#define USB_DEVICE_CONFIG_CCID (0U)
/*! @brief Printer instance count */
#define USB_DEVICE_CONFIG_PRINTER (0U)
/*! @brief DFU instance count */
#define USB_DEVICE_CONFIG_DFU (0U)
/* @} */
/*! @brief Whether device is self power. 1U supported, 0U not supported */
#define USB_DEVICE_CONFIG_SELF_POWER (1U)
/*! @brief How many endpoints are supported in the stack. */
#define USB_DEVICE_CONFIG_ENDPOINTS (4U)
/*! @brief Whether the device task is enabled. */
#define USB_DEVICE_CONFIG_USE_TASK (0U)
/*! @brief How many the notification message are supported when the device task is enabled. */
#define USB_DEVICE_CONFIG_MAX_MESSAGES (8U)
/*! @brief Whether test mode enabled. */
#define USB_DEVICE_CONFIG_USB20_TEST_MODE (0U)
/*! @brief Whether device CV test is enabled. */
#define USB_DEVICE_CONFIG_CV_TEST (0U)
/*! @brief Whether device compliance test is enabled. If the macro is enabled,
the test mode and CV test macroes will be set.*/
#define USB_DEVICE_CONFIG_COMPLIANCE_TEST (0U)
#if ((defined(USB_DEVICE_CONFIG_COMPLIANCE_TEST)) && (USB_DEVICE_CONFIG_COMPLIANCE_TEST > 0U))
/*! @brief Undefine the macro USB_DEVICE_CONFIG_USB20_TEST_MODE. */
#undef USB_DEVICE_CONFIG_USB20_TEST_MODE
/*! @brief Undefine the macro USB_DEVICE_CONFIG_CV_TEST. */
#undef USB_DEVICE_CONFIG_CV_TEST
/*! @brief enable the test mode. */
#define USB_DEVICE_CONFIG_USB20_TEST_MODE (1U)
/*! @brief enable the CV test */
#define USB_DEVICE_CONFIG_CV_TEST (1U)
#endif
#if ((defined(USB_DEVICE_CONFIG_KHCI)) && (USB_DEVICE_CONFIG_KHCI > 0U))
/*! @brief The MAX buffer length for the KHCI DMA workaround.*/
#define USB_DEVICE_CONFIG_KHCI_DMA_ALIGN_BUFFER_LENGTH (64U)
#endif
#if ((defined(USB_DEVICE_CONFIG_EHCI)) && (USB_DEVICE_CONFIG_EHCI > 0U))
/*! @brief How many the DTD are supported. */
#define USB_DEVICE_CONFIG_EHCI_MAX_DTD (16U)
/*! @brief Whether the EHCI ID pin detect feature enabled. */
#define USB_DEVICE_CONFIG_EHCI_ID_PIN_DETECT (0U)
#endif
/*! @brief Whether the keep alive feature enabled. */
#define USB_DEVICE_CONFIG_KEEP_ALIVE_MODE (0U)
/*! @brief Whether the transfer buffer is cache-enabled or not. */
#ifndef USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE
#define USB_DEVICE_CONFIG_BUFFER_PROPERTY_CACHEABLE (0U)
#endif
/*! @brief Whether the low power mode is enabled or not. */
#define USB_DEVICE_CONFIG_LOW_POWER_MODE (0U)
#if ((defined(USB_DEVICE_CONFIG_LOW_POWER_MODE)) && (USB_DEVICE_CONFIG_LOW_POWER_MODE > 0U))
/*! @brief Whether device remote wakeup supported. 1U supported, 0U not supported */
#define USB_DEVICE_CONFIG_REMOTE_WAKEUP (0U)
/*! @brief Whether LPM is supported. 1U supported, 0U not supported */
#define USB_DEVICE_CONFIG_LPM_L1 (0U)
#else
/*! @brief The device remote wakeup is unsupported. */
#define USB_DEVICE_CONFIG_REMOTE_WAKEUP (0U)
#endif
/*! @brief Whether the device detached feature is enabled or not. */
#define USB_DEVICE_CONFIG_DETACH_ENABLE (0U)
/*! @brief Whether handle the USB bus error. */
#define USB_DEVICE_CONFIG_ERROR_HANDLING (0U)
/* @} */
#endif /* _USB_DEVICE_CONFIG_H_ */

View File

@@ -0,0 +1,514 @@
/*
* Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
* Copyright 2016, 2019 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "usb_device_config.h"
#include "usb.h"
#include "usb_device.h"
#include "usb_device_class.h"
#include "usb_device_cdc_acm.h"
#include "usb_device_descriptor.h"
/*******************************************************************************
* Variables
******************************************************************************/
/* Define endpoint for communication class */
usb_device_endpoint_struct_t g_UsbDeviceCdcVcomCicEndpoints[USB_CDC_VCOM_ENDPOINT_CIC_COUNT] = {
{
USB_CDC_VCOM_INTERRUPT_IN_ENDPOINT | (USB_IN << 7U),
USB_ENDPOINT_INTERRUPT,
FS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE,
FS_CDC_VCOM_INTERRUPT_IN_INTERVAL,
},
};
/* Define endpoint for data class */
usb_device_endpoint_struct_t g_UsbDeviceCdcVcomDicEndpoints[USB_CDC_VCOM_ENDPOINT_DIC_COUNT] = {
{
USB_CDC_VCOM_BULK_IN_ENDPOINT | (USB_IN << 7U),
USB_ENDPOINT_BULK,
FS_CDC_VCOM_BULK_IN_PACKET_SIZE,
0U,
},
{
USB_CDC_VCOM_BULK_OUT_ENDPOINT | (USB_OUT << 7U),
USB_ENDPOINT_BULK,
FS_CDC_VCOM_BULK_OUT_PACKET_SIZE,
0U,
}};
/* Define interface for communication class */
usb_device_interface_struct_t g_UsbDeviceCdcVcomCommunicationInterface[] = {{0,
{
USB_CDC_VCOM_ENDPOINT_CIC_COUNT,
g_UsbDeviceCdcVcomCicEndpoints,
},
NULL}};
/* Define interface for data class */
usb_device_interface_struct_t g_UsbDeviceCdcVcomDataInterface[] = {{0,
{
USB_CDC_VCOM_ENDPOINT_DIC_COUNT,
g_UsbDeviceCdcVcomDicEndpoints,
},
NULL}};
/* Define interfaces for virtual com */
usb_device_interfaces_struct_t g_UsbDeviceCdcVcomInterfaces[USB_CDC_VCOM_INTERFACE_COUNT] = {
{USB_CDC_VCOM_CIC_CLASS, USB_CDC_VCOM_CIC_SUBCLASS, USB_CDC_VCOM_CIC_PROTOCOL, USB_CDC_VCOM_COMM_INTERFACE_INDEX,
g_UsbDeviceCdcVcomCommunicationInterface,
sizeof(g_UsbDeviceCdcVcomCommunicationInterface) / sizeof(usb_device_interface_struct_t)},
{USB_CDC_VCOM_DIC_CLASS, USB_CDC_VCOM_DIC_SUBCLASS, USB_CDC_VCOM_DIC_PROTOCOL, USB_CDC_VCOM_DATA_INTERFACE_INDEX,
g_UsbDeviceCdcVcomDataInterface, sizeof(g_UsbDeviceCdcVcomDataInterface) / sizeof(usb_device_interface_struct_t)},
};
/* Define configurations for virtual com */
usb_device_interface_list_t g_UsbDeviceCdcVcomInterfaceList[USB_DEVICE_CONFIGURATION_COUNT] = {
{
USB_CDC_VCOM_INTERFACE_COUNT,
g_UsbDeviceCdcVcomInterfaces,
},
};
/* Define class information for virtual com */
usb_device_class_struct_t g_UsbDeviceCdcVcomConfig = {
g_UsbDeviceCdcVcomInterfaceList,
kUSB_DeviceClassTypeCdc,
USB_DEVICE_CONFIGURATION_COUNT,
};
/* Define device descriptor */
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceDescriptor[] = {
/* Size of this descriptor in bytes */
USB_DESCRIPTOR_LENGTH_DEVICE,
/* DEVICE Descriptor Type */
USB_DESCRIPTOR_TYPE_DEVICE,
/* USB Specification Release Number in Binary-Coded Decimal (i.e., 2.10 is 210H). */
USB_SHORT_GET_LOW(USB_DEVICE_SPECIFIC_BCD_VERSION),
USB_SHORT_GET_HIGH(USB_DEVICE_SPECIFIC_BCD_VERSION),
/* Class code (assigned by the USB-IF). */
USB_DEVICE_CLASS,
/* Subclass code (assigned by the USB-IF). */
USB_DEVICE_SUBCLASS,
/* Protocol code (assigned by the USB-IF). */
USB_DEVICE_PROTOCOL,
/* Maximum packet size for endpoint zero (only 8, 16, 32, or 64 are valid) */
USB_CONTROL_MAX_PACKET_SIZE,
USB_SHORT_GET_LOW(USB_DEVICE_VID),
USB_SHORT_GET_HIGH(USB_DEVICE_VID), /* Vendor ID (assigned by the USB-IF) */
USB_SHORT_GET_LOW(USB_DEVICE_PID),
USB_SHORT_GET_HIGH(USB_DEVICE_PID), /* Product ID (assigned by the manufacturer) */
/* Device release number in binary-coded decimal */
USB_SHORT_GET_LOW(USB_DEVICE_DEMO_BCD_VERSION),
USB_SHORT_GET_HIGH(USB_DEVICE_DEMO_BCD_VERSION),
/* Index of string descriptor describing manufacturer */
0x01,
/* Index of string descriptor describing product */
0x02,
/* Index of string descriptor describing the device's serial number */
0x00,
/* Number of possible configurations */
USB_DEVICE_CONFIGURATION_COUNT,
};
/* Define configuration descriptor */
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceConfigurationDescriptor[] = {
/* Size of this descriptor in bytes */
USB_DESCRIPTOR_LENGTH_CONFIGURE,
/* CONFIGURATION Descriptor Type */
USB_DESCRIPTOR_TYPE_CONFIGURE,
/* Total length of data returned for this configuration. */
USB_SHORT_GET_LOW(USB_DESCRIPTOR_LENGTH_CONFIGURE + USB_DESCRIPTOR_LENGTH_INTERFACE +
USB_DESCRIPTOR_LENGTH_CDC_HEADER_FUNC + USB_DESCRIPTOR_LENGTH_CDC_CALL_MANAG +
USB_DESCRIPTOR_LENGTH_CDC_ABSTRACT + USB_DESCRIPTOR_LENGTH_CDC_UNION_FUNC +
USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_INTERFACE +
USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_ENDPOINT),
USB_SHORT_GET_HIGH(USB_DESCRIPTOR_LENGTH_CONFIGURE + USB_DESCRIPTOR_LENGTH_INTERFACE +
USB_DESCRIPTOR_LENGTH_CDC_HEADER_FUNC + USB_DESCRIPTOR_LENGTH_CDC_CALL_MANAG +
USB_DESCRIPTOR_LENGTH_CDC_ABSTRACT + USB_DESCRIPTOR_LENGTH_CDC_UNION_FUNC +
USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_INTERFACE +
USB_DESCRIPTOR_LENGTH_ENDPOINT + USB_DESCRIPTOR_LENGTH_ENDPOINT),
/* Number of interfaces supported by this configuration */
USB_CDC_VCOM_INTERFACE_COUNT,
/* Value to use as an argument to the SetConfiguration() request to select this configuration */
USB_CDC_VCOM_CONFIGURE_INDEX,
/* Index of string descriptor describing this configuration */
0,
/* Configuration characteristics D7: Reserved (set to one) D6: Self-powered D5: Remote Wakeup D4...0: Reserved
(reset to zero) */
(USB_DESCRIPTOR_CONFIGURE_ATTRIBUTE_D7_MASK) |
(USB_DEVICE_CONFIG_SELF_POWER << USB_DESCRIPTOR_CONFIGURE_ATTRIBUTE_SELF_POWERED_SHIFT) |
(USB_DEVICE_CONFIG_REMOTE_WAKEUP << USB_DESCRIPTOR_CONFIGURE_ATTRIBUTE_REMOTE_WAKEUP_SHIFT),
/* Maximum power consumption of the USB * device from the bus in this specific * configuration when the device is
fully * operational. Expressed in 2 mA units * (i.e., 50 = 100 mA). */
USB_DEVICE_MAX_POWER,
/* Communication Interface Descriptor */
USB_DESCRIPTOR_LENGTH_INTERFACE, USB_DESCRIPTOR_TYPE_INTERFACE, USB_CDC_VCOM_COMM_INTERFACE_INDEX, 0x00,
USB_CDC_VCOM_ENDPOINT_CIC_COUNT, USB_CDC_VCOM_CIC_CLASS, USB_CDC_VCOM_CIC_SUBCLASS, USB_CDC_VCOM_CIC_PROTOCOL,
0x00, /* Interface Description String Index*/
/* CDC Class-Specific descriptor */
USB_DESCRIPTOR_LENGTH_CDC_HEADER_FUNC, /* Size of this descriptor in bytes */
USB_DESCRIPTOR_TYPE_CDC_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_CDC_HEADER_FUNC_DESC, 0x10,
0x01, /* USB Class Definitions for Communications the Communication specification version 1.10 */
USB_DESCRIPTOR_LENGTH_CDC_CALL_MANAG, /* Size of this descriptor in bytes */
USB_DESCRIPTOR_TYPE_CDC_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_CDC_CALL_MANAGEMENT_FUNC_DESC,
0x01, /*Bit 0: Whether device handle call management itself 1, Bit 1: Whether device can send/receive call
management information over a Data Class Interface 0 */
0x01, /* Indicates multiplexed commands are handled via data interface */
USB_DESCRIPTOR_LENGTH_CDC_ABSTRACT, /* Size of this descriptor in bytes */
USB_DESCRIPTOR_TYPE_CDC_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_CDC_ABSTRACT_CONTROL_FUNC_DESC,
0x06, /* Bit 0: Whether device supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and
Get_Comm_Feature 0, Bit 1: Whether device supports the request combination of Set_Line_Coding,
Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State 1, Bit ... */
USB_DESCRIPTOR_LENGTH_CDC_UNION_FUNC, /* Size of this descriptor in bytes */
USB_DESCRIPTOR_TYPE_CDC_CS_INTERFACE, /* CS_INTERFACE Descriptor Type */
USB_CDC_UNION_FUNC_DESC, 0x00, /* The interface number of the Communications or Data Class interface */
0x01, /* Interface number of subordinate interface in the Union */
/*Notification Endpoint descriptor */
USB_DESCRIPTOR_LENGTH_ENDPOINT, USB_DESCRIPTOR_TYPE_ENDPOINT, USB_CDC_VCOM_INTERRUPT_IN_ENDPOINT | (USB_IN << 7U),
USB_ENDPOINT_INTERRUPT, USB_SHORT_GET_LOW(FS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE),
USB_SHORT_GET_HIGH(FS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE), FS_CDC_VCOM_INTERRUPT_IN_INTERVAL,
/* Data Interface Descriptor */
USB_DESCRIPTOR_LENGTH_INTERFACE, USB_DESCRIPTOR_TYPE_INTERFACE, USB_CDC_VCOM_DATA_INTERFACE_INDEX, 0x00,
USB_CDC_VCOM_ENDPOINT_DIC_COUNT, USB_CDC_VCOM_DIC_CLASS, USB_CDC_VCOM_DIC_SUBCLASS, USB_CDC_VCOM_DIC_PROTOCOL,
0x00, /* Interface Description String Index*/
/*Bulk IN Endpoint descriptor */
USB_DESCRIPTOR_LENGTH_ENDPOINT, USB_DESCRIPTOR_TYPE_ENDPOINT, USB_CDC_VCOM_BULK_IN_ENDPOINT | (USB_IN << 7U),
USB_ENDPOINT_BULK, USB_SHORT_GET_LOW(FS_CDC_VCOM_BULK_IN_PACKET_SIZE),
USB_SHORT_GET_HIGH(FS_CDC_VCOM_BULK_IN_PACKET_SIZE), 0x00, /* The polling interval value is every 0 Frames */
/*Bulk OUT Endpoint descriptor */
USB_DESCRIPTOR_LENGTH_ENDPOINT, USB_DESCRIPTOR_TYPE_ENDPOINT, USB_CDC_VCOM_BULK_OUT_ENDPOINT | (USB_OUT << 7U),
USB_ENDPOINT_BULK, USB_SHORT_GET_LOW(FS_CDC_VCOM_BULK_OUT_PACKET_SIZE),
USB_SHORT_GET_HIGH(FS_CDC_VCOM_BULK_OUT_PACKET_SIZE), 0x00, /* The polling interval value is every 0 Frames */
};
/* Define string descriptor */
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceString0[] = {2U + 2U, USB_DESCRIPTOR_TYPE_STRING, 0x09, 0x04};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
uint8_t g_UsbDeviceString1[] = {
2U + 2U * 18U, USB_DESCRIPTOR_TYPE_STRING,
'N', 0x00U,
'X', 0x00U,
'P', 0x00U,
' ', 0x00U,
'S', 0x00U,
'E', 0x00U,
'M', 0x00U,
'I', 0x00U,
'C', 0x00U,
'O', 0x00U,
'N', 0x00U,
'D', 0x00U,
'U', 0x00U,
'C', 0x00U,
'T', 0x00U,
'O', 0x00U,
'R', 0x00U,
'S', 0x00U,
};
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
#if 1 //Changed Descriptor
uint8_t g_UsbDeviceString2[] = {2U + 2U * 16U, USB_DESCRIPTOR_TYPE_STRING,
'U', 0,
'M', 0,
'A', 0,
'G', 0,
' ', 0,
'T', 0,
'R', 0,
'A', 0,
'N', 0,
'S', 0,
'M', 0,
'I', 0,
'T', 0,
'T', 0,
'E', 0,
'R', 0};
#else
uint8_t g_UsbDeviceString2[] = {2U + 2U * 20U, USB_DESCRIPTOR_TYPE_STRING,
'M', 0,
'C', 0,
'U', 0,
' ', 0,
'V', 0,
'I', 0,
'R', 0,
'T', 0,
'U', 0,
'A', 0,
'L', 0,
' ', 0,
'C', 0,
'O', 0,
'M', 0,
' ', 0,
'D', 0,
'E', 0,
'M', 0,
'O', 0};
#endif
uint8_t *g_UsbDeviceStringDescriptorArray[USB_DEVICE_STRING_COUNT] = {g_UsbDeviceString0, g_UsbDeviceString1,
g_UsbDeviceString2};
/* Define string descriptor size */
uint32_t g_UsbDeviceStringDescriptorLength[USB_DEVICE_STRING_COUNT] = {
sizeof(g_UsbDeviceString0), sizeof(g_UsbDeviceString1), sizeof(g_UsbDeviceString2)};
usb_language_t g_UsbDeviceLanguage[USB_DEVICE_LANGUAGE_COUNT] = {{
g_UsbDeviceStringDescriptorArray,
g_UsbDeviceStringDescriptorLength,
(uint16_t)0x0409,
}};
usb_language_list_t g_UsbDeviceLanguageList = {
g_UsbDeviceString0,
sizeof(g_UsbDeviceString0),
g_UsbDeviceLanguage,
USB_DEVICE_LANGUAGE_COUNT,
};
/*******************************************************************************
* Code
******************************************************************************/
/*!
* @brief USB device get device descriptor function.
*
* This function gets the device descriptor of the USB device.
*
* @param handle The USB device handle.
* @param deviceDescriptor The pointer to the device descriptor structure.
*
* @return A USB error code or kStatus_USB_Success.
*/
usb_status_t USB_DeviceGetDeviceDescriptor(usb_device_handle handle,
usb_device_get_device_descriptor_struct_t *deviceDescriptor)
{
deviceDescriptor->buffer = g_UsbDeviceDescriptor;
deviceDescriptor->length = USB_DESCRIPTOR_LENGTH_DEVICE;
return kStatus_USB_Success;
}
/*!
* @brief USB device get configuration descriptor function.
*
* This function gets the configuration descriptor of the USB device.
*
* @param handle The USB device handle.
* @param configurationDescriptor The pointer to the configuration descriptor structure.
*
* @return A USB error code or kStatus_USB_Success.
*/
usb_status_t USB_DeviceGetConfigurationDescriptor(
usb_device_handle handle, usb_device_get_configuration_descriptor_struct_t *configurationDescriptor)
{
if (USB_CDC_VCOM_CONFIGURE_INDEX > configurationDescriptor->configuration)
{
configurationDescriptor->buffer = g_UsbDeviceConfigurationDescriptor;
configurationDescriptor->length = USB_DESCRIPTOR_LENGTH_CONFIGURATION_ALL;
return kStatus_USB_Success;
}
return kStatus_USB_InvalidRequest;
}
/*!
* @brief USB device get string descriptor function.
*
* This function gets the string descriptor of the USB device.
*
* @param handle The USB device handle.
* @param stringDescriptor Pointer to the string descriptor structure.
*
* @return A USB error code or kStatus_USB_Success.
*/
usb_status_t USB_DeviceGetStringDescriptor(usb_device_handle handle,
usb_device_get_string_descriptor_struct_t *stringDescriptor)
{
if (stringDescriptor->stringIndex == 0U)
{
stringDescriptor->buffer = (uint8_t *)g_UsbDeviceLanguageList.languageString;
stringDescriptor->length = g_UsbDeviceLanguageList.stringLength;
}
else
{
uint8_t languageId = 0U;
uint8_t languageIndex = USB_DEVICE_STRING_COUNT;
for (; languageId < USB_DEVICE_LANGUAGE_COUNT; languageId++)
{
if (stringDescriptor->languageId == g_UsbDeviceLanguageList.languageList[languageId].languageId)
{
if (stringDescriptor->stringIndex < USB_DEVICE_STRING_COUNT)
{
languageIndex = stringDescriptor->stringIndex;
}
break;
}
}
if (USB_DEVICE_STRING_COUNT == languageIndex)
{
return kStatus_USB_InvalidRequest;
}
stringDescriptor->buffer = (uint8_t *)g_UsbDeviceLanguageList.languageList[languageId].string[languageIndex];
stringDescriptor->length = g_UsbDeviceLanguageList.languageList[languageId].length[languageIndex];
}
return kStatus_USB_Success;
}
/*!
* @brief USB device set speed function.
*
* This function sets the speed of the USB device.
*
* Due to the difference of HS and FS descriptors, the device descriptors and configurations need to be updated to match
* current speed.
* As the default, the device descriptors and configurations are configured by using FS parameters for both EHCI and
* KHCI.
* When the EHCI is enabled, the application needs to call this function to update device by using current speed.
* The updated information includes endpoint max packet size, endpoint interval, etc.
*
* @param handle The USB device handle.
* @param speed Speed type. USB_SPEED_HIGH/USB_SPEED_FULL/USB_SPEED_LOW.
*
* @return A USB error code or kStatus_USB_Success.
*/
usb_status_t USB_DeviceSetSpeed(usb_device_handle handle, uint8_t speed)
{
usb_descriptor_union_t *ptr1;
usb_descriptor_union_t *ptr2;
int i;
ptr1 = (usb_descriptor_union_t *)(&g_UsbDeviceConfigurationDescriptor[0]);
ptr2 = (usb_descriptor_union_t *)(&g_UsbDeviceConfigurationDescriptor[USB_DESCRIPTOR_LENGTH_CONFIGURATION_ALL - 1]);
while (ptr1 < ptr2)
{
if (ptr1->common.bDescriptorType == USB_DESCRIPTOR_TYPE_ENDPOINT)
{
if (USB_SPEED_HIGH == speed)
{
if (((ptr1->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_IN) &&
(USB_CDC_VCOM_INTERRUPT_IN_ENDPOINT ==
(ptr1->endpoint.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)))
{
ptr1->endpoint.bInterval = HS_CDC_VCOM_INTERRUPT_IN_INTERVAL;
USB_SHORT_TO_LITTLE_ENDIAN_ADDRESS(HS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE,
ptr1->endpoint.wMaxPacketSize);
}
else if (((ptr1->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_IN) &&
(USB_CDC_VCOM_BULK_IN_ENDPOINT ==
(ptr1->endpoint.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)))
{
USB_SHORT_TO_LITTLE_ENDIAN_ADDRESS(HS_CDC_VCOM_BULK_IN_PACKET_SIZE, ptr1->endpoint.wMaxPacketSize);
}
else if (((ptr1->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_OUT) &&
(USB_CDC_VCOM_BULK_OUT_ENDPOINT ==
(ptr1->endpoint.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)))
{
USB_SHORT_TO_LITTLE_ENDIAN_ADDRESS(HS_CDC_VCOM_BULK_OUT_PACKET_SIZE, ptr1->endpoint.wMaxPacketSize);
}
else
{
}
}
else
{
if (((ptr1->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_IN) &&
(USB_CDC_VCOM_INTERRUPT_IN_ENDPOINT ==
(ptr1->endpoint.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)))
{
ptr1->endpoint.bInterval = FS_CDC_VCOM_INTERRUPT_IN_INTERVAL;
USB_SHORT_TO_LITTLE_ENDIAN_ADDRESS(FS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE,
ptr1->endpoint.wMaxPacketSize);
}
else if (((ptr1->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_IN) &&
(USB_CDC_VCOM_BULK_IN_ENDPOINT ==
(ptr1->endpoint.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)))
{
USB_SHORT_TO_LITTLE_ENDIAN_ADDRESS(FS_CDC_VCOM_BULK_IN_PACKET_SIZE, ptr1->endpoint.wMaxPacketSize);
}
else if (((ptr1->endpoint.bEndpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK) ==
USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_OUT) &&
(USB_CDC_VCOM_BULK_OUT_ENDPOINT ==
(ptr1->endpoint.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)))
{
USB_SHORT_TO_LITTLE_ENDIAN_ADDRESS(FS_CDC_VCOM_BULK_OUT_PACKET_SIZE, ptr1->endpoint.wMaxPacketSize);
}
else
{
}
}
}
ptr1 = (usb_descriptor_union_t *)((uint8_t *)ptr1 + ptr1->common.bLength);
}
for (i = 0; i < USB_CDC_VCOM_ENDPOINT_CIC_COUNT; i++)
{
if (USB_SPEED_HIGH == speed)
{
g_UsbDeviceCdcVcomCicEndpoints[i].maxPacketSize = HS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE;
g_UsbDeviceCdcVcomCicEndpoints[i].interval = HS_CDC_VCOM_INTERRUPT_IN_INTERVAL;
}
else
{
g_UsbDeviceCdcVcomCicEndpoints[i].maxPacketSize = FS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE;
g_UsbDeviceCdcVcomCicEndpoints[i].interval = FS_CDC_VCOM_INTERRUPT_IN_INTERVAL;
}
}
for (i = 0; i < USB_CDC_VCOM_ENDPOINT_DIC_COUNT; i++)
{
if (USB_SPEED_HIGH == speed)
{
if (g_UsbDeviceCdcVcomDicEndpoints[i].endpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK)
{
g_UsbDeviceCdcVcomDicEndpoints[i].maxPacketSize = HS_CDC_VCOM_BULK_IN_PACKET_SIZE;
}
else
{
g_UsbDeviceCdcVcomDicEndpoints[i].maxPacketSize = HS_CDC_VCOM_BULK_OUT_PACKET_SIZE;
}
}
else
{
if (g_UsbDeviceCdcVcomDicEndpoints[i].endpointAddress & USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_MASK)
{
g_UsbDeviceCdcVcomDicEndpoints[i].maxPacketSize = FS_CDC_VCOM_BULK_IN_PACKET_SIZE;
}
else
{
g_UsbDeviceCdcVcomDicEndpoints[i].maxPacketSize = FS_CDC_VCOM_BULK_OUT_PACKET_SIZE;
}
}
}
return kStatus_USB_Success;
}

View File

@@ -0,0 +1,206 @@
/*
* Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _USB_DEVICE_DESCRIPTOR_H_
#define _USB_DEVICE_DESCRIPTOR_H_ 1
/*******************************************************************************
* Definitions
******************************************************************************/
#define USB_DEVICE_SPECIFIC_BCD_VERSION (0x0200)
#define USB_DEVICE_DEMO_BCD_VERSION (0x0101U)
#define USB_DEVICE_VID (0x1FC9U)
#define USB_DEVICE_PID (0x8310U)
/* Communication Class Codes */
#define CDC_COMM_CLASS (0x02)
/* Data Class Codes */
#define CDC_DATA_CLASS (0x0A)
/* Communication Class SubClass Codes */
#define USB_CDC_DIRECT_LINE_CONTROL_MODEL (0x01)
#define USB_CDC_ABSTRACT_CONTROL_MODEL (0x02)
#define USB_CDC_TELEPHONE_CONTROL_MODEL (0x03)
#define USB_CDC_MULTI_CHANNEL_CONTROL_MODEL (0x04)
#define USB_CDC_CAPI_CONTROL_MOPDEL (0x05)
#define USB_CDC_ETHERNET_NETWORKING_CONTROL_MODEL (0x06)
#define USB_CDC_ATM_NETWORKING_CONTROL_MODEL (0x07)
#define USB_CDC_WIRELESS_HANDSET_CONTROL_MODEL (0x08)
#define USB_CDC_DEVICE_MANAGEMENT (0x09)
#define USB_CDC_MOBILE_DIRECT_LINE_MODEL (0x0A)
#define USB_CDC_OBEX (0x0B)
#define USB_CDC_ETHERNET_EMULATION_MODEL (0x0C)
/* Communication Class Protocol Codes */
#define USB_CDC_NO_CLASS_SPECIFIC_PROTOCOL (0x00) /*also for Data Class Protocol Code */
#define USB_CDC_AT_250_PROTOCOL (0x01)
#define USB_CDC_AT_PCCA_101_PROTOCOL (0x02)
#define USB_CDC_AT_PCCA_101_ANNEX_O (0x03)
#define USB_CDC_AT_GSM_7_07 (0x04)
#define USB_CDC_AT_3GPP_27_007 (0x05)
#define USB_CDC_AT_TIA_CDMA (0x06)
#define USB_CDC_ETHERNET_EMULATION_PROTOCOL (0x07)
#define USB_CDC_EXTERNAL_PROTOCOL (0xFE)
#define USB_CDC_VENDOR_SPECIFIC (0xFF) /*also for Data Class Protocol Code */
/* Data Class Protocol Codes */
#define USB_CDC_PYHSICAL_INTERFACE_PROTOCOL (0x30)
#define USB_CDC_HDLC_PROTOCOL (0x31)
#define USB_CDC_TRANSPARENT_PROTOCOL (0x32)
#define USB_CDC_MANAGEMENT_PROTOCOL (0x50)
#define USB_CDC_DATA_LINK_Q931_PROTOCOL (0x51)
#define USB_CDC_DATA_LINK_Q921_PROTOCOL (0x52)
#define USB_CDC_DATA_COMPRESSION_V42BIS (0x90)
#define USB_CDC_EURO_ISDN_PROTOCOL (0x91)
#define USB_CDC_RATE_ADAPTION_ISDN_V24 (0x92)
#define USB_CDC_CAPI_COMMANDS (0x93)
#define USB_CDC_HOST_BASED_DRIVER (0xFD)
#define USB_CDC_UNIT_FUNCTIONAL (0xFE)
/* Descriptor SubType in Communications Class Functional Descriptors */
#define USB_CDC_HEADER_FUNC_DESC (0x00)
#define USB_CDC_CALL_MANAGEMENT_FUNC_DESC (0x01)
#define USB_CDC_ABSTRACT_CONTROL_FUNC_DESC (0x02)
#define USB_CDC_DIRECT_LINE_FUNC_DESC (0x03)
#define USB_CDC_TELEPHONE_RINGER_FUNC_DESC (0x04)
#define USB_CDC_TELEPHONE_REPORT_FUNC_DESC (0x05)
#define USB_CDC_UNION_FUNC_DESC (0x06)
#define USB_CDC_COUNTRY_SELECT_FUNC_DESC (0x07)
#define USB_CDC_TELEPHONE_MODES_FUNC_DESC (0x08)
#define USB_CDC_TERMINAL_FUNC_DESC (0x09)
#define USB_CDC_NETWORK_CHANNEL_FUNC_DESC (0x0A)
#define USB_CDC_PROTOCOL_UNIT_FUNC_DESC (0x0B)
#define USB_CDC_EXTENSION_UNIT_FUNC_DESC (0x0C)
#define USB_CDC_MULTI_CHANNEL_FUNC_DESC (0x0D)
#define USB_CDC_CAPI_CONTROL_FUNC_DESC (0x0E)
#define USB_CDC_ETHERNET_NETWORKING_FUNC_DESC (0x0F)
#define USB_CDC_ATM_NETWORKING_FUNC_DESC (0x10)
#define USB_CDC_WIRELESS_CONTROL_FUNC_DESC (0x11)
#define USB_CDC_MOBILE_DIRECT_LINE_FUNC_DESC (0x12)
#define USB_CDC_MDLM_DETAIL_FUNC_DESC (0x13)
#define USB_CDC_DEVICE_MANAGEMENT_FUNC_DESC (0x14)
#define USB_CDC_OBEX_FUNC_DESC (0x15)
#define USB_CDC_COMMAND_SET_FUNC_DESC (0x16)
#define USB_CDC_COMMAND_SET_DETAIL_FUNC_DESC (0x17)
#define USB_CDC_TELEPHONE_CONTROL_FUNC_DESC (0x18)
#define USB_CDC_OBEX_SERVICE_ID_FUNC_DESC (0x19)
/* usb descriptor length */
#define USB_DESCRIPTOR_LENGTH_CONFIGURATION_ALL (sizeof(g_UsbDeviceConfigurationDescriptor))
#define USB_DESCRIPTOR_LENGTH_CDC_HEADER_FUNC (5)
#define USB_DESCRIPTOR_LENGTH_CDC_CALL_MANAG (5)
#define USB_DESCRIPTOR_LENGTH_CDC_ABSTRACT (4)
#define USB_DESCRIPTOR_LENGTH_CDC_UNION_FUNC (5)
/* Configuration, interface and endpoint. */
#define USB_DEVICE_CONFIGURATION_COUNT (1)
#define USB_DEVICE_STRING_COUNT (3)
#define USB_DEVICE_LANGUAGE_COUNT (1)
#define USB_CDC_VCOM_CONFIGURE_INDEX (1)
#define USB_CDC_VCOM_ENDPOINT_CIC_COUNT (1)
#define USB_CDC_VCOM_ENDPOINT_DIC_COUNT (2)
#define USB_CDC_VCOM_INTERRUPT_IN_ENDPOINT (1)
#define USB_CDC_VCOM_BULK_IN_ENDPOINT (2)
#define USB_CDC_VCOM_BULK_OUT_ENDPOINT (3)
#define USB_CDC_VCOM_INTERFACE_COUNT (2)
#define USB_CDC_VCOM_COMM_INTERFACE_INDEX (0)
#define USB_CDC_VCOM_DATA_INTERFACE_INDEX (1)
/* Packet size. */
#define HS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE (16)
#define FS_CDC_VCOM_INTERRUPT_IN_PACKET_SIZE (16)
#define HS_CDC_VCOM_INTERRUPT_IN_INTERVAL (0x07) /* 2^(7-1) = 8ms */
#define FS_CDC_VCOM_INTERRUPT_IN_INTERVAL (0x08)
#define HS_CDC_VCOM_BULK_IN_PACKET_SIZE (512)
#define FS_CDC_VCOM_BULK_IN_PACKET_SIZE (64)
#define HS_CDC_VCOM_BULK_OUT_PACKET_SIZE (512)
#define FS_CDC_VCOM_BULK_OUT_PACKET_SIZE (64)
/* String descriptor length. */
#define USB_DESCRIPTOR_LENGTH_STRING0 (sizeof(g_UsbDeviceString0))
#define USB_DESCRIPTOR_LENGTH_STRING1 (sizeof(g_UsbDeviceString1))
#define USB_DESCRIPTOR_LENGTH_STRING2 (sizeof(g_UsbDeviceString2))
#define USB_DESCRIPTOR_TYPE_CDC_CS_INTERFACE (0x24)
#define USB_DESCRIPTOR_TYPE_CDC_CS_ENDPOINT (0x25)
/* Class code. */
#define USB_DEVICE_CLASS (0x02)
#define USB_DEVICE_SUBCLASS (0x00)
#define USB_DEVICE_PROTOCOL (0x00)
#define USB_DEVICE_MAX_POWER (0x32)
#define USB_CDC_VCOM_CIC_CLASS (CDC_COMM_CLASS)
#define USB_CDC_VCOM_CIC_SUBCLASS (USB_CDC_ABSTRACT_CONTROL_MODEL)
#define USB_CDC_VCOM_CIC_PROTOCOL (USB_CDC_NO_CLASS_SPECIFIC_PROTOCOL)
#define USB_CDC_VCOM_DIC_CLASS (CDC_DATA_CLASS)
#define USB_CDC_VCOM_DIC_SUBCLASS (0x00)
#define USB_CDC_VCOM_DIC_PROTOCOL (USB_CDC_NO_CLASS_SPECIFIC_PROTOCOL)
/*******************************************************************************
* API
******************************************************************************/
/*!
* @brief USB device set speed function.
*
* This function sets the speed of the USB device.
*
* Due to the difference of HS and FS descriptors, the device descriptors and configurations need to be updated to match
* current speed.
* As the default, the device descriptors and configurations are configured by using FS parameters for both EHCI and
* KHCI.
* When the EHCI is enabled, the application needs to call this function to update device by using current speed.
* The updated information includes endpoint max packet size, endpoint interval, etc.
*
* @param handle The USB device handle.
* @param speed Speed type. USB_SPEED_HIGH/USB_SPEED_FULL/USB_SPEED_LOW.
*
* @return A USB error code or kStatus_USB_Success.
*/
extern usb_status_t USB_DeviceSetSpeed(usb_device_handle handle, uint8_t speed);
/*!
* @brief USB device get device descriptor function.
*
* This function gets the device descriptor of the USB device.
*
* @param handle The USB device handle.
* @param deviceDescriptor The pointer to the device descriptor structure.
*
* @return A USB error code or kStatus_USB_Success.
*/
extern usb_status_t USB_DeviceGetDeviceDescriptor(usb_device_handle handle,
usb_device_get_device_descriptor_struct_t *deviceDescriptor);
/*!
* @brief USB device get string descriptor function.
*
* This function gets the string descriptor of the USB device.
*
* @param handle The USB device handle.
* @param stringDescriptor Pointer to the string descriptor structure.
*
* @return A USB error code or kStatus_USB_Success.
*/
usb_status_t USB_DeviceGetStringDescriptor(usb_device_handle handle,
usb_device_get_string_descriptor_struct_t *stringDescriptor);
/*!
* @brief USB device get configuration descriptor function.
*
* This function gets the configuration descriptor of the USB device.
*
* @param handle The USB device handle.
* @param configurationDescriptor The pointer to the configuration descriptor structure.
*
* @return A USB error code or kStatus_USB_Success.
*/
extern usb_status_t USB_DeviceGetConfigurationDescriptor(
usb_device_handle handle, usb_device_get_configuration_descriptor_struct_t *configurationDescriptor);
#endif /* _USB_DEVICE_DESCRIPTOR_H_ */

673
source/USB/virtual_com.c Normal file
View File

@@ -0,0 +1,673 @@
/*
* Copyright (c) 2015 - 2016, Freescale Semiconductor, Inc.
* Copyright 2016 - 2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "usb_device_config.h"
#include "usb.h"
#include "usb_device.h"
#include "usb_device_class.h"
#include "usb_device_cdc_acm.h"
#include "usb_device_ch9.h"
#include "usb_device_descriptor.h"
#include "virtual_com.h"
#if (defined(FSL_FEATURE_SOC_SYSMPU_COUNT) && (FSL_FEATURE_SOC_SYSMPU_COUNT > 0U))
#include "fsl_sysmpu.h"
#endif /* FSL_FEATURE_SOC_SYSMPU_COUNT */
#if ((defined FSL_FEATURE_SOC_USBPHY_COUNT) && (FSL_FEATURE_SOC_USBPHY_COUNT > 0U))
#include "usb_phy.h"
#endif
#if defined(FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED) && (FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED > 0U) && \
defined(USB_DEVICE_CONFIG_KEEP_ALIVE_MODE) && (USB_DEVICE_CONFIG_KEEP_ALIVE_MODE > 0U) && \
defined(FSL_FEATURE_USB_KHCI_USB_RAM) && (FSL_FEATURE_USB_KHCI_USB_RAM > 0U)
extern uint8_t USB_EnterLowpowerMode(void);
#endif
#include "fsl_power.h"
//Application Includes
#include "flashUpdate.h"
#include "usbComms.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define CR '\r' //carriage return
#define LF '\n' //line feed
#define null 0 //NULL is defined at (void *)0 so it causes errors
/*******************************************************************************
* Prototypes
******************************************************************************/
void BOARD_InitHardware(void);
void USB_DeviceClockInit(void);
void USB_DeviceIsrEnable(void);
#if USB_DEVICE_CONFIG_USE_TASK
void USB_DeviceTaskFn(void *deviceHandle);
#endif
void BOARD_DbgConsole_Deinit(void);
void BOARD_DbgConsole_Init(void);
usb_status_t USB_DeviceCdcVcomCallback(class_handle_t handle, uint32_t event, void *param);
usb_status_t USB_DeviceCallback(usb_device_handle handle, uint32_t event, void *param);
#if 0 //Trying to fix project after adding, then removing FLASHIAP driver. Makes no difference
extern usb_status_t USB_DeviceCdcAcmSend(class_handle_t handle, uint8_t ep, uint8_t *buffer, uint32_t length);
extern usb_status_t USB_DeviceCdcAcmRecv(class_handle_t handle, uint8_t ep, uint8_t *buffer, uint32_t length);
#endif
/*******************************************************************************
* Variables
******************************************************************************/
//Application
extern USB_t usb;
extern usb_device_endpoint_struct_t g_UsbDeviceCdcVcomDicEndpoints[];
extern usb_device_class_struct_t g_UsbDeviceCdcVcomConfig;
/* Data structure of virtual com device */
usb_cdc_vcom_struct_t s_cdcVcom;
/* Line coding of cdc device */
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
static uint8_t s_lineCoding[LINE_CODING_SIZE] = {
/* E.g. 0x00,0xC2,0x01,0x00 : 0x0001C200 is 115200 bits per second */
(LINE_CODING_DTERATE >> 0U) & 0x000000FFU,
(LINE_CODING_DTERATE >> 8U) & 0x000000FFU,
(LINE_CODING_DTERATE >> 16U) & 0x000000FFU,
(LINE_CODING_DTERATE >> 24U) & 0x000000FFU,
LINE_CODING_CHARFORMAT,
LINE_CODING_PARITYTYPE,
LINE_CODING_DATABITS};
/* Abstract state of cdc device */
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
static uint8_t s_abstractState[COMM_FEATURE_DATA_SIZE] = {(STATUS_ABSTRACT_STATE >> 0U) & 0x00FFU,
(STATUS_ABSTRACT_STATE >> 8U) & 0x00FFU};
/* Country code of cdc device */
USB_DMA_INIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE)
static uint8_t s_countryCode[COMM_FEATURE_DATA_SIZE] = {(COUNTRY_SETTING >> 0U) & 0x00FFU,
(COUNTRY_SETTING >> 8U) & 0x00FFU};
/* CDC ACM information */
USB_DMA_NONINIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE) static usb_cdc_acm_info_t s_usbCdcAcmInfo;
/* Data buffer for receiving and sending*/
USB_DMA_NONINIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE) static uint8_t rxBuffer[USB_BUFFER_SIZE];
USB_DMA_NONINIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE) static uint8_t txBuffer[USB_BUFFER_SIZE];
volatile static uint32_t rxDataSize = 0;
volatile static uint32_t txDataSize = 0;
/* USB device class information */
static usb_device_class_config_struct_t s_cdcAcmConfig[1] = {{
USB_DeviceCdcVcomCallback,
0,
&g_UsbDeviceCdcVcomConfig,
}};
/* USB device class configuration information */
static usb_device_class_config_list_struct_t s_cdcAcmConfigList = {
s_cdcAcmConfig,
USB_DeviceCallback,
1,
};
#if defined(FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED) && (FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED > 0U) && \
defined(USB_DEVICE_CONFIG_KEEP_ALIVE_MODE) && (USB_DEVICE_CONFIG_KEEP_ALIVE_MODE > 0U) && \
defined(FSL_FEATURE_USB_KHCI_USB_RAM) && (FSL_FEATURE_USB_KHCI_USB_RAM > 0U)
volatile static uint8_t s_waitForDataReceive = 0;
volatile static uint8_t s_comOpen = 0;
#endif
/*******************************************************************************
* Code
******************************************************************************/
void USB0_IRQHandler(void)
{
USB_DeviceLpcIp3511IsrFunction(s_cdcVcom.deviceHandle);
}
void USB_DeviceClockInit(void)
{
/* enable USB IP clock */
CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcFro, CLOCK_GetFreq(kCLOCK_FroHf));
}
void USB_DeviceIsrEnable(void)
{
uint8_t irqNumber;
uint8_t usbDeviceIP3511Irq[] = USB_IRQS;
irqNumber = usbDeviceIP3511Irq[CONTROLLER_ID - kUSB_ControllerLpcIp3511Fs0];
/* Install isr, set priority, and enable IRQ. */
NVIC_SetPriority((IRQn_Type)irqNumber, USB_DEVICE_INTERRUPT_PRIORITY);
EnableIRQ((IRQn_Type)irqNumber);
}
#if USB_DEVICE_CONFIG_USE_TASK
void USB_DeviceTaskFn(void *deviceHandle)
{
USB_DeviceLpcIp3511TaskFunction(deviceHandle);
}
#endif
/*!
* @brief CDC class specific callback function.
*
* This function handles the CDC class specific requests.
*
* @param handle The CDC ACM class handle.
* @param event The CDC ACM class event type.
* @param param The parameter of the class specific request.
*
* @return A USB error code or kStatus_USB_Success.
*/
usb_status_t USB_DeviceCdcVcomCallback(class_handle_t handle, uint32_t event, void *param)
{
uint32_t len;
uint8_t *uartBitmap;
usb_device_cdc_acm_request_param_struct_t *acmReqParam;
usb_device_endpoint_callback_message_struct_t *epCbParam;
usb_status_t error = kStatus_USB_Error;
usb_cdc_acm_info_t *acmInfo = &s_usbCdcAcmInfo;
acmReqParam = (usb_device_cdc_acm_request_param_struct_t *)param;
epCbParam = (usb_device_endpoint_callback_message_struct_t *)param;
switch (event)
{
case kUSB_DeviceCdcEventSendResponse:
{
if ((epCbParam->length != 0) && (!(epCbParam->length % g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize)))
{
/* If the last packet is the size of endpoint, then send also zero-ended packet,
** meaning that we want to inform the host that we do not have any additional
** data, so it can flush the output.
*/
error = USB_DeviceCdcAcmSend(handle, USB_CDC_VCOM_BULK_IN_ENDPOINT, NULL, 0);
}
else if ((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions))
{
if ((epCbParam->buffer != NULL) || ((epCbParam->buffer == NULL) && (epCbParam->length == 0)))
{
/* User: add your own code for send complete event */
/* Schedule buffer for next receive event */
error = USB_DeviceCdcAcmRecv(handle, USB_CDC_VCOM_BULK_OUT_ENDPOINT, rxBuffer,
g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);
#if defined(FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED) && (FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED > 0U) && \
defined(USB_DEVICE_CONFIG_KEEP_ALIVE_MODE) && (USB_DEVICE_CONFIG_KEEP_ALIVE_MODE > 0U) && \
defined(FSL_FEATURE_USB_KHCI_USB_RAM) && (FSL_FEATURE_USB_KHCI_USB_RAM > 0U)
s_waitForDataReceive = 1;
USB0->INTEN &= ~USB_INTEN_SOFTOKEN_MASK;
#endif
}
}
else
{
}
}
break;
case kUSB_DeviceCdcEventRecvResponse:
{
if ((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions))
{
rxDataSize = epCbParam->length;
#if defined(FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED) && (FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED > 0U) && \
defined(USB_DEVICE_CONFIG_KEEP_ALIVE_MODE) && (USB_DEVICE_CONFIG_KEEP_ALIVE_MODE > 0U) && \
defined(FSL_FEATURE_USB_KHCI_USB_RAM) && (FSL_FEATURE_USB_KHCI_USB_RAM > 0U)
s_waitForDataReceive = 0;
USB0->INTEN |= USB_INTEN_SOFTOKEN_MASK;
#endif
if (!rxDataSize)
{
/* Schedule buffer for next receive event */
error = USB_DeviceCdcAcmRecv(handle, USB_CDC_VCOM_BULK_OUT_ENDPOINT, rxBuffer,
g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);
#if defined(FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED) && (FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED > 0U) && \
defined(USB_DEVICE_CONFIG_KEEP_ALIVE_MODE) && (USB_DEVICE_CONFIG_KEEP_ALIVE_MODE > 0U) && \
defined(FSL_FEATURE_USB_KHCI_USB_RAM) && (FSL_FEATURE_USB_KHCI_USB_RAM > 0U)
s_waitForDataReceive = 1;
USB0->INTEN &= ~USB_INTEN_SOFTOKEN_MASK;
#endif
}
}
}
break;
case kUSB_DeviceCdcEventSerialStateNotif:
((usb_device_cdc_acm_struct_t *)handle)->hasSentState = 0;
error = kStatus_USB_Success;
break;
case kUSB_DeviceCdcEventSendEncapsulatedCommand:
break;
case kUSB_DeviceCdcEventGetEncapsulatedResponse:
break;
case kUSB_DeviceCdcEventSetCommFeature:
if (USB_DEVICE_CDC_FEATURE_ABSTRACT_STATE == acmReqParam->setupValue)
{
if (1 == acmReqParam->isSetup)
{
*(acmReqParam->buffer) = s_abstractState;
}
else
{
*(acmReqParam->length) = 0;
}
}
else if (USB_DEVICE_CDC_FEATURE_COUNTRY_SETTING == acmReqParam->setupValue)
{
if (1 == acmReqParam->isSetup)
{
*(acmReqParam->buffer) = s_countryCode;
}
else
{
*(acmReqParam->length) = 0;
}
}
else
{
}
error = kStatus_USB_Success;
break;
case kUSB_DeviceCdcEventGetCommFeature:
if (USB_DEVICE_CDC_FEATURE_ABSTRACT_STATE == acmReqParam->setupValue)
{
*(acmReqParam->buffer) = s_abstractState;
*(acmReqParam->length) = COMM_FEATURE_DATA_SIZE;
}
else if (USB_DEVICE_CDC_FEATURE_COUNTRY_SETTING == acmReqParam->setupValue)
{
*(acmReqParam->buffer) = s_countryCode;
*(acmReqParam->length) = COMM_FEATURE_DATA_SIZE;
}
else
{
}
error = kStatus_USB_Success;
break;
case kUSB_DeviceCdcEventClearCommFeature:
break;
case kUSB_DeviceCdcEventGetLineCoding:
*(acmReqParam->buffer) = s_lineCoding;
*(acmReqParam->length) = LINE_CODING_SIZE;
error = kStatus_USB_Success;
break;
case kUSB_DeviceCdcEventSetLineCoding:
{
if (1 == acmReqParam->isSetup)
{
*(acmReqParam->buffer) = s_lineCoding;
}
else
{
*(acmReqParam->length) = 0;
}
}
error = kStatus_USB_Success;
break;
case kUSB_DeviceCdcEventSetControlLineState:
{
s_usbCdcAcmInfo.dteStatus = acmReqParam->setupValue;
/* activate/deactivate Tx carrier */
if (acmInfo->dteStatus & USB_DEVICE_CDC_CONTROL_SIG_BITMAP_CARRIER_ACTIVATION)
{
acmInfo->uartState |= USB_DEVICE_CDC_UART_STATE_TX_CARRIER;
}
else
{
acmInfo->uartState &= (uint16_t)~USB_DEVICE_CDC_UART_STATE_TX_CARRIER;
}
/* activate carrier and DTE. Com port of terminal tool running on PC is open now */
if (acmInfo->dteStatus & USB_DEVICE_CDC_CONTROL_SIG_BITMAP_DTE_PRESENCE)
{
acmInfo->uartState |= USB_DEVICE_CDC_UART_STATE_RX_CARRIER;
}
/* Com port of terminal tool running on PC is closed now */
else
{
acmInfo->uartState &= (uint16_t)~USB_DEVICE_CDC_UART_STATE_RX_CARRIER;
}
/* Indicates to DCE if DTE is present or not */
acmInfo->dtePresent = (acmInfo->dteStatus & USB_DEVICE_CDC_CONTROL_SIG_BITMAP_DTE_PRESENCE) ? 1 : 0;
/* Initialize the serial state buffer */
acmInfo->serialStateBuf[0] = NOTIF_REQUEST_TYPE; /* bmRequestType */
acmInfo->serialStateBuf[1] = USB_DEVICE_CDC_NOTIF_SERIAL_STATE; /* bNotification */
acmInfo->serialStateBuf[2] = 0x00; /* wValue */
acmInfo->serialStateBuf[3] = 0x00;
acmInfo->serialStateBuf[4] = 0x00; /* wIndex */
acmInfo->serialStateBuf[5] = 0x00;
acmInfo->serialStateBuf[6] = UART_BITMAP_SIZE; /* wLength */
acmInfo->serialStateBuf[7] = 0x00;
/* Notify to host the line state */
acmInfo->serialStateBuf[4] = acmReqParam->interfaceIndex;
/* Lower byte of UART BITMAP */
uartBitmap = (uint8_t *)&acmInfo->serialStateBuf[NOTIF_PACKET_SIZE + UART_BITMAP_SIZE - 2];
uartBitmap[0] = acmInfo->uartState & 0xFFu;
uartBitmap[1] = (acmInfo->uartState >> 8) & 0xFFu;
len = (uint32_t)(NOTIF_PACKET_SIZE + UART_BITMAP_SIZE);
if (0 == ((usb_device_cdc_acm_struct_t *)handle)->hasSentState)
{
error = USB_DeviceCdcAcmSend(handle, USB_CDC_VCOM_INTERRUPT_IN_ENDPOINT, acmInfo->serialStateBuf, len);
if (kStatus_USB_Success != error)
{
//usb_echo("kUSB_DeviceCdcEventSetControlLineState error!");
}
((usb_device_cdc_acm_struct_t *)handle)->hasSentState = 1;
}
/* Update status */
if (acmInfo->dteStatus & USB_DEVICE_CDC_CONTROL_SIG_BITMAP_CARRIER_ACTIVATION)
{
/* To do: CARRIER_ACTIVATED */
}
else
{
/* To do: CARRIER_DEACTIVATED */
}
if (acmInfo->dteStatus & USB_DEVICE_CDC_CONTROL_SIG_BITMAP_DTE_PRESENCE)
{
/* DTE_ACTIVATED */
if (1 == s_cdcVcom.attach)
{
s_cdcVcom.startTransactions = 1;
#if defined(FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED) && (FSL_FEATURE_USB_KHCI_KEEP_ALIVE_ENABLED > 0U) && \
defined(USB_DEVICE_CONFIG_KEEP_ALIVE_MODE) && (USB_DEVICE_CONFIG_KEEP_ALIVE_MODE > 0U) && \
defined(FSL_FEATURE_USB_KHCI_USB_RAM) && (FSL_FEATURE_USB_KHCI_USB_RAM > 0U)
s_waitForDataReceive = 1;
USB0->INTEN &= ~USB_INTEN_SOFTOKEN_MASK;
s_comOpen = 1;
usb_echo("USB_APP_CDC_DTE_ACTIVATED\r\n");
#endif
}
}
else
{
/* DTE_DEACTIVATED */
if (1 == s_cdcVcom.attach)
{
s_cdcVcom.startTransactions = 0;
}
}
}
break;
case kUSB_DeviceCdcEventSendBreak:
break;
default:
break;
}
return error;
}
/*!
* @brief USB device callback function.
*
* This function handles the usb device specific requests.
*
* @param handle The USB device handle.
* @param event The USB device event type.
* @param param The parameter of the device specific request.
*
* @return A USB error code or kStatus_USB_Success.
*/
usb_status_t USB_DeviceCallback(usb_device_handle handle, uint32_t event, void *param)
{
usb_status_t error = kStatus_USB_Error;
uint16_t *temp16 = (uint16_t *)param;
uint8_t *temp8 = (uint8_t *)param;
switch (event)
{
case kUSB_DeviceEventBusReset:
{
s_cdcVcom.attach = 0;
s_cdcVcom.currentConfiguration = 0U;
#if (defined(USB_DEVICE_CONFIG_EHCI) && (USB_DEVICE_CONFIG_EHCI > 0U)) || \
(defined(USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U))
/* Get USB speed to configure the device, including max packet size and interval of the endpoints. */
if (kStatus_USB_Success == USB_DeviceClassGetSpeed(CONTROLLER_ID, &s_cdcVcom.speed))
{
USB_DeviceSetSpeed(handle, s_cdcVcom.speed);
}
#endif
}
break;
case kUSB_DeviceEventSetConfiguration:
if (0U == (*temp8))
{
s_cdcVcom.attach = 0;
s_cdcVcom.currentConfiguration = 0U;
}
else if (USB_CDC_VCOM_CONFIGURE_INDEX == (*temp8))
{
s_cdcVcom.attach = 1;
s_cdcVcom.currentConfiguration = *temp8;
/* Schedule buffer for receive */
USB_DeviceCdcAcmRecv(s_cdcVcom.cdcAcmHandle, USB_CDC_VCOM_BULK_OUT_ENDPOINT, rxBuffer,
g_UsbDeviceCdcVcomDicEndpoints[0].maxPacketSize);
}
else
{
error = kStatus_USB_InvalidRequest;
}
break;
case kUSB_DeviceEventSetInterface:
if (s_cdcVcom.attach)
{
uint8_t interface = (uint8_t)((*temp16 & 0xFF00U) >> 0x08U);
uint8_t alternateSetting = (uint8_t)(*temp16 & 0x00FFU);
if (interface < USB_CDC_VCOM_INTERFACE_COUNT)
{
s_cdcVcom.currentInterfaceAlternateSetting[interface] = alternateSetting;
}
}
break;
case kUSB_DeviceEventGetConfiguration:
break;
case kUSB_DeviceEventGetInterface:
break;
case kUSB_DeviceEventGetDeviceDescriptor:
if (param)
{
error = USB_DeviceGetDeviceDescriptor(handle, (usb_device_get_device_descriptor_struct_t *)param);
}
break;
case kUSB_DeviceEventGetConfigurationDescriptor:
if (param)
{
error = USB_DeviceGetConfigurationDescriptor(handle,
(usb_device_get_configuration_descriptor_struct_t *)param);
}
break;
case kUSB_DeviceEventGetStringDescriptor:
if (param)
{
/* Get device string descriptor request */
error = USB_DeviceGetStringDescriptor(handle, (usb_device_get_string_descriptor_struct_t *)param);
}
break;
default:
break;
}
return error;
}
/*!
* @brief Application initialization function.
*
* This function initializes the application.
*
* @return None.
*/
void USB_Init(void)
{
if(usb.initialized)
{
return;
}
usb.initialized = true;
USB_DeviceClockInit();
#if (defined(FSL_FEATURE_SOC_SYSMPU_COUNT) && (FSL_FEATURE_SOC_SYSMPU_COUNT > 0U))
SYSMPU_Enable(SYSMPU, 0);
#endif /* FSL_FEATURE_SOC_SYSMPU_COUNT */
usb.rxDataIndex = 0;
s_cdcVcom.speed = USB_SPEED_FULL;
s_cdcVcom.attach = 0;
s_cdcVcom.cdcAcmHandle = (class_handle_t)NULL;
s_cdcVcom.deviceHandle = NULL;
if (kStatus_USB_Success != USB_DeviceClassInit(CONTROLLER_ID, &s_cdcAcmConfigList, &s_cdcVcom.deviceHandle))
{
//usb_echo("USB device init failed\r\n");
}
else
{
usb_echo("USB device CDC virtual com demo\r\n");
s_cdcVcom.cdcAcmHandle = s_cdcAcmConfigList.config->classHandle;
}
USB_DeviceIsrEnable();
/*Add one delay here to make the DP pull down long enough to allow host to detect the previous disconnection.*/
SDK_DelayAtLeastUs(5000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);
USB_DeviceRun(s_cdcVcom.deviceHandle);
}
/*!
* @brief Application task function.
*
* This function runs the task for application.
*
* @return None.
*/
void USB_Update(void)
{
usb_status_t error = kStatus_USB_Error;
if ((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions))
{
/* User Code */
/* endpoint callback length is USB_CANCELLED_TRANSFER_LENGTH (0xFFFFFFFFU) when transfer is canceled */
if ((0 != rxDataSize) && (USB_CANCELLED_TRANSFER_LENGTH != rxDataSize))
{
usb.rxDataIndex = 0;
//copy to rxDataBuffer for processing
for (int32_t i = 0; i < rxDataSize; i++)
{
usb.rxDataBuffer[usb.rxDataIndex++] = rxBuffer[i];
}
uint32_t tempDataSize = rxDataSize; //temp variable to pass to USB_ProcessData()
rxDataSize = 0;
if(usb.programMode) //ProgramMode = send data for write to FLASH
{
FU_WriteProgramDataToFLASH();
}
else
{
//Process String
USB_ProcessString(tempDataSize);
}
}
#if 0 //Transmit
if (txDataSize)
{
uint32_t size = txDataSize;
txDataSize = 0;
error = USB_DeviceCdcAcmSend(s_cdcVcom.cdcAcmHandle, USB_CDC_VCOM_BULK_IN_ENDPOINT, txBuffer, size);
if (error != kStatus_USB_Success)
{
/* Failure to send Data Handling code here */
}
}
#endif
}
}
//Send data to via USB
void USB_SendString(uint8_t * str)
{
if(!s_cdcVcom.attach) //exit if USB not connected
{
return;
}
uint32_t length = strlen(str);
if(length > USB_BUFFER_SIZE - 1) //allow for LF char
{
return; //TODO: handle this better. Use a txRingbuffer
}
//copy data to txBuffer
memcpy(txBuffer, str, length);
txBuffer[length++] = CR; //append CR for realterm
txBuffer[length++] = LF; //append LF for windows
txDataSize = length;
#if 1 //Send data
//Wait for USB ready
while(!((1 == s_cdcVcom.attach) && (1 == s_cdcVcom.startTransactions))); //TODO: make this not block forever
uint32_t size = txDataSize;
txDataSize = 0;
usb_status_t error = USB_DeviceCdcAcmSend(s_cdcVcom.cdcAcmHandle, USB_CDC_VCOM_BULK_IN_ENDPOINT, txBuffer, size);
if (error != kStatus_USB_Success)
{
/* Failure to send Data Handling code here */
usb.sendErrorCount++;
}
#endif
}
#if 0 //main function from example
int main(void)
{
/* attach 12 MHz clock to FLEXCOMM0 (debug console) */
CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
BOARD_InitPins();
BOARD_BootClockPLL150M();
CLOCK_SetupFROClocking(96000000U); /*!< Set up high frequency FRO output to selected frequency */
BOARD_InitDebugConsole();
POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*Turn on USB Phy */
USB_Init();
while (1)
{
USB_Update();
}
}
#endif

107
source/USB/virtual_com.h Normal file
View File

@@ -0,0 +1,107 @@
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _USB_CDC_VCOM_H_
#define _USB_CDC_VCOM_H_ 1
#include "usb_device_config.h"
#include "usb.h"
#include "usb_device.h"
#include "usb_device_class.h"
#include "usb_device_cdc_acm.h"
#include "usb_device_ch9.h"
#include "usb_device_descriptor.h"
#include "virtual_com.h"
#include "usb.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#if defined(USB_DEVICE_CONFIG_EHCI) && (USB_DEVICE_CONFIG_EHCI > 0)
#define CONTROLLER_ID kUSB_ControllerEhci0
#define USB_BUFFER_SIZE HS_CDC_VCOM_BULK_OUT_PACKET_SIZE
#endif
#if defined(USB_DEVICE_CONFIG_KHCI) && (USB_DEVICE_CONFIG_KHCI > 0)
#define CONTROLLER_ID kUSB_ControllerKhci0
#define USB_BUFFER_SIZE FS_CDC_VCOM_BULK_OUT_PACKET_SIZE
#endif
#if defined(USB_DEVICE_CONFIG_LPCIP3511FS) && (USB_DEVICE_CONFIG_LPCIP3511FS > 0U)
#define CONTROLLER_ID kUSB_ControllerLpcIp3511Fs0
#define USB_BUFFER_SIZE FS_CDC_VCOM_BULK_OUT_PACKET_SIZE
#endif
#if defined(USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS > 0U)
#define CONTROLLER_ID kUSB_ControllerLpcIp3511Hs0
#define USB_BUFFER_SIZE HS_CDC_VCOM_BULK_OUT_PACKET_SIZE
#endif
#define USB_DEVICE_INTERRUPT_PRIORITY (3U)
/* Currently configured line coding */
#define LINE_CODING_SIZE (0x07)
#define LINE_CODING_DTERATE (115200)
#define LINE_CODING_CHARFORMAT (0x00)
#define LINE_CODING_PARITYTYPE (0x00)
#define LINE_CODING_DATABITS (0x08)
/* Communications feature */
#define COMM_FEATURE_DATA_SIZE (0x02)
#define STATUS_ABSTRACT_STATE (0x0000)
#define COUNTRY_SETTING (0x0000)
/* Notification of serial state */
#define NOTIF_PACKET_SIZE (0x08)
#define UART_BITMAP_SIZE (0x02)
#define NOTIF_REQUEST_TYPE (0xA1)
/* Define the types for application */
typedef struct _usb_cdc_vcom_struct
{
usb_device_handle deviceHandle; /* USB device handle. */
class_handle_t cdcAcmHandle; /* USB CDC ACM class handle. */
volatile uint8_t attach; /* A flag to indicate whether a usb device is attached. 1: attached, 0: not attached */
uint8_t speed; /* Speed of USB device. USB_SPEED_FULL/USB_SPEED_LOW/USB_SPEED_HIGH. */
volatile uint8_t
startTransactions; /* A flag to indicate whether a CDC device is ready to transmit and receive data. */
uint8_t currentConfiguration; /* Current configuration value. */
uint8_t currentInterfaceAlternateSetting[USB_CDC_VCOM_INTERFACE_COUNT]; /* Current alternate setting value for each
interface. */
} usb_cdc_vcom_struct_t;
/* Define the information relates to abstract control model */
typedef struct _usb_cdc_acm_info
{
uint8_t serialStateBuf[NOTIF_PACKET_SIZE + UART_BITMAP_SIZE]; /* Serial state buffer of the CDC device to notify the
serial state to host. */
uint8_t dtePresent; /* A flag to indicate whether DTE is present. */
uint16_t breakDuration; /* Length of time in milliseconds of the break signal */
uint8_t dteStatus; /* Status of data terminal equipment */
uint8_t currentInterface; /* Current interface index. */
uint16_t uartState; /* UART state of the CDC device. */
} usb_cdc_acm_info_t;
void USB_Init(void);
void USB_Update(void);
void USB_SendString(uint8_t * str);
#if 0 //TESTING - definitions for USB functions
void USB_DeviceLpcIp3511IsrFunction(void *deviceHandle);
#endif
#endif /* _USB_CDC_VCOM_H_ */

1206
source/adc.c Normal file

File diff suppressed because it is too large Load Diff

141
source/adc.h Normal file
View File

@@ -0,0 +1,141 @@
/*
* adc.h
*
* Created on: Mar 31, 2023
* Author: Keith.Lloyd
*/
#ifndef ADC_H_
#define ADC_H_
#include "arm_math.h"
#define ADC_NUM_AVERAGES 10 //number of samples averaged for measurements
#define ADC_VREF 3.3 //3.23 //ADC reference voltage = 3v3 supply (Measured @ 3.23v)
#define ADC_HALF_COUNTS 2048 //half of max ADC reading
#define ADC_OFFSET_MAX_ERROR 30 //maximum allowed error for ADC offset measurement
#define ADC_USE_NOISE_OFFSET 1 //Use a standard noise offset
#define ADC_NOISE_OFFSET_COUNTS 13 //ADC offset due to precision rectifier noise conversion to DC
#define ADC_CORRECT_FOR_CURRENT_NOISE 1 //Correct current measurement for noise from the precision rectifier
#define ADC_USE_CURRENT_TABLE 1 //Use the current table to scale current measurements
#define ADC_TABLE_COLUMNS 2 //number of columns for current and voltage tables
#define ADC_TABLE_COLUMNS2 3 //number of columns for current and voltage tables with offset
#define ADC_TABLE_FREQ 0 //frequency column in current and voltage tables
#define ADC_TABLE_SCALE 1 //scale column in current and voltage tables
#define ADC_TABLE_OFFSET 2 //offset column in current tables
#define ADC_LOW_GAIN_CURR_CLIP_THRESH 1050 //LOW gain current measurement clipping threshold (in ADC counts)
#define ADC_HIGH_GAIN_CURR_CLIP_THRESH 800 //HIGH gain current measurement clipping threshold (in ADC counts)
#define ADC_LOW_GAIN_VOLT_CLIP_THRESH 1050
#define ADC_HIGH_GAIN_VOLT_CLIP_THRESH 800
#define ADC_MEASUREMENT_TEST 0 //Collect ADC data @ adc sampleRate when triggered. FOR TESTING
#if ADC_MEASUREMENT_TEST
#define ADC_NUM_TEST 40 //10mS samples
#endif
typedef struct {
bool measure; //measure ADC values in timer ISR
//current measurement offset
bool iosOK; //current offset within limits, use it
uint32_t I_OffsetAdc; //Current channel offset - measured @ startup
uint32_t rawCurrent; //raw current measurement used for offset
//Voltage measurement offset
bool vosOK; //voltage offset error within limits, use it
uint32_t V_OffsetAdc; //VOltage channel offset - measured @ startup
uint32_t rawVoltage; //raw voltage measurement used for offset
bool currentClipping; //Current measurement clip status (for LOW and HIGH gains)
bool voltageClipping; //Voltage measurement clip status (for LOW and HIGH gains)
//storage for raw ADC values (0 - 4096). Sum up samples
uint32_t V_ID1_RAW; //ch5 Port A identifier.
uint32_t V_ID2_RAW; //ch6 Port B identifier
uint32_t V_CHK_RAW; //ch7 Incoming voltage eg. 110V
uint32_t V_PSU_RAW; //ch3 Power supply monitor
uint32_t V_TMP_RAW; //ch8 External temperature
uint32_t I_OUT_RAW; // ch0 Current out
uint32_t V_OUT_RAW; // ch1 Volts Out
uint32_t V_BAT_RAW; //ch4 Battery Voltage
uint32_t V_BID_RAW; //ch10 Battery ID
//Storage for scaled value - float32_t
float32_t V_ID1;
float32_t V_ID2;
float32_t V_CHK;
float32_t V_BID;
float32_t V_BAT;
float32_t I_OUT;
float32_t V_OUT;
float32_t V_TMP;
float32_t V_PSU;
//Storage for filtered values - float32_t
float32_t I_OUT_SlowFilt;
float32_t V_OUT_SlowFilt;
float32_t V_OUT_FastFilt;
float32_t I_OUT_FastFilt;
float32_t Ohms_slowfilt;
// Delay Lines for filters
float32_t V_OUT_Delay;
float32_t I_OUT_Delay;
float32_t V_OUT_FastDelay;
float32_t I_OUT_FastDelay;
float32_t Ohms_FastDelay;
float32_t Ohms_SlowDelay;
#if 1 //ADC raw current filtering - This is for testing
float32_t IRaw;
float32_t IRawFilt;
float32_t IRawDelay;
#endif
#if 1 //ADC raw voltage filtering - This is for testing
float32_t VRaw;
float32_t VRawFilt;
float32_t VRawDelay;
#endif
uint32_t diag_bat; // commented test value for battery diagnosis
//TESTING - faster current measurement without averaging
#if ADC_MEASUREMENT_TEST
bool testCollectData;
uint32_t testIndex;
//storage for sampled data
float32_t testData1[ADC_NUM_TEST];
float32_t testData2[ADC_NUM_TEST];
float32_t testIout;
float32_t testIoutDelay;
float32_t testVout;
float32_t testVoutDelay;
#endif
}ADC_t;
void ADC_Init2(void);
void ADC_MeasureCurrentOffset(void);
void ADC_Update(void);
float32_t FILT_ExpAvgF32(float32_t input, float32_t *temp, float32_t k);
#endif /* ADC_H_ */

165
source/amps.c Normal file
View File

@@ -0,0 +1,165 @@
/*
* amps.c
*
* Created on: Mar 6, 2023
* Author: Keith.Lloyd
*/
#include <stdbool.h>
#include <stdint.h>
#include "amps.h"
#include "utils.h"
#include "psu_ctrl.h"
#include "timer.h"
#include "ports.h"
#include "frq.h"
#include "taps.h"
extern uint8_t frequency, Power_Level,old_freq, psu_failed;
extern uint8_t Port_State[];
extern uint16_t PSU_Check_tmr;
extern uint8_t Dds_Pot_Val[],catch_up_flag,Suspend_Step_Chk,step_count;
void Enable_Amplifier(void)
{
// Port_State[BOTTOM_SR] |= 0b00000100; // for testing only select TAP1 TODO remove
if (freqArray[frequency].frequency1 <= MAX_DTYPE)
{
// if(freqArray[old_freq].frequency1 >= MAX_DTYPE && old_freq !=DUMMY_FRQ)
if(freqArray[old_freq].frequency1 > freqArray[frequency].frequency1 && old_freq !=DUMMY_FRQ)
{
Reduce_Kick_Back();// prevent the HF amp demand from setting the LF amp.
//# Power_Level = 0;
// catch_up_flag = true;
Suspend_Step_Chk = false;
step_count = 0;
// Check_Pot_Val(); // reload max_pot
Port_State[BOTTOM_SR] &= TAPS_OFF_MASK; // Set taps to safe
Port_State[BOTTOM_SR] |= TAP2_LF_ON;
}
// Enable D'type amp
// Port_State[1] = 0x22; // U13
Port_State[BOTTOM_SR] &= ~AMP_AB_SW; // Disable AB amp
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
Delay_Ticks(5);
Port_State[BOTTOM_SR] &= AMP_PSU_ON; // switch AMP PSU on
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
Delay_Ticks(5);
if((Check_For_Clamp()))
Set_PSU_Voltage(V_42V);
else
Set_PSU_Voltage(V_36V); // TODO V_36V Set PSU Pot to D amp max
Delay_Ticks(1);
PSU_Check_tmr = PSU_DELAY;
Port_State[BOTTOM_SR] |= SLCT_AMPD_ON; // Enable switch to allow power to driver
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
Delay_Ticks(5);
Port_State[MID_SR] |= DAMP_EN_ON; // Enable driver
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
// Port_State[MID_SR] &= ~DAMP_EN_ON; // TODO Disable driver remove later
// Select_Amp_Xfrmr_Rly(LFA_LFX); // Select LF amp and LF transformer
}
else
{
// if(freqArray[old_freq].frequency1 <= MAX_DTYPE && old_freq !=DUMMY_FRQ)
if(freqArray[old_freq].frequency1 <= MAX_DTYPE && old_freq !=DUMMY_FRQ)
{
Reduce_Kick_Back();
// Power_Level = 0;
Suspend_Step_Chk = false;
step_count = 0;
}
if((Check_For_Clamp()))
Set_PSU_Voltage(V_27V);
else
Set_PSU_Voltage(V_24V); // TODO V_36V Set PSU Pot to D amp max
// Set_PSU_Voltage(MAX_AB_PSU); // Set PSU Pot to AB amp max
// Disable D amp//enable AB amp
Port_State[BOTTOM_SR] &= ~AMP_AB_SW; // Disable AB amp
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
Port_State[BOTTOM_SR] &= AMP_PSU_ON; // switch AMP PSU on
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
#if 1
psu_failed = false;
if(!Wait_For_Psu(32.0)) // wait for PSU to drop
{
psu_failed = true;
Delay_Ticks(100);
}
#endif
Port_State[MID_SR] &= ~DAMP_EN_ON; // Disable driver
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
Port_State[BOTTOM_SR] &= ~SLCT_AMPD_ON; // Disable D Amps PSU Switch
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
Delay_Ticks(5);
if(!psu_failed)
{
Port_State[BOTTOM_SR] |= AMP_AB_SW; // Enable AB AMP Power Switch.
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
}
}
}
void All_Amps_Off(void) // shut down Amplifiers DC for broadcast mode
{
Port_State[BOTTOM_SR] &= ~AMP_AB_SW; // Power down AB amp
Port_State[BOTTOM_SR] &= ~SLCT_AMPD_ON; // Power down D amp
Port_State[TOP_SR] &= ~ANT_AMP_SW; // Power down D amp
Port_State[MID_SR] &= ~DAMP_EN_ON; // Disable driver DC Driver
Port_State[MID_SR] &= ~ANT_AMP_EN; // Disable driver Antenna Driver
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
}
void Check_Pot_Val(void)
{
if(Dds_Pot_Val[1] > freqArray[frequency].max_pot) // if the old value is > max for new freq
{
Dds_Pot_Val[0] = 0; // address
Dds_Pot_Val[1] = freqArray[frequency].max_pot;
SPI0_SendBytes(Dds_Pot_Val, 2, AMPLITUDE); // reduce amplitude
}
}

20
source/amps.h Normal file
View File

@@ -0,0 +1,20 @@
/*
* amps.h
*
* Created on: Mar 6, 2023
* Author: Keith.Lloyd
*/
#ifndef AMPS_H_
#define AMPS_H_
#define MAX_DTYPE 44500
#define MAX_LOW_FRQ 83078
#define AMP_D_SW 0b00000010 //AMPD_ON U13 D1
#define AMP_AB_SW 0b00000001 // AMPAB_ON U13 D0 ACTIVE LOW
void Enable_Amplifier(void);
void All_Amps_Off(void); // shut down Amplifiers DC connections
void Check_Pot_Val(void);
#endif /* AMPS_H_ */

181
source/battery.c Normal file
View File

@@ -0,0 +1,181 @@
/*
* Battery.c
*
* Created on: Jun 10, 2022
* Author: Keith.Lloyd
*/
#include "arm_math.h"
#include "utils.h"
#include "battery.h"
#include "adc.h"
#include "main.h"
#include "timer.h"
#include "lcd.h"
#include "display.h"
#include "safety_key.h"
#include "amps.h"
#include "ports.h"
#include "hwFixes.h"
uint8_t Bat_Type;
extern uint8_t Task, Error;
extern ADC_t adc;
extern float32_t Max_Power_Limit;
extern uint16_t Low_Bat_timer;
extern uint16_t battery;
//uint16_t Bat_Level[] = {100,200,300,400,500,125,225,325,425,525}; // Battery life levels 5 Alkaline and 5 Lithium.
extern HARDWARE_FIX_t hwf;
bool Compare_With_Limit(float32_t V1 ,float32_t V2,float32_t limit)
{
float32_t tolerance;
bool result;
result = false;
tolerance = limit / 100.0;
tolerance = tolerance + 1.0;
tolerance = tolerance * V2;
if(V1 < tolerance)
result = true;
tolerance = limit /100.0;
tolerance = 1.0 - tolerance;
tolerance = tolerance * V2;
if(V1 > tolerance)
result = true;
return(result);
}
void Check_Bat_Id(void)
{
float32_t Battery;
float32_t Bat_Mid_Point;
if(adc.V_BID > LITHIUM_MID_POINT) // BAT_ID = 0V for lithium, mid point for Alkaline
{
if(Compare_With_Limit(adc.V_BID,adc.V_BAT,5.0))
{
Bat_Type = EXT_DC;
Max_Power_Limit = 10.0; // Limit max power to 5W.
}
else
{
Bat_Type = ALKALINE;
Max_Power_Limit = 5.0; // Limit max power to 5W.
Battery = adc.V_BAT; // Calculate mid-point for alkaline
Bat_Mid_Point = Battery / 2;
if ((adc.V_BID > (Bat_Mid_Point * 1.1)) || (adc.V_BID < (Bat_Mid_Point * 0.9)) ) // Check if not at mid-point
Bat_Type = BAT_ERROR; // indicate battery insertion error
}
}
else
{
Bat_Type = LITHIUM;
Max_Power_Limit = 10.0; // Limit max power to 5W. 1.7 = 10.0 1.7X = 25.0
}
if(Bat_Type == BAT_ERROR)
{
LCD_Clear();
Task=BAT_INSERTION_ERROR;
while(1)
{
safe_key();
Display_Update();
Delay_Ticks(10);
}
}
}
void Chk_Bat_Level(void)
{
if(Bat_Type == LITHIUM)
{
if(hwf.vBattCap_021)
Test_Bat_Level(CF_LITHIUM_CUT_OFF);
else
Test_Bat_Level(LITHIUM_CUT_OFF);
}
else
{
if(hwf.vBattCap_021)
Test_Bat_Level(CF_ALKALINE_CUT_OFF);
else
Test_Bat_Level(ALKALINE_CUT_OFF);
}
}
void Test_Bat_Level(float32_t Bat_Cut_Off)
{
if(adc.V_BAT < Bat_Cut_Off && Task != LOW_BATTERY_TASK)
{
if(Task != PWR_OFF_TASK)
{
All_Amps_Off();
Disable_BC(); //Disable BC
Select_Estop(ON);
Delay_Ticks(25); //wait for battery voltage to rise
// if(adc.V_BAT <= Bat_Cut_Off)
// {
Task = LOW_BATTERY_TASK;
Low_Bat_timer = DELAY_2S;
// }
// else
// {
// Task = FATAL_ERROR_TASK;
// Error = 2;
// }
}
}
}
float32_t Adjust_Battery_For_Load() // adjust to true battery voltage due to battery cable
//drop and current demand
{ // assumed frequency and efficiency may need table for frequency adjust
float32_t battery; //assumes taps are correct
battery = adc.V_BAT;
if(Bat_Type == LITHIUM)
{
if(adc.I_OUT_SlowFilt < DEMAND1)
battery = battery + 1.1;
else if(adc.I_OUT_SlowFilt < DEMAND2)
battery = battery + 1.2;
else if(adc.I_OUT_SlowFilt < DEMAND3)
battery = battery + 1.3;
else if(adc.I_OUT_SlowFilt < DEMAND4)
battery = battery + 1.4;
else if(adc.I_OUT_SlowFilt < DEMAND5)
battery = battery + 1.5;
else if(adc.I_OUT_SlowFilt < DEMAND6)
battery = battery + 1.6;
else
battery = battery + 2;
return(battery);
}
else
{
}
}

95
source/battery.h Normal file
View File

@@ -0,0 +1,95 @@
/*
* battery.h
*
* Created on: Mar 1, 2023
* Author: Keith.Lloyd
*/
#ifndef BATTERY_H_
#define BATTERY_H_
#define ALKALINE_VAL 300
#define LITHIUM_MID_POINT 1.0 // mid point tap = 0V for lithium
//#define BATTERY_NINETY 15.2
//#define BATTERY_FULL 16.4
//#define BATTERY_3QUARTERS 15.0
//#define BATTERY_FIFTY 14.4
//#define BATTERY_1QUARTER 14.28
//#define BATTERY_EMPTY 12.3
#define L_BATTERY_FULL 16.4 // Cap fitted Lithium
#define L_BATTERY_NINETY 16.0
#define L_BATTERY_3QUARTERS 15.6
#define L_BATTERY_FIFTY 14.8
#define L_BATTERY_1QUARTER 14.0
#define L_BATTERY_1EIGTH 13.6
#define L_BATTERY_EMPTY 12.3
#define NCL_BATTERY_FULL 14.94 // No Cap Fitted Lithium
#define NCL_BATTERY_NINETY 14.62
#define NCL_BATTERY_3QUARTERS 14.3
#define NCL_BATTERY_FIFTY 13.68
#define NCL_BATTERY_1QUARTER 13.05
#define NCL_BATTERY_1EIGTH 12.72
#define NCL_BATTERY_EMPTY 11.72
#define A_BATTERY_FULL 12.0
#define A_BATTERY_NINETY 11.85
#define A_BATTERY_3QUARTERS 10.72
#define A_BATTERY_FIFTY 10.24
#define A_BATTERY_1QUARTER 9.76
#define A_BATTERY_1EIGTH 9.20
#define A_BATTERY_EMPTY 9.15
#define NCA_BATTERY_FULL 11.61
#define NCA_BATTERY_NINETY 11.17
#define NCA_BATTERY_3QUARTERS 10.95
#define NCA_BATTERY_FIFTY 10.42
#define NCA_BATTERY_1QUARTER 9.86
#define NCA_BATTERY_1EIGTH 9.44
#define NCA_BATTERY_EMPTY 8.98
#define LITHIUM_CUT_OFF 11.69 // No Cap fitted
#define ALKALINE_CUT_OFF 9.2 // No Cap fitted
#define CF_LITHIUM_CUT_OFF 12.28 //Cap fitted
#define CF_ALKALINE_CUT_OFF 9.0 // Cap fitted
#define DEMAND1 0.1 // current demand
#define DEMAND2 0.2
#define DEMAND3 0.3
#define DEMAND4 0.4
#define DEMAND5 0.5
#define DEMAND6 0.6
typedef enum {
ALKALINE,
LITHIUM,
BAT_ERROR,
EXT_DC
}BAT_STACK_t;
void Check_Bat_Id(void);
void Chk_Bat_Level(void);
void Test_Bat_Level(float32_t Bat_Cut_Off);
float32_t Adjust_Battery_For_Load();
bool Compare_With_Limit(float32_t V1 ,float32_t V2,float32_t limit);
/*typedef enum {
I_OUT1,
V_OUT1,
N_USED,
PSU_MON,
VBAT_MON,
ID1,
ID2,
V_CHK,
TEMP_SENSOR,
VBUS,
BAT_ID
}ADC_STACK_t;
*/
#endif /* BATTERY_H_ */

1102
source/display.c Normal file

File diff suppressed because it is too large Load Diff

103
source/display.h Normal file
View File

@@ -0,0 +1,103 @@
/*
* display.h
*
* Created on: Jun 17, 2022
* Author: Keith.Lloyd
*/
#ifndef DISPLAY_H_
#define DISPLAY_H_
#define X_POS_MA 36
#define X_POS_FRQ 80
#define STACKS_4 4
#define STACKS_3 3
#define STACKS_2 2
#define STACKS_1 1
#define STACKS_0 0
#define STACKS_EMPTY STACKS_0
//#define LEICA 1 // temporary replace with Enum
typedef enum{
UMAG,
LEICA,
GLAND
} D_MODE_t;
typedef enum {
DIRECT_CON,
DCLAMP,
BCAST,
DUAL_DIRECT
} OP_MODE_t;
typedef enum {
A1,
A2,
B1,
B2
} CON_MODE_t;
typedef enum {
LEVEL0,
LEVEL1,
LEVEL2,
LEVEL3,
LEVEL4,
LEVEL_MAX
} PWR_MODE_t;
void Display_Volts(void);
void Display_Current(void);
void Display_Ohms(void);
void Display_Watts(void);
void Display_Battery(void);
void Display_Battery_NC(void);
void Display_Battery_CF(void);
void Display_Mode(uint8_t Con_Mode1);
void Display_Wireless(uint8_t wireless);
void Display_Level(PWR_MODE_t Level);
void Display_Connection(CON_MODE_t Con_Output1, CON_MODE_t Con_Output2);
void Display_Level(PWR_MODE_t Level);
void Display_Backlight(uint8_t Back_Light);
void Display_Frequency(uint8_t frequency);
void Display_CD_Symbol(void);
void Display_Bye_Bye(void);
void Display_Splash(void);
void Display_Bcast(void);
void Display_Danger_Menu(void);
void Display_Measurements(void);
void Display_Normal(void);
void Display_Flash_Bat(void);
void Display_Estop(void);
void Display_Bat_Error(void);
void Display_High_Voltage(void);
void Display_Line_Ohms(void);
void Display_Line_Current(void);
void Display_Clamp_Volts(void);
void Display_Clamp_Power(void);
void Display_Line_Voltage(void);
void Display_Clamp_Volts(void);
void Display_USB(void);
uint8_t Display_Taps(void);
void Display_Bat_Frame_Flash(void);
void Display_Currently_Selected(void);
void Display_Line_Measurements(void);
void Display_Fatal_Error(void);
void Display_OnScreen_Diagnostics(void);
void Display_Over_Voltage_Status(void);
void Display_USB_Status(void);
void Display_Tx_Status(void);
void Draw_Battery(uint8_t stacks);
uint8_t Read_Model_type();
void Display_EXT_DC(void);
#endif /* DISPLAY_H_ */

415
source/eeprom.c Normal file
View File

@@ -0,0 +1,415 @@
/*
* eeprom.c
*
* Created on: Jun 10, 2022
* Author: Keith.Lloyd
*/
#include <stdio.h>
#include "fsl_spi.h"
#include <fsl_clock.h>
#include <fsl_ctimer.h>
#include "m95512.h"
#include "spi.h"
#include "timer.h"
#include "System/system.h"
#include "bootloader.h"
#include "frq.h"
#include "eeprom.h"
#include "Fonts/translate.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define EE_BUFFER_SIZE (8) //size of buffer for send/receive 4-byte words
#define EE_BYTES_PER_WORD (4)
#define EE_HEADER_NUM_BYTES (3) //number of bytes in m95512 header - instruction, addrH, addrL
/*******************************************************************************
* Variables
******************************************************************************/
extern SYSTEM_DATA_t sys;
extern spi_transfer_t SPI0_xfer;
extern uint8_t frequency;
extern TIMER_t tmr;
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
/*******************************************************************************
* Static Functions
******************************************************************************/
static bool EE_Busy(void)
{
uint8_t sr;
M95512_ReadStatus(&sr);
return sr & EE_SR_WIP;
}
/*******************************************************************************
* Public Functions
******************************************************************************/
/*
* Load data from EEPROM
*/
void EE_LoadData(void)
{
//Check for blank EEPROM
EE_ReadBytes(EE_SYS_MFG, sys.manufacturer, SYS_INFO_LENGTH);
if(sys.manufacturer[0] == 0xff)
{
SYS_LoadFactoryDefaults();
EE_SaveData();
}
//System Data
EE_ReadBytes(EE_SYS_MFG, sys.manufacturer, SYS_INFO_LENGTH);
EE_ReadBytes(EE_SYS_MODEL_NUMBER, sys.modelNumber, SYS_INFO_LENGTH);
EE_ReadBytes(EE_SYS_MODEL_NAME, sys.modelName, SYS_INFO_LENGTH);
EE_ReadBytes(EE_SYS_SERIAL, sys.serialNumber, SYS_INFO_LENGTH);
EE_ReadBytes(EE_SYS_MFG_DATE, sys.mfgDate, SYS_INFO_LENGTH);
EE_ReadMemoryUINT32(BL_VERSION_EEPROM_ADDR, &sys.bootloaderVersion);
EE_ReadMemoryUINT32(EE_DATA_LANGUAGE, &sys.language);
if(sys.language > NUM_TRANSLATION_STRINGS)
sys.language = LANG_ENGLISH;
EE_ReadBytes(EE_DATA_FREQUENCY, &frequency, 1); //1 byte only
EE_ReadBytes(EE_DATA_TIMER, &tmr.autoShutdown, 1); //timer 1 byte only
if(tmr.autoShutdown >= SD_NUM)
tmr.autoShutdown = SD_1_HR;
if(frequency > FREQ_MAX_NUM)
frequency = 1;
}
bool EE_LoadFrequencies(void)
{
bool success = true;
//Load frequencies
uint32_t tempNumFreqs = EE_ReadUINT32(EE_FREQ_NUM);
if((tempNumFreqs > FREQ_MAX_NUM) || (tempNumFreqs == 0)) //Error check numFreqs
{
return false;
}
else
{
for(uint32_t i = 0; i < tempNumFreqs; i++)
{
uint32_t packedFreq = EE_ReadUINT32(EE_FREQ_START + EE_BYTES_PER_WORD * i);
FREQ_AddPackedFrequency(packedFreq);
}
}
return success;
}
/*
* Save data to EEPROM
*/
void EE_SaveData(void)
{
EE_WriteBytes(EE_SYS_MFG, sys.manufacturer, SYS_INFO_LENGTH);
EE_WriteBytes(EE_SYS_MODEL_NUMBER, sys.modelNumber, SYS_INFO_LENGTH);
EE_WriteBytes(EE_SYS_MODEL_NAME, sys.modelName, SYS_INFO_LENGTH);
EE_WriteBytes(EE_SYS_SERIAL, sys.serialNumber, SYS_INFO_LENGTH);
EE_WriteBytes(EE_SYS_MFG_DATE, sys.mfgDate, SYS_INFO_LENGTH);
EE_WriteUINT32(EE_DATA_LANGUAGE, sys.language);
EE_WriteBytes(EE_DATA_FREQUENCY, &frequency, 1);
EE_WriteBytes(EE_DATA_TIMER, &tmr.autoShutdown, 1); // Save Power down timer status
//Save Frequencies
uint32_t numFreqs = FREQ_GetNumFrequencies();
EE_WriteUINT32(EE_FREQ_NUM, numFreqs);
for(uint32_t i = 0; i < numFreqs; i++)
{
EE_WriteUINT32(EE_FREQ_START + EE_BYTES_PER_WORD * i, FREQ_GetPackedFrequency(i));
}
}
/*
* Erase ALL EEPROM data except for bootloader data
* Write 0xff to all
*/
void EE_EraseAllData(void)
{
for(uint32_t i = EE_PAGE_SYS; i < EE_PAGE_DATA; i++) //EE_DATA_END; i++)
{
EE_WriteUINT32(i, 0xffffffff);
}
}
void EE_Test(void)
{
uint32_t data = 0;
uint32_t TEST_START_ADDR = 256;
uint32_t numWords = 64;
uint32_t writeData[numWords]; //write to EEPROM
uint32_t readData[numWords]; //read from EEPROM
static uint32_t numGood = 0;
static uint32_t numBad = 0;
//Init writeData
for(uint32_t i = 0; i < numWords; i++)
{
writeData[i] = i;
}
//Write data to EEPROM
for(uint32_t i = 0; i < numWords; i++)
{
data = i;
EE_WriteMemoryUINT32(TEST_START_ADDR + i*EE_BYTES_PER_WORD, &writeData[i]);
}
//Read back
memset(readData, 0, sizeof(readData));
for(uint32_t i = 0; i < numWords; i++)
{
EE_ReadMemoryUINT32(TEST_START_ADDR + i*EE_BYTES_PER_WORD, &readData[i]);
}
//COMPARE DATA
if(0 == memcmp(writeData, readData, numWords))
{
numGood++;
}
else
{
numBad++;
}
//Write zeros to EEPROM
for(uint32_t i = 0; i < numWords; i++)
{
data = 0;
EE_WriteMemoryUINT32(TEST_START_ADDR + i*EE_BYTES_PER_WORD, &data);
}
//Read back
memset(readData, 0, sizeof(readData));
for(uint32_t i = 0; i < numWords; i++)
{
EE_ReadMemoryUINT32(TEST_START_ADDR + i*EE_BYTES_PER_WORD, &readData[i]);
}
}
void EE_TestBytes(void)
{
uint32_t data = 0;
uint32_t TEST_START_ADDR = 256;
uint32_t numBytes = 128;
uint8_t writeData[numBytes]; //write to EEPROM
uint8_t readData[numBytes]; //read from EEPROM
static uint32_t numGood = 0;
static uint32_t numBad = 0;
//Init writeData
for(uint32_t i = 0; i < numBytes; i++)
{
writeData[i] = i;
}
//Write data to EEPROM
EE_WriteBytes(TEST_START_ADDR, writeData, numBytes);
//Read back
memset(readData, 0, numBytes);
EE_ReadBytes(TEST_START_ADDR, readData, numBytes);
//COMPARE DATA
if(0 == memcmp(writeData, readData, numBytes))
{
numGood++;
}
else
{
numBad++;
}
//Write zeros to EEPROM
memset(writeData, 0, sizeof(writeData));
EE_WriteBytes(TEST_START_ADDR, writeData, numBytes);
//Read back
memset(readData, 0, sizeof(readData));
EE_ReadBytes(TEST_START_ADDR, readData, numBytes);
}
void EE_WriteMemoryUINT32(uint16_t address, uint32_t *pdata)
{
TMR_Stop(); //Stop the timer to prevent interrupts from breaking EEPROM comms
uint32_t data;
uint8_t srcBuff[EE_BUFFER_SIZE];
M95512_WriteEnable();
data = *pdata;
srcBuff[0] = WRITE_MEM_ARRAY;
srcBuff[1] = address >> 8;
srcBuff[2] = address;
srcBuff[3] = (data & 0xff000000) >> 24;
srcBuff[4] = (data & 0x00ff0000) >> 16;
srcBuff[5] = (data & 0x0000ff00) >> 8;
srcBuff[6] = (data & 0x000000ff);
SPI0_SendBytes(srcBuff, 7, E2PROM);
//Wait for EEPROM WIP flag low
while(EE_Busy());
TMR_Start();
}
void EE_ReadMemoryUINT32(uint16_t address, uint32_t *pdata)
{
TMR_Stop(); //Stop the timer to prevent interrupts from breaking EEPROM comms
uint32_t data;
uint8_t srcBuff[EE_BUFFER_SIZE];
memset(srcBuff, 0, EE_BUFFER_SIZE); //Zero out srcBuff[]. byte 3 was 1???
srcBuff[0] = READ_MEM_ARRAY;
srcBuff[1] = address >> 8; //ADDR high
srcBuff[2] = address; //ADDR low
SPI0_SendBytes(srcBuff, 7, E2PROM);
for(uint16_t i = 3; i < 7; i++){
data <<= 8;
data += SPI0_xfer.rxData[i];
}
*pdata = data;
TMR_Start();
}
void EE_WriteUINT32(uint16_t address, uint32_t data)
{
TMR_Stop(); //Stop the timer to prevent interrupts from breaking EEPROM comms
uint8_t srcBuff[EE_BUFFER_SIZE];
M95512_WriteEnable();
srcBuff[0] = WRITE_MEM_ARRAY;
srcBuff[1] = address >> 8;
srcBuff[2] = address;
srcBuff[3] = (data & 0xff000000) >> 24;
srcBuff[4] = (data & 0x00ff0000) >> 16;
srcBuff[5] = (data & 0x0000ff00) >> 8;
srcBuff[6] = (data & 0x000000ff);
SPI0_SendBytes(srcBuff, 7, E2PROM);
//Wait for EEPROM WIP flag low
while(EE_Busy());
TMR_Start();
}
uint32_t EE_ReadUINT32(uint16_t address)
{
TMR_Stop(); //Stop the timer to prevent interrupts from breaking EEPROM comms
uint32_t data;
uint8_t srcBuff[EE_BUFFER_SIZE];
memset(srcBuff, 0, EE_BUFFER_SIZE); //Zero out srcBuff[]. byte 3 was 1???
srcBuff[0] = READ_MEM_ARRAY;
srcBuff[1] = address >> 8; //ADDR high
srcBuff[2] = address; //ADDR low
SPI0_SendBytes(srcBuff, 7, E2PROM);
for(uint16_t i = 3; i < 7; i++){
data <<= 8;
data += SPI0_xfer.rxData[i];
}
TMR_Start();
return data;
}
/* Write bytes to EEPROM
* CAUTION: avoid writing across a 128 byte page boundary! This will cause rollover per the datasheet section 6.6
*/
void EE_WriteBytes(uint16_t address, uint8_t *pdata, uint16_t numBytes)
{
if((address % EE_PAGE_SIZE) + numBytes > EE_PAGE_SIZE) //Prevent writing across page boundary
{
//while(1); //Use for debugging
return;
}
TMR_Stop(); //Stop the timer to prevent interrupts from breaking EEPROM comms
uint8_t srcBuff[SPI_XFER_BUFFER_SIZE + EE_HEADER_NUM_BYTES]; //temporary buffer for data
M95512_WriteEnable();
srcBuff[0] = WRITE_MEM_ARRAY;
srcBuff[1] = address >> 8;
srcBuff[2] = address;
memcpy(&srcBuff[3], pdata, numBytes); //copy pData to srcBuf
SPI0_SendBytes(srcBuff, numBytes + EE_HEADER_NUM_BYTES, E2PROM);
//Wait for EEPROM WIP flag low
while(EE_Busy());
TMR_Start();
}
/* Read bytes from EEPROM
*
*/
void EE_ReadBytes(uint16_t address, uint8_t *pdata, uint16_t numBytes)
{
TMR_Stop(); //Stop the timer to prevent interrupts from breaking EEPROM comms
uint8_t srcBuff[SPI_XFER_BUFFER_SIZE + EE_HEADER_NUM_BYTES];
memset(srcBuff, 0, SPI_XFER_BUFFER_SIZE); //Zero out srcBuff[]. byte 3 was 1???
srcBuff[0] = READ_MEM_ARRAY;
srcBuff[1] = address >> 8; //ADDR high
srcBuff[2] = address; //ADDR low
SPI0_SendBytes(srcBuff, numBytes + EE_HEADER_NUM_BYTES, E2PROM);
memcpy(pdata, &SPI0_xfer.rxData[3], numBytes); //copy received data to pdata
TMR_Start();
}

88
source/eeprom.h Normal file
View File

@@ -0,0 +1,88 @@
/*
* eeprom.h
*
* Created on: Nov 11, 2022
* Author: Keith.Lloyd
*/
#ifndef EEPROM_H_
#define EEPROM_H_
/*
* CAUTION: avoid writing across a 128 byte page boundary! This will cause rollover per the datasheet section 6.6
*/
//EEPROM 128 byte pages
#define EE_PAGE_SIZE 128 //Page size in bytes
#define EE_PAGE_BL (0 * EE_PAGE_SIZE) //Bootloader data. DO NOT USE!
#define EE_PAGE_SYS (1 * EE_PAGE_SIZE) //System info
#define EE_PAGE_DATA (2 * EE_PAGE_SIZE) //Saved data
#define EE_PAGE_FREQ1 (3 * EE_PAGE_SIZE) //Frequency data page 1
#define EE_PAGE_FREQ2 (4 * EE_PAGE_SIZE) //Frequency data page 2
#define EE_PAGE_HW_FIXES (5 * EE_PAGE_SIZE) //END of EEPROM data. Used for EE_EraseAllData()
/*******************************************************************************************************************/
//SYSTEM INFO - EE_PAGE_SYS
/*******************************************************************************************************************/
//defines are eeprom addresses in bytes
#define EE_SYS_MFG (EE_PAGE_SYS + 0) //Manufacturer string SYS_INFO_LENGTH is 24 bytes
#define EE_SYS_MODEL_NAME (EE_PAGE_SYS + 24) //Model name string SYS_INFO_LENGTH is 24 bytes
#define EE_SYS_SERIAL (EE_PAGE_SYS + 48) //Serial Number string SYS_INFO_LENGTH is 24 bytes
#define EE_SYS_MFG_DATE (EE_PAGE_SYS + 72) //Manufacture Date SYS_INFO_LENGTH is 24 bytes
#define EE_SYS_MODEL_NUMBER (EE_PAGE_SYS + 96) //Model number string SYS_INFO_LENGTH is 24 bytes
//Next available is 120
/*******************************************************************************************************************/
//SAVED DATA - EE_PAGE_DATA
/*******************************************************************************************************************/
#define EE_DATA_FREQUENCY (EE_PAGE_DATA + 0) //Index of operating frequency UINT32 4 bytes
#define EE_DATA_MODE (EE_PAGE_DATA + 4) //Mode ( In Bytes)
#define EE_DATA_TIMER (EE_PAGE_DATA + 8) //autoShutdown Timer setting UINT32 4 bytes
#define EE_DATA_LANGUAGE (EE_PAGE_DATA + 12) //System language UINT32 4 bytes
/*******************************************************************************************************************/
//FREQUENCY DATA - EE_PAGE_HARDWARE_FIXES
/*******************************************************************************************************************/
#define EE_FREQ_NUM (EE_PAGE_FREQ1 + 0) //Number of frequencies
//Addresses 4 through 39 reserved for future use
#define EE_FREQ_START (EE_PAGE_FREQ1 + 40) //Start of frequency data. Freqs are save as packed UINT32
//Frequencies are stored as 1 packed UINT32_t per frequency, so 32 per 128 byte EEPROM page.
//21 on page1 and up to 32 on page2 gives 53 max frequencies. Need more space if storing more than that!
//If each frequency stored is a separate call to EE_WriteMemoryUINT32() it will not cause problems with EEPROM page wrap
/*******************************************************************************************************************/
//HARDWARE FIX DATA - EE_PAGE_FREQ
/*******************************************************************************************************************/
#define EE_HWFIX_INIT (EE_PAGE_HW_FIXES + 0) //Hardware fix eeprom page initialized
#define EE_HWFIX_VBATT_CAP_021 (EE_PAGE_HW_FIXES + 4) //Add cap parallel with R6 on 208021
#define EE_HWFIX_MAIN_PCBA_PN (EE_PAGE_HW_FIXES + 8) //Main PCBA part number
//future hardware fixes go here
void EE_LoadData(void);
bool EE_LoadFrequencies(void);
void EE_SaveData(void); // Save settings to EEPROM
void EE_EraseAllData(void);
void EE_Test(void);
void EE_TestBytes(void);
void EE_WriteMemoryUINT32(uint16_t address, uint32_t *pdata);
void EE_ReadMemoryUINT32(uint16_t address, uint32_t *pdata);
void EE_WriteUINT32(uint16_t address, uint32_t data);
uint32_t EE_ReadUINT32(uint16_t address);
void EE_WriteBytes(uint16_t address, uint8_t *pdata, uint16_t numBytes);
void EE_ReadBytes(uint16_t address, uint8_t *pdata, uint16_t numBytes);
#endif /* EEPROM_H_ */

975
source/frq.c Normal file
View File

@@ -0,0 +1,975 @@
/*
* frq.c
*
* Created on: Jun 8, 2022
* Author: Keith.Lloyd
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "arm_math.h"
#include "spi.h"
#include "fsl_gpio.h"
#include "frq.h"
#include "LPC54114_cm4.h"
#include "display.h"
#include "utils.h"
#include "init.h"
#include "amps.h"
#include "ports.h"
#include "timer.h"
#include "mode.h"
#include "stdbool.h"
#include "eeprom.h"
#include "pwr_level.h"
extern uint8_t Test_Mode, catch_up_flag;
extern uint8_t Taps_Flag;
extern uint32_t new_freq;
extern uint8_t frequency,Cur_Mode,LD_Flag;
extern uint8_t Dds_Pot_Val[2];
extern uint16_t Sys_Chk_tmr;
uint8_t Tx_mode, frq_chg_tmr,old_freq;
FREQDATA_t freq;
FREQUENCY_t freqArray[FREQ_MAX_NUM];
uint8_t foo[4]; //stuff the 2 16-bit values into an array of 4 uint8_t
uint8_t frq_update_flag;
extern uint8_t Power_Level;
extern ClampData_t clampData;
extern uint32_t systemTime;
uint32_t Calc_Freq(uint32_t fout) // Calculate frequency word for DDS
{
float Freg;
uint32_t Frq_result;
Freg = fout * 268435456.0; // FREG = (Frequency * 2^28)/fclk = 12MHz normally
Frq_result = Freg/DDS_CLK + 0.5;
return(Frq_result);
}
void Load_Ramp(uint32_t ramp_freq) // Sets up RAMP DDS for PWM AMP
{
uint16_t ramp_hi = FREQ0_REG; //top 2 bits 0x01 for Freq0 register address
uint16_t ramp_lo = FREQ0_REG;
if (ramp_freq > 0)
{
Send_Ctrl_Word(RAMP_CTRL_WORD1,RAMP); // send Control word to hold setup
ramp_lo |= (ramp_freq & 0x3fff);
ramp_freq >>= 14;
ramp_hi |= (ramp_freq & 0x3fff);
//ramp_hi |= (ramp_freq & 0xc000) >> 14; // Preserve upper 2 bits
foo[0] = (uint8_t)(ramp_lo >> 8); //LS 16-bit word, MSB
foo[1] = (uint8_t)(ramp_lo & 0x00ff); //LS 16-bit word, LSB
foo[2] = (uint8_t)(ramp_hi >> 8);
foo[3] = (uint8_t)(ramp_hi & 0x00ff);
SPI0_SendBytes(foo, 4, RAMP);
Send_Ctrl_Word(RAMP_CTRL_WORD2,RAMP); // send Control word to release setup
}
else
{
Send_Ctrl_Word(RAMP_CTRL_WORD3,RAMP); // Control word to hold setup and put part to sleep
GPIO_PinWrite(GPIO, RAMP_PORT, RAMP_RST_GPIO_PIN, HI); //Hold RST HI
while(1); //stop
}
}
void Load_Frq_Gen(FRQ_OUT_SELECT_t Freq_Mode, int32_t f1, int32_t f2)
{
uint8_t x=0;
uint16_t freq_hi = FREQ0_REG;
uint16_t freq_lo = FREQ0_REG;
if (Freq_Mode == NULL_FREQ)
x = 1; // Switch both DDS chips OFF
if (Freq_Mode == SINGLE)
{
x = 2; // Switch the primary DDS ON
Send_Ctrl_Word(FRQ_CTRL_WORD1,SIGNAL); // send Control word to hold setup
freq_lo |= (f1 & 0x3fff);
f1 >>= 14;
freq_hi |= (f1 & 0x3fff);
foo[0] = (uint8_t)(freq_lo >> 8); //LS 16-bit word, MSB
foo[1] = (uint8_t)(freq_lo & 0x00ff); //LS 16-bit word, LSB
foo[2] = (uint8_t)(freq_hi >> 8);
foo[3] = (uint8_t)(freq_hi & 0x00ff);
// freq_hi |= (f1 & 0xc000) >> 14; // Preserve upper 2 bits
// freq_lo |= (f1 & 0x3fff);
// foo[0] = (uint8_t)(freq_lo >> 8);
// foo[1] = (uint8_t)(freq_lo & 0x00ff);
// foo[2] = (uint8_t)(freq_hi >> 8);
// foo[3] = (uint8_t)(freq_hi & 0x00ff);
SPI0_SendBytes(foo, 4, SIGNAL);
Send_Ctrl_Word(FRQ_CTRL_WORD2,SIGNAL); // send Control word to release setup
}
if (Freq_Mode == DUAL)
{ // ############---Switch both DDS chips ON SYNCHRONOUSLY--######
// Set RESET to hold
// Load F1
Send_Ctrl_Word(FRQ_CTRL_WORD1,SIGNAL); // send Control word to hold setup
freq_lo |= (f1 & 0x3fff);
f1 >>= 14;
freq_hi |= (f1 & 0x3fff);
foo[0] = (uint8_t)(freq_lo >> 8); //LS 16-bit word, MSB
foo[1] = (uint8_t)(freq_lo & 0x00ff); //LS 16-bit word, LSB
foo[2] = (uint8_t)(freq_hi >> 8);
foo[3] = (uint8_t)(freq_hi & 0x00ff);
SPI0_SendBytes(foo, 4, SIGNAL);
Send_Ctrl_Word(FRQ_CTRL_WORD2,SIGNAL); // send Control word to release setup
// Load F2
freq_hi = FREQ0_REG;
freq_lo = FREQ0_REG;
Send_Ctrl_Word(FRQ_CTRL_WORD1,SDSIGNAL); // send Control word to hold setup
freq_lo |= (f2 & 0x3fff);
f2 >>= 14;
freq_hi |= (f2 & 0x3fff);
foo[0] = (uint8_t)(freq_lo >> 8); //LS 16-bit word, MSB
foo[1] = (uint8_t)(freq_lo & 0x00ff); //LS 16-bit word, LSB
foo[2] = (uint8_t)(freq_hi >> 8);
foo[3] = (uint8_t)(freq_hi & 0x00ff);
SPI0_SendBytes(foo, 4, SDSIGNAL);
Send_Ctrl_Word(FRQ_CTRL_WORD2,SDSIGNAL); // send Control word to release setup
// Send_Ctrl_Word(SLP_CTRL_WRD,SIGNAL); // TEST ONLY REMOVE Put unused DDS to sleep
// Send_Ctrl_Word(PHASE_RESET,SIGNAL); // // Set Phase F1 to 0
// Send_Ctrl_Word(PHASE_RESET,SDSIGNAL); // Set Phase F2 to 0
// Send_Ctrl_Word(FRQ_CTRL_WORD2,BOTH_SIGNAL); // Send release code word simultaneously
// End#.
// GPIO_PinWrite(GPIO, 1, 13, 1);
// Set high SD_RST
// Set high SIG_RST
// Set up both Sine Wave generators
// set low SD_RST
// set low SIG_RST.
}
}
void Send_Ctrl_Word(uint16_t Control_Reg, SPI_MODE_t mode)
{
//Set the control register Send MS Byte first then LSByte
foo[0] = (uint8_t)(Control_Reg >> 8); // Reset bit held
foo[1] = (uint8_t)(Control_Reg & 0x00ff);
SPI0_SendBytes(foo, 2, mode);
}
void AddFrequency(uint32_t frequency1,uint32_t frequency2, uint8_t enabled, uint8_t bc_enabled,uint8_t bc_mask,uint8_t pot,float i_lo,float i_hi,float v_lo,float v_hi)
{
uint32_t i = freq.numFrequencies;
freqArray[i].frequency1 = frequency1;
freqArray[i].frequency2 = frequency2;
freqArray[i].enabled = enabled;
freqArray[i].bc_enabled = bc_enabled;
freqArray[i].bc_Mask = bc_mask;
freqArray[i].max_pot = pot;
// freqArray[i].v_coeff_lo = 0.876923;
freqArray[i].v_coeff_lo = v_lo;
freqArray[i].i_coeff_hi = i_hi;
freqArray[i].i_coeff_lo = i_lo;
freq.numFrequencies++;
}
void ClearFreqArray(void)
{
for(uint32_t i = 0; i < FREQ_MAX_NUM; i++)
{
freqArray[i].frequency1 = 0;
freqArray[i].frequency2 = 0;
freqArray[i].enabled = 0;
freqArray[i].bc_enabled = 0;
}
}
void FREQ_Init(void)
{
uint32_t tmp;
GPIO_PinWrite(GPIO, SIGNAL_PORT, SIG_RST_GPIO_PIN, 1); // Set all RESET signals to RESET
GPIO_PinWrite(GPIO, SIGNAL_PORT, SD_RST_GPIO_PIN, 1);
GPIO_PinWrite(GPIO, SIGNAL_PORT, RAMP_RST_GPIO_PIN, 1);
Delay_Ticks(1);
GPIO_PinWrite(GPIO, SIGNAL_PORT, RAMP_RST_GPIO_PIN, 0);
GPIO_PinWrite(GPIO, SIGNAL_PORT, SIG_RST_GPIO_PIN, 0); // Set all RESET signals to RESET
GPIO_PinWrite(GPIO, SIGNAL_PORT, SD_RST_GPIO_PIN, 0); // 8/26/24
freq.numFrequencies = 0;
if(Test_Mode) //
{
FREQ_LoadFactoryDefaults();
// frq_update_flag = false;
}
else
{
if(!EE_LoadFrequencies())
{
FREQ_LoadFactoryDefaults();
}
}
Send_Ctrl_Word(SLP_CTRL_WRD,SDSIGNAL); // Put unused DDS to sleep
// tmp = Calc_Freq(32768);
// Load_Frq_Gen(SINGLE,tmp,0); // testing only 8KHz
// Load_Ramp(7829367); // 350KHz ramp waveform
Load_Ramp(6710886); // 300KHz ramp waveform
// Load_Ramp(20132659); // 900KHz ramp waveform
// Load_Ramp(72370199); // 3.2352MHz ramp waveform
}
void FREQ_LoadFactoryDefaults(void)
{
#if 1 //Use new function so we don't have to specify all the parameters
//These are the FACTORY TEST Frequencies
FREQ_ClearFrequencies();
FREQ_AddFrequency(512, 1, 1, FT_ACTIVE);
FREQ_AddFrequency(3140, 1, 1, FT_ACTIVE);
FREQ_AddFrequency(8192, 1, 1, FT_ACTIVE);
FREQ_AddFrequency(29433, 1, 1, FT_ACTIVE);
FREQ_AddFrequency(32770, 1, 1, FT_ACTIVE);
FREQ_AddFrequency(65055, 1, 1, FT_ACTIVE);
FREQ_AddFrequency(88779, 1, 1, FT_ACTIVE);
#else //Or we can specify all the parameters
AddFrequency(98, 0, 0, 0, 0, 0,0,0,0,0);
AddFrequency(128, 0, 0, 0, 0, 0,0,0,0,0);
AddFrequency(263, 0, 1, 0, 0, 165,0.8396,0.47,0.876923,0);
AddFrequency(440, 0, 0, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(440, 220, 0, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(512, 0, 1, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(512, 256, 0, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(560, 0, 0, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(577, 0, 0, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(640, 0, 0, 0, 0,180,0.8396,0.47,0.876923,0);
AddFrequency(640, 320, 0, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(815, 0, 0, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(870, 0, 1, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(870, 435, 0, 0, 0, 180,0.8396,0.47,0.876923,0);
AddFrequency(940, 0, 0, 0, 0, 180,0.8105,0.47,0.876923,0);
AddFrequency(940, 470, 0, 0, 0, 180,0.8105,0.47,0.876923,0);
AddFrequency(1024, 0, 0, 0, 0, 180,0.8105,0.49,0.911538,0);
AddFrequency(1170, 0, 1, 0, 0, 180,0.8105,0.49,0.911538,0);
AddFrequency(1170, 585, 0, 0, 0, 180,0.8105,0.49,0.911538,0);
AddFrequency(3140, 0, 1, 1, MASK_144, 180,0.8634,0.482,0.97083,0);
AddFrequency(3140, 1570, 0, 0, 0 , 180,0.8634,0.482,0.97083,0);
AddFrequency(4096, 0, 1, 0, 0, 180,0.8634,0.482,0.97083,0);
AddFrequency(6000, 0, 1, 0, 0, 180,0.8634,0.482,0.97083,0);
AddFrequency(8010, 0, 0, 1,MASK_144, 180,0.8976,0.53,1.025,0);
AddFrequency(8192, 0, 1, 1,MASK_144, 180,0.8976,0.53,1.025,0);
AddFrequency(9820, 0, 1, 0,MASK_144, 180,0.8976,0.53,1.025,0);
AddFrequency(29433, 0, 1, 1,MASK_58, 180,0.9534,0.69,1.043,0);
AddFrequency(32770, 0, 1, 1,MASK_58, 180,0.9581,0.713333333,1.009,0);
AddFrequency(44499, 0, 1, 1,MASK_15, 180,1,0.91,1.035,0);
AddFrequency(66055, 0, 1, 1,MASK_58, 120,1.215,1.35,1.6375,0);
AddFrequency(88779, 0, 1, 1,MASK_15, 120,1.355,1.36,1.8857,0);
AddFrequency(99037, 0, 0, 1,MASK_58, 120,1.355,01.36,0,0);
AddFrequency(200000, 0, 1, 1,MASK_144, 120,1.355,01.36,7.6,0);
AddFrequency(480000, 0, 0, 0,MASK_144, 120,4.111,2.111,7.6,0);
#endif
}
/*
* Pack frequency data and return
* Packed data is used for saving to FLASH
*/
uint32_t FREQ_GetPackedFrequency(uint32_t index)
{
uint32_t packed = freqArray[index].frequency1;
//packed |= freqArray[index].type << FREQ_PACK_SHIFT_TYPE;
packed |= (uint32_t)freqArray[index].enabled << FREQ_PACK_SHIFT_ENABLED;
//packed |= (uint32_t)freqArray[index].inMenu << FREQ_PACK_SHIFT_INMENU;
return packed;
}
/*
* Add a frequency to the list from packed data
* Packed data is used for saving to FLASH
*/
void FREQ_AddPackedFrequency(uint32_t packedFreq)
{
uint32_t frequency = packedFreq & FREQ_PACK_MASK_FREQ;
//FREQ_TYPE_t type = (packedFreq & FREQ_PACK_MASK_TYPE) >> FREQ_PACK_SHIFT_TYPE;
bool enabled = packedFreq & FREQ_PACK_MASK_ENABLED;
//bool inMenu = packedFreq & FREQ_PACK_MASK_INMENU;
FREQ_AddFrequency(frequency, enabled, 1, FT_ACTIVE); //inMenu always 1, all FT_ACTIVE
}
/*
* Clear the frequency list
* Zero out all data and set freq.numFrequencies to zero
*/
void FREQ_ClearFrequencies(void)
{
// frq_update_flag = true;
for(uint32_t i = 0; i < freq.numFrequencies; i++)
{
freqArray[i].frequency1 = 0;
freqArray[i].enabled = 0;
}
freq.numFrequencies = 0;
frequency = 0;
}
/*
* Add a Frequency from UM Setup
*/
void FREQ_AddFrequency(uint32_t f1, uint8_t enabledTemp, uint8_t inMenu, FREQ_TYPE_t type)
{
if(!inMenu)
{
return; //ignore freqs that are not in menu
}
if((type != FT_ACTIVE) && (type != FT_LD_ACTIVE))
{
return; //ignore RX frequency types
}
//TODO: Calculate other things in Keith's freqArray[] here
//frequency2 for LD needs a function to determine 2nd frequency
//Doesn't matter yet since RX doesn't support LD
//scale factors
//other crap
//f2
uint32_t f2 = 0;
if(type == FT_LD_ACTIVE)
{
if(f1 <= FREQ_LD_SWITCH_POINT)
{
f2 = f1 * 2;
}
else if(f1 <= FREQ_LD_MAX_FREQUENCY)
{
f2 = f1 / 2; //TODO: This will break for odd frequencies since it's an integer. Need to rework freqs...
}
else
{
f2 = 0;
}
}
//TODO: Generate values for these!!!!!!!!!!
uint32_t bc_enabledTemp = BC_Enable_Chk(f1);
uint32_t bc_maskTemp = BC_Mask_Chk(f1); //Todo remove as unused
uint32_t max_pot = Max_Pot_Chk(f1);
float32_t v_coeff_lo = V_coeff_lo_Chk(f1);
float32_t i_coeff_hi = I_coeff_hi_Chk(f1);
float32_t i_coeff_lo = I_coeff_lo_Chk(f1);
float32_t v_coeff_hi = V_coeff_hi_Chk(f1); //always 0
AddFrequency(f1, f2, enabledTemp, bc_enabledTemp, bc_maskTemp, max_pot, i_coeff_lo, i_coeff_hi, v_coeff_lo, v_coeff_hi);
}
uint8_t BC_Enable_Chk(uint32_t f1)
{
if((f1 >= BCAST_MIN) && (f1 < BCAST_MAX+1))
return(1);
else
return(0);
}
uint8_t BC_Mask_Chk(uint32_t f1)
{
if((f1 >= BCAST_MIN) && (f1 < 9820)|| (f1 >= 200000) && (f1 <=480000))
return(MASK_144);
else if(f1 == 29430 || f1==32768 || f1==65536 || f1==131072)
return(MASK_58);
else if(f1 == 44624 || f1== 83078)
return(MASK_15);
else
{
return 99;
}
}
uint8_t Max_Pot_Chk(uint32_t f1)
{
if(f1 < 440)
return(180);//165
if((f1 >= 440) && (f1 < 12000)) // 29430
return(235);
if((f1 >= 12000) && (f1 < 29430))
return(245);
if((f1 >= 29430)&& (f1 <= 44500))
return(250);
if((f1 > 44624) && (f1 < 200000))
return(200);
if(f1 == 200000)
return(140);
else
return(140);
//TODO set up default value
}
float V_coeff_lo_Chk(uint32_t f1)
{
float a;
switch(f1)
{
case 1 ... 940:
a= 0.876923;
break;
case 941 ... 1170:
a = 0.911538;
break;
case 1171 ... 6000:
a = 0.97083;
break;
case 6001 ... 8009:
a = 1.025;
break;
case 8010 ... 9820:
a = 1.025;
break;
case 9821 ... 29430:
a = 0.81;
break;
case 29431 ... 32768:
a = 0.81;//1.009;
break;
case 32769 ... 44100:
a = 1.035;
break;
case 44101 ... 65536:
a = 1.0;
break;
case 65537 ... 80000:
a = 1.1;
break;
case 80001 ... 199999:
a = 1.36;
break;
case 200000 ... 480000:
a = 4.5;
break;
default:
a = 0.53;
}
return(a);
}
float V_coeff_hi_Chk(uint32_t f1)
{
return(0);
}
float I_coeff_lo_Chk(uint32_t f1)
{
float a;
// a = freqArray[Search_for_frq(f1)].i_coeff_lo;
switch(f1)
{
case 1 ... 500:
a = 1;
break;
case 501 ... 870:
a= 0.8396;
break;
case 871 ... 1170:
a = 0.8105;
break;
case 1171 ... 3139:
a = 0.8634;
break;
case 3140 ... 6000:
a = 0.8634;
break;
case 6001 ... 8009:
a = 0.8634;
break;
case 8010 ... 9820:
a = 0.8976;
break;
case 9821 ... 29430:
a = 0.8976;
break;
case 29431 ... 32768:
a = 0.8976;
break;
case 32769 ... 44100:
a = 0.91;
break;
case 44101 ... 65536:
a = 1.015;
break;
case 65537 ... 199999:
a = 1.255;
break;
case 200000 ... 480000:
a = 3.111;
break;
default:
a = 0.8976;
}
return(a);
}
float I_coeff_hi_Chk(uint32_t f1)
{
float a;
a = freqArray[Search_for_frq(f1)].i_coeff_hi;
switch(f1)
{
case 1 ... 940:
a= 0.47;
break;
case 941 ... 1170:
a = 0.49;
break;
case 1171 ... 6000:
a = 0.482;
break;
case 6001 ... 8009:
a = 0.53;
break;
case 8010 ... 9820:
a = 0.53;
break;
case 9821 ... 29430:
a = 0.69;
break;
case 29431 ... 32768:
a = 0.71333;
break;
case 32769 ... 44100:
a = 1.035;
break;
case 44101 ... 65536:
a = 1.35;
break;
case 65537 ... 200000:
a = 1.36;
break;
case 200001 ... 480000:
a = 2.111;
break;
default:
a = 0.53;
}
return(a);
}
uint8_t Search_for_frq(uint32_t f1)
{
uint8_t i =0;
for(i=0; i < FREQ_MAX_NUM - 1; i++)
{
if((f1 == freqArray[i].frequency1)) //(freqArray[frq_tmp].enabled > 0)
break;
}
return(i);
}
void FREQ_ToggleEnable(uint32_t selected) //selected is same as frequency index
{
freqArray[selected].enabled ^= 1;
}
FREQUENCY_t FREQ_GetFreqByIndex(uint32_t index)
{
return freqArray[index];
}
uint32_t FREQ_GetNumFrequencies(void)
{
return freq.numFrequencies;
}
uint8_t Next_Frequency(uint8_t frq_tmp) // increments frequency
{
uint8_t found = false;
uint8_t i;
frq_tmp = frequency;
if (frq_tmp < FREQ_MAX_NUM - 1)
frq_tmp++;
else
frq_tmp = 0;
for(i=0; i < FREQ_MAX_NUM - 1; i++)
{
if(Check_freq_enabled(frq_tmp)) //(freqArray[frq_tmp].enabled > 0)
{
found = 1;
break;
}
if (frq_tmp < FREQ_MAX_NUM - 1)
frq_tmp++;
else
frq_tmp= 0;
}
return(frq_tmp);
}
bool Check_freq_enabled(uint8_t frq_tmp)
{
bool x;
x = false;
if(Cur_Mode != BROADCAST && (freqArray[frq_tmp].enabled > 0))
x= true;
else
if ((Cur_Mode == BROADCAST) && (freqArray[frq_tmp].bc_enabled > 0) && (freqArray[frq_tmp].enabled > 0))
x = true;
return(x);
}
/* Generate name for the frequency at the specified index
* @param index index in the frequency list
* @param *string pointer to the storage location for the name string
*/
void FREQ_GetFrequencyName(uint32_t index, uint8_t *string)
{
//Generate frequency name
// < 1000Hz: "xxxHz"
// < 10kHz: "x.xxkHz"
// < 100kHz: "xx.xkHz"
// >=100kHz: "xxxkHz"
uint32_t freqTemp = freqArray[index].frequency1; //the numeric freqTemp
if(freqArray[index].frequency2 != 0)
{
if(freqTemp < 1000)
{
sprintf(string, "LD %dHz", freqTemp);
}
else if(freqTemp < 10000)
{
sprintf(string, "LD %.2fkHz", (float32_t)freqTemp / 1000.0);
}
else
{
sprintf(string, "ERROR");
}
}
else
{
if(freqTemp < 1000)
{
sprintf(string, "%dHz", freqTemp);
}
else if(freqTemp < 10000)
{
sprintf(string, "%.2fkHz", (float32_t)freqTemp / 1000.0);
}
else if(freqTemp < 100000)
{
sprintf(string, "%.1fkHz", (float32_t)freqTemp / 1000.0);
}
else if(freqTemp < 500000)
{
sprintf(string, "%.0fkHz", (float32_t)freqTemp / 1000.0);
}
else
{
sprintf(string, "ERROR");
}
}
}
/*while(!found && frq_tmp < FREQ_MAX_NUM)
{
frq_tmp++;
if(freqArray[frq_tmp].enabled > 0)
found = true;
if(frq_tmp >= FREQ_MAX_NUM)
frq_tmp = FREQ_MIN;
} */
void Update_Min_Frequency(void)
{
}
void Update_Frequency()
{
uint32_t tmp;
if (Cur_Mode != BROADCAST) // IF - ! Broadcast
{
Enable_Amplifier(); // Select correct amplifier
Select_Transformer(); // Select correct transformer
// tmp = Calc_Freq(freqArray[frequency].frequency1);
// Load_Frq_Gen(SINGLE,tmp,0); // # update the frequency generators
Set_Selected_Freq();
Taps_Flag = false;
if((ACCY_GetConnectedAccessory(1) == ID_CLAMP) || (ACCY_GetConnectedAccessory(2) == ID_CLAMP))
{
Get_Clamp_Value(); // Ensure correct table for Clamp amplitude
SPI0_SendBytes(Dds_Pot_Val, 2, AMPLITUDE);
}
else
if ((ACCY_GetConnectedAccessory(1) == ID_CLAMP2) || (ACCY_GetConnectedAccessory(2) == ID_CLAMP2))
{
clampData.regulate = true;
if (freqArray[frequency].frequency1 < 800)
{
clampData.maxPower = MAX_POWER_TARGET_VLF;
}
else
if (freqArray[frequency].frequency1 < 45000)
{
clampData.maxPower = MAX_POWER_TARGET_LF;
}
else
{
clampData.maxPower = MAX_POWER_TARGET_HF;
}
Get_Clamp_Value();
clampData.timeout = systemTime + CLAMP_REGULATE_DELAY;
if (Power_Level > 0)
{
clampData.prevPowerLevel = 0;
setTestPot();
}
}
// Select_Output_Port(ONE); // Switch in the correct pathway
}
else // else
{
All_Amps_Off(); // shut down Amplifiers DC connections
Disable_DC();
Enable_BC(); // Enable BCAST circuitry using either Minimum or previously selected freq
LD_Flag = false;
// Init_PWM(); // update PWM generators
}
old_freq = frequency; // Indicate done
}
void Set_Selected_Freq(void)
{
uint32_t frq1;
uint32_t frq2;
if(LD_Flag && freqArray[frequency].frequency1 <= MAX_LD_FREQ)
{
frq1 = Calc_Freq(freqArray[frequency].frequency1);
frq2 = freqArray[frequency].frequency1;
frq2 = frq2 * 2.0;
// frq2 = 9100; // test only
frq2 = Calc_Freq(frq2);
Load_Frq_Gen(DUAL,frq1,frq2); // # update the frequency generators
}
else
{
frq1 = Calc_Freq(freqArray[frequency].frequency1);
frq2 = 0;
Load_Frq_Gen(SINGLE,frq1,frq2); // # update the frequency generators
Send_Ctrl_Word(SLP_CTRL_WRD,SDSIGNAL); // Put unused DDS to sleep
}
}
void Reset_DDS(void)
{
GPIO_PinWrite(GPIO, SIGNAL_PORT, SIG_RST_GPIO_PIN, 1); // Set all RESET signals to RESET
GPIO_PinWrite(GPIO, SIGNAL_PORT, SD_RST_GPIO_PIN, 1);
GPIO_PinWrite(GPIO, SIGNAL_PORT, RAMP_RST_GPIO_PIN, 1);
Delay_Ticks(1);
GPIO_PinWrite(GPIO, SIGNAL_PORT, RAMP_RST_GPIO_PIN, 0);
GPIO_PinWrite(GPIO, SIGNAL_PORT, SIG_RST_GPIO_PIN, 0); // Set all RESET signals to RESET
}
void Change_to_next_dc_frq(void)
{
uint32_t tmp_frqx;
uint8_t count;
if((ACCY_GetConnectedAccessory(1) == ID_CLAMP) || (ACCY_GetConnectedAccessory(2) == ID_CLAMP))
{
frequency = Next_Frequency(frequency); // increment the frequency
new_freq = freqArray[frequency].frequency1;
if(freqArray[frequency].frequency1 <= MIN_CTYPE)// is frequecny > min
{
count = 0;
while(freqArray[frequency].frequency1 < MIN_CTYPE && count < FREQ_MAX_NUM)
{
frequency = Next_Frequency(frequency); // increment the frequency
new_freq = freqArray[frequency].frequency1;
count++;
}
// tmp_frqx = Search_Frequency(256); // select minimum frequency for DC Clamp operation
// if (tmp_frqx < FREQ_MAX_NUM) // set up new min freq
// {
// frequency = tmp_frqx;
// new_freq = freqArray[frequency].frequency1;
// }
}
else
{
// frequency = Next_Frequency(frequency); // increment the frequency
new_freq = freqArray[frequency].frequency1;
}
}
else
{
frequency = Next_Frequency(frequency); // increment the frequency
new_freq = freqArray[frequency].frequency1;
Sys_Chk_tmr= DELAY_500MS; // Allow system settling before checking measurements
// catch_up_flag = true;
}
}
void Change_To_Next_BC_Freq(void)
{
uint32_t tmp_frqx;
if(Cur_Mode == BROADCAST) // Special case only if BC mode already selected
{
if (freqArray[frequency].frequency1 < BCAST_MIN) // if (freq < min freq) ToDo
tmp_frqx = Search_Frequency(3140); // select minimum frequency for BCAST
if (tmp_frqx < FREQ_MAX_NUM)
{
frequency = tmp_frqx;
new_freq = freqArray[frequency].frequency1;
}
}
}

144
source/frq.h Normal file
View File

@@ -0,0 +1,144 @@
/*
* frq.h
*
* Created on: Jun 8, 2022
* Author: Keith.Lloyd
*/
#ifndef FRQ_H_
#define FRQ_H_
#include "spi.h"
typedef enum {
NULL_FREQ,
SINGLE,
DUAL
}FRQ_OUT_SELECT_t;
#define TX_SYS_CLK 12000000 // 12MHZ
#define DDS_CLK TX_SYS_CLK
#define FREQ_MAX_NUM 50 //Max number of frequencies allowed
#define FREQ_MIN 0
#define FREQ0_REG 0x4000 // Address of internal 9838 register
#define FRQ_CTRL_WORD1 0x2100 // Control register with Reset bit active
#define FRQ_CTRL_WORD2 0x2000 // Exit Reset Control Word
//#define FRQ_CTRL_WORD2 0x2038 // Exit Reset Control Word for PLL Test
#define PHASE_RESET 0xC000 // PHASE Register 0 = 0;
#define RAMP_CTRL_WORD1 0x2102
#define RAMP_CTRL_WORD2 0x2002
#define RAMP_CTRL_WORD3 0x2002 // TODO Places wavegen in sleep mode
#define SLP_CTRL_WRD 0x2180 // Power down unused DDS
#define SLP_CTRL_WRD2 0x21C0
#define RAMP_PORT 1
//#define RAMP_RST_GPIO_PIN 14
#define HI 1
#define BCAST_MIN 3140
#define BCAST_MAX 200000
#define DUMMY_FRQ 250
#define MIN_BLOCK_FREQ 20000
#define MASK_15 0b00000000
#define MASK_58 0b00001000
#define MASK_144 0b00011000
#define CLK_MASK_BITS 0b11100111
#define MAX_LD_FREQ 10000
//FREQUENCY PACKING - from RX so it has extra fields
#define FREQ_PACK_MASK_FREQ 0x0007ffff //target frequency bits 0 - 18
#define FREQ_PACK_MASK_TYPE 0x00380000 //3-bit field for FREQ_TYPE_t. bits 19 - 21
#define FREQ_PACK_SHIFT_TYPE 19 //Frequency type shift
#define FREQ_PACK_MASK_ENABLED 0x80000000 //enabled mask
#define FREQ_PACK_SHIFT_ENABLED 31 //enabled shift bit 31
#define FREQ_PACK_MASK_INMENU 0x40000000 //inMenu mask
#define FREQ_PACK_SHIFT_INMENU 30 //inMenu shift bit 30
//Locate direction (LD)
#define FREQ_LD_MAX_FREQUENCY 10000 //LD runs at or below this frequency
#define FREQ_LD_SWITCH_POINT 1500 //At or below this freq, f2 is f1 * 2. above this f2 = f1 / 2
#define MIN_CTYPE 263 // Minimum clamp frequency.
typedef enum {
FT_ACTIVE, //active
FT_LD_ACTIVE, //active w/ Locate Direction
FT_POWER, //RX ONLY individual power
FT_GROUPED_POWER, //RX ONLY Radio style grouped power
FT_CATHODIC, //RX ONLY cathodic protection - Identical to individual power except naming in frequency menu
FT_SONDE, //RX ONLY
FT_RADIO, //RX ONLY
FT_FAULT_FIND, //RX ONLY fault finder - Has it's own dedicated frequency set. frequencies are NOT user definable
}FREQ_TYPE_t;
//Data for individual frequencies
typedef struct {
uint32_t frequency1; //frequency in Hz
uint32_t frequency2;
uint8_t enabled; //
uint8_t bc_enabled;
uint8_t bc_Mask;
uint8_t max_pot;
float i_coeff_lo;
float i_coeff_hi;
float v_coeff_lo;
float v_coeff_hi;
}FREQUENCY_t;
//General data for frequencies module
typedef struct {
uint32_t numFrequencies; //number of frequencies in freqArray
}FREQDATA_t;
void FREQ_Init(void);
void FREQ_LoadFactoryDefaults(void);
uint32_t FREQ_GetPackedFrequency(uint32_t index);
void FREQ_AddPackedFrequency(uint32_t packedFreq);
void FREQ_ClearFrequencies(void);
void FREQ_AddFrequency(uint32_t f1, uint8_t enabledTemp, uint8_t inMenu, FREQ_TYPE_t type);
void Load_Ramp(uint32_t ramp_freq);
void Load_Frq_Gen(FRQ_OUT_SELECT_t, int32_t, int32_t); // NONE,either or both plus two data words
//void AddFrequency(uint32_t frequency, uint32_t frequency2, uint8_t enabled, uint8_t bc_enabled, uint8_t bc_mask);
uint8_t Next_Frequency(uint8_t frequency);
void FREQ_ToggleEnable(uint32_t selected);
FREQUENCY_t FREQ_GetFreqByIndex(uint32_t index);
uint32_t FREQ_GetNumFrequencies(void);
void FREQ_GetFrequencyName(uint32_t index, uint8_t *string);
void Send_Ctrl_Word(uint16_t Control_Reg, SPI_MODE_t mode);
uint32_t Calc_Freq(uint32_t fout); // Calculate frequency word for DDS
void Update_Min_Frequency(void);
void Update_Frequency();
void Reset_DDS(void);
void AddFrequency(uint32_t frequency1,uint32_t frequency2, uint8_t enabled, uint8_t bc_enabled,uint8_t bc_mask,uint8_t pot,float i_lo,float i_hi,float v_lo,float v_hi);
bool Check_freq_enabled(uint8_t frq_tmp);
uint8_t BC_Enable_Chk(uint32_t f1);
uint8_t BC_Mask_Chk(uint32_t f1);
uint8_t Max_Pot_Chk(uint32_t f1);
float V_coeff_lo_Chk(uint32_t f1);
float V_coeff_hi_Chk(uint32_t f1);
float I_coeff_lo_Chk(uint32_t f1);
float I_coeff_hi_Chk(uint32_t f1);
uint8_t Search_for_frq(uint32_t f1);
void Change_to_next_dc_frq(void);
void Change_To_Next_BC_Freq(void);
void Set_Selected_Freq(void);
extern FREQUENCY_t freqArray[];
#endif /* FRQ_H_ */

87
source/hwFixes.c Normal file
View File

@@ -0,0 +1,87 @@
/*
* hwFixes.c
*
* Created on: Mar 27, 2024
* Author: Brian.Bailey
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdint.h>
//Drivers
#include "fsl_common.h"
#include "fsl_gpio.h"
#include "Fonts\fontLibrary.h"
#include "Graphics\graphicsLibrary.h"
#include "keys.h"
#include "eeprom.h"
#include "hwFixes.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
HARDWARE_FIX_t hwf;
extern char tempString[40];
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
/*******************************************************************************
* Public Functions
******************************************************************************/
/*
* Initialize hardware fix EEPROM and read out fix data
*/
void HWF_Init(void)
{
//Check if HWF eeprom page has been initialized
if(EE_ReadUINT32(EE_HWFIX_INIT) != 1)
{
//erase HWF sector
for(uint32_t i = EE_PAGE_HW_FIXES; i < EE_PAGE_HW_FIXES + EE_PAGE_SIZE; i++)
{
EE_WriteUINT32(i, 0x00000000);
}
//Set HWF initialized
EE_WriteUINT32(EE_HWFIX_INIT, true);
EE_WriteUINT32(EE_HWFIX_MAIN_PCBA_PN, HWF_MIN_MAIN_PCBA_PN); //Default to earliest hardware
hwf.mainPcbaPN = HWF_MIN_MAIN_PCBA_PN;
}
else
{
//Read hardware fix info
hwf.vBattCap_021 = EE_ReadUINT32(EE_HWFIX_VBATT_CAP_021);
hwf.mainPcbaPN = EE_ReadUINT32(EE_HWFIX_MAIN_PCBA_PN);
if(hwf.mainPcbaPN >= 208023) //Set vBattCap fix to true for 208023+
{
hwf.vBattCap_021 = true;
}
}
}

24
source/hwFixes.h Normal file
View File

@@ -0,0 +1,24 @@
/*
* hwFixes.h
*
* Created on: Mar 27, 2024
* Author: Brian.Bailey
*/
#ifndef HWFIXES_H_
#define HWFIXES_H_
#define HWF_MIN_MAIN_PCBA_PN 208021 //Minimum PCBA part number
#define HWF_MAX_MAIN_PCBA_PN 208025 //Max PCBA part number - Increase this when changing hardware
typedef struct
{
bool vBattCap_021;
uint32_t mainPcbaPN;
}HARDWARE_FIX_t;
void HWF_Init(void);
#endif /* HWFIXES_H_ */

390
source/init.c Normal file
View File

@@ -0,0 +1,390 @@
/*
* init.c
*
* Created on: May 20, 2022
* Author: Keith.Lloyd
*/
#include "arm_math.h"
#include <stdbool.h>
#include <stdint.h>
#include "init.h"
#include "taps.h"
#include "measure.h"
#include "ports.h"
#include "utils.h"
#include "frq.h"
#include "adc.h"
#include "mode.h"
#include "psu_ctrl.h"
#include "timer.h"
#include "main.h"
#include "lcd.h"
#include "menu.h"
#include "safety_key.h"
#include "usbComms.h"
#include "flashUpdate.h"
#include "bootloader.h"
#include "eeprom.h"
#include "sys_chk.h"
#include "pwr_level.h"
#include "Graphics/icons.h"
#include "display.h"
#include "pwm.h"
#include "battery.h"
#include "keys.h"
#include "System/system.h"
extern uint8_t OverVolts_Flag,catch_up_flag; // global OverVoltsFlag
extern ADC_t adc;
extern MODE_REC_t mode_Array[MODE_MAX_NUM];
extern uint8_t Cur_Mode, Old_Mode;
extern uint8_t Port_State[];
extern uint32_t what_val1, what_val2;
uint8_t Over_Voltage_Flag;
uint8_t Over_Current_Flag;
uint8_t Hardware_Error_Flag;
uint8_t Taps_Flag, psu_failed;
uint8_t Diag_Flag,LD_Flag;
extern uint8_t init_flag,step_count;
extern uint8_t Task,Tx_Time_Out_Flag, Test_Mode,Ports_Cleared_Flag;
extern uint8_t Power_Level;
extern uint8_t old_freq, frequency, frq_chg_tmr;
extern uint8_t Bat_Type,Bcast_Pwr_Level;
extern uint16_t Port_timer, Taps_adjust_timer;
extern uint8_t Port_changed_flag,i;
extern uint8_t Safety_Select,Suspend_Step_Chk;
uint8_t Safe_Mode, Init_Done;
extern uint16_t Estop_timer,Sys_Chk_tmr,Pot_Value[],Vchktmr,Key_Lock_Out_tmr;
extern uint8_t Dds_Pot_Val[]; // 2 byte Data for SPI
float32_t Max_Power_Limit;
extern uint32_t TX_TIME[];
extern uint32_t Sys_Timer,Tx_timer;
extern float32_t last_Ohms;
extern uint16_t PSU_Check_tmr,Power_tmr;
void Init_vars()
{
Taps_adjust_timer = DELAY_ONE_SECOND;
Task = PRIMARY_TASK;
// Task = MENU_TASK;
Power_Level = 0;
Bcast_Pwr_Level = 0;
frequency = 5;
old_freq = frequency;
Tx_Time_Out_Flag = DISABLED; // Disable time outs for now (temporary)
// Tx_timer = TX_TIME[0]; // reload the timer
Safety_Select = false;
Over_Voltage_Flag = false;
Safe_Mode = false;
Test_Mode = false; //
char *ver = SW_VERSION;
for (int i=0; i < strlen(ver); ++i)
{
if (isalpha(ver[i]))
{
Test_Mode = true;
break;
}
}
Estop_timer = 0;
Sys_Chk_tmr = 0;
Vchktmr = 0;
Key_Lock_Out_tmr = 0;
step_count = 0;
PSU_Check_tmr = PSU_DELAY;
Max_Power_Limit = 5.0; // default until battery type determined.
last_Ohms = 1;
Taps_Flag = false;
catch_up_flag= false;
Ports_Cleared_Flag = false;
psu_failed = false;
Init_Done = false;
Suspend_Step_Chk = false;
Diag_Flag = false; // default for now should be read from EEPROM
LD_Flag = false;
Power_tmr = 0;
}
void Init_peripherals(void)
{
timer_init();
SPI_Init();
LCD_Init();
}
void Init_sys(void)
{
FREQ_Init();
Init_PSU_Pot(); // initialize pot.
Init_Ports(); // Ensure Ports are set to safe mode
MENU_Init();
}
void Init_Ports() // Ensure all ports are set to safe when powering up
{
// [Not BYPASSED,PSU OFF, ALL AMPS SWITCHED OFF, BACKLIGHT ON.]
Select_Estop(ON);
Port_State[TOP_SR] = 0x00; //
Port_State[MID_SR] = 0x00; // U12
Port_State[BOTTOM_SR] = 0x24; // U13 AMP_AB = ON, BKLITE = on PWR SW's off, AMP PSU OFF
SPI0_SendBytes(Port_State, 3, EXPANDER);
Delay_Ticks(2); // execute short delay
}
void Clear_Flags()
{
OverVolts_Flag = false;
}
void Init_Output(void)
{
if(adc.V_CHK < EXCEDED) // Read external voltage disable if present
{
// Read_Tx_Ports(); // check for what's connected is controlled from timer interrupt
Init_Mode(); // default induction mode
Update_Min_Frequency(); // determine frequency to be applied from last or if clamp or broadcast mode
Init_Amplitude(); // set amplitude to minimum
// Measure_Ohms(); // Done calculate Ohms
// Check_Taps(); // Done determine optimum taps etc
} //
else
Estop_Mode(); //
}
void Init_Mode()
{
uint8_t i;
// initialize until E2PROM fitted
for(i = 0; i <= MODE_MAX_NUM; i++ )
{
mode_Array[i].Selected = true;
mode_Array[i].Plugged = true;
}
mode_Array[BROADCAST].Selected = true; //default BCAST always available
mode_Array[BROADCAST].Plugged = BROADCAST;
mode_Array[PORT1_A].Plugged = ID_TX_SINGLE_DIRECT;
mode_Array[PORT1_B].Plugged = EMPTY;
mode_Array[PORT2_A].Plugged = ID_TX_DUAL_DIRECT;
mode_Array[PORT2_B].Plugged = ID_TX_DUAL_DIRECT;
mode_Array[PORT2_A].Selected = false;
mode_Array[PORT2_B].Selected = false;
Cur_Mode = BROADCAST;
Old_Mode = Cur_Mode;
Read_Tx_Ports(); // now scan external ports
}
void Init_Amplitude(void) // set amplitude to minimum
{
// if(Cur_Mode != BROADCAST)
// {
Dds_Pot_Val[0] = 0; // address
Dds_Pot_Val[1] = Pot_Value[INIT_PWR_LEVEL]; // data
SPI0_SendBytes(Dds_Pot_Val, 2, AMPLITUDE);
// }
}
void Init_PWM_CLKS(void)
{
if(freqArray[frequency].bc_Mask == MASK_144)
Init_Int_Clk();
else
Init_Ext_Clk();
}
void Init_Ext_Clk(void)
{
Port_State[TOP_SR] &= CLK_MASK_BITS;
Port_State[TOP_SR] |= freqArray[frequency].bc_Mask;
SPI0_SendBytes(Port_State, 3, EXPANDER);
}
void Init_Int_Clk(void)
{
}
void Init_PSU_Pot(void) // Set PSU_POT half way approx 23V
{
Port_State[TOP_SR] = 0x0; //TODO Ensure PSU DISABLED
Port_State[MID_SR] = 0x00; //Port_State[MID_SR] | 0x04;
Port_State[BOTTOM_SR] = 0x24;
SPI0_SendBytes(Port_State, 3, EXPANDER);
Set_PSU_Voltage(MAX_AB_PSU); //MID_POINT_PSU 18,24,27,30,36, 55
Delay_Ticks(2);
Port_State[TOP_SR] = 0x0; //TODO ENABLE PSU
Port_State[MID_SR] = 0x00;//Port_State[MID_SR] & 0xfb;
Port_State[BOTTOM_SR] = 0x24;
SPI0_SendBytes(Port_State, 3, EXPANDER);
}
void Normal_Init(void)
{
Power_ON_OFF(ON); // Enable_Psu(); Ensure Power supply stays switched on.
Select_Estop(ON); // Ensure output is ISOLATED from connections
Init_vars();
// Init_peripherals(); 2/9/24
// Init_sys(); 2/9/24
BL_ReadInfo();
EE_LoadData(); //Read saved data
Display_Splash(); //Display splash screen
Delay_Ticks(200); // execute short delay
KEY_Init(); //Init keys after splash delay to prevent POWER short press on startup
// USB_Init();
// Read_Tx_Ports(); // Read output ports and determine what is connected
// Select_Amplifier(); // Select correct amplifier according to frequency
Init_Mode(); //
//init_PWM();
// PWM_Setup(32768, BC_Duty_Cycle);//freqArray[frequency].frequency1
// PWM_Setup(29430, BC_Duty_Cycle);
PWM_Setup(15890, 0); // switches off PWM
Safety_Check(); // Check all voltages are safe to continue in DC.
Check_Bat_Id(); // Check for Alkaline or Lithium and battery insertion error.
what_val1=0;
what_val2=0;
Cur_Mode = PORT2_A;
init_flag = 0;
for( i=0; i < 15; i++);
{
Delay_Ticks(10);
// ADC_Update();
Read_Tx_Ports(); // check for whats plugged in at the ports every 100mS.
}
if ((adc.V_ID2 > 3.0) && (adc.V_ID1 > 3.0))
{
Cur_Mode = BROADCAST;
Port_changed_flag= 1;
init_flag = 1;
}
Disconnect(2);
Delay_Ticks(30);
Check_For_Clamp_On_Pwr_Up();
Select_Output_Port();
Safety_Check(); // Second time J.I.C Check all voltages are safe to continue in DC.
Normal_Bypass_Chk();
old_freq = DUMMY_FRQ; //force a frequency on initialization
frq_chg_tmr = 0;
Update_Frequency();
// Select_Bypass(OFF);
Select_Estop(OFF); // Ensure output is ISOLATED from connections
Init_Amplitude();
}
void Init_Pwr_Level_One(void)
{
if(!Init_Done)
{
Delay_Ticks(10); // Wait for Current to catch up
inc_pwr(); // Set power level to 1
Init_Done = true;
}
}
void Init_LD_Sync(void)
{
Update_Frequency();
}

29
source/init.h Normal file
View File

@@ -0,0 +1,29 @@
/*
* init.h
*
* Created on: May 20, 2022
* Author: Keith.Lloyd
*/
#ifndef INIT_H_
#define INIT_H_
#define MID_POINT_PSU 128 // 25V
#define INIT_PWR_LEVEL 0
void Clear_Flags(void);
void Init_Output(void);
void Init_Amplitude(void); // set amplitude to minimum
void Init_PWM_CLKS(void); // select internal or Ext clocks
void Init_Mode(void);
void Init_PSU_Pot(void); // Set PSU_POT half way approx 23V
void Init_vars(void);
void Init_Ports(void);
void Init_peripherals(void);
void Init_sys(void);
void Init_Ext_Clk(void);
void Init_Int_Clk(void);
void Normal_Init(void);
void Init_Pwr_Level_One(void);
void Init_LD_Sync(void);
#endif /* INIT_H_ */

349
source/keys.c Normal file
View File

@@ -0,0 +1,349 @@
/*
* keys.c
*
* Created on: Mar 7, 2022
* Author: Brian.Bailey
*/
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include<arm_math.h>
#include <stdint.h>
#include "fsl_common.h"
#include "fsl_gpio.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "keys.h"
#include "timer.h"
/*******************************************************************************
* Definitions
******************************************************************************/
//KEY GPIO DEFINITIONS
/*
#define KEY0_PORT 1 // 208002
#define KEY1_PORT 1
#define KEY2_PORT 0
#define KEY3_PORT 0
#define KEY4_PORT 0
#define KEY5_PORT 0
*/
#define KEY0_PORT 1 // 208004
#define KEY1_PORT 0
#define KEY2_PORT 0
#define KEY3_PORT 0
#define KEY4_PORT 0
#define KEY5_PORT 0
/* //208002
#define KEY0_PIN 15 //Power On/Off key //on off
#define KEY1_PIN 5 //MODE key //SFTKY0
#define KEY2_PIN 2 //UP key //SFTKY1
#define KEY3_PIN 3 //DOWN key //SFTKY2
#define KEY4_PIN 8 //FREQUENCY key //SFTKY3
#define KEY5_PIN 9 //Menu key //SFTKY4
*/
// 208004
#define KEY0_PIN 15 //Power On/Off key //on off 208004
#define KEY1_PIN 14 //MODE key //SFTKY0
#define KEY2_PIN 2 //UP key //SFTKY1
#define KEY3_PIN 3 //DOWN key //SFTKY2
#define KEY4_PIN 24 //FREQUENCY key //SFTKY3
#define KEY5_PIN 25 //Menu key //SFTKY4
#define KEY_UP_PIN KEY2_PIN //UP key
#define KEY_DOWN_PIN KEY3_PIN //DOWN key
#define KEY_FREQ_PIN KEY4_PIN //FREQ key
/*******************************************************************************
* Variables
******************************************************************************/
//Move this to header file later
typedef struct
{
uint32_t gpioPin; //Key gpio pin within the port
uint32_t gpioPort; // Key GPIO Port
uint32_t tickCount; //number of consecutive ticks key held ON
uint32_t currentState; //Key on/off for current tick
uint32_t lastState; //key on/off last tick
uint32_t longPressDetected; //Long press
uint32_t shortPressDetected; //short press
} KEY_DATA_t;
KEY_DATA_t keyData[KEY_NUM];
uint32_t key_bits;
extern uint32_t TX_TIME[];
extern uint32_t Tx_timer;
extern TIMER_t tmr;
//TESTING
static uint32_t keyPressCount = 0;
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
static void InitKeyData(void);
/*******************************************************************************
* Static Functions
******************************************************************************/
//Assign port and pin to each key
static void InitKeyData(void)
{
//Init keys as digital inputs, no interrupts
//Set keyData[] gpioPins
keyData[0].gpioPin = KEY0_PIN; // ON_POLL
keyData[1].gpioPin = KEY1_PIN; // SFTKY0
keyData[2].gpioPin = KEY2_PIN; // SFTKY1
keyData[3].gpioPin = KEY3_PIN; // SFTKY2
keyData[4].gpioPin = KEY4_PIN; // SFTKY3
keyData[5].gpioPin = KEY5_PIN; // SFTKY4
//Set keyData[] gpioPorts
keyData[0].gpioPort = KEY0_PORT;
keyData[1].gpioPort = KEY1_PORT;
keyData[2].gpioPort = KEY2_PORT;
keyData[3].gpioPort = KEY3_PORT;
keyData[4].gpioPort = KEY4_PORT;
keyData[5].gpioPort = KEY5_PORT;
}
/*******************************************************************************
* Public Functions
******************************************************************************/
void KEY_Init(void)
{
InitKeyData();
KEY_ClearKeyPresses();
KEY_ClearAll();
}
//reset all key states and timer values
void KEY_ClearAll(void)
{
for (uint32_t i = 0; i < KEY_NUM; i++)
{
keyData[i].lastState = 0;
keyData[i].tickCount = 0;
}
}
//Clear key presses
void KEY_ClearKeyPresses(void)
{
key_bits = 0;
// key_bits &= !KEY_ALL;
}
//waits for key press returns key and clears previous keys
uint32_t KEY_WaitForKeyPress(uint32_t keyMask)
{
while(!(key_bits & keyMask));
uint32_t tempKeys = key_bits;
KEY_ClearKeyPresses();
return tempKeys;
}
/* returns 1 if a key press event is present, 0 otherwise
*
*/
bool KEY_IsKeyPressed(uint32_t keyMask)
{
return (key_bits & keyMask);
}
//return the key press event bits
uint32_t KEY_GetPressed(void)
{
uint32_t tempKeys = key_bits;
KEY_ClearKeyPresses();
return tempKeys;
}
uint8_t KEY_GetModeKeyHeld(void)
{
return !GPIO_PinRead(GPIO, keyData[1].gpioPort, keyData[1].gpioPin);
}
//Get current state of UP key
uint8_t KEY_GetUpKeyHeld(void)
{
return !GPIO_PinRead(GPIO, keyData[2].gpioPort, keyData[2].gpioPin);
}
//Get current state of DOWN key
uint8_t KEY_GetDownKeyHeld(void)
{
return !GPIO_PinRead(GPIO, keyData[3].gpioPort, keyData[3].gpioPin);
}
//Get current state of FREQUENCY key
uint8_t KEY_GetFrequencyKeyHeld(void)
{
return !GPIO_PinRead(GPIO, keyData[4].gpioPort, keyData[4].gpioPin);
}
//Get current state of DOWN key
uint8_t KEY_GetPowerKeyHeld(void)
{
return !GPIO_PinRead(GPIO, keyData[0].gpioPort, keyData[0].gpioPin);
}
#if 0
//Called from gui task
void KEY_Locate(void)
{
static uint8_t upKeyHeld = false;
static uint8_t downKeyHeld = false;
//Increase gain repeatedly if UP key held
#if 0
if(KEY_IsKeyPressed(KEY_UP | (KEY_UP << KEY_LONG_PRESS))) //UP key short or long press
{
upKeyHeld = true;
}
#endif
if(upKeyHeld)
{
if(!GPIO_PinRead(KEY_GPIO, KEY_UP_PIN)) //read the port to see if key held
{
GAIN_IncreaseGain();
}
else
{
upKeyHeld = false;
}
}
//Decrease gain repeatedly if DOWN key held
#if 0
if(KEY_IsKeyPressed(KEY_UP | (KEY_UP << KEY_LONG_PRESS))) //UP key short or long press
{
downKeyHeld = true;
}
#endif
if(downKeyHeld)
{
if(!GPIO_PinRead(KEY_GPIO, KEY_DOWN_PIN)) //read DOWN key
{
GAIN_DecreaseGain();
}
else
{
downKeyHeld = false;
}
}
uint32_t pressed = KEY_GetPressed();
switch (pressed)
//This won't work if multiple keys pressed, but it'll clear them
{
case KEY_VOLUME:
AUDIO_ChangeVolume();
break;
case KEY_MODE:
//Change Mode / Screen
break;
case KEY_UP:
GAIN_IncreaseGain();
break;
case (KEY_UP << KEY_LONG_PRESS):
upKeyHeld = true; //key held down, setup for repeated gain increases
break;
case KEY_DOWN:
GAIN_DecreaseGain();
break;
case (KEY_DOWN << KEY_LONG_PRESS):
downKeyHeld = true; //key held down, setup for repeated gain decreases
break;
case KEY_FREQ:
FREQ_ChangeFrequency();
break;
case KEY_POWER:
//Shut down
break;
case KEY_TX_CTL:
//TX Control
break;
case KEY_FA:
//Frequency Analysis
break;
case KEY_MENU:
KEY_ClearAll(); //clear all key data so it's clean for the menu
xSemaphoreGive(xSem_RunMenu); //Run the menu
xSemaphoreTake(xSem_ExitMenu, portMAX_DELAY); //Block gui task until menu done
break;
}
KEY_ClearKeyPresses();
}
#endif
//Processing for key presses
//Key# corresponds to i
//This is called at intervals of KEY_TIMER_PERIOD_MS
void KEY_Update(void)
{
for (uint32_t i = 0; i < KEY_NUM; i++)
{
//if Key is pressed
//GPIO_PinRead(GPIO_Type *base, uint32_t port, uint32_t pin)
if (!GPIO_PinRead(GPIO, keyData[i].gpioPort, keyData[i].gpioPin))
{
keyData[i].currentState = 1;
keyData[i].tickCount++;
if (keyData[i].tickCount == KEY_LONG_PRESS_TICKS)
{
//Long press detected
key_bits |= ((1 << i) << KEY_LONG_PRESS);//set long press event
//Don't reset tickCount. Continue tick accumulation. when key released it won't do anything
}
Tx_timer = TX_TIME[tmr.autoShutdown]; // reload the timer
}
else //Key is NOT pressed
{
//If key was pressed last time, check for valid keypress
if (keyData[i].lastState)
{
if (keyData[i].tickCount >= KEY_SHORT_PRESS_MIN_TICKS
&& keyData[i].tickCount <= KEY_SHORT_PRESS_MAX_TICKS)
{
//Short press detected
key_bits |= ((1 << i) << KEY_SHORT_PRESS);//set short press event
}
keyData[i].tickCount = 0; //reset tick count
}
}
}
//Update lastState
for (uint32_t i = 0; i < KEY_NUM; i++)
{
keyData[i].lastState = keyData[i].currentState;
}
}

87
source/keys.h Normal file
View File

@@ -0,0 +1,87 @@
/*
* keys.h
*
* Created on: Mar 7, 2022
* Author: Brian.Bailey
*/
#ifndef KEYS_H_
#define KEYS_H_
#include <stdint.h>
#include <stdbool.h>
#define KEY_NUM 6 //number of keys
/* Key event_bits structure
* bits 0 - 5 are KEY0 - 5 long presses
* bits 6 - 11 are KEY0 - 5 long presses
* KEY_SHORT_PRESS is 0 and KEY_LONG_PRESS is 6
* Accessing key data:
* KEY3 short press would be KEY3 or (KEY3 << SHORT_PRESS)
* KEY4 long press bit would be (KEY4 << KEY_LONG_PRESS)
*/
#define KEY0 (1 << 0)
#define KEY1 (1 << 1)
#define KEY2 (1 << 2)
#define KEY3 (1 << 3)
#define KEY4 (1 << 4)
#define KEY5 (1 << 5)
#define KEY_SHORT_PRESS 0
#define KEY_LONG_PRESS 6
#define KEY_ALL 0xfff //All short and long keypresses
#define KEY_TIMER_PERIOD_MS 10 //pdMS_TO_TICKS(25) //25mS
//Key Press Parameters
#define KEY_SHORT_PRESS_MIN_TICKS 5 //50mS
#define KEY_SHORT_PRESS_MAX_TICKS 49 //490mS
#define KEY_LONG_PRESS_TICKS 50 //500mS
//Key Aliases
//Short Press Functions
#define KEY_VOLUME KEY0 //Change Volume
#define KEY_MODE KEY1 //Change Mode //Cancel / Back in menu
#define KEY_UP KEY2 //Increase Gain //Up in menu
#define KEY_DOWN KEY3 //Decrease Gain //Down in menu
#define KEY_FREQ KEY4 //Change Frequency //Enter / Select in menu
#define KEY_MENU KEY5 //Menu
#if 1//Long Press Functions
#define KEY_POWER (KEY0 << KEY_LONG_PRESS) //Power ON/OFF
#endif
//Menu Press Functions
#define KEY_BACK KEY1 //Cancel / Back in menu
#define KEY_UP KEY2 //Up in menu
#define KEY_DOWN KEY3 //Down in menu
#define KEY_SEL KEY4 //Enter / Select in menu
#define KEY_ENTER KEY4 //Enter / Select in menu
//Keith Translations
#define ON_OFF_KEY KEY0
#define FRQ_KEY KEY4
#define PWR_UP_KEY KEY2
#define PWR_DN_KEY KEY3
#define MODE_KEY KEY1
#define MENU_KEY KEY5
void KEY_Init(void);
void KEY_ClearAll(void);
void KEY_ClearKeyPresses(void);
uint32_t KEY_WaitForKeyPress(uint32_t keyMask);
bool KEY_IsKeyPressed(uint32_t keyMask);
uint32_t KEY_GetPressed(void);
uint8_t KEY_GetModeKeyHeld(void);
uint8_t KEY_GetUpKeyHeld(void);
uint8_t KEY_GetDownKeyHeld(void);
uint8_t KEY_GetFrequencyKeyHeld(void);
uint8_t KEY_GetPowerKeyHeld(void);
void KEY_Locate(void);
void KEY_Update(void);
#endif /* KEYS_H_ */

374
source/lcd.c Normal file
View File

@@ -0,0 +1,374 @@
/*
* lcd.c
*
* Created on: May 27, 2022
* Author: Keith.Lloyd
*/
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <arm_math.h>
#include "fsl_gpio.h"
#include "spi.h"
#include "lcd.h"
#include "display.h"
#include "timer.h"
#include "mode.h"
#include "Graphics/graphicsLibrary.h"
#include "Fonts/fontLibrary.h"
#include "Graphics/testIconsMono.h"
#include "Graphics/icons.h"
#include "adc.h"
#include "main.h"
#include "ports.h"
#include "utils.h"
//Overview:
// LCD control / data line normally stays in the data state.
// Any function that changes to control MUST change the line back to data before exiting
/*******************************************************************************
* Definitions
******************************************************************************/
//Backlight GPIO
#define LCD_BL_PORT 2 //ToDo: Update this for LPC
#define LCD_BL_GPIO_PIN 30 //ToDo: Update this for LPC
//#define LCD_CD_PORT 0 //ToDo: Update this for LPC Port0 || Port1 208002
//#define LCD_CD_GPIO_PIN 6 //ToDo: Update this for LPC Bit position 208002
#define LCD_CD_PORT 1 //ToDo: Update this for LPC Port0 || Port1 208004
#define LCD_CD_GPIO_PIN 8 //ToDo: Update this for LPC Bit position 208004
/*******************************************************************************
* Variables
******************************************************************************/
// Frame buffer
//uint16_t mFrameBuffer[LCD_HEIGHT_PIXELS][LCD_WIDTH_PIXELS/16]; //y,x
//uint8_t mFrameBuffer[LCD_WIDTH_PIXELS][LCD_HEIGHT_PIXELS / 8]; //x,y
uint8_t mFrameBuffer[LCD_HEIGHT_PIXELS/8][LCD_WIDTH_PIXELS]; //x,y
extern uint8_t Power_Level, Over_Voltage_Flag, Task,Error;
extern uint8_t tempString[];
extern uint8_t frequency, Cur_Mode, Safe_Mode;
extern ADC_t adc;
extern uint8_t Dds_Pot_Val[];
extern uint8_t Port_State[];
extern uint8_t Diag_Flag;
extern uint16_t Display_warning_tmr;
/*******************************************************************************
* Static Function Declarations
******************************************************************************/
static void SetBacklightPower(uint8_t state);
static void SetCommandDataLine(LCD_CDLINE_t state);
static void SendLcdCommand(uint8_t command, uint8_t data);
/*******************************************************************************
* Static Functions
******************************************************************************/
//Set Backlight GPIO to 'state'
static void SetBacklightPower(uint8_t state)
{
//ToDo This function Note backlight is now on Serial expander
GPIO_PinWrite(GPIO, LCD_BL_PORT, LCD_BL_GPIO_PIN, state);
}
//Set CD line GPIO high for LCD_CDLINE_DATA or low for LCD_CDLINE_CONTROL
static void SetCommandDataLine(LCD_CDLINE_t state)
{
//ToDo This function Done !!
GPIO_PinWrite(GPIO, LCD_CD_PORT, LCD_CD_GPIO_PIN, state);
}
//command is the #defined command
//data is optional arguments > zero if not used!
static void SendLcdCommand(uint8_t command, uint8_t data)
{
SetCommandDataLine(LCD_CDLINE_CONTROL);
uint8_t sendData = command | data;
SPI3_SendBytes(&sendData, 1); //send one byte via SPI
SetCommandDataLine(LCD_CDLINE_DATA);
}
//dedicated function for setting LCD gain and pot values
static void SetGainAndPot(uint8_t data)
{
SetCommandDataLine(LCD_CDLINE_CONTROL);
uint8_t sendData[2];
sendData[0] = LCD_SET_GAIN_AND_POT;
sendData[1] = data;
SPI3_SendBytes(&sendData[0], 2); //send one byte via SPI
SetCommandDataLine(LCD_CDLINE_DATA);
}
static void TestLCD(void)
{
//Alternate setting all pixels black, then white
while(1)
{
SendLcdCommand(LCD_SET_ALL_PIXELS, 1);
uint32_t delay = 50000000;
while(delay--);
SendLcdCommand(LCD_SET_ALL_PIXELS, 0);
delay = 50000000;
while(delay--);
// Delay_Ticks(500);
}
}
static void TestLCD2(void)
{
while(1)
{
//Draw vertical stripes in frameBuffer and output to LCD
for(uint32_t y = 0; y < LCD_HEIGHT_PIXELS; y++)
{
for(uint32_t x = 0; x < LCD_WIDTH_PIXELS / 16; x++)
{
mFrameBuffer[y][x] = 0xF0;
}
}
LCD_Update();
uint32_t delay = 50000000;
while(delay--);
//Draw horizontal striped in frameBuffer and output to LCD
for(uint32_t y = 0; y < LCD_HEIGHT_PIXELS; y++)
{
for(uint32_t x = 0; x < LCD_WIDTH_PIXELS / 16; x++)
{
if(y % 1 == 0) //every other row
{
mFrameBuffer[y][x] = 0xF0;
}
}
}
LCD_Update();
delay = 50000000;
while(delay--);
}
}
void LCD_Init(void)
{
SendLcdCommand(0, 0); // SET COLUMN LSB
SendLcdCommand(0b00010000, 0); // SET COLUMN MSB
SendLcdCommand(0b01000000, 0); // SET START LINE
SendLcdCommand(0b00100100, 0); // SET MUX & TEMP. COMPENSATION
SendLcdCommand(0b00101101, 0); // SET POWER CONTROL
SendLcdCommand(0b10000001, 0); // SET GAIN & POTENTIOMETER
SendLcdCommand(0b10000000, 0); // SET GAIN & POTENTIOMETER (second part)
SendLcdCommand(0b10001001, 0); // RAM CONTROL
SendLcdCommand(0b10100100, 0); // ALL PIX OFF
SendLcdCommand(0b10100100, 0); // ALL PIX OFF
SendLcdCommand(0b10101111, 0); // SLEEP MODE OFF
SendLcdCommand(0b11001000, 0); // MY=1 MX=0 MSF=0
// SendLcdCommand(0b11101010, 0); // BIAS=12 D1,D0 = BR[1:0]
SendLcdCommand(0b11101010, 0); // BIAS=12 D1,D0
SendLcdCommand(0b10010000, 0); // fixed line
}
void Display_Update(void)
{
LCD_Clear(); //clear the frameBuffer
Display_USB_Status();
if((!Check_For_Clamp_New()) && Display_warning_tmr == 0)
Display_Over_Voltage_Status();
Display_Tx_Status();
//Display_OnScreen_Diagnostics(); // temporary for debug
#if 0 //info
if(Diag_Flag)
Display_OnScreen_Diagnostics();
#endif
LCD_Update();
}
void LCD_PowerOff(void)
{
//TODO: UC1608 Power down requirements: (see datasheet page 33)
//Reset command
//Wait 2mS
//Turn off VDD
}
/* Output frameBuffer data to LCD
*
*/
void LCD_Update(void)
{
SendLcdCommand(LCD_SET_COLUMN_LSB, 0);
SendLcdCommand(LCD_SET_COLUMN_MSB, 0);
SendLcdCommand(LCD_SET_PAGE_ADDRESS, 0);
//output framebuffer data via SPI
SPI3_SendBytes((uint8_t *)mFrameBuffer, sizeof(mFrameBuffer));
}
//Clear mFrameBuffer
void LCD_Clear(void)
{
//Clear Screen
memset(mFrameBuffer, 0, sizeof(mFrameBuffer));
}
//Write a pixel to the framebuffer in the specified location
void LCD_DrawPixel(int16_t x, int16_t y, LCD_DRAWMODE_t mode)
{
//ignore if outside LCD area
if(x < 0 || x > LCD_X_MAX)
return;
if(y < 0 || y > LCD_Y_MAX)
return;
//Flip LCD 180*
x = LCD_X_MAX - x;
y = LCD_Y_MAX - y;
//8-bit data in frameBuffer to read > modify > write
uint16_t page = y / LCD_Y_BITS_PER_PAGE;
uint8_t bitPosition = y%8;
uint8_t bitMask = 1 << bitPosition;
//Draw the pixel
switch(mode)
{
case LCD_DRAW_SET:
mFrameBuffer[page][x] |= bitMask;
break;
case LCD_DRAW_CLEAR:
mFrameBuffer[page][x] &= bitMask;
break;
case LCD_DRAW_XOR:
mFrameBuffer[page][x] ^= bitMask;
break;
}
}
//get a pixel from the framebuffer at the specified location
//returns 1 if pixel set, 0 otherwise
uint8_t LCD_GetPixel(int16_t x, int16_t y)
{
//Flip LCD 180*
x = LCD_X_MAX - x;
y = LCD_Y_MAX - y;
uint16_t page = y / LCD_Y_BITS_PER_PAGE;
uint8_t bitPosition = y%8;
uint8_t bitMask = 1 << bitPosition;
uint8_t byte = mFrameBuffer[page][x];
return (byte >> bitPosition) & 0x01; // right shift the bit of interest to the ones position, then mask
}
#if 0 //UC1608
/****************************************************************************/
/*** uc1608 ***/
/****************************************************************************/
/**
* uc1608_send send chunk over SPI
* @param spi config
* @param command or data array ptr
* @param size of command or data to send
* @param command or data mode
* @param io pin for data/cmd mode
* @author Matthieu Barreteau
* @date 04/26/2014
*/
int uc1608_send(struct spi_config *config,unsigned char *data, int len,uint8_t mode,uint8_t cmdPin)
{
delayMicroseconds(10);
if(mode == UC1608_DATA) {
GPIO_SET = 1<<cmdPin; // ToDo
} else {
GPIO_CLR = 1<<cmdPin; //ToDo
}
delayMicroseconds(75);
if(spi_write_data(config, data, len) == -1) {
fprintf (stderr, "Unable to send over SPI : %s\n", strerror (errno)) ;
return -1;
}
return 0;
}
/**
* uc1608_setup screen setup
* @param spi config
* @param io pin for data/cmd mode
* @author Matthieu Barreteau
* @date 04/26/2014
*/
void uc1608_setup(struct spi_config *config,uint8_t cmdPin)
{
unsigned char cmdToSend[14];
cmdToSend[0] = 0b11100010; // SYSTEM RESET
uc1608_send(config, cmdToSend, 1, UC1608_CMD, cmdPin) ;
delay(300);
cmdToSend[0] = 0b00000000; // SET COLUMN LSB
cmdToSend[1] = 0b00010000; // SET COLUMN MSB
cmdToSend[2] = 0b01000000; // SET START LINE
cmdToSend[3] = 0b00100100; // SET MUX & TEMP. COMPENSATION
cmdToSend[4] = 0b00101101; // SET POWER CONTROL
cmdToSend[5] = 0b10000001; // SET GAIN & POTENTIOMETER
cmdToSend[6] = 0b10000000; // SET GAIN & POTENTIOMETER (second part)
cmdToSend[7] = 0b10001001; // RAM CONTROL
cmdToSend[8] = 0b10100100; // ALL PIX OFF
cmdToSend[9] = 0b10100100; // ALL PIX OFF
cmdToSend[10] = 0b10101111; // SLEEP MODE OFF
cmdToSend[11] = 0b11001100; // MY=1 MX=1 MSF=0
cmdToSend[12] = 0b11101010; // BIAS=12
cmdToSend[13] = 0b10010000; // fixed line
uc1608_send(config, cmdToSend, 14, UC1608_CMD, cmdPin) ;
}
/* EOF */
#endif

76
source/lcd.h Normal file
View File

@@ -0,0 +1,76 @@
/*
* lcd.h
*
* Created on: May 27, 2022
* Author: Keith.Lloyd
*/
#ifndef LCD_H_
#define LCD_H_
#define LCD_WIDTH_PIXELS 240
#define LCD_HEIGHT_PIXELS 128
#define LCD_X_CENTER 120
#define LCD_Y CENTER 64
#define LCD_X_MAX 239
#define LCD_Y_MAX 127
#define LCD_X_MID 120
#define LCD_Y_MID 64
#define LCD_X_MIN 0
#define LCD_Y_MIN 0
#define LCD_Y_BITS_PER_PAGE 8 //8 bits per page in Y direction (for draw and get pixel)
//UC1608 defines: These all require CONTROL MODE
//Some commands have the last few bits as arguments. These can be set with SendLcdCommand()
#define LCD_SET_COLUMN_LSB 0x00 // last 4 bits are data
#define LCD_SET_COLUMN_MSB 0x10 // last 4 bits are data
#define LCD_SET_MUX_AND_TC 0x24 // ## 21 last 2 bits are Temperature compensation curve
#define LCD_SET_POWER_CONTROL 0x28 // last 3 bits are data ## 2D
#define LCD_SET_START_LINE 0x40 // last 6 bits are data
#define LCD_SET_GAIN_AND_POT 0x81 // DOUBLE BYTE COMMAND! Send this, then 8 data bits
#define LCD_SET_RAM_ADDRESS_CTRL 0x88 //## 89 ? Last 3 bits are the control
#define LCD_SET_ALL_PIXELS 0xA4 //# Actually off A5 = On Set all pixels - last bit is on/off
#define LCD_SYSTEM_RESET 0xE2 // # must delay min 15mS after use
#define LCD_SET_DISPLAY_ENABLE 0xAE // # last bit is arg (on/off)
#define LCD_SET_BIAS_RATIO 0xE8 // last 2 bits are data
#define LCD_SET_PAGE_ADDRESS 0xB0 //last 4 bits are data
typedef enum {
LCD_DRAW_SET,
LCD_DRAW_CLEAR,
LCD_DRAW_XOR
}LCD_DRAWMODE_t;
//UM1608 Data / Control line
typedef enum {
LCD_CDLINE_CONTROL = 0,
LCD_CDLINE_DATA = 1
}LCD_CDLINE_t;
void LCD_Init(void);
void Display_Update(void);
void LCD_Update(void);
void LCD_Clear(void);
void LCD_DrawPixel(int16_t x, int16_t y, LCD_DRAWMODE_t mode);
uint8_t LCD_GetPixel(int16_t x0, int16_t y0);
#if 0 //UC1608
#define UC1608_DATA 1
#define UC1608_CMD 0
int uc1608_send(struct spi_config *config,unsigned char *data, int len,uint8_t mode,uint8_t cmdPin);
void uc1608_setup(struct spi_config *config,uint8_t cmdPin);
#endif
#endif /* LCD_H_ */

69
source/m95512.c Normal file
View File

@@ -0,0 +1,69 @@
/*
* m95512.c
*
* Created on: Nov 1, 2023
* Author: Warner
*/
#include "m95512.h"
#include "fsl_spi.h"
#include "spi.h"
#include "timer.h"
#define M95512_BUFFER_SIZE (8)
extern uint8_t Port_State[];
extern spi_transfer_t SPI0_xfer;
/* BB 11/10/23
* m95512.c functions should ONLY be used by eeprom.c functions!
* This is because the CTIMER0 interrupt corrupts EEPROM data
* eeprom.c functions stop CTIMER0 while accessing the EEPROM
*/
status_t M95512_WriteEnable(void){
status_t reslut; //not used, because function SPI0_SendBytes() has no return.
uint8_t srcBuff[M95512_BUFFER_SIZE];
srcBuff[0] = WRITE_ENABLE;
SPI0_SendBytes(srcBuff, 1, E2PROM);
return reslut;
}
status_t M95512_WriteDisable(void){
status_t reslut;
uint8_t srcBuff[M95512_BUFFER_SIZE];
srcBuff[0] = WRITE_DISABLE;
SPI0_SendBytes(srcBuff, 1, E2PROM);
return reslut;
}
status_t M95512_ReadStatus(uint8_t *pdata){
status_t reslut;
uint8_t srcBuff[M95512_BUFFER_SIZE];
uint8_t destBuff[M95512_BUFFER_SIZE];
srcBuff[0] = READ_STATUS_REG;
SPI0_SendBytes(srcBuff, 2, E2PROM);
*pdata = SPI0_xfer.rxData[1];
return reslut;
}
status_t M95512_WriteStatus(uint8_t *pdata){
status_t reslut;
uint8_t srcBuff[M95512_BUFFER_SIZE];
srcBuff[0] = WRITE_STATUS_REG;
srcBuff[1] = *pdata;
SPI0_SendBytes(srcBuff, 2, E2PROM);
return reslut;
}

44
source/m95512.h Normal file
View File

@@ -0,0 +1,44 @@
/*
* m95512.h
*
* Created on: Nov 1, 2023
* Author: Warner
*/
#ifndef M95512_H_
#define M95512_H_
#include "board.h"
#include "LPC54114_cm4.h"
#include "pin_mux.h"
#include "spi.h"
/*******************************************************************************
* Definitions
******************************************************************************/
// #define EXAMPLE_SPI_MASTER SPI0
#define WRITE_ENABLE 0x06
#define WRITE_DISABLE 0x04
#define READ_STATUS_REG 0x05
#define WRITE_STATUS_REG 0x01
#define READ_MEM_ARRAY 0x03
#define WRITE_MEM_ARRAY 0x02
//Status register bits
#define EE_SR_WIP 0x01
#define EE_SR_WEL 0x02
#define EE_SR_BP0 0x04
#define EE_SR_BP1 0x08
status_t M95512_WriteEnable(void);
status_t M95512_WriteDisable(void);
status_t M95512_ReadStatus(uint8_t *pdata);
status_t M95512_WriteStatus(uint8_t *pdata);
#endif /* M95512_H_ */

389
source/main.c Normal file
View File

@@ -0,0 +1,389 @@
/*
* main.c
*
* Created on: May 20, 2022
* Author: Keith.Lloyd
*/
#include "fsl_spi.h"
#include "pin_mux.h"
#include "board.h"
#include "fsl_debug_console.h"
#include "fsl_power.h"
#include <stdbool.h>
#include <stdint.h>
#include "Fonts\fontLibrary.h"
#include "Graphics\graphicsLibrary.h"
#include "spi.h"
#include "lcd.h"
#include "main.h"
#include "frq.h"
#include "pro_key.h"
#include "menu1.h"
#include "mode.h"
#include "utils.h"
#include "timer.h"
#include "over_ride.h"
#include "menu.h"
#include "sys_chk.h"
#include "amps.h"
#include "display.h"
#include "ports.h"
#include "adc.h"
#include "battery.h"
#include "mode.h"
#include "init.h"
#include "taps.h"
#include "pwm.h"
#include "safety_key.h"
#include "usbComms.h"
#include "flashUpdate.h"
#include "bootloader.h"
#include "eeprom.h"
#include "sys_chk.h"
#include "pwr_level.h"
#include "Graphics/icons.h"
#include "hwFixes.h"
//temp
#include "fsl_sctimer.h"
extern volatile uint8_t BC_Duty_Cycle;
uint8_t Task,Tx_Time_Out_Flag,i,Test_Mode;
extern uint8_t Power_Level,Over_Voltage_Flag,Safe_Mode;
extern uint8_t Port_State[];
extern uint8_t old_freq, frequency, frq_chg_tmr,Cur_Mode;
extern uint8_t Bat_Type,Bcast_Pwr_Level;
extern uint16_t Port_timer, Taps_adjust_timer,Sys_Chk_tmr,Shut_down_tmr;
extern uint8_t Port_changed_flag;
extern uint16_t Low_Bat_timer,Estop_timer;
extern uint32_t what_val1, what_val2;
extern ADC_t adc;
extern uint32_t new_freq;
uint8_t init_flag,catch_up_flag;
uint8_t Selected = false;
extern uint8_t frq_update_flag,Ports_Cleared_Flag;
extern HARDWARE_FIX_t hwf;
extern uint8_t tempString[40]; // Todo move
#define BYPASS_USB_SAFETY 0 //Use for debugging
#define DDS_PLL_TEST 0
ClampData_t clampData;
int main(void)
{
// indicate no slope calulated since slope will always be positive
clampData.slope = -1.0f;
/* attach 12 MHz clock to FLEXCOMM0 (debug console) */
CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
/* attach 12 MHz clock to SPI3 */
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM3);
/* reset FLEXCOMM for SPI */
RESET_PeripheralReset(kFC3_RST_SHIFT_RSTn);
BOARD_InitPins();
BOARD_BootClockPLL150M();
CLOCK_SetupFROClocking(96000000U); // Set up high frequency FRO output for USB
POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*Turn on USB Phy */
Power_ON_OFF(ON); // Enable_Psu(); Ensure Power supply stays switched on.
Select_Estop(ON); // Ensure output is ISOLATED from connections
Init_vars();
Init_peripherals();
HWF_Init();
Init_sys();
//###################
Check_For_Usb(); // Set everything safe if so
KEY_Init(); //Init keys after splash delay to prevent POWER short press on startup
// Display_Splash(); //Display splash screen
// Delay_Ticks(100); // execute short delay
BL_ReadInfo();
EE_LoadData(); //Read saved data
#if !BYPASS_USB_SAFETY
if(GPIO_PinRead(GPIO,1,6))
{
USB_Init();
Display_Splash(); //Display splash screen
Delay_Ticks(100); // execute short delay
}
while(GPIO_PinRead(GPIO,1,6))
{
LCD_Clear();
Display_USB(); //Display USB icon
LCD_Update();
Delay_Ticks(1); // execute short delay
safe_key(); // process primary keys as safety menu
USB_Update();
}
#endif
//###################
Display_Splash(); //Display splash screen
Delay_Ticks(100); // execute short delay
ADC_Init2();
ACCY_Init();
KEY_Init(); //Init keys after splash delay to prevent POWER short press on startup
// Read_Tx_Ports(); // Read output ports and determine what is connected
// Select_Amplifier(); // Select correct amplifier according to frequency
Init_Mode(); //
//init_PWM();
// PWM_Setup(32768, BC_Duty_Cycle);//freqArray[frequency].frequency1
// PWM_Setup(29430, BC_Duty_Cycle);
PWM_Setup(15890, 0); // switches off PWM
Delay_Ticks(100); // execute short delay
Safety_Check(); // Check all voltages are safe to continue in DC.
Check_Bat_Id(); // Check for Alkaline or Lithium and battery insertion error.
what_val1=0;
what_val2=0;
Cur_Mode = PORT2_A;
init_flag = 0;
for( i=0; i < 15; i++)
{
Delay_Ticks(10);
// ADC_Update();
// Read_Tx_Ports(); // check for whats plugged in at the ports every 100mS.
}
if ((adc.V_ID2 > 3.0) && (adc.V_ID1 > 3.0))
{
Cur_Mode = BROADCAST;
Port_changed_flag= 1;
init_flag = 1;
}
Disconnect(2);
Delay_Ticks(30);
Check_For_Clamp_On_Pwr_Up();
Select_Output_Port();
Safety_Check(); // Second time J.I.C Check all voltages are safe to continue in DC.
Normal_Bypass_Chk();
old_freq = DUMMY_FRQ; //force a frequency on initialization
frq_chg_tmr = 0;
Update_Frequency();
// Select_Bypass(OFF); // 3/14/24
Select_Estop(OFF); // Restore output.
Init_Amplitude();
USB_Init();
#if DDS_PLL_TEST
//# Insert special test code here.
uint32_t tmp;
All_Amps_Off();
// Set OBPTEN
tmp = Calc_Freq(3500090);
Load_Frq_Gen(SINGLE,tmp,0); // # update the frequency generators
//# End Test code
#endif
//#########################
// if(Read_Model_type() == LEICA) // Read Model Patches erroneous boards sent to Leica 8/2/24
// {
// sprintf(tempString, "%d", hwf.mainPcbaPN);
// if(strncmp(tempString,"208021",6) == 0) // check for HW rev.
// {
// hwf.mainPcbaPN = 208025;
// EE_WriteUINT32(EE_HWFIX_MAIN_PCBA_PN, hwf.mainPcbaPN);// Change to 208025 Assembly
// }
// }
// Leica_Patch(); // Patches erroneous boards sent to Leica 8/2/24
// Umag_Patch();
//########################
while(1)
{
static uint32_t tickCount = 0;
USB_Update(); //Update USB here so we're outside the ISR
#if !BYPASS_USB_SAFETY
//#####################
Check_For_Usb();
if(GPIO_PinRead(GPIO,1,6))
{
Task = USB_SAFE_TASK; // process primary keys as safety menu
safe_key(); // process primary keys as safety menu
LCD_Clear();
Display_USB(); //Display USB icon
LCD_Update();
}
else
if(!GPIO_PinRead(GPIO,1,6) && Ports_Cleared_Flag)
{
Normal_Init(); // USB is unplugged so reinitialize
}
//###############################
#endif
Delay_Ticks(1); //10mS delay
#if !BYPASS_USB_SAFETY
if((tickCount++ % 10 == 0) && !GPIO_PinRead(GPIO,1,6)) //every 10 ticks = 100mS AND !USB
#else
if(tickCount++ % 10 == 0) //every 10 ticks = 100mS
#endif
{
switch (Task)
{
case SAFETY_TASK:
safe_key(); // process primary keys as safety menu
break;
case USB_SAFE_TASK:
safe_key(); // process primary keys as safety menu
break;
case FATAL_ERROR_TASK:
safe_key(); // process primary keys as safety menu
break;
case PRIMARY_TASK:
pro_key(); // process primary keys front 6 first menu
break;
case MENU_TASK: // Allows user to select options
menu_key();
Task = PRIMARY_TASK;
break;
case MODE_TASK: // Selects between DC || BC
mode_menu();
Task = PRIMARY_TASK;
break;
case PWR_OFF_TASK:
Power_Down(); // Stores last settings and powers off
break;
case OVER_RIDE_TASK: // Allows user to Over ride safe settings
Over_Ride(); // schedule Over Ride Menu
KEY_ClearKeyPresses();
break;
case BAT_INSERTION_ERROR:
if(Shut_down_tmr == 0); //Display_Bat_Error();
Power_Down(); // Stores last settings and powers off
break;
case LOW_BATTERY_TASK:
if(Low_Bat_timer == 0)
Task = PWR_OFF_TASK;
break;
}
#if !DDS_PLL_TEST
if(old_freq != frequency && frq_chg_tmr == 0 && (!frq_update_flag))
{
Update_Frequency();
//Port_changed_flag = true;
}
if(Bat_Type == BAT_ERROR)
Task = BAT_INSERTION_ERROR;
if (Port_timer == 0)
Read_Tx_Ports(); // check for whats plugged in at the ports every 100mS.
if(Port_changed_flag)
{
Select_Output_Port();
Update_Frequency();
Init_Pwr_Level_One(); // Set power out level 1
}
if (Sys_Chk_tmr == 0)
{
System_Check(); // Check all system functions
Chk_Gain();
if(catch_up_flag)
{
Delay_Ticks(10);
Request_Current_Change(); // Request_Current_Change();
catch_up_flag = false;
}
}
if((!Check_For_Clamp_New()))
{
Check_For_Open_Circuit(); // DC mode only
}
else
{
Port_State[MID_SR] |= BYPASS_ON; // Set relay to By Pass protection cap
SPI0_SendBytes(Port_State, 3, EXPANDER); // Send_Update_Port();
}
if (Check_For_Clamp())
{
doClampPower();
}
//Send_Wireless_Data(); // Send system update to Receiver.
if (Taps_adjust_timer == 0)
Check_Taps(); // Check for optimum Taps
#endif
Display_Update();
}
}
}

27
source/main.h Normal file
View File

@@ -0,0 +1,27 @@
/*
* main.h
*
* Created on: May 20, 2022
* Author: Keith.Lloyd
*/
#ifndef MAIN_H_
#define MAIN_H_
#define PRIMARY_TASK 0
#define MODE_TASK 1
#define MENU_TASK 2
#define PWR_OFF_TASK 3
#define OVER_RIDE_TASK 4
#define ESTOP_TASK 5
#define BAT_INSERTION_ERROR 6
#define SAFETY_TASK 7
#define LOW_BATTERY_TASK 8
#define USB_SAFE_TASK 9
#define FATAL_ERROR_TASK 10
#endif /* MAIN_H_ */

54
source/measure.c Normal file
View File

@@ -0,0 +1,54 @@
/*
* measure.c
*
* Created on: Jun 7, 2022
* Author: Keith.Lloyd
*/
#include "fsl_spi.h"
#include "pin_mux.h"
#include "board.h"
#include "fsl_debug_console.h"
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <arm_math.h>
#include "measure.h"
#include "frq.h"
#include "ports.h"
#include "adc.h"
#include "amps.h"
extern float32_t Volts;
extern float32_t Amps;
extern float32_t Ohms;
extern float32_t Watts,Max_Power_Limit;
extern uint8_t frequency;
extern uint8_t Port_State[];
extern ADC_t adc;
float Calc_Max_current(void)
{
float a;
if(freqArray[frequency].frequency1 <= MAX_DTYPE)
a = sqrtf(Max_Power_Limit / adc.Ohms_slowfilt);
else
a = sqrtf(1/adc.Ohms_slowfilt);
return(a);
}

21
source/measure.h Normal file
View File

@@ -0,0 +1,21 @@
/*
* measure.h
*
* Created on: Mar 24, 2023
* Author: Keith.Lloyd
*/
#ifndef MEASURE_H_
#define MEASURE_H_
void Measure_Volts(void);
void Measure_Current(void);
void Calculate_Volts(void);
void Calculate_Current(void);
float Calc_Max_current(void);
#define HI_VOLTS 7 //ADC CHannel 7
#define EXCEDED 500 // High voltage value at port
#endif /* MEASURE_H_ */

1098
source/menu.c Normal file

File diff suppressed because it is too large Load Diff

84
source/menu.h Normal file
View File

@@ -0,0 +1,84 @@
/*
* menu.h
*
* Created on: Mar 8, 2022
* Author: Brian.Bailey
*
* Each menu has two functions: XMenu() and DisplayXMenu(), where X is the menu type
* XMenu() handles key presses
* DisplayXMenu(line) draws the menu using the arg as the selected menu line
*
*
*
*
*/
#ifndef MENU_MENU_H_
#define MENU_MENU_H_
#include <stdint.h>
#include <stdbool.h>
//Menu Setup
#define MENU_SYS_INFO_NUM 3 //System info and diagnostics
#define MAIN_MENU_NUM_TX10 4 //Tx10
#define MAIN_MENU_NUM_TX25 6 //Tx25 has Link Radio and Regulatory menus
#define LINK_MENU_NUM 3
#define LANG_MENU_NUM 4 //This can use LANG_NUM enum
//Menu scrolling
#define MENU_MAX_LINES_DISPLAYED 6
#define MENU_KEY_HOLD_SCROLL_DELAY 10 //increments of DelayTicks
#define MENU_LINE_HEIGHT 21
//Main Menu drawing locations
#define MENU_MAIN_BMP_X 0 //bitmap x
#define MENU_MAIN_BMP_Y 0 //bitmap y
#define MENU_MAIN_TEXT_X 5 //main text x
#define MENU_MAIN_TEXT_Y_START 0 //main text y starting value (start + n*lines)
#define MENU_MAIN_STATUS_X 160 //x location of text describing status of the menu item
#define MENU_MAIN_STATUS_Y_OFF 4 //y offset for menu status icons
//Submenu drawing locations - NOT USED
#define MENU_SUB_TEXT_X 5 //submenu text x
#define MENU_SUB_TEXT_Y_START 0 //submenu text y starting value (start + n*lines)
#define MENU_SUB_STATUS_X 160 //x location of text describing status of the menu item
#define MENU_MAX_STRING_LENGTH 20
#define MENU_FONT font12Bold
//Selection Rectangle
#define MENU_SEL_RECT_X0 0
#define MENU_SEL_RECT_X1 239
#define MENU_SEL_RECT_X1A 200
#define MENU_SEL_RECT_RADIUS 5
typedef struct {
bool exitToMainScreen;
}MENU_t;
//Menu Item Struct
//contains pointers to both mono and color bitmaps. mono bitmap requires a color.
//each item may have a mono bitmap, a color bitmap, or no bitmap.
typedef struct {
uint16_t * pMonoIcon; // bitmap
char text[MENU_MAX_STRING_LENGTH];
}MENU_ITEM_t;
void MENU_Init(void);
void MENU_Main(void);
void MENU_DisplayMain(uint32_t selected);
#endif /* MENU_MENU_H_ */

30
source/menu1.c Normal file
View File

@@ -0,0 +1,30 @@
/*
* menu.c
*
* Created on: Jun 27, 2022
* Author: Keith.Lloyd
*/
#include <menu1.h>
#include "menu.h"
void menu_key(void)
{
// Display_Menu(); // "wireless on/off,link, Power down timer,language,frequencies"
MENU_Main();
}

13
source/menu1.h Normal file
View File

@@ -0,0 +1,13 @@
/*
* menu.h
*
* Created on: Jun 27, 2022
* Author: Keith.Lloyd
*/
#ifndef MENU1_H_
#define MENU1_H_
void menu_key(void);
#endif /* MENU1_H_ */

111
source/mode.c Normal file
View File

@@ -0,0 +1,111 @@
/*
* mode.c
*
* Created on: Jun 27, 2022
* Author: Keith.Lloyd
*/
#include "spi.h"
#include <stdbool.h>
#include <stdint.h>
#include <frq.h>
#include <stdio.h>
#include "arm_math.h"
#include "display.h"
#include "timer.h"
#include "mode.h"
#include "ports.h"
extern uint8_t Port_State[];
extern uint8_t LD_Flag;
uint8_t Cur_Mode, Old_Mode, Port_changed_flag; // Currently selected mode and last
MODE_REC_t mode_Array[MODE_MAX_NUM];
void mode_menu(void)
{
uint32_t value = 22370; // testing only
uint32_t tmp;
static bool keithistan = false;
// Delay_Ticks(10);
keithistan ^= 1; //toggle
Select_Next_Mode(); //
Port_changed_flag = true;
if(Cur_Mode == BROADCAST)
LD_Flag = false;
}
void Select_Next_Mode()
{
// Save currently selected mode
Old_Mode = Cur_Mode;
Cur_Mode = Next_Available_Mode(Cur_Mode); // find next Mode available
// if(Cur_Mode != Old_Mode)
// Set_Up_New_Mode();
// Display_Mode(Cur_Mode); // Display the currently selected mode
}
void Set_Up_New_Mode()
{
if (Old_Mode > 0)
{
mode_Array[Old_Mode].Selected = false;
mode_Array[Cur_Mode].Selected = true;
}
}
uint8_t Next_Available_Mode(uint8_t mode_tmp)
{
uint8_t found = false;
uint8_t i;
// mode_tmp = Cur_Mode;
if (mode_tmp < MODE_MAX_NUM - 1)
mode_tmp++;
else
mode_tmp = 0;
for(i=0; i < MODE_MAX_NUM - 1; i++)
{
if(mode_Array[mode_tmp].Selected > 0)
{
found = 1;
break;
}
if (mode_tmp < MODE_MAX_NUM - 1)
mode_tmp++;
else
mode_tmp= 0;
}
return(mode_tmp);
}
void Display_available_Modes(void)
{
// if (DC_Available())
// {
// }
}
void Select_All_Modes()
{
uint8_t i;
for(i = 0;i < MODE_MAX_NUM-1; i++)
mode_Array[i].Selected = true;
}

41
source/mode.h Normal file
View File

@@ -0,0 +1,41 @@
/*
* mode.h
*
* Created on: Jun 27, 2022
* Author: Keith.Lloyd
*/
#ifndef MODE_H_
#define MODE_H_
#define MODE_MAX_NUM 5
//typedef enum {
// DIRECT_CONNECT = 0,
// BROADCAST = 1
//}CONNECT_MODE_t;
typedef enum {
BROADCAST,
PORT1_A,
PORT1_B,
PORT2_A,
PORT2_B
}PLUG_MODE_t;
//Data for individual frequencies
typedef struct {
uint8_t Plugged; //frequency in Hz
uint8_t Selected;
}MODE_REC_t;
void mode_menu(void);
void Display_available_Modes(void);
void Select_Next_Mode(void);
//void Next_Available_Mode(void);
uint8_t Next_Available_Mode(uint8_t mode_tmp);
void Init_Mode(void);
void Set_Up_New_Mode(void);
#endif /* MODE_H_ */

16
source/over_ride.c Normal file
View File

@@ -0,0 +1,16 @@
/*
* over_ride.c
*
* Created on: Jun 30, 2022
* Author: Keith.Lloyd
*/
void Over_Ride(void)
{
// display Over ride message
// wait for user response
}

14
source/over_ride.h Normal file
View File

@@ -0,0 +1,14 @@
/*
* over_ride.h
*
* Created on: Jun 30, 2022
* Author: Keith.Lloyd
*/
#ifndef OVER_RIDE_H_
#define OVER_RIDE_H_
void Over_Ride(void);
#endif /* OVER_RIDE_H_ */

625
source/ports.c Normal file
View File

@@ -0,0 +1,625 @@
/*
* ports.c
*
* Created on: Mar 21, 2023
* Author: Keith.Lloyd
*/
/*
* Return accessory associated with voltage read
*/
#include "fsl_spi.h"
#include "pin_mux.h"
#include "board.h"
#include "fsl_debug_console.h"
#include <stdbool.h>
#include <stdint.h>
#include "arm_math.h"
#include "ports.h"
#include "frq.h"
#include "spi.h"
#include "display.h"
#include "utils.h"
#include "adc.h"
#include "mode.h"
#include "psu_ctrl.h"
#include "timer.h"
#include "init.h"
#include "amps.h"
#include "fsl_sctimer.h"
#include "pwm.h"
#include "pwr_level.h"
ACCESSORY_t accy1;
ACCESSORY_t accy2;
uint16_t Port_timer;
uint16_t Taps_adjust_timer;
extern uint8_t Port_changed_flag,Init_Done;
extern ADC_t adc;
extern uint8_t Port_State[],Cur_Mode,old_freq,Bcast_Pwr_Level,Bcast_LF_Value[],Bcast_HF_Value[],Power_Level;
extern MODE_REC_t mode_Array[MODE_MAX_NUM];
extern uint8_t frequency,Over_Voltage_Flag;
extern FREQUENCY_t freqArray[FREQ_MAX_NUM];
extern volatile uint8_t BC_Duty_Cycle;
extern uint16_t Pot_Value_AB[];
extern uint16_t Pot_Value[];
extern uint8_t Dds_Pot_Val[];
uint8_t whatever;
static ACCY_ID_t ReadAccessory(uint8_t port)
{
float32_t idVoltage = 0.0;
if(port == 1)
idVoltage = adc.V_ID1; //idVoltage = ANA_GetVAccyDetect(); //TODO: Write this function
else
idVoltage = adc.V_ID2;
//ID 0 through 11. Voltage target is ID * 0.3v
uint32_t idNumber = (uint32_t)((idVoltage * 3.3333) + 0.25); //multiply by 3.3333 and round down to nearest integer
return (ACCY_ID_t)idNumber;
}
void Disconnect(uint8_t port) // called when you disconnect
{
if (port ==1)
{
accy1.connected = ID_NONE;
accy1.consecutiveScans = 0;
accy1.isConnected = false;
//Change Mode if this accessory was selected
if(mode_Array[PORT1_A].Selected || mode_Array[PORT1_B].Selected)
{
//disconnect port 1 from keith's struct
mode_Array[PORT1_A].Selected = 0;
mode_Array[PORT1_B].Selected = 0;
if ((Cur_Mode > BROADCAST) && (Cur_Mode ==PORT1_A) || (Cur_Mode == PORT1_B) ) //and change mode
Cur_Mode = Next_Available_Mode(Cur_Mode); // find next Mode available
}
else
{
//disconnect port 1 from keith's struct
mode_Array[PORT1_A].Selected = 0;
mode_Array[PORT1_B].Selected = 0;
}
}
else //port 2
{
accy2.connected = ID_NONE;
accy2.consecutiveScans = 0;
accy2.isConnected = false;
//Change Mode if this accessory was selected
if(mode_Array[PORT2_A].Selected || mode_Array[PORT2_B].Selected)
{
//disconnect port 2 from keith's struct
mode_Array[PORT2_A].Selected = 0;
mode_Array[PORT2_B].Selected = 0;
if ((Cur_Mode > BROADCAST) && (Cur_Mode == PORT2_A) || (Cur_Mode == PORT2_B) ) //and change mode
// Cur_Mode = Next_Available_Mode(Cur_Mode); // find next Mode available
{
if (mode_Array[PORT1_A].Selected || mode_Array[PORT1_B].Selected) //and change mode
Cur_Mode = PORT1_A;
else
Cur_Mode = Next_Available_Mode(Cur_Mode); // find next Mode available
}
//
// else
// Cur_Mode = 1;
// if (Cur_Mode > 0)
// {
// if (mode_Array[1].Selected || mode_Array[2].Selected) //and change mode
// Cur_Mode = 1;
// else
// Cur_Mode = Next_Available_Mode(Cur_Mode); // find next Mode available
// }
}
else
{
//disconnect port 1 from keith's struct
mode_Array[PORT2_A].Selected = 0;
mode_Array[PORT2_B].Selected = 0;
}
}
Port_changed_flag = true; // added 10/2/23
Init_Done = false; // 3/20/24 Force a Power Level One change
//Configure frequency to make sure things are setup correctly
// Tx_ConfigureFrequency();
}
void ACCY_Init(void)
{
accy1.connected = ID_NONE;
accy1.consecutiveScans = 0;
accy1.isConnected = false;
accy2.connected = ID_NONE;
accy2.consecutiveScans = 0;
accy2.isConnected = false;
Port_timer = DELAY_100MS;
Port_changed_flag = false;
//Setup accessory for GPIO gain control
// InitAccessoryGainGPIO();
}
//Call @ 10Hz to detect, connect, and disconnect accessories
void ACCY_Update1(void)
{
//read ID voltage and determine connected accessory *for each port*
//Require same accessory detected 3 consecutive updates (to de-glitch)
//Read accessory voltage and identify accessory
ACCY_ID_t detected = ReadAccessory(1);
if(accy1.connected == ID_NONE) //Nothing connected. Look for accessory to connect
{
if((detected == accy1.lastDetected) && (detected != ID_NONE)) //If detected same as last time and not ID_NONE
{
if(++accy1.consecutiveScans == AC_NUM_SCANS_TO_CONNECT) //Connect on 3rd consecutive scan of same accessory
{
ACCY_Connect1(accy1.lastDetected); //CONNECT
}
}
else //If different than last scan
{
accy1.lastDetected = detected; //remember what was scanned last time
accy1.consecutiveScans = 0;
}
}
else if (detected != accy1.connected) //If connected and detected reads different, disconnect
{
Disconnect(1);
}
}
//Call @ 10Hz to detect, connect, and disconnect accessories
void ACCY_Update2(void)
{
//read ID voltage and determine connected accessory *for each port*
//Require same accessory detected 3 consecutive updates (to de-glitch)
//Read accessory voltage and identify accessory
ACCY_ID_t detected = ReadAccessory(2);
whatever = ReadAccessory(2);
if(accy2.connected == ID_NONE) //Nothing connected. Look for accessory to connect
{
if((detected == accy2.lastDetected) && (detected != ID_NONE)) //If detected same as last time and not ID_NONE
{
if(++accy2.consecutiveScans == AC_NUM_SCANS_TO_CONNECT) //Connect on 3rd consecutive scan of same accessory
{
ACCY_Connect2(accy2.lastDetected); //CONNECT
}
}
else //If different than last scan
{
accy2.lastDetected = detected; //remember what was scanned last time
accy2.consecutiveScans = 0;
}
}
else if (detected != accy2.connected) //If connected and detected reads different, disconnect
{
Disconnect(2);
}
}
/*
* Connect accessory
*/
void ACCY_Connect1(ACCY_ID_t id)
{
accy1.connected = id;
accy1.isConnected = true;
switch(id)
{
case ID_TX_SINGLE_DIRECT:
Port_changed_flag = true; //connect it
break;
case ID_TX_DUAL_DIRECT:
Port_changed_flag = true; //connect it
break;
case ID_CLAMP:
Port_changed_flag = true; //connect it
break;
case ID_CLAMP2:
Port_changed_flag = true; //connect it
break;
default:
accy1.connected = ID_NONE;
accy1.isConnected = false;
}
//Configure frequency to make sure things are setup correctly
// Tx_ConfigureFrequency();
}
void ACCY_Connect2(ACCY_ID_t id)
{
accy2.connected = id;
accy2.isConnected = true;
switch(id)
{
case ID_TX_SINGLE_DIRECT:
Port_changed_flag = true;//connect it
break;
case ID_TX_DUAL_DIRECT:
Port_changed_flag = true;//connect it
break;
case ID_CLAMP:
Port_changed_flag = true;//connect it
break;
case ID_CLAMP2:
Port_changed_flag = true;//connect it
break;
default:
accy2.connected = ID_NONE;
accy2.isConnected = false;
}
//Configure frequency to make sure things are setup correctly
// Tx_ConfigureFrequency();
}
bool ACCY_IsConnected1(uint8_t port)
{
if(port == 1)
return accy1.isConnected;
else
return accy2.isConnected;
}
ACCY_ID_t ACCY_GetConnectedAccessory(uint8_t port)
{
if(port == 1)
return accy1.connected;
else
return accy2.connected;
}
ACCY_ID_t ACCY_GetActive(void)
{
if(Cur_Mode == PORT1_A)
{
return ACCY_GetConnectedAccessory(1);
}
else
{
return ACCY_GetConnectedAccessory(2);
}
}
void Read_Tx_Ports(void) // check for whats plugged in at the ports every 100mS.
{
uint8_t chip;
Port_timer = DELAY_100MS;
ACCY_Update1();
if((mode_Array[PORT1_A].Selected == false) && (mode_Array[PORT1_B].Selected == false) && (accy1.isConnected)) //new bit here
Cur_Mode = PORT1_A; // Something is connected to PORT1
switch(accy1.connected) // Find out what it is
{
case ID_TX_DUAL_DIRECT: //Transmitter accessory
mode_Array[PORT1_A].Selected = accy1.isConnected;
mode_Array[PORT1_B].Selected = accy1.isConnected;
break;
case ID_TX_SINGLE_DIRECT:
mode_Array[PORT1_A].Selected = accy1.isConnected;
break;
case ID_CLAMP:
mode_Array[PORT1_A].Selected = accy1.isConnected;
break;
case ID_CLAMP2:
mode_Array[PORT1_A].Selected = accy1.isConnected;
break;
default: //empty
mode_Array[PORT1_A].Selected = accy1.isConnected;
mode_Array[PORT1_B].Selected = accy1.isConnected;
}
ACCY_Update2();
if((mode_Array[PORT2_A].Selected == false) && (mode_Array[PORT2_B].Selected == false) && (accy2.isConnected)) //new bit here
Cur_Mode = PORT2_A;
switch(accy2.connected)
{
case ID_TX_DUAL_DIRECT: //Transmitter accessory
mode_Array[PORT2_A].Selected = accy2.isConnected;
mode_Array[PORT2_B].Selected = accy2.isConnected;
break;
case ID_TX_SINGLE_DIRECT:
mode_Array[PORT2_A].Selected = accy2.isConnected;
break;
case ID_CLAMP:
mode_Array[PORT2_A].Selected = accy2.isConnected;
break;
case ID_CLAMP2:
mode_Array[PORT2_A].Selected = accy2.isConnected;
break;
default: //empty
mode_Array[PORT2_A].Selected = accy2.isConnected;
mode_Array[PORT2_B].Selected = accy2.isConnected;
}
}
void Select_Output_Port(void) // which DC Out port, to switch on
{
Port_State[MID_SR] &= OUT_RELAY_OFF_MASK;
if (Cur_Mode != BROADCAST)
{
Delay_Ticks(DELAY_100MS);
if(Compare_Voltage(adc.V_CHK, MAX_BYPASS_VOLTS))
{
Over_Voltage_Flag = true;
Select_Bypass(OFF); // Force into blocked state.
Delay_Ticks(20);
}
Select_Estop(OFF); // Ensure output is not ISOLATED from connections
switch (Cur_Mode)
{
case PORT1_A:
Port_State[MID_SR] |= PORT1A_ON;
break;
case PORT1_B:
Port_State[MID_SR] |= PORT1B_ON;
break;
case PORT2_A:
Port_State[MID_SR] |= PORT2A_ON;
break;
case PORT2_B:
Port_State[MID_SR] |= PORT2B_ON;
break;
default:
Port_State[MID_SR] |= PORT2B_ON; // TODO Later disconnect??
break;
}
Disable_BC();
Reset_Power_Gain();
Port_changed_flag = false;
SPI0_SendBytes(Port_State, 3, EXPANDER);
}
else
{ // Assumes broadcast mode has just been selected
Disable_DC(); // Shut down Direct connect circuitry
Select_Estop(ON); // Ensure output is ISOLATED from connections
Tx_ConfigureFrequency(); // Select correct frequency
Enable_BC(); // Enable BCAST circuitry using either Minimum or previously selected freq
Port_changed_flag = false;
}
}
void Reset_Power_Gain(void)
{
Power_Level = 0;
Bcast_Pwr_Level = 0;
// if( (ACCY_GetConnectedAccessory(1) != ID_CLAMP) && (ACCY_GetConnectedAccessory(2) != ID_CLAMP))
if(!Check_For_Clamp())
{
if (freqArray[frequency].frequency1 <= MAX_DTYPE)
Dds_Pot_Val[1] = Pot_Value[Power_Level]; // data
else
Dds_Pot_Val[1] = Pot_Value_AB[Power_Level]; // data
}
else
Get_Clamp_Value();
Dds_Pot_Val[0] = 0; // address
SPI0_SendBytes(Dds_Pot_Val, 2, AMPLITUDE);
Delay_Ticks(30); // Set power out level 1 3/20/24
// Power_Level = 1;
// if(Init_Done)
// {
// Delay_Ticks(10); // Set power out level 1 3/20/24
// Power_Level++;
// inc_pwr();
Init_Done = false;
// }
}
void Tx_ConfigureFrequency(void)
{
uint32_t tmp_frq;
if (freqArray[frequency].bc_enabled == false && Cur_Mode == BROADCAST) // if (freq < min freq) ToDo
{
tmp_frq = Search_BC_Frequency(); // select minimum frequency for BCAST
if (tmp_frq < FREQ_MAX_NUM)
frequency = tmp_frq;
//endif
}
}
uint32_t Search_BC_Frequency(void)
{
uint32_t idx;
idx = 0;
while (freqArray[idx].bc_enabled == false && idx < FREQ_MAX_NUM)
idx++;
if (idx >= FREQ_MAX_NUM)
idx = FREQ_MAX_NUM;
return(idx);
}
uint32_t Search_Frequency(uint32_t pattern)
{
uint32_t idx;
idx = 0;
while (freqArray[idx].frequency1 != pattern && idx < FREQ_MAX_NUM)
idx++;
if (idx >= FREQ_MAX_NUM)
idx = FREQ_MAX_NUM;
return(idx);
}
void Disable_DC(void)
{
All_Amps_Off(); // shut down Amplifiers DC connections
// Shut off all amplifier enables
// Reset_DDS(); // Stop all DDS chips
// Set_PSU_Voltage(V_18V); //MID_POINT_PSU 18,24,27,30,36, 55
// Set PSU to MIN.
}
void Enable_BC(void)
{
// if((freqArray[old_freq].frequency1 >8010 ) && (freqArray[frequency].frequency1 < 8010))
// Cycled_Freq_Change_BC(LF);
// else
// {
// if((freqArray[old_freq].frequency1 < 8010 ) && (freqArray[frequency].frequency1 > 8010))
// Cycled_Freq_Change_BC(HF);
// }
if(freqArray[frequency].frequency1 <= 8010)
BC_Duty_Cycle = Bcast_LF_Value[Bcast_Pwr_Level];
else
BC_Duty_Cycle = Bcast_HF_Value[Bcast_Pwr_Level];
PWM_Setup(freqArray[frequency].frequency1, BC_Duty_Cycle);//freqArray[frequency].frequency1
Port_State[MID_SR] |=ANT_AMP_EN; // Enable Antenna amp
// Port_State[BOTTOM_SR] |= ANT_AMP_PWR; // Enable PWR Switch
Port_State[TOP_SR] |= ANT_AMP_SW;
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
Delay_Ticks(5);
Set_PSU_Voltage(V_27V); // Set PSU to MAX
Port_State[BOTTOM_SR] &= AMP_PSU_ON; // switch AMP PSU on
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
}
void Cycled_Freq_Change_BC(uint8_t value)
{
if(value == LF)
{
if(Bcast_Pwr_Level == MAX_BCAST_PWR)
Bcast_Pwr_Level--;
BC_Duty_Cycle = 10;
BC_Duty_Cycle = BC_Duty_Cycle + Bcast_Pwr_Level*5;
}
else
{
BC_Duty_Cycle = 10;
BC_Duty_Cycle = BC_Duty_Cycle + Bcast_Pwr_Level*10;
}
}
void Enable_DC(void)
{
// Switch on correct amplifier enables
// Switch on correct power switches
// Enable correct DDS chips
// Set PSU to Medium.
}
void Disable_BC(void)
{
Port_State[MID_SR] &=~ANT_AMP_EN; // disable Antenna amp
// Port_State[BOTTOM_SR] |=ANT_AMP_PWR; // Enable PWR Switch
Port_State[TOP_SR] &= ~ANT_AMP_SW;
SPI0_SendBytes(Port_State, 3, EXPANDER); // Update shift register
// Change the SCT clock back here
PWM_Setup(15890, 0); // switches off PWM // Set duty cycle to zero
Delay_Ticks(5);
Set_PSU_Voltage(V_24V); // Set PSU to MIN
// Init_PWM_CLKS(DC_CLK); // Return timer clock to internal
}
bool Is_Clamp_Detected(void)
{
if((ACCY_GetConnectedAccessory(1) == ID_CLAMP) || (ACCY_GetConnectedAccessory(2) == ID_CLAMP) || (ACCY_GetConnectedAccessory(1) == ID_CLAMP2) || (ACCY_GetConnectedAccessory(2) == ID_CLAMP2))
return(true);
else
return(false);
}

79
source/ports.h Normal file
View File

@@ -0,0 +1,79 @@
/*
* ports.h
*
* Created on: Mar 21, 2023
* Author: Keith.Lloyd
*/
#ifndef PORTS_H_
#define PORTS_H_
typedef enum {
ID_ERROR = 0, //0V should never happen. Error condition
ID_TX_SINGLE_DIRECT, //Transmitter accessory
ID_TX_DUAL_DIRECT, //Transmitter accessory
ID_TX_TBD1, //
ID_CLAMP2, //
ID_CLAMP, //Receiver Clamp
ID_TBD1, //
ID_DIGITAL, //Digital Accessory - Use for EMS boot in future
ID_FAULT_PROBE, //Fault Probe
ID_TBD2, //
ID_TBD3, //
ID_NONE, //No accessory connected
ID_NUM
}ACCY_ID_t;
typedef struct {
bool isConnected; //Accessory is connected
ACCY_ID_t connected; //Currently connected accessory
ACCY_ID_t lastDetected; //accessory detected last scan
uint32_t consecutiveScans; //number of consecutive scans of same accessory
}ACCESSORY_t;
#define DELAY_100MS 10
#define DELAY_ONE_SECOND 100
#define AC_NUM_SCANS_TO_CONNECT 3 //require 3 consecutive scans to connect to accessory
#define A1_SLCT 0b00000000
#define A2_SLCT 0b00010000
#define B1_SLCT 0b00001000
#define B2_SLCT 0b00011000
#define TOP_SR 0 //0
#define MID_SR 1
#define BOTTOM_SR 2 //1
#define LF false
#define HF true
typedef enum {
ONE,
TWO,
THREE,
FOUR
}OUTPUT_SELECT_t;
void ACCY_Init(void);
void ACCY_Update1(void);
void ACCY_Update2(void);
void Read_Tx_Ports(void); // check for whats plugged in at the ports.
void Tx_ConfigureFrequency(void);
void ACCY_Connect1(ACCY_ID_t id);
void ACCY_Connect2(ACCY_ID_t id);
bool ACCY_IsConnected(uint8_t port);
ACCY_ID_t ACCY_GetConnectedAccessory(uint8_t port);
ACCY_ID_t ACCY_GetActive(void);
void Select_Output_Port(void); // Mutually exclusive output port selector
void Enable_BC(void);
void Disable_DC(void);
void Disable_BC(void);
void Disconnect(uint8_t port); // called when you disconnect
uint32_t Search_BC_Frequency(void);
uint32_t Search_Frequency(uint32_t pattern);
bool Is_Clamp_Detected(void);
void Cycled_Freq_Change_BC(uint8_t value);
void Reset_Power_Gain(void);
#endif /* PORTS_H_ */

116
source/pro_key.c Normal file
View File

@@ -0,0 +1,116 @@
/*
* pro_key.c
*
* Created on: Jun 27, 2022
* Author: Keith.Lloyd
*/
#include "pro_key.h"
#include <stdbool.h>
#include <stdint.h>
#include "keys.h"
#include "frq.h"
#include "display.h"
#include "main.h"
#include "timer.h"
#include "pwr_level.h"
#include "mode.h"
#include "ports.h"
#include "utils.h"
extern uint8_t Task,Cur_Mode,Suspend_Step_Chk,step_count;
extern uint8_t frequency,old_freq,frq_chg_tmr;
extern uint32_t new_freq;
extern uint16_t Vchktmr,Key_Lock_Out_tmr;
uint8_t keyval;
extern uint8_t Port_State[];
#if 1
void pro_key(void)
{
uint32_t tmp_frqx;
switch(KEY_GetPressed())//(key_bits)
{
//TODO: cases need to use the key #defines from keys.c and keys.h
case ON_OFF_KEY: // Begin Primary Key
Task = PWR_OFF_TASK;
break;
case KEY_POWER: // Long press power Key
Task = PWR_OFF_TASK;
break;
case FRQ_KEY:
freq_key_process();
break;
// case KEY_FREQ << KEY_LONG_PRESS: //Enable/Disable CD(LD).
// LD_key_process();
// break;
case PWR_UP_KEY:
if(Key_Lock_Out_tmr == 0)
{
Vchktmr = LOCK_OUT_DELAY;
inc_pwr();//increment the power output
Key_Lock_Out_tmr = KEY_LOCK_TIME;
Suspend_Step_Chk = false;
step_count = 0;
}
break;
case PWR_DN_KEY:
if(Key_Lock_Out_tmr == 0)
{
Vchktmr = LOCK_OUT_DELAY;
dec_pwr();// decrement the power output
Key_Lock_Out_tmr = KEY_LOCK_TIME;
Suspend_Step_Chk = false;
step_count = 0;
}
break;
case MENU_KEY:
Task = MENU_TASK; // display the menus
break;
case MODE_KEY: // End Primary Key
// Task = MODE_TASK; // Display the Modes
#if 0 //Use mode key to toggle current gain
if(Port_State[MID_SR] & I_GAIN)
{
Port_State[MID_SR] &= ~I_GAIN;
}
else
{
Port_State[MID_SR] |= I_GAIN;
}
SPI0_SendBytes(Port_State, 3, EXPANDER);
//Sys_Chk_tmr = DELAY_1S;
#else
Task = MODE_TASK; // Display the Modes
#endif
break;
// break;
default:
break;
}
}
#endif

25
source/pro_key.h Normal file
View File

@@ -0,0 +1,25 @@
/*
* pro_key.h
*
* Created on: Jun 27, 2022
* Author: Keith.Lloyd
*/
#ifndef PRO_KEY_H_
#define PRO_KEY_H_
#include "keys.h"
#define BKLITE_KEY 0x0f9
#define OPT_KEY 0x0f8
#define OVER_RIDE_KEY 0x0f7
#define PRIMARY_KEY 1
#define KEY_DELAY 10
#define TASK_PWR_DN 0x00;
void pro_key(void);
void LD_key_process(void);
#endif /* PRO_KEY_H_ */

138
source/psu_ctrl.c Normal file
View File

@@ -0,0 +1,138 @@
/*
* psu_ctrl.c
*
* Created on: Mar 16, 2023
* Author: Keith.Lloyd
*/
#include "psu_ctrl.h"
#include "arm_math.h"
#include "fsl_gpio.h"
#include "spi.h"
#include "mode.h"
#include "amps.h"
#include "frq.h"
#include "adc.h"
#include "timer.h"
#include "utils.h"
#include <stdbool.h>
#include <stdint.h>
uint8_t PSU_Val_Limit;
uint8_t Psu_Pot_Val[2]; // 2 byte Data for SPI
extern uint8_t frequency;
uint8_t mode,psu_index;
extern uint8_t Power_Level;
uint8_t Psu_Pot_Data[5] = {V_18V,V_24V,V_27V,V_36V,V_55V}; // PSU Pot values.
extern ADC_t adc;
void Set_PSU_Voltage(uint8_t value)
{
Psu_Pot_Val[0] = 0x0;
Psu_Pot_Val[1] = value;
Get_Max_PSU_Limit(); // Get the maximum limit to compare to for each frequency or mode
if (Psu_Pot_Val[1] > PSU_Val_Limit)
Psu_Pot_Val[1] = PSU_Val_Limit;
SPI0_SendBytes(Psu_Pot_Val, 2, PSU_VCTRL); // Update the Pot
}
void Get_Max_PSU_Limit(void) // Set up Maximum voltage for PSU
{
if (freqArray[frequency].frequency1 > MAX_DTYPE)
PSU_Val_Limit = MAX_AB_PSU;
else
PSU_Val_Limit = MAX_D_PSU;
if (mode == BROADCAST)
PSU_Val_Limit = MAX_BCAST_PSU;
if((Check_For_Clamp()))
PSU_Val_Limit = MAX_CLAMP_PSU;
}
void Adjust_Psu(uint8_t direction)
{
if(direction == UP)
psu_index++;
else
psu_index--;
}
void Psu_Match(void)
{// may need tap check plus current and voltage
if(freqArray[frequency].frequency1 <= MAX_DTYPE) //may need current and impedance check
{
switch (Power_Level)
{
case 0:
Set_PSU_Voltage(V_21V);
break;
case 1:
Set_PSU_Voltage(V_24V);
break;
case 2:
Set_PSU_Voltage(V_27V);
break;
case 3:
Set_PSU_Voltage(V_36V);
break;
case 4:
Set_PSU_Voltage(V_36V);
break;
default:
Set_PSU_Voltage(V_36V);
break;
}
}
}
bool Wait_For_Psu(float32_t volt_limit)
{
uint16_t escape_count;
escape_count = 350;
while(adc.V_PSU > volt_limit && escape_count > 0 )
{
Delay_Ticks(1);
escape_count--;
}
if(escape_count > 0)
return(true);
else
return(false);
}

Some files were not shown because too many files have changed in this diff Show More