diff --git a/vendor/other/demo/02_paj7620u2_gesture/doc/PAJ7620U2_spec.pdf b/vendor/other/demo/02_paj7620u2_gesture/doc/PAJ7620U2_spec.pdf new file mode 100755 index 0000000000000000000000000000000000000000..820b82bfce740480cb65d994e6503cf9c5b2d660 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/doc/PAJ7620U2_spec.pdf differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/doc/SSD1306.pdf b/vendor/other/demo/02_paj7620u2_gesture/doc/SSD1306.pdf new file mode 100755 index 0000000000000000000000000000000000000000..c17940971b592e1d88f7b0ac1671c922f79e6089 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/doc/SSD1306.pdf differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/generatecode/feature.h b/vendor/other/demo/02_paj7620u2_gesture/generatecode/feature.h new file mode 100644 index 0000000000000000000000000000000000000000..2dcb64229b65147db3edbf7bebc1cd9372a37a20 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/generatecode/feature.h @@ -0,0 +1,125 @@ +/** + * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + * following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * @file feature.h + * @author MCU Driver Team + * @brief This file contains macro configurations related to the project. This file is generated by the IDE tool. + */ + +#ifndef MCU_MAGIC_TAG_FEATURE_H +#define MCU_MAGIC_TAG_FEATURE_H + +/* Macro definitions --------------------------------------------------------- */ +#define CHIP_3061MNPICA MACRO_ENABLE + +#define MACRO_ENABLE 1 +#define MACRO_DISABLE 0 + +/* Macro switch */ +#define BASE_DEFINE_USE_ASSERT MACRO_ENABLE +#ifndef FLASH_CRC_CONFIG +#define FLASH_CRC_CONFIG +#endif /* #ifndef FLASH_CRC_CONFIG */ +#define BASE_MATH_SINCOS_MIDDLE_TABLE \ + MACRO_ENABLE /**< This macro is used to control the table type when the \ + BASE_MATH_GetSinCos() queries the table. When the value of \ + this macro is MACRO_ENABLE, the error value obtained by the \ + BASE_MATH_GetSinCos() is relatively small, and the return \ + value of the function may be greater than or less than the \ + actual value. When the value of this macro is MACRO_DISABLE, \ + the error value obtained by the BASE_MATH_GetSinCos() is \ + relatively large. However, in the range [0°, 180°) and \ + [180°, 360°), the return value of the function is either \ + greater than or less than the actual value. */ + +#define DBG_ENABLE MACRO_ENABLE +#define MCS_PARAM_CHECK MACRO_ENABLE +#define APT_PARAM_CHECK MACRO_ENABLE +#define ADC_PARAM_CHECK MACRO_ENABLE +#define CAPM_PARAM_CHECK MACRO_ENABLE +#define CRG_PARAM_CHECK MACRO_ENABLE +#define IIC_PARAM_CHECK MACRO_ENABLE // I2C_PARAM_CHECK +#define UART_PARAM_CHECK MACRO_ENABLE +#define SPI_PARAM_CHECK MACRO_ENABLE +#define TIMER_PARAM_CHECK MACRO_ENABLE +#define IWDG_PARAM_CHECK MACRO_ENABLE +#define WWDG_PARAM_CHECK MACRO_ENABLE +#define GPIO_PARAM_CHECK MACRO_ENABLE +#define GPT_PARAM_CHECK MACRO_ENABLE +#define DMA_PARAM_CHECK MACRO_ENABLE +#define CRC_PARAM_CHECK MACRO_ENABLE +#define CFD_PARAM_CHECK MACRO_ENABLE +#define CMM_PARAM_CHECK MACRO_ENABLE +#define CAN_PARAM_CHECK MACRO_ENABLE +#define FLASH_PARAM_CHECK MACRO_ENABLE +#define PMC_PARAM_CHECK MACRO_ENABLE +#define ACMP_PARAM_CHECK MACRO_ENABLE +#define DAC_PARAM_CHECK MACRO_ENABLE +#define PGA_PARAM_CHECK MACRO_ENABLE +#define IOCMG_PARAM_CHECK MACRO_ENABLE +#define QDM_PARAM_CHECK MACRO_ENABLE + +/* Peripheral module macro switch--------------------------------------------- */ +#define BOARD_DIM_NUM 1 /**< Number of dimming handle arrays. */ + +#define BOARD_KEY_NUM 10 /**< Number of key handle arrays. */ +#define BOARD_KEY_PRESS_ON GPIO_HIGH_LEVEL /**< GPIO status corresponding to long press valid. */ +#define BOARD_KEY_PRESS_OFF GPIO_LOW_LEVEL /**< GPIO status corresponding to short press valid. */ + +#define BOARD_LED_SEG_NUM 4 /**< Number of segments. */ +#define BOARD_LED_SEGMENT_ON GPIO_HIGH_LEVEL /**< GPIO level status corresponding to valid segments. */ +#define BOARD_LED_SEGMENT_OFF GPIO_LOW_LEVEL /**< GPIO level status corresponding to invalid segments. */ + +#define BOARD_MKEY_SCHEME_NUMBER BOARD_MKEY_SCHEME_NUMBER_ONE /**< Define the scheme to be adopted. */ +#define BOARD_MKEY_OUT_NUM 4 /**< Number of GPIO pins used as output during scanning. */ +#define BOARD_MKEY_IN_NUM 4 /**< Number of GPIO pins used as input during scanning. */ +#define BOARD_MKEY_OUT_PIN_VALID \ + GPIO_LOW_LEVEL /**< GPIO level status corresponding to the valid \ + status of the output GPIO in the key matrix. */ +#define BOARD_MKEY_OUT_PIN_INVALID \ + GPIO_HIGH_LEVEL /**< GPIO level status corresponding to the \ + invalid status of the output GPIO in the key matrix. */ +#define BOARD_MKEY_IN_PIN_VALID \ + GPIO_LOW_LEVEL /**< Indicates the GPIO level corresponding to the \ + valid status of the input GPIO in the key matrix. */ +#define BOARD_MKEY_IN_PIN_INVALID \ + GPIO_HIGH_LEVEL /**< Indicates the GPIO level corresponding to the \ + invalid status of the input GPIO in the key matrix. */ + +#define BOARD_PULSES_NUM 2 /**< Number of pulse handles. */ + +#define BASE_DEFINE_SLIPAVERAGE_NUM 2 /**< Sliding average array length. */ + +#define LISTNODE_MAX 20 + +#define BASE_DEFINE_DMA_QUICKSTART + +#define XTRAIL_FREQ 30000000U + +#define DBG_USE_NO_PRINTF 0U +#define DBG_USE_UART_PRINTF 1U + +#define DBG_PRINTF_USE DBG_USE_UART_PRINTF +#if (DBG_PRINTF_USE == DBG_USE_UART_PRINTF) +#define DBG_PRINTF_UART_PORT UART0 +#endif + +/* USER CODE BEGIN 0 */ +/* USER CODE 区域内代码不会被覆盖,区域外会被生成的默认代码覆盖(其余USER CODE 区域同理) */ +/* USER CODE END 0 */ + +#endif /* MCU_MAGIC_TAG_FEATURE_H */ \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/generatecode/main.h b/vendor/other/demo/02_paj7620u2_gesture/generatecode/main.h new file mode 100644 index 0000000000000000000000000000000000000000..c2d5247c815e46a26afa816c00b43b2cff1e7a73 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/generatecode/main.h @@ -0,0 +1,65 @@ +/** + * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + * following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * @file main.h + * @author MCU Driver Team + * @brief This file contains driver init functions. + */ + +/* Define to prevent recursive inclusion ------------------------------------- */ +#ifndef MCU_MAGIC_TAG_SYSTEM_INIT_H +#define MCU_MAGIC_TAG_SYSTEM_INIT_H + +#include "uart.h" +#include "uart_ex.h" +#include "i2c.h" +#include "i2c_ex.h" +#include "crg.h" +#include "dma.h" +#include "dma_ex.h" +#include "iocmg.h" + +#define IO_SPEED_FAST 0x00U +#define IO_SPEED_SLOW 0x01U + +#define IO_DRV_LEVEL4 0x00U +#define IO_DRV_LEVEL3 0x01U +#define IO_DRV_LEVEL2 0x02U +#define IO_DRV_LEVEL1 0x03U + +#define XTAL_DRV_LEVEL4 0x03U +#define XTAL_DRV_LEVEL3 0x02U +#define XTAL_DRV_LEVEL2 0x01U +#define XTAL_DRV_LEVEL1 0x00U + +extern UART_Handle g_uart0; +extern I2C_Handle g_i2c0_master; + +extern DMA_Handle g_dmac; + +BASE_StatusType CRG_Config(CRG_CoreClkSelect *coreClkSelect); +void SystemInit(void); + +void common_i2c0_tx_callback(I2C_Handle *handle); +void common_i2c0_rx_callback(I2C_Handle *handle); +void common_i2c0_error_callback(I2C_Handle *handle); + +/* USER CODE BEGIN 0 */ +/* USER CODE 区域内代码不会被覆盖,区域外会被生成的默认代码覆盖(其余USER CODE 区域同理) */ +/* USER CODE END 0 */ + +#endif /* MCU_MAGIC_TAG_SYSTEM_INIT_H */ \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/generatecode/system_init.c b/vendor/other/demo/02_paj7620u2_gesture/generatecode/system_init.c new file mode 100644 index 0000000000000000000000000000000000000000..75d876846aae6f01f8e122035629ad0b703eb295 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/generatecode/system_init.c @@ -0,0 +1,213 @@ +/** + * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + * following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * @file system_init.c + * @author MCU Driver Team + * @brief This file contains driver init functions. + */ + +#include "main.h" +#include "ioconfig.h" +#include "iocmg_ip.h" + +#define UART0_BAND_RATE 115200 + +BASE_StatusType CRG_Config(CRG_CoreClkSelect *coreClkSelect) +{ + CRG_Handle crg; + crg.baseAddress = CRG; + crg.pllRefClkSelect = CRG_PLL_REF_CLK_SELECT_HOSC; + crg.pllPreDiv = CRG_PLL_PREDIV_4; + crg.pllFbDiv = 48; /* PLL Multiplier 48 */ + crg.pllPostDiv = CRG_PLL_POSTDIV_2; + crg.coreClkSelect = CRG_CORE_CLK_SELECT_PLL; + crg.handleEx.pllPostDiv2 = CRG_PLL_POSTDIV2_3; + crg.handleEx.clk1MSelect = CRG_1M_CLK_SELECT_HOSC; + crg.handleEx.clk1MDiv = (25 - 1); /* The 1 MHz freq is equal to the input clock frequency / (clk_1m_div + 1). 25 is + the div of the clk_1m in CLOCK. */ + + if (HAL_CRG_Init(&crg) != BASE_STATUS_OK) { + return BASE_STATUS_ERROR; + } + *coreClkSelect = crg.coreClkSelect; + return BASE_STATUS_OK; +} + +static void dma_channel0_init(I2C_Handle *handle) +{ + DMA_ChannelParam dma_param; + dma_param.direction = DMA_PERIPH_TO_MEMORY_BY_DMAC; + dma_param.srcAddrInc = DMA_ADDR_UNALTERED; + dma_param.destAddrInc = DMA_ADDR_INCREASE; + dma_param.srcPeriph = DMA_REQUEST_I2C0_RX; + dma_param.destPeriph = DMA_REQUEST_MEM; + dma_param.srcWidth = DMA_TRANSWIDTH_BYTE; + dma_param.destWidth = DMA_TRANSWIDTH_BYTE; + dma_param.srcBurst = DMA_BURST_LENGTH_1; + dma_param.destBurst = DMA_BURST_LENGTH_1; + dma_param.pHandle = handle; + HAL_DMA_InitChannel(&g_dmac, &dma_param, DMA_CHANNEL_ZERO); +} + +static void dma_channel1_init(I2C_Handle *handle) +{ + DMA_ChannelParam dma_param; + dma_param.direction = DMA_MEMORY_TO_PERIPH_BY_DMAC; + dma_param.srcAddrInc = DMA_ADDR_INCREASE; + dma_param.destAddrInc = DMA_ADDR_UNALTERED; + dma_param.srcPeriph = DMA_REQUEST_MEM; + dma_param.destPeriph = DMA_REQUEST_I2C0_TX; + dma_param.srcWidth = DMA_TRANSWIDTH_WORD; + dma_param.destWidth = DMA_TRANSWIDTH_WORD; + dma_param.srcBurst = DMA_BURST_LENGTH_1; + dma_param.destBurst = DMA_BURST_LENGTH_1; + dma_param.pHandle = handle; + HAL_DMA_InitChannel(&g_dmac, &dma_param, DMA_CHANNEL_ONE); +} + +static void dma_init(void) +{ + HAL_CRG_IpEnableSet(DMA_BASE, IP_CLK_ENABLE); + g_dmac.baseAddress = DMA; + IRQ_Register(IRQ_DMA_TC, HAL_DMA_IrqHandlerTc, &g_dmac); + IRQ_Register(IRQ_DMA_ERR, HAL_DMA_IrqHandlerError, &g_dmac); + IRQ_EnableN(IRQ_DMA_TC); + IRQ_EnableN(IRQ_DMA_ERR); + HAL_DMA_Init(&g_dmac); + dma_channel0_init(&g_i2c0_master); + HAL_DMA_SetChannelPriorityEx(&g_dmac, DMA_CHANNEL_ZERO, DMA_PRIORITY_HIGHEST); + dma_channel1_init(&g_i2c0_master); + HAL_DMA_SetChannelPriorityEx(&g_dmac, DMA_CHANNEL_ONE, DMA_PRIORITY_HIGHEST); +} + +__weak void common_i2c0_tx_callback(I2C_Handle *handle) +{ + BASE_FUNC_UNUSED(handle); + /* USER CODE BEGIN common_i2c0_tx_callback */ + /* USER CODE END common_i2c0_tx_callback */ +} + +__weak void common_i2c0_rx_callback(I2C_Handle *handle) +{ + BASE_FUNC_UNUSED(handle); + /* USER CODE BEGIN common_i2c0_rx_callback */ + /* USER CODE END common_i2c0_rx_callback */ +} + +__weak void common_i2c0_error_callback(I2C_Handle *handle) +{ + BASE_FUNC_UNUSED(handle); + /* USER CODE BEGIN common_i2c0_error_callback */ + /* USER CODE END common_i2c0_error_callback */ +} + +static void iic0_init(void) +{ + HAL_CRG_IpEnableSet(I2C0_BASE, IP_CLK_ENABLE); /* I2C0 clock enable. */ + g_i2c0_master.baseAddress = I2C0; + + g_i2c0_master.functionMode = I2C_MODE_SELECT_MASTER_ONLY; + g_i2c0_master.addrMode = I2C_7_BITS; + g_i2c0_master.sdaHoldTime = 10; /* 10 is sda Hold Time */ + g_i2c0_master.freq = 400000; /* freqence is 400000 */ + g_i2c0_master.transferBuff = NULL; + g_i2c0_master.ignoreAckFlag = BASE_CFG_DISABLE; + g_i2c0_master.handleEx.spikeFilterTime = 0; + g_i2c0_master.handleEx.sdaDelayTime = 0; + g_i2c0_master.timeout = 10000; /* 10000 is time out */ + g_i2c0_master.state = I2C_STATE_RESET; + g_i2c0_master.rxWaterMark = 1; /* 1 is Rx Threshold configuration */ + g_i2c0_master.txWaterMark = 12; /* 12 is Tx Threshold configuration */ + g_i2c0_master.dmaHandle = &g_dmac; + g_i2c0_master.txDmaCh = DMA_CHANNEL_ONE; + g_i2c0_master.rxDmaCh = DMA_CHANNEL_ZERO; + HAL_I2C_Init(&g_i2c0_master); + HAL_I2C_RegisterCallback(&g_i2c0_master, I2C_MASTER_TX_COMPLETE_CB_ID, common_i2c0_tx_callback); + HAL_I2C_RegisterCallback(&g_i2c0_master, I2C_MASTER_RX_COMPLETE_CB_ID, common_i2c0_rx_callback); + HAL_I2C_RegisterCallback(&g_i2c0_master, I2C_ERROR_CB_ID, common_i2c0_error_callback); +} + +static void uart0_init(void) +{ + HAL_CRG_IpEnableSet(UART0_BASE, IP_CLK_ENABLE); /* UART0 clock enable. */ + g_uart0.baseAddress = UART0; + + g_uart0.baudRate = UART0_BAND_RATE; + g_uart0.dataLength = UART_DATALENGTH_8BIT; + g_uart0.stopBits = UART_STOPBITS_ONE; + g_uart0.parity = UART_PARITY_NONE; + g_uart0.txMode = UART_MODE_BLOCKING; + g_uart0.rxMode = UART_MODE_BLOCKING; + g_uart0.fifoMode = BASE_CFG_ENABLE; + g_uart0.fifoTxThr = UART_FIFODEPTH_SIZE8; + g_uart0.fifoRxThr = UART_FIFODEPTH_SIZE8; + g_uart0.hwFlowCtr = BASE_CFG_DISABLE; + g_uart0.handleEx.overSampleMultiple = UART_OVERSAMPLING_16X; + g_uart0.handleEx.msbFirst = BASE_CFG_DISABLE; + HAL_UART_Init(&g_uart0); +} + +static void io_config(void) +{ + /* Config PIN36 */ + HAL_IOCMG_SetPinAltFuncMode(GPIO0_0_AS_JTAG_TCK); /* Check function selection */ + HAL_IOCMG_SetPinPullMode(GPIO0_0_AS_JTAG_TCK, PULL_NONE); /* Pull-up and Pull-down */ + HAL_IOCMG_SetPinSchmidtMode(GPIO0_0_AS_JTAG_TCK, SCHMIDT_DISABLE); /* Schmitt input on/off */ + HAL_IOCMG_SetPinLevelShiftRate(GPIO0_0_AS_JTAG_TCK, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ + HAL_IOCMG_SetPinDriveRate(GPIO0_0_AS_JTAG_TCK, DRIVER_RATE_2); /* Output signal edge fast/slow */ + /* Config PIN37 */ + HAL_IOCMG_SetPinAltFuncMode(GPIO0_1_AS_JTAG_TMS); /* Check function selection */ + HAL_IOCMG_SetPinPullMode(GPIO0_1_AS_JTAG_TMS, PULL_NONE); /* Pull-up and Pull-down */ + HAL_IOCMG_SetPinSchmidtMode(GPIO0_1_AS_JTAG_TMS, SCHMIDT_DISABLE); /* Schmitt input on/off */ + HAL_IOCMG_SetPinLevelShiftRate(GPIO0_1_AS_JTAG_TMS, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ + HAL_IOCMG_SetPinDriveRate(GPIO0_1_AS_JTAG_TMS, DRIVER_RATE_2); /* Output signal edge fast/slow */ + /* Config PIN26 */ + HAL_IOCMG_SetPinAltFuncMode(GPIO4_3_AS_I2C0_SDA); /* Check function selection */ + HAL_IOCMG_SetPinPullMode(GPIO4_3_AS_I2C0_SDA, PULL_NONE); /* Pull-up and Pull-down */ + HAL_IOCMG_SetPinSchmidtMode(GPIO4_3_AS_I2C0_SDA, SCHMIDT_DISABLE); /* Schmitt input on/off */ + HAL_IOCMG_SetPinLevelShiftRate(GPIO4_3_AS_I2C0_SDA, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ + HAL_IOCMG_SetPinDriveRate(GPIO4_3_AS_I2C0_SDA, DRIVER_RATE_2); /* Output signal edge fast/slow */ + /* Config PIN25 */ + HAL_IOCMG_SetPinAltFuncMode(GPIO4_2_AS_I2C0_SCL); /* Check function selection */ + HAL_IOCMG_SetPinPullMode(GPIO4_2_AS_I2C0_SCL, PULL_NONE); /* Pull-up and Pull-down */ + HAL_IOCMG_SetPinSchmidtMode(GPIO4_2_AS_I2C0_SCL, SCHMIDT_DISABLE); /* Schmitt input on/off */ + HAL_IOCMG_SetPinLevelShiftRate(GPIO4_2_AS_I2C0_SCL, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ + HAL_IOCMG_SetPinDriveRate(GPIO4_2_AS_I2C0_SCL, DRIVER_RATE_2); /* Output signal edge fast/slow */ + /* Config PIN39 */ + HAL_IOCMG_SetPinAltFuncMode(GPIO0_3_AS_UART0_TXD); /* Check function selection */ + HAL_IOCMG_SetPinPullMode(GPIO0_3_AS_UART0_TXD, PULL_NONE); /* Pull-up and Pull-down */ + HAL_IOCMG_SetPinSchmidtMode(GPIO0_3_AS_UART0_TXD, SCHMIDT_DISABLE); /* Schmitt input on/off */ + HAL_IOCMG_SetPinLevelShiftRate(GPIO0_3_AS_UART0_TXD, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ + HAL_IOCMG_SetPinDriveRate(GPIO0_3_AS_UART0_TXD, DRIVER_RATE_2); /* Output signal edge fast/slow */ + /* Config PIN40 */ + HAL_IOCMG_SetPinAltFuncMode(GPIO0_4_AS_UART0_RXD); /* Check function selection */ + HAL_IOCMG_SetPinPullMode(GPIO0_4_AS_UART0_RXD, PULL_UP); /* Pull-up and Pull-down, UART RX recommend PULL_UP */ + HAL_IOCMG_SetPinSchmidtMode(GPIO0_4_AS_UART0_RXD, SCHMIDT_DISABLE); /* Schmitt input on/off */ + HAL_IOCMG_SetPinLevelShiftRate(GPIO0_4_AS_UART0_RXD, LEVEL_SHIFT_RATE_SLOW); /* Output drive capability */ + HAL_IOCMG_SetPinDriveRate(GPIO0_4_AS_UART0_RXD, DRIVER_RATE_2); /* Output signal edge fast/slow */ +} + +void SystemInit(void) +{ + io_config(); + dma_init(); + uart0_init(); + iic0_init(); + + /* USER CODE BEGIN system_init */ + /* USER CODE END system_init */ +} \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/i2c_common/inc/i2c_common.h b/vendor/other/demo/02_paj7620u2_gesture/i2c_common/inc/i2c_common.h new file mode 100644 index 0000000000000000000000000000000000000000..c90944d13dc3fa58670c618ac12a337c53574b20 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/i2c_common/inc/i2c_common.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024 Soon.Liao. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * @Author: soon.liao + * @Date: 2024-11-02 08:51:27 + * @LastEditors: soon.liao + * @LastEditTime: 2024-11-02 10:03:02 + * @FilePath: \user\i2c_common\src\i2c_common.c + * @Description: Create Date : 2024 + * NA + */ +#ifndef IIC_COMMON_H +#define IIC_COMMON_H + +#define IIC_READ_WRITE_DELAY_MS 10 + +int get_tx_done_flag(void); +int get_rx_done_flag(void); +int get_error_flag(void); + +void set_tx_done_flag(int val); +void set_rx_done_flag(int val); +void set_error_flag(int val); + +#endif \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/i2c_common/src/i2c_common.c b/vendor/other/demo/02_paj7620u2_gesture/i2c_common/src/i2c_common.c new file mode 100755 index 0000000000000000000000000000000000000000..dd5d15cce24b1470427786ab01610bae25859e47 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/i2c_common/src/i2c_common.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2024 Soon.Liao. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * @Author: soon.liao + * @Date: 2024-11-02 08:51:27 + * @LastEditors: soon.liao + * @LastEditTime: 2024-11-02 10:03:02 + * @FilePath: \user\i2c_common\src\i2c_common.c + * @Description: Create Date : 2024 + * NA + */ +#include "main.h" +#include "debug.h" +#include "i2c_common.h" + +static volatile int g_tx_done_flag = BASE_CFG_UNSET; +static volatile int g_rx_done_flag = BASE_CFG_UNSET; +static volatile int g_error_flag = BASE_CFG_UNSET; + +/** + * @brief I2c dma sample tx callback handle. + * @param handle I2c handle. + * @retval None. + */ +void common_i2c0_tx_callback(I2C_Handle *handle) +{ + BASE_FUNC_UNUSED(handle); + g_tx_done_flag = BASE_CFG_SET; +} + +/** + * @brief I2c dma sample rx callback handle. + * @param handle I2c handle. + * @retval None. + */ +void common_i2c0_rx_callback(I2C_Handle *handle) +{ + BASE_FUNC_UNUSED(handle); + g_rx_done_flag = BASE_CFG_SET; +} + +/** + * @brief I2c dma sample Error callback handle. + * @param handle I2c handle. + * @retval None. + */ +void common_i2c0_error_callback(I2C_Handle *handle) +{ + BASE_FUNC_UNUSED(handle); + g_error_flag = BASE_CFG_SET; + DBG_PRINTF("LINE:%d,Common_I2C0ErrorCallback\r\n", __LINE__); +} + +int get_tx_done_flag(void) +{ + return g_tx_done_flag; +} + +int get_rx_done_flag(void) +{ + return g_rx_done_flag; +} + +int get_error_flag(void) +{ + return g_error_flag; +} + +void set_tx_done_flag(int val) +{ + g_tx_done_flag = val; +} + +void set_rx_done_flag(int val) +{ + g_rx_done_flag = val; +} + +void set_error_flag(int val) +{ + g_error_flag = val; +} diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/I2C0_config.png b/vendor/other/demo/02_paj7620u2_gesture/images/I2C0_config.png new file mode 100755 index 0000000000000000000000000000000000000000..99eefb8c057533805c8f8691e447bbfd290e5a2f Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/I2C0_config.png differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/build_success.png b/vendor/other/demo/02_paj7620u2_gesture/images/build_success.png new file mode 100644 index 0000000000000000000000000000000000000000..d18fd2b96d9dba002e27bedff37960d6cd1943f2 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/build_success.png differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/down_display.jpg b/vendor/other/demo/02_paj7620u2_gesture/images/down_display.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dab70570e907b3039186048ff5f1b8d5b73b7292 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/down_display.jpg differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/hw_connect.jpg b/vendor/other/demo/02_paj7620u2_gesture/images/hw_connect.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c057d3ed7e1194bfec41db55be871c4ac264a491 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/hw_connect.jpg differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/init_display.jpg b/vendor/other/demo/02_paj7620u2_gesture/images/init_display.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cd170c40674c0ed1362c88be3f5c3b591ee38bfa Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/init_display.jpg differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/macro_config.png b/vendor/other/demo/02_paj7620u2_gesture/images/macro_config.png new file mode 100755 index 0000000000000000000000000000000000000000..e60bc0b3ae30787f36215093db2cb1982dfc57dc Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/macro_config.png differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/paj7620u2.png b/vendor/other/demo/02_paj7620u2_gesture/images/paj7620u2.png new file mode 100755 index 0000000000000000000000000000000000000000..9d31184307e5ad177232a9aa2341f4660d8475d0 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/paj7620u2.png differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/project_pin_view.png b/vendor/other/demo/02_paj7620u2_gesture/images/project_pin_view.png new file mode 100755 index 0000000000000000000000000000000000000000..31b24d8fb794d97c9c484f0d00b79af669557d8c Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/project_pin_view.png differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/serial_log.png b/vendor/other/demo/02_paj7620u2_gesture/images/serial_log.png new file mode 100755 index 0000000000000000000000000000000000000000..1fa3d52ef5031ad30d0efdbf89b29d20a28d1551 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/serial_log.png differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/ssd1306_oled.png b/vendor/other/demo/02_paj7620u2_gesture/images/ssd1306_oled.png new file mode 100755 index 0000000000000000000000000000000000000000..e5482ca0567e8ff01ce945c2b68785a05b56a922 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/ssd1306_oled.png differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/images/uart0_config.png b/vendor/other/demo/02_paj7620u2_gesture/images/uart0_config.png new file mode 100755 index 0000000000000000000000000000000000000000..f7febd28ac4cacdd5f15b82122724d4f6fa407e2 Binary files /dev/null and b/vendor/other/demo/02_paj7620u2_gesture/images/uart0_config.png differ diff --git a/vendor/other/demo/02_paj7620u2_gesture/main.c b/vendor/other/demo/02_paj7620u2_gesture/main.c new file mode 100644 index 0000000000000000000000000000000000000000..6a65f0f613af4a28804cc402924ad82ffad5e848 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/main.c @@ -0,0 +1,65 @@ +/** + * @copyright Copyright (c) 2022, HiSilicon (Shanghai) Technologies Co., Ltd. All rights reserved. + * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the + * following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * @file main.c + * @author MCU Driver Team + * @brief Main program body. + */ + +#include "typedefs.h" +#include "feature.h" +#include "main.h" +/* USER CODE BEGIN 0 */ +/* USER CODE 区域内代码不会被覆盖,区域外会被生成的默认代码覆盖(其余USER CODE 区域同理) */ +#include "ssd1306.h" +#include "paj7620u2_entry.h" +/* 建议用户放置头文件 */ +/* USER CODE END 0 */ +UART_Handle g_uart0; +I2C_Handle g_i2c0_master; +DMA_Handle g_dmac; +/* USER CODE BEGIN 1 */ +/* 建议用户定义全局变量、结构体、宏定义或函数声明等 */ +/* USER CODE END 1 */ + +int main(void) +{ + /* USER CODE BEGIN 2 */ + /* 建议用户放置初始化代码或启动代码等 */ + /* USER CODE END 2 */ + SystemInit(); + /* USER CODE BEGIN 3 */ + /* 建议用户放置初始配置代码 */ + paj7620u2_entry(); + + ssd1306_device_init(); + /* USER CODE END 3 */ + while (1) { + /* USER CODE BEGIN 4 */ + /* 建议用户放置周期性执行代码 */ + paj7620u2_event(); + /* USER CODE END 4 */ + } + /* USER CODE BEGIN 5 */ + /* 建议用户放置代码流程 */ + /* USER CODE END 5 */ + return BASE_STATUS_OK; +} + +/* USER CODE BEGIN 6 */ +/* 建议用户放置自定义函数 */ +/* USER CODE END 6 */ \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/oled/inc/ssd1306.h b/vendor/other/demo/02_paj7620u2_gesture/oled/inc/ssd1306.h new file mode 100755 index 0000000000000000000000000000000000000000..d75b92878997d849ba673b2f67c845fbb90f4c47 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/oled/inc/ssd1306.h @@ -0,0 +1,114 @@ +/* Copyright (c) 2024 HiSilicon Technologies CO., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SSD1306_H +#define SSD1306_H + +#include +#include +#include "ssd1306_fonts.h" + +#define SSD1306_WAIT_I2C_INIT_DELAY_MS 200 + +#define CHAR_SPACE 0x20 // space character +#define CHAR_END '\0' // end character +#define MAX_FONT_7_10_IN_ONE_LINE 18 + +// g_ssd1306 OLED height in pixels +#ifndef SSD1306_HEIGHT +#define SSD1306_HEIGHT 64 +#endif + +// g_ssd1306 width in pixels +#ifndef SSD1306_WIDTH +#define SSD1306_WIDTH 128 +#endif + +// some LEDs don't display anything in first two columns + +#ifndef SSD1306_BUFFER_SIZE +#define SSD1306_BUFFER_SIZE (SSD1306_WIDTH * SSD1306_HEIGHT / 8) +#endif + +// Enumeration for screen colors +typedef enum { + BLACK = 0x00, // BLACK color, no pixel + WHITE = 0x01 // Pixel is set. Color depends on OLED +} ssd1306_color; + +typedef enum { + SSD1306_OK = 0x00, + SSD1306_ERR = 0x01 // Generic error. +} ssd1306_error_t; + +// Struct to store transformations +typedef struct { + uint16_t current_x; + uint16_t current_y; + uint8_t inverted; + uint8_t initialized; + uint8_t display_on; +} SSD1306_t; +typedef struct { + uint8_t x; + uint8_t y; +} ssd1306_vertex; + +void ssd1306_device_init(void); + +// Procedure definitions +void ssd1306_init(void); +void ssd1306_fill(ssd1306_color color); +void ssd1306_set_cursor(uint8_t x, uint8_t y); +void ssd1306_update_screen(void); + +char ssd1306_draw_char(char ch, font_def font, ssd1306_color color); +char ssd1306_draw_string(char *str, font_def font, ssd1306_color color); + +void ssd1306_draw_pixel(uint8_t x, uint8_t y, ssd1306_color color); +void ssd1306_draw_line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, ssd1306_color color); +void ssd1306_draw_polyline(const ssd1306_vertex *par_vertex, uint16_t par_size, ssd1306_color color); +void ssd1306_draw_rectangle(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, ssd1306_color color); +void ssd1306_draw_circle(uint8_t par_x, uint8_t par_y, uint8_t par_r, ssd1306_color par_color); +void ssd1306_draw_bitmap(const uint8_t *bitmap, uint32_t size); +void ssd1306_draw_region(uint8_t x, uint8_t y, uint8_t w, const uint8_t *data, uint32_t size); + +/** + * @brief Sets the contrast of the display. + * @param[in] value contrast to set. + * @note Contrast increases as the value increases. + * @note RESET = 7Fh. + */ +void ssd1306_set_contrast(const uint8_t value); +/** + * @brief Set Display ON/OFF. + * @param[in] on 0 for OFF, any for ON. + */ +void ssd1306_set_display_on(const uint8_t on); +/** + * @brief Reads display_on state. + * @return 0: OFF. + * 1: ON. + */ +uint8_t ssd1306_get_display_on(void); + +// Low-level procedures +void ssd1306_reset(void); +void ssd1306_write_command(uint8_t byte); +void ssd1306_write_data(uint8_t *buffer, size_t buff_size); +ssd1306_error_t ssd1306_fill_buffer(uint8_t *buf, uint32_t len); +void ssd1306_clear_oled(void); +void ssd1306_printf(char *fmt, ...); + +#endif // SSD1306_H \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/oled/inc/ssd1306_fonts.h b/vendor/other/demo/02_paj7620u2_gesture/oled/inc/ssd1306_fonts.h new file mode 100755 index 0000000000000000000000000000000000000000..55bf4956926feb139f6fe12101c07071d94bc29a --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/oled/inc/ssd1306_fonts.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2018, Alexey Dynda + MIT License + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ +/** + * @file ssd1306_fonts.h Fonts for monochrome/rgb oled display + */ + +#ifndef SSD1306_FONTS_H +#define SSD1306_FONTS_H + +/** + * @defgroup LCD_FONTS FONTS: Supported LCD fonts + * @{ + */ + +extern const unsigned char F6_X8[][6]; +extern const unsigned char F8_X16[]; + +typedef struct { + const unsigned char font_width; /*!< Font width in pixels */ + unsigned char font_height; /*!< Font height in pixels */ + const unsigned short *data; /*!< Pointer to data font data array */ +} font_def; + +extern font_def g_font_7x10; +extern font_def g_font_6x8; +extern font_def g_font_11x18; +extern font_def g_font_16x26; + +#endif // SSD1306_FONTS_H \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/oled/src/ssd1306.c b/vendor/other/demo/02_paj7620u2_gesture/oled/src/ssd1306.c new file mode 100644 index 0000000000000000000000000000000000000000..b923791cb2e87a5665142dd4f2972782149d4871 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/oled/src/ssd1306.c @@ -0,0 +1,549 @@ +/* Copyright (c) 2024 HiSilicon Technologies CO., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "i2c.h" +#include "main.h" +#include "debug.h" +#include "i2c_common.h" +#include "ssd1306.h" + +#define SSD1306_READ_WRITE_DELAY_MS 100 +#define SSD1306_SLAVE2_ADDR 0x3C << 1 +#define SSD1306_CTRL_CMD 0x00 +#define SSD1306_CTRL_DATA 0x40 +#define SSD1306_MASK_CONT (0x1 << 7) +#define DOUBLE 2 + +void ssd1306_reset(void) +{ + // Wait for the screen to boot,1ms The delay here is very important + BASE_FUNC_DELAY_MS(1); +} + +static uint32_t ssd1306_send_data(uint8_t *buffer, uint32_t size) +{ + BASE_StatusType ret = BASE_STATUS_OK; + + BASE_FUNC_DELAY_MS(IIC_READ_WRITE_DELAY_MS); /* Delay 5 ms. */ + ret = HAL_I2C_MasterWriteDMA(&g_i2c0_master, SSD1306_SLAVE2_ADDR, (unsigned char *)buffer, (unsigned int)size); + if (ret != BASE_STATUS_OK) { + DBG_PRINTF("ssd1306_send_data LINE:%d,Write Data Fail,ret:%d\r\n", __LINE__, ret); + return ret; + } + /* Waiting for write completion or failure */ + while (!(get_tx_done_flag() || get_error_flag())) { + ; + } + set_tx_done_flag(BASE_CFG_UNSET); + if (get_error_flag() == BASE_CFG_SET) { + set_error_flag(BASE_CFG_UNSET); /* Reset g_error_flag. */ + DBG_PRINTF("LINE:%d,Write Data Fail\r\n", __LINE__); + return BASE_STATUS_ERROR; + } + return 0; +} + +static uint32_t ssd1306_wite_byte(uint8_t reg_addr, uint8_t byte) +{ + uint8_t buffer[] = {reg_addr, byte}; + return ssd1306_send_data(buffer, sizeof(buffer)); +} + +// Send a byte to the command register +void ssd1306_write_command(uint8_t byte) +{ + ssd1306_wite_byte(SSD1306_CTRL_CMD, byte); +} + +// Send data +void ssd1306_write_data(uint8_t *buffer, uint32_t buff_size) +{ + uint8_t data[SSD1306_WIDTH * DOUBLE] = {0}; + for (uint32_t i = 0; i < buff_size; i++) { + data[i * DOUBLE] = SSD1306_CTRL_DATA | SSD1306_MASK_CONT; + data[i * DOUBLE + 1] = buffer[i]; + } + data[(buff_size - 1) * DOUBLE] = SSD1306_CTRL_DATA; + DBG_PRINTF("LINE:%d,FUNC:%S\r\n", __LINE__, __FUNCTION__); + ssd1306_send_data(data, sizeof(data)); +} + +// Screenbuffer +static uint8_t g_ssd1306_buffer[SSD1306_BUFFER_SIZE]; + +// Screen object +static SSD1306_t g_ssd1306; + +/* Fills the Screenbuffer with values from a given buffer of a fixed length */ +ssd1306_error_t ssd1306_fill_buffer(uint8_t *buf, uint32_t len) +{ + ssd1306_error_t ret = SSD1306_ERR; + if (len <= SSD1306_BUFFER_SIZE) { + memcpy_s(g_ssd1306_buffer, len + 1, buf, len); + ret = SSD1306_OK; + } + return ret; +} + +static void ssd1306_init_cmd(void) +{ + ssd1306_write_command(0xA4); // 0xa4,Output follows RAM content;0xa5,Output ignores RAM content + + ssd1306_write_command(0xD3); // -set display offset - CHECK + ssd1306_write_command(0x00); // -not offset + + ssd1306_write_command(0xD5); // --set display clock divide ratio/oscillator frequency + ssd1306_write_command(0xF0); // --set divide ratio + + ssd1306_write_command(0xD9); // --set pre-charge period + ssd1306_write_command(0x11); // 0x22 by default + + ssd1306_write_command(0xDA); // --set com pins hardware configuration - CHECK +#if (SSD1306_HEIGHT == 32) + ssd1306_write_command(0x02); +#elif (SSD1306_HEIGHT == 64) + ssd1306_write_command(0x12); +#elif (SSD1306_HEIGHT == 128) + ssd1306_write_command(0x12); +#else +#error "Only 32, 64, or 128 lines of height are supported!" +#endif + + ssd1306_write_command(0xDB); // --set vcomh + ssd1306_write_command(0x30); // 0x20,0.77xVcc, 0x30,0.83xVcc + + ssd1306_write_command(0x8D); // --set DC-DC enable + ssd1306_write_command(0x14); // + ssd1306_set_display_on(1); // --turn on g_ssd1306 panel +} + +// Initialize the oled screen +void ssd1306_init(void) +{ + // Reset OLED + ssd1306_reset(); + // Init OLED + ssd1306_set_display_on(0); // display off + + ssd1306_write_command(0x20); // Set Memory Addressing Mode + ssd1306_write_command(0x00); // 00b,Horizontal Addressing Mode; 01b,Vertical Addressing Mode; + // 10b,Page Addressing Mode (RESET); 11b,Invalid + + ssd1306_write_command(0xB0); // Set Page Start Address for Page Addressing Mode,0-7 + +#ifdef SSD1306_MIRROR_VERT + ssd1306_write_command(0xC0); // Mirror vertically +#else + ssd1306_write_command(0xC8); // Set COM Output Scan Direction +#endif + + ssd1306_write_command(0x00); // ---set low column address + ssd1306_write_command(0x10); // ---set high column address + + ssd1306_write_command(0x40); // --set start line address - CHECK + + ssd1306_set_contrast(0xFF); + +#ifdef SSD1306_MIRROR_HORIZ + ssd1306_write_command(0xA0); // Mirror horizontally +#else + ssd1306_write_command(0xA1); // --set segment re-map 0 to 127 - CHECK +#endif + +#ifdef SSD1306_INVERSE_COLOR + ssd1306_write_command(0xA7); // --set inverse color +#else + ssd1306_write_command(0xA6); // --set normal color +#endif + +// Set multiplex ratio. +#if (SSD1306_HEIGHT == 128) + // Found in the Luma Python lib for SH1106. + ssd1306_write_command(0xFF); +#else + ssd1306_write_command(0xA8); // --set multiplex ratio(1 to 64) - CHECK +#endif + +#if (SSD1306_HEIGHT == 32) + ssd1306_write_command(0x1F); // +#elif (SSD1306_HEIGHT == 64) + ssd1306_write_command(0x3F); // +#elif (SSD1306_HEIGHT == 128) + ssd1306_write_command(0x3F); // Seems to work for 128px high displays too. +#else +#error "Only 32, 64, or 128 lines of height are supported!" +#endif + ssd1306_init_cmd(); + // Clear screen + ssd1306_fill(BLACK); + + BASE_FUNC_DELAY_MS(SSD1306_READ_WRITE_DELAY_MS); + // Flush buffer to screen + ssd1306_update_screen(); + + // Set default values for screen object + g_ssd1306.current_x = 0; + g_ssd1306.current_y = 0; + + g_ssd1306.initialized = 1; +} + +// Fill the whole screen with the given color +void ssd1306_fill(ssd1306_color color) +{ + /* Set memory */ + uint32_t i; + + for (i = 0; i < sizeof(g_ssd1306_buffer); i++) { + g_ssd1306_buffer[i] = (color == BLACK) ? 0x00 : 0xFF; + } +} + +// Write the screenbuffer with changed to the screen +void ssd1306_update_screen(void) +{ + // Write data to each page of RAM. Number of pages + // depends on the screen height: + // + // * 32px == 4 pages + // * 64px == 8 pages + // * 128px == 16 pages + + uint8_t cmd[] = { + 0X21, // 设置列起始和结束地址 + 0X00, // 列起始地址 0 + 0X7F, // 列终止地址 127 + 0X22, // 设置页起始和结束地址 + 0X00, // 页起始地址 0 + 0X07, // 页终止地址 7 + }; + uint32_t count = 0; + uint8_t data[sizeof(cmd) * DOUBLE + SSD1306_BUFFER_SIZE + 1] = {}; + + // copy cmd + for (uint32_t i = 0; i < sizeof(cmd) / sizeof(cmd[0]); i++) { + data[count++] = SSD1306_CTRL_CMD | SSD1306_MASK_CONT; + data[count++] = cmd[i]; + } + + // copy frame data + data[count++] = SSD1306_CTRL_DATA; + memcpy_s(&data[count], SSD1306_BUFFER_SIZE + 1, g_ssd1306_buffer, SSD1306_BUFFER_SIZE); + count += sizeof(g_ssd1306_buffer); + + // send to i2c bus + uint32_t retval = ssd1306_send_data(data, count); + if (retval != 0) { + DBG_PRINTF("ssd1306_update_screen send frame data filed: %d!\r\n", retval); + } +} + +// Draw one pixel in the screenbuffer +// X => X Coordinate +// Y => Y Coordinate +// color => Pixel color +void ssd1306_draw_pixel(uint8_t x, uint8_t y, ssd1306_color color) +{ + if (x >= SSD1306_WIDTH || y >= SSD1306_HEIGHT) { + // Don't write outside the buffer + return; + } + ssd1306_color color1 = color; + // Check if pixel should be inverted + if (g_ssd1306.inverted) { + color1 = (ssd1306_color)!color1; + } + + // Draw in the right color + uint32_t c = 8; // 8 + if (color == WHITE) { + g_ssd1306_buffer[x + (y / c) * SSD1306_WIDTH] |= 1 << (y % c); + } else { + g_ssd1306_buffer[x + (y / c) * SSD1306_WIDTH] &= ~(1 << (y % c)); + } +} + +// Draw 1 char to the screen buffer +// ch => char om weg te schrijven +// Font => Font waarmee we gaan schrijven +// color => BLACK or WHITE +char ssd1306_draw_char(char ch, font_def font, ssd1306_color color) +{ + uint32_t i, b, j; + + // Check if character is valid + uint32_t ch_min = 32; // 32 + uint32_t ch_max = 126; // 126 + if ((uint32_t)ch < ch_min || (uint32_t)ch > ch_max) { + return 0; + } + + // Check remaining space on current line + if ((g_ssd1306.current_x + font.font_width) > SSD1306_WIDTH || + (g_ssd1306.current_y + font.font_height) > SSD1306_HEIGHT) { + // Not enough space on current line + return 0; + } + + // Use the font to write + for (i = 0; i < font.font_height; i++) { + b = font.data[(ch - ch_min) * font.font_height + i]; + for (j = 0; j < font.font_width; j++) { + if ((b << j) & 0x8000) { + ssd1306_draw_pixel(g_ssd1306.current_x + j, (g_ssd1306.current_y + i), (ssd1306_color)color); + } else { + ssd1306_draw_pixel(g_ssd1306.current_x + j, (g_ssd1306.current_y + i), (ssd1306_color)!color); + } + } + } + + // The current space is now taken + g_ssd1306.current_x += font.font_width; + + // Return written char for validation + return ch; +} + +// Write full string to screenbuffer +char ssd1306_draw_string(char *str, font_def font, ssd1306_color color) +{ + // Write until null-byte + char *str1 = str; + while (*str1) { + if (ssd1306_draw_char(*str1, font, color) != *str1) { + // Char could not be written + return *str1; + } + // Next char + str1++; + } + + // Everything ok + return *str1; +} + +// Position the cursor +void ssd1306_set_cursor(uint8_t x, uint8_t y) +{ + g_ssd1306.current_x = x; + g_ssd1306.current_y = y; +} + +// Draw line by Bresenhem's algorithm +void ssd1306_draw_line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, ssd1306_color color) +{ + uint8_t x = x1; + uint8_t y = y1; + int32_t delta_x = abs(x2 - x1); + int32_t delta_y = abs(y2 - y1); + int32_t sign_x = ((x1 < x2) ? 1 : -1); + int32_t sign_y = ((y1 < y2) ? 1 : -1); + int32_t error = delta_x - delta_y; + int32_t error2; + ssd1306_draw_pixel(x2, y2, color); + while ((x1 != x2) || (y1 != y2)) { + ssd1306_draw_pixel(x1, y1, color); + error2 = error * DOUBLE; + if (error2 > -delta_y) { + error -= delta_y; + x += sign_x; + } else { + /* nothing to do */ + } + if (error2 < delta_x) { + error += delta_x; + y += sign_y; + } else { + /* nothing to do */ + } + } +} + +// Draw polyline +void ssd1306_draw_polyline(const ssd1306_vertex *par_vertex, uint16_t par_size, ssd1306_color color) +{ + uint16_t i; + if (par_vertex != 0) { + for (i = 1; i < par_size; i++) { + ssd1306_draw_line(par_vertex[i - 1].x, par_vertex[i - 1].y, par_vertex[i].x, par_vertex[i].y, color); + } + } else { + /* nothing to do */ + } + return; +} + +// Draw circle by Bresenhem's algorithm +void ssd1306_draw_circle(uint8_t par_x, uint8_t par_y, uint8_t par_r, ssd1306_color par_color) +{ + int32_t x = -par_r; + int32_t y = 0; + int32_t b = 2; + int32_t err = b - b * par_r; + int32_t e2; + + if (par_x >= SSD1306_WIDTH || par_y >= SSD1306_HEIGHT) { + return; + } + + do { + ssd1306_draw_pixel(par_x - x, par_y + y, par_color); + ssd1306_draw_pixel(par_x + x, par_y + y, par_color); + ssd1306_draw_pixel(par_x + x, par_y - y, par_color); + ssd1306_draw_pixel(par_x - x, par_y - y, par_color); + e2 = err; + if (e2 <= y) { + y++; + err = err + (y * b + 1); + if (-x == y && e2 <= x) { + e2 = 0; + } else { + /* nothing to do */ + } + } else { + /* nothing to do */ + } + if (e2 > x) { + x++; + err = err + (x * b + 1); + } else { + /* nothing to do */ + } + } while (x <= 0); + + return; +} + +// Draw rectangle +void ssd1306_draw_rectangle(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, ssd1306_color color) +{ + ssd1306_draw_line(x1, y1, x2, y1, color); + ssd1306_draw_line(x2, y1, x2, y2, color); + ssd1306_draw_line(x2, y2, x1, y2, color); + ssd1306_draw_line(x1, y2, x1, y1, color); +} + +void ssd1306_draw_bitmap(const uint8_t *bitmap, uint32_t size) +{ + unsigned int c = 8; + uint8_t rows = size * c / SSD1306_WIDTH; + if (rows > SSD1306_HEIGHT) { + rows = SSD1306_HEIGHT; + } + for (uint8_t y = 0; y < rows; y++) { + for (uint8_t x = 0; x < SSD1306_WIDTH; x++) { + uint8_t byte = bitmap[(y * SSD1306_WIDTH / c) + (x / c)]; + uint8_t bit = byte & (0x80 >> (x % c)); + ssd1306_draw_pixel(x, y, bit ? WHITE : BLACK); + } + } +} + +void ssd1306_draw_region(uint8_t x, uint8_t y, uint8_t w, const uint8_t *data, uint32_t size) +{ + uint32_t stride = w; + uint8_t h = w; // 字体宽高一样 + uint8_t width = w; + if (x + w > SSD1306_WIDTH || y + h > SSD1306_HEIGHT || w * h == 0) { + DBG_PRINTF("%dx%d @ %d,%d out of range or invalid!\r\n", w, h, x, y); + return; + } + + width = (width <= SSD1306_WIDTH ? width : SSD1306_WIDTH); + h = (h <= SSD1306_HEIGHT ? h : SSD1306_HEIGHT); + stride = (stride == 0 ? w : stride); + unsigned int c = 8; + + uint8_t rows = size * c / stride; + for (uint8_t i = 0; i < rows; i++) { + uint32_t base = i * stride / c; + for (uint8_t j = 0; j < width; j++) { + uint32_t idx = base + (j / c); + uint8_t byte = idx < size ? data[idx] : 0; + uint8_t bit = byte & (0x80 >> (j % c)); + ssd1306_draw_pixel(x + j, y + i, bit ? WHITE : BLACK); + } + } +} + +void ssd1306_set_contrast(const uint8_t value) +{ + const uint8_t k_set_contrast_control_register = 0x81; + ssd1306_write_command(k_set_contrast_control_register); + ssd1306_write_command(value); +} + +void ssd1306_set_display_on(const uint8_t on) +{ + uint8_t value; + if (on) { + value = 0xAF; // Display on + g_ssd1306.display_on = 1; + } else { + value = 0xAE; // Display off + g_ssd1306.display_on = 0; + } + ssd1306_write_command(value); +} + +uint8_t ssd1306_get_display_on(void) +{ + return g_ssd1306.display_on; +} + +int g_ssd1306_current_loc_v = 0; +#define SSD1306_INTERVAL_V (15) + +void ssd1306_clear_oled(void) +{ + ssd1306_fill(BLACK); + g_ssd1306_current_loc_v = 0; +} + +void ssd1306_printf(char *fmt, ...) +{ + char buffer[20]; + int ret = 0; + if (fmt) { + va_list arg_list; + va_start(arg_list, fmt); + ret = vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer), fmt, arg_list); + if (ret < 0) { + DBG_PRINTF("buffer is null\r\n"); + } + va_end(arg_list); + ssd1306_set_cursor(0, g_ssd1306_current_loc_v); + ssd1306_draw_string(buffer, g_font_7x10, WHITE); + + ssd1306_update_screen(); + } + g_ssd1306_current_loc_v += SSD1306_INTERVAL_V; +} + +void ssd1306_device_init(void) +{ + BASE_FUNC_DELAY_MS(SSD1306_WAIT_I2C_INIT_DELAY_MS); + ssd1306_init(); + ssd1306_fill(BLACK); + ssd1306_set_cursor(0, 0); + ssd1306_draw_string("Hello Paj7620U2!!!", g_font_7x10, WHITE); + ssd1306_update_screen(); +} \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/oled/src/ssd1306_fonts.c b/vendor/other/demo/02_paj7620u2_gesture/oled/src/ssd1306_fonts.c new file mode 100755 index 0000000000000000000000000000000000000000..5c0e06f23a9cdca77427e0d334e2f16532a66120 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/oled/src/ssd1306_fonts.c @@ -0,0 +1,817 @@ +/* Copyright (c) 2018-2019, Alexey Dynda + MIT License + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ +/* + * ssd1306xled_font6x8 is by Neven Boyanov + * ssd1306xled_font8x16 is by Neven Boyanov + * + * @created: 2014-08-12 + * @author: Neven Boyanov + * + * Copyright (c) 2015 Neven Boyanov, Tinusaur Team. All Rights Reserved. + * Distributed as open source software under MIT License, see LICENSE.txt file. + * Please, as a favour, retain the link http://tinusaur.org to The Tinusaur Project. + * + * Source code available at: https://bitbucket.org/tinusaur/ssd1306xled + * + */ + +#include "ssd1306_fonts.h" + +/************************************6*8的点阵************************************/ +const unsigned char F6_X8[][6] = { + {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // sp + {0x00, 0x00, 0x00, 0x2f, 0x00, 0x00}, // ! + {0x00, 0x00, 0x07, 0x00, 0x07, 0x00}, // " + {0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14}, // # + {0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12}, // $ + {0x00, 0x62, 0x64, 0x08, 0x13, 0x23}, // % + {0x00, 0x36, 0x49, 0x55, 0x22, 0x50}, // & + {0x00, 0x00, 0x05, 0x03, 0x00, 0x00}, // ' + {0x00, 0x00, 0x1c, 0x22, 0x41, 0x00}, // ( + {0x00, 0x00, 0x41, 0x22, 0x1c, 0x00}, // ) + {0x00, 0x14, 0x08, 0x3E, 0x08, 0x14}, // * + {0x00, 0x08, 0x08, 0x3E, 0x08, 0x08}, // + + {0x00, 0x00, 0x00, 0xA0, 0x60, 0x00}, // , + {0x00, 0x08, 0x08, 0x08, 0x08, 0x08}, // - + {0x00, 0x00, 0x60, 0x60, 0x00, 0x00}, // . + {0x00, 0x20, 0x10, 0x08, 0x04, 0x02}, // / + {0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E}, // 0 + {0x00, 0x00, 0x42, 0x7F, 0x40, 0x00}, // 1 + {0x00, 0x42, 0x61, 0x51, 0x49, 0x46}, // 2 + {0x00, 0x21, 0x41, 0x45, 0x4B, 0x31}, // 3 + {0x00, 0x18, 0x14, 0x12, 0x7F, 0x10}, // 4 + {0x00, 0x27, 0x45, 0x45, 0x45, 0x39}, // 5 + {0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30}, // 6 + {0x00, 0x01, 0x71, 0x09, 0x05, 0x03}, // 7 + {0x00, 0x36, 0x49, 0x49, 0x49, 0x36}, // 8 + {0x00, 0x06, 0x49, 0x49, 0x29, 0x1E}, // 9 + {0x00, 0x00, 0x36, 0x36, 0x00, 0x00}, // : + {0x00, 0x00, 0x56, 0x36, 0x00, 0x00}, // ;号 + {0x00, 0x08, 0x14, 0x22, 0x41, 0x00}, // < + {0x00, 0x14, 0x14, 0x14, 0x14, 0x14}, // = + {0x00, 0x00, 0x41, 0x22, 0x14, 0x08}, // > + {0x00, 0x02, 0x01, 0x51, 0x09, 0x06}, // ? + {0x00, 0x32, 0x49, 0x59, 0x51, 0x3E}, // @ + {0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C}, // A + {0x00, 0x7F, 0x49, 0x49, 0x49, 0x36}, // B + {0x00, 0x3E, 0x41, 0x41, 0x41, 0x22}, // C + {0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C}, // D + {0x00, 0x7F, 0x49, 0x49, 0x49, 0x41}, // E + {0x00, 0x7F, 0x09, 0x09, 0x09, 0x01}, // F + {0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A}, // G + {0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F}, // H + {0x00, 0x00, 0x41, 0x7F, 0x41, 0x00}, // I + {0x00, 0x20, 0x40, 0x41, 0x3F, 0x01}, // J + {0x00, 0x7F, 0x08, 0x14, 0x22, 0x41}, // K + {0x00, 0x7F, 0x40, 0x40, 0x40, 0x40}, // L + {0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F}, // M + {0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F}, // N + {0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E}, // O + {0x00, 0x7F, 0x09, 0x09, 0x09, 0x06}, // P + {0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E}, // Q + {0x00, 0x7F, 0x09, 0x19, 0x29, 0x46}, // R + {0x00, 0x46, 0x49, 0x49, 0x49, 0x31}, // S + {0x00, 0x01, 0x01, 0x7F, 0x01, 0x01}, // T + {0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F}, // U + {0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F}, // V + {0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F}, // W + {0x00, 0x63, 0x14, 0x08, 0x14, 0x63}, // X + {0x00, 0x07, 0x08, 0x70, 0x08, 0x07}, // Y + {0x00, 0x61, 0x51, 0x49, 0x45, 0x43}, // Z + {0x00, 0x00, 0x7F, 0x41, 0x41, 0x00}, // [ + {0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55}, // 55 + {0x00, 0x00, 0x41, 0x41, 0x7F, 0x00}, // ] + {0x00, 0x04, 0x02, 0x01, 0x02, 0x04}, // ^ + {0x00, 0x40, 0x40, 0x40, 0x40, 0x40}, // _ + {0x00, 0x00, 0x01, 0x02, 0x04, 0x00}, // ' + {0x00, 0x20, 0x54, 0x54, 0x54, 0x78}, // a + {0x00, 0x7F, 0x48, 0x44, 0x44, 0x38}, // b + {0x00, 0x38, 0x44, 0x44, 0x44, 0x20}, // c + {0x00, 0x38, 0x44, 0x44, 0x48, 0x7F}, // d + {0x00, 0x38, 0x54, 0x54, 0x54, 0x18}, // e + {0x00, 0x08, 0x7E, 0x09, 0x01, 0x02}, // f + {0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C}, // g + {0x00, 0x7F, 0x08, 0x04, 0x04, 0x78}, // h + {0x00, 0x00, 0x44, 0x7D, 0x40, 0x00}, // i + {0x00, 0x40, 0x80, 0x84, 0x7D, 0x00}, // j + {0x00, 0x7F, 0x10, 0x28, 0x44, 0x00}, // k + {0x00, 0x00, 0x41, 0x7F, 0x40, 0x00}, // l + {0x00, 0x7C, 0x04, 0x18, 0x04, 0x78}, // m + {0x00, 0x7C, 0x08, 0x04, 0x04, 0x78}, // n + {0x00, 0x38, 0x44, 0x44, 0x44, 0x38}, // o + {0x00, 0xFC, 0x24, 0x24, 0x24, 0x18}, // p + {0x00, 0x18, 0x24, 0x24, 0x18, 0xFC}, // q + {0x00, 0x7C, 0x08, 0x04, 0x04, 0x08}, // r + {0x00, 0x48, 0x54, 0x54, 0x54, 0x20}, // s + {0x00, 0x04, 0x3F, 0x44, 0x40, 0x20}, // t + {0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C}, // u + {0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C}, // v + {0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C}, // w + {0x00, 0x44, 0x28, 0x10, 0x28, 0x44}, // x + {0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C}, // y + {0x00, 0x44, 0x64, 0x54, 0x4C, 0x44}, // z + {0x14, 0x14, 0x14, 0x14, 0x14, 0x14}, // horiz lines +}; + +/****************************************8*16的点阵************************************/ +const unsigned char F8_X16[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0 + 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x30, 0x00, 0x00, 0x00, // ! 1 + 0x00, 0x10, 0x0C, 0x06, 0x10, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // " 2 + 0x40, 0xC0, 0x78, 0x40, 0xC0, 0x78, 0x40, 0x00, 0x04, 0x3F, 0x04, 0x04, 0x3F, 0x04, 0x04, 0x00, // # 3 + 0x00, 0x70, 0x88, 0xFC, 0x08, 0x30, 0x00, 0x00, 0x00, 0x18, 0x20, 0xFF, 0x21, 0x1E, 0x00, 0x00, // $ 4 + 0xF0, 0x08, 0xF0, 0x00, 0xE0, 0x18, 0x00, 0x00, 0x00, 0x21, 0x1C, 0x03, 0x1E, 0x21, 0x1E, 0x00, // % 5 + 0x00, 0xF0, 0x08, 0x88, 0x70, 0x00, 0x00, 0x00, 0x1E, 0x21, 0x23, 0x24, 0x19, 0x27, 0x21, 0x10, // & 6 + 0x10, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ' 7 + 0x00, 0x00, 0x00, 0xE0, 0x18, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x20, 0x40, 0x00, // ( 8 + 0x00, 0x02, 0x04, 0x18, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, // ) 9 + 0x40, 0x40, 0x80, 0xF0, 0x80, 0x40, 0x40, 0x00, 0x02, 0x02, 0x01, 0x0F, 0x01, 0x02, 0x02, 0x00, // * 10 + 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x1F, 0x01, 0x01, 0x01, 0x00, // + 11 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xB0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // , 12 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // - 13 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // . 14 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, 0x04, 0x00, 0x60, 0x18, 0x06, 0x01, 0x00, 0x00, 0x00, // / 15 + 0x00, 0xE0, 0x10, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x00, 0x0F, 0x10, 0x20, 0x20, 0x10, 0x0F, 0x00, // 0 16 + 0x00, 0x10, 0x10, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // 1 17 + 0x00, 0x70, 0x08, 0x08, 0x08, 0x88, 0x70, 0x00, 0x00, 0x30, 0x28, 0x24, 0x22, 0x21, 0x30, 0x00, // 2 18 + 0x00, 0x30, 0x08, 0x88, 0x88, 0x48, 0x30, 0x00, 0x00, 0x18, 0x20, 0x20, 0x20, 0x11, 0x0E, 0x00, // 3 19 + 0x00, 0x00, 0xC0, 0x20, 0x10, 0xF8, 0x00, 0x00, 0x00, 0x07, 0x04, 0x24, 0x24, 0x3F, 0x24, 0x00, // 4 20 + 0x00, 0xF8, 0x08, 0x88, 0x88, 0x08, 0x08, 0x00, 0x00, 0x19, 0x21, 0x20, 0x20, 0x11, 0x0E, 0x00, // 5 21 + 0x00, 0xE0, 0x10, 0x88, 0x88, 0x18, 0x00, 0x00, 0x00, 0x0F, 0x11, 0x20, 0x20, 0x11, 0x0E, 0x00, // 6 22 + 0x00, 0x38, 0x08, 0x08, 0xC8, 0x38, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, // 7 23 + 0x00, 0x70, 0x88, 0x08, 0x08, 0x88, 0x70, 0x00, 0x00, 0x1C, 0x22, 0x21, 0x21, 0x22, 0x1C, 0x00, // 8 24 + 0x00, 0xE0, 0x10, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x00, 0x00, 0x31, 0x22, 0x22, 0x11, 0x0F, 0x00, // 9 25 + 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, // : 26 + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x00, // ;号 27 + 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x00, 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, // < 28 + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, // = 29 + 0x00, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, // > 30 + 0x00, 0x70, 0x48, 0x08, 0x08, 0x08, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x30, 0x36, 0x01, 0x00, 0x00, // ? 31 + 0xC0, 0x30, 0xC8, 0x28, 0xE8, 0x10, 0xE0, 0x00, 0x07, 0x18, 0x27, 0x24, 0x23, 0x14, 0x0B, 0x00, // @ 32 + 0x00, 0x00, 0xC0, 0x38, 0xE0, 0x00, 0x00, 0x00, 0x20, 0x3C, 0x23, 0x02, 0x02, 0x27, 0x38, 0x20, // A 33 + 0x08, 0xF8, 0x88, 0x88, 0x88, 0x70, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x20, 0x20, 0x11, 0x0E, 0x00, // B 34 + 0xC0, 0x30, 0x08, 0x08, 0x08, 0x08, 0x38, 0x00, 0x07, 0x18, 0x20, 0x20, 0x20, 0x10, 0x08, 0x00, // C 35 + 0x08, 0xF8, 0x08, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x20, 0x3F, 0x20, 0x20, 0x20, 0x10, 0x0F, 0x00, // D 36 + 0x08, 0xF8, 0x88, 0x88, 0xE8, 0x08, 0x10, 0x00, 0x20, 0x3F, 0x20, 0x20, 0x23, 0x20, 0x18, 0x00, // E 37 + 0x08, 0xF8, 0x88, 0x88, 0xE8, 0x08, 0x10, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x03, 0x00, 0x00, 0x00, // F 38 + 0xC0, 0x30, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x07, 0x18, 0x20, 0x20, 0x22, 0x1E, 0x02, 0x00, // G 39 + 0x08, 0xF8, 0x08, 0x00, 0x00, 0x08, 0xF8, 0x08, 0x20, 0x3F, 0x21, 0x01, 0x01, 0x21, 0x3F, 0x20, // H 40 + 0x00, 0x08, 0x08, 0xF8, 0x08, 0x08, 0x00, 0x00, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // I 41 + 0x00, 0x00, 0x08, 0x08, 0xF8, 0x08, 0x08, 0x00, 0xC0, 0x80, 0x80, 0x80, 0x7F, 0x00, 0x00, 0x00, // J 42 + 0x08, 0xF8, 0x88, 0xC0, 0x28, 0x18, 0x08, 0x00, 0x20, 0x3F, 0x20, 0x01, 0x26, 0x38, 0x20, 0x00, // K 43 + 0x08, 0xF8, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x20, 0x20, 0x20, 0x30, 0x00, // L 44 + 0x08, 0xF8, 0xF8, 0x00, 0xF8, 0xF8, 0x08, 0x00, 0x20, 0x3F, 0x00, 0x3F, 0x00, 0x3F, 0x20, 0x00, // M 45 + 0x08, 0xF8, 0x30, 0xC0, 0x00, 0x08, 0xF8, 0x08, 0x20, 0x3F, 0x20, 0x00, 0x07, 0x18, 0x3F, 0x00, // N 46 + 0xE0, 0x10, 0x08, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x0F, 0x10, 0x20, 0x20, 0x20, 0x10, 0x0F, 0x00, // O 47 + 0x08, 0xF8, 0x08, 0x08, 0x08, 0x08, 0xF0, 0x00, 0x20, 0x3F, 0x21, 0x01, 0x01, 0x01, 0x00, 0x00, // P 48 + 0xE0, 0x10, 0x08, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x0F, 0x18, 0x24, 0x24, 0x38, 0x50, 0x4F, 0x00, // Q 49 + 0x08, 0xF8, 0x88, 0x88, 0x88, 0x88, 0x70, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x03, 0x0C, 0x30, 0x20, // R 50 + 0x00, 0x70, 0x88, 0x08, 0x08, 0x08, 0x38, 0x00, 0x00, 0x38, 0x20, 0x21, 0x21, 0x22, 0x1C, 0x00, // S 51 + 0x18, 0x08, 0x08, 0xF8, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x00, 0x00, // T 52 + 0x08, 0xF8, 0x08, 0x00, 0x00, 0x08, 0xF8, 0x08, 0x00, 0x1F, 0x20, 0x20, 0x20, 0x20, 0x1F, 0x00, // U 53 + 0x08, 0x78, 0x88, 0x00, 0x00, 0xC8, 0x38, 0x08, 0x00, 0x00, 0x07, 0x38, 0x0E, 0x01, 0x00, 0x00, // V 54 + 0xF8, 0x08, 0x00, 0xF8, 0x00, 0x08, 0xF8, 0x00, 0x03, 0x3C, 0x07, 0x00, 0x07, 0x3C, 0x03, 0x00, // W 55 + 0x08, 0x18, 0x68, 0x80, 0x80, 0x68, 0x18, 0x08, 0x20, 0x30, 0x2C, 0x03, 0x03, 0x2C, 0x30, 0x20, // X 56 + 0x08, 0x38, 0xC8, 0x00, 0xC8, 0x38, 0x08, 0x00, 0x00, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x00, 0x00, // Y 57 + 0x10, 0x08, 0x08, 0x08, 0xC8, 0x38, 0x08, 0x00, 0x20, 0x38, 0x26, 0x21, 0x20, 0x20, 0x18, 0x00, // Z 58 + 0x00, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x40, 0x40, 0x40, 0x00, // [ 59 + 0x00, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x38, 0xC0, 0x00, // \ 60 + 0x00, 0x02, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x7F, 0x00, 0x00, 0x00, // ] 61 + 0x00, 0x00, 0x04, 0x02, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ^ 62 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, // _ 63 + 0x00, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ` 64 + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x19, 0x24, 0x22, 0x22, 0x22, 0x3F, 0x20, // a 65 + 0x08, 0xF8, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x11, 0x20, 0x20, 0x11, 0x0E, 0x00, // b 66 + 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x0E, 0x11, 0x20, 0x20, 0x20, 0x11, 0x00, // c 67 + 0x00, 0x00, 0x00, 0x80, 0x80, 0x88, 0xF8, 0x00, 0x00, 0x0E, 0x11, 0x20, 0x20, 0x10, 0x3F, 0x20, // d 68 + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x22, 0x22, 0x22, 0x22, 0x13, 0x00, // e 69 + 0x00, 0x80, 0x80, 0xF0, 0x88, 0x88, 0x88, 0x18, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // f 70 + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x6B, 0x94, 0x94, 0x94, 0x93, 0x60, 0x00, // g 71 + 0x08, 0xF8, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x20, 0x3F, 0x21, 0x00, 0x00, 0x20, 0x3F, 0x20, // h 72 + 0x00, 0x80, 0x98, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // i 73 + 0x00, 0x00, 0x00, 0x80, 0x98, 0x98, 0x00, 0x00, 0x00, 0xC0, 0x80, 0x80, 0x80, 0x7F, 0x00, 0x00, // j 74 + 0x08, 0xF8, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x20, 0x3F, 0x24, 0x02, 0x2D, 0x30, 0x20, 0x00, // k 75 + 0x00, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x3F, 0x20, 0x20, 0x00, 0x00, // l 76 + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x20, 0x3F, 0x20, 0x00, 0x3F, 0x20, 0x00, 0x3F, // m 77 + 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x20, 0x3F, 0x21, 0x00, 0x00, 0x20, 0x3F, 0x20, // n 78 + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x20, 0x20, 0x20, 0x20, 0x1F, 0x00, // o 79 + 0x80, 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0xFF, 0xA1, 0x20, 0x20, 0x11, 0x0E, 0x00, // p 80 + 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x0E, 0x11, 0x20, 0x20, 0xA0, 0xFF, 0x80, // q 81 + 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x20, 0x20, 0x3F, 0x21, 0x20, 0x00, 0x01, 0x00, // r 82 + 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x33, 0x24, 0x24, 0x24, 0x24, 0x19, 0x00, // s 83 + 0x00, 0x80, 0x80, 0xE0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x20, 0x20, 0x00, 0x00, // t 84 + 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x1F, 0x20, 0x20, 0x20, 0x10, 0x3F, 0x20, // u 85 + 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x01, 0x0E, 0x30, 0x08, 0x06, 0x01, 0x00, // v 86 + 0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x0F, 0x30, 0x0C, 0x03, 0x0C, 0x30, 0x0F, 0x00, // w 87 + 0x00, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x20, 0x31, 0x2E, 0x0E, 0x31, 0x20, 0x00, // x 88 + 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x81, 0x8E, 0x70, 0x18, 0x06, 0x01, 0x00, // y 89 + 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x21, 0x30, 0x2C, 0x22, 0x21, 0x30, 0x00, // z 90 + 0x00, 0x00, 0x00, 0x00, 0x80, 0x7C, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x40, 0x40, // { 91 + 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, // | 92 + 0x00, 0x02, 0x02, 0x7C, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x3F, 0x00, 0x00, 0x00, 0x00, // } 93 + 0x00, 0x06, 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ~ 94 +}; + +static const unsigned short FONT7X10[] = { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // sp + 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x1000, 0x0000, 0x0000, // ! + 0x2800, 0x2800, 0x2800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // " + 0x2400, 0x2400, 0x7C00, 0x2400, 0x4800, 0x7C00, 0x4800, 0x4800, 0x0000, 0x0000, // # + 0x3800, 0x5400, 0x5000, 0x3800, 0x1400, 0x5400, 0x5400, 0x3800, 0x1000, 0x0000, // $ + 0x2000, 0x5400, 0x5800, 0x3000, 0x2800, 0x5400, 0x1400, 0x0800, 0x0000, 0x0000, // % + 0x1000, 0x2800, 0x2800, 0x1000, 0x3400, 0x4800, 0x4800, 0x3400, 0x0000, 0x0000, // & + 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ' + 0x0800, 0x1000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x1000, 0x0800, // ( + 0x2000, 0x1000, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x1000, 0x2000, // ) + 0x1000, 0x3800, 0x1000, 0x2800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // * + 0x0000, 0x0000, 0x1000, 0x1000, 0x7C00, 0x1000, 0x1000, 0x0000, 0x0000, 0x0000, // + + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x1000, 0x1000, // , + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3800, 0x0000, 0x0000, 0x0000, 0x0000, // - + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, // . + 0x0800, 0x0800, 0x1000, 0x1000, 0x1000, 0x1000, 0x2000, 0x2000, 0x0000, 0x0000, // / + 0x3800, 0x4400, 0x4400, 0x5400, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // 0 + 0x1000, 0x3000, 0x5000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // 1 + 0x3800, 0x4400, 0x4400, 0x0400, 0x0800, 0x1000, 0x2000, 0x7C00, 0x0000, 0x0000, // 2 + 0x3800, 0x4400, 0x0400, 0x1800, 0x0400, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // 3 + 0x0800, 0x1800, 0x2800, 0x2800, 0x4800, 0x7C00, 0x0800, 0x0800, 0x0000, 0x0000, // 4 + 0x7C00, 0x4000, 0x4000, 0x7800, 0x0400, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // 5 + 0x3800, 0x4400, 0x4000, 0x7800, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // 6 + 0x7C00, 0x0400, 0x0800, 0x1000, 0x1000, 0x2000, 0x2000, 0x2000, 0x0000, 0x0000, // 7 + 0x3800, 0x4400, 0x4400, 0x3800, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // 8 + 0x3800, 0x4400, 0x4400, 0x4400, 0x3C00, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // 9 + 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, // : + 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000, 0x1000, 0x1000, 0x1000, // ; + 0x0000, 0x0000, 0x0C00, 0x3000, 0x4000, 0x3000, 0x0C00, 0x0000, 0x0000, 0x0000, // < + 0x0000, 0x0000, 0x0000, 0x7C00, 0x0000, 0x7C00, 0x0000, 0x0000, 0x0000, 0x0000, // = + 0x0000, 0x0000, 0x6000, 0x1800, 0x0400, 0x1800, 0x6000, 0x0000, 0x0000, 0x0000, // > + 0x3800, 0x4400, 0x0400, 0x0800, 0x1000, 0x1000, 0x0000, 0x1000, 0x0000, 0x0000, // ? + 0x3800, 0x4400, 0x4C00, 0x5400, 0x5C00, 0x4000, 0x4000, 0x3800, 0x0000, 0x0000, // @ + 0x1000, 0x2800, 0x2800, 0x2800, 0x2800, 0x7C00, 0x4400, 0x4400, 0x0000, 0x0000, // A + 0x7800, 0x4400, 0x4400, 0x7800, 0x4400, 0x4400, 0x4400, 0x7800, 0x0000, 0x0000, // B + 0x3800, 0x4400, 0x4000, 0x4000, 0x4000, 0x4000, 0x4400, 0x3800, 0x0000, 0x0000, // C + 0x7000, 0x4800, 0x4400, 0x4400, 0x4400, 0x4400, 0x4800, 0x7000, 0x0000, 0x0000, // D + 0x7C00, 0x4000, 0x4000, 0x7C00, 0x4000, 0x4000, 0x4000, 0x7C00, 0x0000, 0x0000, // E + 0x7C00, 0x4000, 0x4000, 0x7800, 0x4000, 0x4000, 0x4000, 0x4000, 0x0000, 0x0000, // F + 0x3800, 0x4400, 0x4000, 0x4000, 0x5C00, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // G + 0x4400, 0x4400, 0x4400, 0x7C00, 0x4400, 0x4400, 0x4400, 0x4400, 0x0000, 0x0000, // H + 0x3800, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x3800, 0x0000, 0x0000, // I + 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // J + 0x4400, 0x4800, 0x5000, 0x6000, 0x5000, 0x4800, 0x4800, 0x4400, 0x0000, 0x0000, // K + 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x7C00, 0x0000, 0x0000, // L + 0x4400, 0x6C00, 0x6C00, 0x5400, 0x4400, 0x4400, 0x4400, 0x4400, 0x0000, 0x0000, // M + 0x4400, 0x6400, 0x6400, 0x5400, 0x5400, 0x4C00, 0x4C00, 0x4400, 0x0000, 0x0000, // N + 0x3800, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // O + 0x7800, 0x4400, 0x4400, 0x4400, 0x7800, 0x4000, 0x4000, 0x4000, 0x0000, 0x0000, // P + 0x3800, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x5400, 0x3800, 0x0400, 0x0000, // Q + 0x7800, 0x4400, 0x4400, 0x4400, 0x7800, 0x4800, 0x4800, 0x4400, 0x0000, 0x0000, // R + 0x3800, 0x4400, 0x4000, 0x3000, 0x0800, 0x0400, 0x4400, 0x3800, 0x0000, 0x0000, // S + 0x7C00, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // T + 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // U + 0x4400, 0x4400, 0x4400, 0x2800, 0x2800, 0x2800, 0x1000, 0x1000, 0x0000, 0x0000, // V + 0x4400, 0x4400, 0x5400, 0x5400, 0x5400, 0x6C00, 0x2800, 0x2800, 0x0000, 0x0000, // W + 0x4400, 0x2800, 0x2800, 0x1000, 0x1000, 0x2800, 0x2800, 0x4400, 0x0000, 0x0000, // X + 0x4400, 0x4400, 0x2800, 0x2800, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // Y + 0x7C00, 0x0400, 0x0800, 0x1000, 0x1000, 0x2000, 0x4000, 0x7C00, 0x0000, 0x0000, // Z + 0x1800, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1800, // [ + 0x2000, 0x2000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0800, 0x0800, 0x0000, 0x0000, /* \ */ + 0x3000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x3000, // ] + 0x1000, 0x2800, 0x2800, 0x4400, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ^ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFE00, // _ + 0x2000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ` + 0x0000, 0x0000, 0x3800, 0x4400, 0x3C00, 0x4400, 0x4C00, 0x3400, 0x0000, 0x0000, // a + 0x4000, 0x4000, 0x5800, 0x6400, 0x4400, 0x4400, 0x6400, 0x5800, 0x0000, 0x0000, // b + 0x0000, 0x0000, 0x3800, 0x4400, 0x4000, 0x4000, 0x4400, 0x3800, 0x0000, 0x0000, // c + 0x0400, 0x0400, 0x3400, 0x4C00, 0x4400, 0x4400, 0x4C00, 0x3400, 0x0000, 0x0000, // d + 0x0000, 0x0000, 0x3800, 0x4400, 0x7C00, 0x4000, 0x4400, 0x3800, 0x0000, 0x0000, // e + 0x0C00, 0x1000, 0x7C00, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // f + 0x0000, 0x0000, 0x3400, 0x4C00, 0x4400, 0x4400, 0x4C00, 0x3400, 0x0400, 0x7800, // g + 0x4000, 0x4000, 0x5800, 0x6400, 0x4400, 0x4400, 0x4400, 0x4400, 0x0000, 0x0000, // h + 0x1000, 0x0000, 0x7000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // i + 0x1000, 0x0000, 0x7000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0xE000, // j + 0x4000, 0x4000, 0x4800, 0x5000, 0x6000, 0x5000, 0x4800, 0x4400, 0x0000, 0x0000, // k + 0x7000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x0000, 0x0000, // l + 0x0000, 0x0000, 0x7800, 0x5400, 0x5400, 0x5400, 0x5400, 0x5400, 0x0000, 0x0000, // m + 0x0000, 0x0000, 0x5800, 0x6400, 0x4400, 0x4400, 0x4400, 0x4400, 0x0000, 0x0000, // n + 0x0000, 0x0000, 0x3800, 0x4400, 0x4400, 0x4400, 0x4400, 0x3800, 0x0000, 0x0000, // o + 0x0000, 0x0000, 0x5800, 0x6400, 0x4400, 0x4400, 0x6400, 0x5800, 0x4000, 0x4000, // p + 0x0000, 0x0000, 0x3400, 0x4C00, 0x4400, 0x4400, 0x4C00, 0x3400, 0x0400, 0x0400, // q + 0x0000, 0x0000, 0x5800, 0x6400, 0x4000, 0x4000, 0x4000, 0x4000, 0x0000, 0x0000, // r + 0x0000, 0x0000, 0x3800, 0x4400, 0x3000, 0x0800, 0x4400, 0x3800, 0x0000, 0x0000, // s + 0x2000, 0x2000, 0x7800, 0x2000, 0x2000, 0x2000, 0x2000, 0x1800, 0x0000, 0x0000, // t + 0x0000, 0x0000, 0x4400, 0x4400, 0x4400, 0x4400, 0x4C00, 0x3400, 0x0000, 0x0000, // u + 0x0000, 0x0000, 0x4400, 0x4400, 0x2800, 0x2800, 0x2800, 0x1000, 0x0000, 0x0000, // v + 0x0000, 0x0000, 0x5400, 0x5400, 0x5400, 0x6C00, 0x2800, 0x2800, 0x0000, 0x0000, // w + 0x0000, 0x0000, 0x4400, 0x2800, 0x1000, 0x1000, 0x2800, 0x4400, 0x0000, 0x0000, // x + 0x0000, 0x0000, 0x4400, 0x4400, 0x2800, 0x2800, 0x1000, 0x1000, 0x1000, 0x6000, // y + 0x0000, 0x0000, 0x7C00, 0x0800, 0x1000, 0x2000, 0x4000, 0x7C00, 0x0000, 0x0000, // z + 0x1800, 0x1000, 0x1000, 0x1000, 0x2000, 0x2000, 0x1000, 0x1000, 0x1000, 0x1800, // { + 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, // | + 0x3000, 0x1000, 0x1000, 0x1000, 0x0800, 0x0800, 0x1000, 0x1000, 0x1000, 0x3000, // } + 0x0000, 0x0000, 0x0000, 0x7400, 0x4C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ~ +}; + +static const unsigned short FONT11X18[] = { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // sp + 0x0000, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // ! + 0x0000, 0x1B00, 0x1B00, 0x1B00, 0x1B00, 0x1B00, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // " + 0x0000, 0x1980, 0x1980, 0x1980, 0x1980, 0x7FC0, 0x7FC0, 0x1980, 0x3300, + 0x7FC0, 0x7FC0, 0x3300, 0x3300, 0x3300, 0x3300, 0x0000, 0x0000, 0x0000, // # + 0x0000, 0x1E00, 0x3F00, 0x7580, 0x6580, 0x7400, 0x3C00, 0x1E00, 0x0700, + 0x0580, 0x6580, 0x6580, 0x7580, 0x3F00, 0x1E00, 0x0400, 0x0400, 0x0000, // $ + 0x0000, 0x7000, 0xD800, 0xD840, 0xD8C0, 0xD980, 0x7300, 0x0600, 0x0C00, + 0x1B80, 0x36C0, 0x66C0, 0x46C0, 0x06C0, 0x0380, 0x0000, 0x0000, 0x0000, // % + 0x0000, 0x1E00, 0x3F00, 0x3300, 0x3300, 0x3300, 0x1E00, 0x0C00, 0x3CC0, + 0x66C0, 0x6380, 0x6180, 0x6380, 0x3EC0, 0x1C80, 0x0000, 0x0000, 0x0000, // & + 0x0000, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ' + 0x0080, 0x0100, 0x0300, 0x0600, 0x0600, 0x0400, 0x0C00, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0C00, 0x0400, 0x0600, 0x0600, 0x0300, 0x0100, 0x0080, // ( + 0x2000, 0x1000, 0x1800, 0x0C00, 0x0C00, 0x0400, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0400, 0x0C00, 0x0C00, 0x1800, 0x1000, 0x2000, // ) + 0x0000, 0x0C00, 0x2D00, 0x3F00, 0x1E00, 0x3300, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // * + 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0xFFC0, 0xFFC0, + 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // + + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0400, 0x0400, 0x0800, // , + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1E00, 0x1E00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // - + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // . + 0x0000, 0x0300, 0x0300, 0x0300, 0x0600, 0x0600, 0x0600, 0x0600, 0x0C00, + 0x0C00, 0x0C00, 0x0C00, 0x1800, 0x1800, 0x1800, 0x0000, 0x0000, 0x0000, // / + 0x0000, 0x1E00, 0x3F00, 0x3300, 0x6180, 0x6180, 0x6180, 0x6D80, 0x6D80, + 0x6180, 0x6180, 0x6180, 0x3300, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 0 + 0x0000, 0x0600, 0x0E00, 0x1E00, 0x3600, 0x2600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, // 1 + 0x0000, 0x1E00, 0x3F00, 0x7380, 0x6180, 0x6180, 0x0180, 0x0300, 0x0600, + 0x0C00, 0x1800, 0x3000, 0x6000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, // 2 + 0x0000, 0x1C00, 0x3E00, 0x6300, 0x6300, 0x0300, 0x0E00, 0x0E00, 0x0300, + 0x0180, 0x0180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 3 + 0x0000, 0x0600, 0x0E00, 0x0E00, 0x1E00, 0x1E00, 0x1600, 0x3600, 0x3600, + 0x6600, 0x7F80, 0x7F80, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, // 4 + 0x0000, 0x7F00, 0x7F00, 0x6000, 0x6000, 0x6000, 0x6E00, 0x7F00, 0x6380, + 0x0180, 0x0180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 5 + 0x0000, 0x1E00, 0x3F00, 0x3380, 0x6180, 0x6000, 0x6E00, 0x7F00, 0x7380, + 0x6180, 0x6180, 0x6180, 0x3380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 6 + 0x0000, 0x7F80, 0x7F80, 0x0180, 0x0300, 0x0300, 0x0600, 0x0600, 0x0C00, + 0x0C00, 0x0C00, 0x0800, 0x1800, 0x1800, 0x1800, 0x0000, 0x0000, 0x0000, // 7 + 0x0000, 0x1E00, 0x3F00, 0x6380, 0x6180, 0x6180, 0x2100, 0x1E00, 0x3F00, + 0x6180, 0x6180, 0x6180, 0x6180, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 8 + 0x0000, 0x1E00, 0x3F00, 0x7300, 0x6180, 0x6180, 0x6180, 0x7380, 0x3F80, + 0x1D80, 0x0180, 0x6180, 0x7300, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // 9 + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // : + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0C00, 0x0C00, 0x0400, 0x0400, 0x0800, // ; + 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0380, 0x0E00, 0x3800, 0x6000, + 0x3800, 0x0E00, 0x0380, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // < + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7F80, 0x7F80, 0x0000, 0x0000, + 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // = + 0x0000, 0x0000, 0x0000, 0x0000, 0x4000, 0x7000, 0x1C00, 0x0700, 0x0180, + 0x0700, 0x1C00, 0x7000, 0x4000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // > + 0x0000, 0x1F00, 0x3F80, 0x71C0, 0x60C0, 0x00C0, 0x01C0, 0x0380, 0x0700, + 0x0E00, 0x0C00, 0x0C00, 0x0000, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // ? + 0x0000, 0x1E00, 0x3F00, 0x3180, 0x7180, 0x6380, 0x6F80, 0x6D80, 0x6D80, + 0x6F80, 0x6780, 0x6000, 0x3200, 0x3E00, 0x1C00, 0x0000, 0x0000, 0x0000, // @ + 0x0000, 0x0E00, 0x0E00, 0x1B00, 0x1B00, 0x1B00, 0x1B00, 0x3180, 0x3180, + 0x3F80, 0x3F80, 0x3180, 0x60C0, 0x60C0, 0x60C0, 0x0000, 0x0000, 0x0000, // A + 0x0000, 0x7C00, 0x7E00, 0x6300, 0x6300, 0x6300, 0x6300, 0x7E00, 0x7E00, + 0x6300, 0x6180, 0x6180, 0x6380, 0x7F00, 0x7E00, 0x0000, 0x0000, 0x0000, // B + 0x0000, 0x1E00, 0x3F00, 0x3180, 0x6180, 0x6000, 0x6000, 0x6000, 0x6000, + 0x6000, 0x6000, 0x6180, 0x3180, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // C + 0x0000, 0x7C00, 0x7F00, 0x6300, 0x6380, 0x6180, 0x6180, 0x6180, 0x6180, + 0x6180, 0x6180, 0x6300, 0x6300, 0x7E00, 0x7C00, 0x0000, 0x0000, 0x0000, // D + 0x0000, 0x7F80, 0x7F80, 0x6000, 0x6000, 0x6000, 0x6000, 0x7F00, 0x7F00, + 0x6000, 0x6000, 0x6000, 0x6000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, // E + 0x0000, 0x7F80, 0x7F80, 0x6000, 0x6000, 0x6000, 0x6000, 0x7F00, 0x7F00, + 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x0000, 0x0000, 0x0000, // F + 0x0000, 0x1E00, 0x3F00, 0x3180, 0x6180, 0x6000, 0x6000, 0x6000, 0x6380, + 0x6380, 0x6180, 0x6180, 0x3180, 0x3F80, 0x1E00, 0x0000, 0x0000, 0x0000, // G + 0x0000, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x7F80, 0x7F80, + 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, // H + 0x0000, 0x3F00, 0x3F00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x3F00, 0x3F00, 0x0000, 0x0000, 0x0000, // I + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x6180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // J + 0x0000, 0x60C0, 0x6180, 0x6300, 0x6600, 0x6600, 0x6C00, 0x7800, 0x7C00, + 0x6600, 0x6600, 0x6300, 0x6180, 0x6180, 0x60C0, 0x0000, 0x0000, 0x0000, // K + 0x0000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, + 0x6000, 0x6000, 0x6000, 0x6000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, // L + 0x0000, 0x71C0, 0x71C0, 0x7BC0, 0x7AC0, 0x6AC0, 0x6AC0, 0x6EC0, 0x64C0, + 0x60C0, 0x60C0, 0x60C0, 0x60C0, 0x60C0, 0x60C0, 0x0000, 0x0000, 0x0000, // M + 0x0000, 0x7180, 0x7180, 0x7980, 0x7980, 0x7980, 0x6D80, 0x6D80, 0x6D80, + 0x6580, 0x6780, 0x6780, 0x6780, 0x6380, 0x6380, 0x0000, 0x0000, 0x0000, // N + 0x0000, 0x1E00, 0x3F00, 0x3300, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, + 0x6180, 0x6180, 0x6180, 0x3300, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // O + 0x0000, 0x7E00, 0x7F00, 0x6380, 0x6180, 0x6180, 0x6180, 0x6380, 0x7F00, + 0x7E00, 0x6000, 0x6000, 0x6000, 0x6000, 0x6000, 0x0000, 0x0000, 0x0000, // P + 0x0000, 0x1E00, 0x3F00, 0x3300, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, + 0x6180, 0x6580, 0x6780, 0x3300, 0x3F80, 0x1E40, 0x0000, 0x0000, 0x0000, // Q + 0x0000, 0x7E00, 0x7F00, 0x6380, 0x6180, 0x6180, 0x6380, 0x7F00, 0x7E00, + 0x6600, 0x6300, 0x6300, 0x6180, 0x6180, 0x60C0, 0x0000, 0x0000, 0x0000, // R + 0x0000, 0x0E00, 0x1F00, 0x3180, 0x3180, 0x3000, 0x3800, 0x1E00, 0x0700, + 0x0380, 0x6180, 0x6180, 0x3180, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // S + 0x0000, 0xFFC0, 0xFFC0, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // T + 0x0000, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, + 0x6180, 0x6180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // U + 0x0000, 0x60C0, 0x60C0, 0x60C0, 0x3180, 0x3180, 0x3180, 0x1B00, 0x1B00, + 0x1B00, 0x1B00, 0x0E00, 0x0E00, 0x0E00, 0x0400, 0x0000, 0x0000, 0x0000, // V + 0x0000, 0xC0C0, 0xC0C0, 0xC0C0, 0xC0C0, 0xC0C0, 0xCCC0, 0x4C80, 0x4C80, + 0x5E80, 0x5280, 0x5280, 0x7380, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, // W + 0x0000, 0xC0C0, 0x6080, 0x6180, 0x3300, 0x3B00, 0x1E00, 0x0C00, 0x0C00, + 0x1E00, 0x1F00, 0x3B00, 0x7180, 0x6180, 0xC0C0, 0x0000, 0x0000, 0x0000, // X + 0x0000, 0xC0C0, 0x6180, 0x6180, 0x3300, 0x3300, 0x1E00, 0x1E00, 0x0C00, + 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // Y + 0x0000, 0x3F80, 0x3F80, 0x0180, 0x0300, 0x0300, 0x0600, 0x0C00, 0x0C00, + 0x1800, 0x1800, 0x3000, 0x6000, 0x7F80, 0x7F80, 0x0000, 0x0000, 0x0000, // Z + 0x0F00, 0x0F00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0F00, 0x0F00, // [ + 0x0000, 0x1800, 0x1800, 0x1800, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0300, 0x0300, 0x0300, 0x0000, 0x0000, 0x0000, /* \ */ + 0x1E00, 0x1E00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x1E00, 0x1E00, // ] + 0x0000, 0x0C00, 0x0C00, 0x1E00, 0x1200, 0x3300, 0x3300, 0x6180, 0x6180, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ^ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFE0, 0x0000, // _ + 0x0000, 0x3800, 0x1800, 0x0C00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ` + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F00, 0x3F80, 0x6180, 0x0180, + 0x1F80, 0x3F80, 0x6180, 0x6380, 0x7F80, 0x38C0, 0x0000, 0x0000, 0x0000, // a + 0x0000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6E00, 0x7F00, 0x7380, 0x6180, + 0x6180, 0x6180, 0x6180, 0x7380, 0x7F00, 0x6E00, 0x0000, 0x0000, 0x0000, // b + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x3F00, 0x7380, 0x6180, + 0x6000, 0x6000, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // c + 0x0000, 0x0180, 0x0180, 0x0180, 0x0180, 0x1D80, 0x3F80, 0x7380, 0x6180, + 0x6180, 0x6180, 0x6180, 0x7380, 0x3F80, 0x1D80, 0x0000, 0x0000, 0x0000, // d + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x3F00, 0x7300, 0x6180, + 0x7F80, 0x7F80, 0x6000, 0x7180, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // e + 0x0000, 0x07C0, 0x0FC0, 0x0C00, 0x0C00, 0x7F80, 0x7F80, 0x0C00, 0x0C00, + 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0000, 0x0000, 0x0000, // f + 0x0000, 0x0000, 0x0000, 0x0000, 0x1D80, 0x3F80, 0x7380, 0x6180, 0x6180, + 0x6180, 0x6180, 0x7380, 0x3F80, 0x1D80, 0x0180, 0x6380, 0x7F00, 0x3E00, // g + 0x0000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6F00, 0x7F80, 0x7180, 0x6180, + 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, // h + 0x0000, 0x0600, 0x0600, 0x0000, 0x0000, 0x3E00, 0x3E00, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, // i + 0x0600, 0x0600, 0x0000, 0x0000, 0x3E00, 0x3E00, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x4600, 0x7E00, 0x3C00, // j + 0x0000, 0x6000, 0x6000, 0x6000, 0x6000, 0x6180, 0x6300, 0x6600, 0x6C00, + 0x7C00, 0x7600, 0x6300, 0x6300, 0x6180, 0x60C0, 0x0000, 0x0000, 0x0000, // k + 0x0000, 0x3E00, 0x3E00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, // l + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xDD80, 0xFFC0, 0xCEC0, 0xCCC0, + 0xCCC0, 0xCCC0, 0xCCC0, 0xCCC0, 0xCCC0, 0xCCC0, 0x0000, 0x0000, 0x0000, // m + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6F00, 0x7F80, 0x7180, 0x6180, + 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x6180, 0x0000, 0x0000, 0x0000, // n + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x3F00, 0x7380, 0x6180, + 0x6180, 0x6180, 0x6180, 0x7380, 0x3F00, 0x1E00, 0x0000, 0x0000, 0x0000, // o + 0x0000, 0x0000, 0x0000, 0x0000, 0x6E00, 0x7F00, 0x7380, 0x6180, 0x6180, + 0x6180, 0x6180, 0x7380, 0x7F00, 0x6E00, 0x6000, 0x6000, 0x6000, 0x6000, // p + 0x0000, 0x0000, 0x0000, 0x0000, 0x1D80, 0x3F80, 0x7380, 0x6180, 0x6180, + 0x6180, 0x6180, 0x7380, 0x3F80, 0x1D80, 0x0180, 0x0180, 0x0180, 0x0180, // q + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6700, 0x3F80, 0x3900, 0x3000, + 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x0000, 0x0000, 0x0000, // r + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1E00, 0x3F80, 0x6180, 0x6000, + 0x7F00, 0x3F80, 0x0180, 0x6180, 0x7F00, 0x1E00, 0x0000, 0x0000, 0x0000, // s + 0x0000, 0x0000, 0x0800, 0x1800, 0x1800, 0x7F00, 0x7F00, 0x1800, 0x1800, + 0x1800, 0x1800, 0x1800, 0x1800, 0x1F80, 0x0F80, 0x0000, 0x0000, 0x0000, // t + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6180, 0x6180, 0x6180, 0x6180, + 0x6180, 0x6180, 0x6180, 0x6380, 0x7F80, 0x3D80, 0x0000, 0x0000, 0x0000, // u + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x60C0, 0x3180, 0x3180, 0x3180, + 0x1B00, 0x1B00, 0x1B00, 0x0E00, 0x0E00, 0x0600, 0x0000, 0x0000, 0x0000, // v + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xDD80, 0xDD80, 0xDD80, 0x5500, + 0x5500, 0x5500, 0x7700, 0x7700, 0x2200, 0x2200, 0x0000, 0x0000, 0x0000, // w + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6180, 0x3300, 0x3300, 0x1E00, + 0x0C00, 0x0C00, 0x1E00, 0x3300, 0x3300, 0x6180, 0x0000, 0x0000, 0x0000, // x + 0x0000, 0x0000, 0x0000, 0x0000, 0x6180, 0x6180, 0x3180, 0x3300, 0x3300, + 0x1B00, 0x1B00, 0x1B00, 0x0E00, 0x0E00, 0x0E00, 0x1C00, 0x7C00, 0x7000, // y + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7FC0, 0x7FC0, 0x0180, 0x0300, + 0x0600, 0x0C00, 0x1800, 0x3000, 0x7FC0, 0x7FC0, 0x0000, 0x0000, 0x0000, // z + 0x0380, 0x0780, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0E00, 0x1C00, + 0x1C00, 0x0E00, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0780, 0x0380, // { + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, 0x0600, // | + 0x3800, 0x3C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0E00, 0x0700, + 0x0700, 0x0E00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x0C00, 0x3C00, 0x3800, // } + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3880, 0x7F80, + 0x4700, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ~ +}; +static const unsigned short FONT16X26[] = { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [ ] + 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03C0, 0x03C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, + 0x01C0, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [!] + 0x1E3C, 0x1E3C, 0x1E3C, 0x1E3C, 0x1E3C, 0x1E3C, 0x1E3C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = ["] + 0x01CE, 0x03CE, 0x03DE, 0x039E, 0x039C, 0x079C, 0x3FFF, 0x7FFF, 0x0738, 0x0F38, 0x0F78, 0x0F78, 0x0E78, 0xFFFF, + 0xFFFF, 0x1EF0, 0x1CF0, 0x1CE0, 0x3CE0, 0x3DE0, 0x39E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [#] + 0x03FC, 0x0FFE, 0x1FEE, 0x1EE0, 0x1EE0, 0x1EE0, 0x1EE0, 0x1FE0, 0x0FE0, 0x07E0, 0x03F0, 0x01FC, 0x01FE, 0x01FE, + 0x01FE, 0x01FE, 0x01FE, 0x01FE, 0x3DFE, 0x3FFC, 0x0FF0, 0x01E0, 0x01E0, 0x0000, 0x0000, 0x0000, // Ascii = [$] + 0x3E03, 0xF707, 0xE78F, 0xE78E, 0xE39E, 0xE3BC, 0xE7B8, 0xE7F8, 0xF7F0, 0x3FE0, 0x01C0, 0x03FF, 0x07FF, 0x07F3, + 0x0FF3, 0x1EF3, 0x3CF3, 0x38F3, 0x78F3, 0xF07F, 0xE03F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [%] + 0x07E0, 0x0FF8, 0x0F78, 0x1F78, 0x1F78, 0x1F78, 0x0F78, 0x0FF0, 0x0FE0, 0x1F80, 0x7FC3, 0xFBC3, 0xF3E7, 0xF1F7, + 0xF0F7, 0xF0FF, 0xF07F, 0xF83E, 0x7C7F, 0x3FFF, 0x1FEF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [&] + 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = ['] + 0x003F, 0x007C, 0x01F0, 0x01E0, 0x03C0, 0x07C0, 0x0780, 0x0780, 0x0F80, 0x0F00, 0x0F00, 0x0F00, 0x0F00, 0x0F00, + 0x0F00, 0x0F80, 0x0780, 0x0780, 0x07C0, 0x03C0, 0x01E0, 0x01F0, 0x007C, 0x003F, 0x000F, 0x0000, // Ascii = [(] + 0x7E00, 0x1F00, 0x07C0, 0x03C0, 0x01E0, 0x01F0, 0x00F0, 0x00F0, 0x00F8, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, + 0x0078, 0x00F8, 0x00F0, 0x00F0, 0x01F0, 0x01E0, 0x03C0, 0x07C0, 0x1F00, 0x7E00, 0x7800, 0x0000, // Ascii = [)] + 0x03E0, 0x03C0, 0x01C0, 0x39CE, 0x3FFF, 0x3F7F, 0x0320, 0x0370, 0x07F8, 0x0F78, 0x1F3C, 0x0638, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [*] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0xFFFF, + 0xFFFF, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [+] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x01E0, 0x01E0, 0x01E0, 0x01C0, 0x0380, // Ascii = [,] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3FFE, 0x3FFE, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [-] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [.] + 0x000F, 0x000F, 0x001E, 0x001E, 0x003C, 0x003C, 0x0078, 0x0078, 0x00F0, 0x00F0, 0x01E0, 0x01E0, 0x03C0, 0x03C0, + 0x0780, 0x0780, 0x0F00, 0x0F00, 0x1E00, 0x1E00, 0x3C00, 0x3C00, 0x7800, 0x7800, 0xF000, 0x0000, // Ascii = [/] + 0x07F0, 0x0FF8, 0x1F7C, 0x3E3E, 0x3C1E, 0x7C1F, 0x7C1F, 0x780F, 0x780F, 0x780F, 0x780F, 0x780F, 0x780F, 0x780F, + 0x7C1F, 0x7C1F, 0x3C1E, 0x3E3E, 0x1F7C, 0x0FF8, 0x07F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [0] + 0x00F0, 0x07F0, 0x3FF0, 0x3FF0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, + 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x3FFF, 0x3FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [1] + 0x0FE0, 0x3FF8, 0x3C7C, 0x003C, 0x003E, 0x003E, 0x003E, 0x003C, 0x003C, 0x007C, 0x00F8, 0x01F0, 0x03E0, 0x07C0, + 0x0780, 0x0F00, 0x1E00, 0x3E00, 0x3C00, 0x3FFE, 0x3FFE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [2] + 0x0FF0, 0x1FF8, 0x1C7C, 0x003E, 0x003E, 0x003E, 0x003C, 0x003C, 0x00F8, 0x0FF0, 0x0FF8, 0x007C, 0x003E, 0x001E, + 0x001E, 0x001E, 0x001E, 0x003E, 0x1C7C, 0x1FF8, 0x1FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [3] + 0x0078, 0x00F8, 0x00F8, 0x01F8, 0x03F8, 0x07F8, 0x07F8, 0x0F78, 0x1E78, 0x1E78, 0x3C78, 0x7878, 0x7878, 0xFFFF, + 0xFFFF, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [4] + 0x1FFC, 0x1FFC, 0x1FFC, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1FE0, 0x1FF8, 0x00FC, 0x007C, 0x003E, 0x003E, + 0x001E, 0x003E, 0x003E, 0x003C, 0x1C7C, 0x1FF8, 0x1FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [5] + 0x01FC, 0x07FE, 0x0F8E, 0x1F00, 0x1E00, 0x3E00, 0x3C00, 0x3C00, 0x3DF8, 0x3FFC, 0x7F3E, 0x7E1F, 0x3C0F, 0x3C0F, + 0x3C0F, 0x3C0F, 0x3E0F, 0x1E1F, 0x1F3E, 0x0FFC, 0x03F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [6] + 0x3FFF, 0x3FFF, 0x3FFF, 0x000F, 0x001E, 0x001E, 0x003C, 0x0038, 0x0078, 0x00F0, 0x00F0, 0x01E0, 0x01E0, 0x03C0, + 0x03C0, 0x0780, 0x0F80, 0x0F80, 0x0F00, 0x1F00, 0x1F00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [7] + 0x07F8, 0x0FFC, 0x1F3E, 0x1E1E, 0x3E1E, 0x3E1E, 0x1E1E, 0x1F3C, 0x0FF8, 0x07F0, 0x0FF8, 0x1EFC, 0x3E3E, 0x3C1F, + 0x7C1F, 0x7C0F, 0x7C0F, 0x3C1F, 0x3F3E, 0x1FFC, 0x07F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [8] + 0x07F0, 0x0FF8, 0x1E7C, 0x3C3E, 0x3C1E, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x3C1F, 0x3E3F, 0x1FFF, 0x07EF, 0x001F, + 0x001E, 0x001E, 0x003E, 0x003C, 0x38F8, 0x3FF0, 0x1FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [9] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [:] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x01E0, 0x01E0, 0x01E0, 0x03C0, 0x0380, // Ascii = [;] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0003, 0x000F, 0x003F, 0x00FC, 0x03F0, 0x0FC0, 0x3F00, 0xFE00, + 0x3F00, 0x0FC0, 0x03F0, 0x00FC, 0x003F, 0x000F, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [<] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, + 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [=] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xE000, 0xF800, 0x7E00, 0x1F80, 0x07E0, 0x01F8, 0x007E, 0x001F, + 0x007E, 0x01F8, 0x07E0, 0x1F80, 0x7E00, 0xF800, 0xE000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [>] + 0x1FF0, 0x3FFC, 0x383E, 0x381F, 0x381F, 0x001E, 0x001E, 0x003C, 0x0078, 0x00F0, 0x01E0, 0x03C0, 0x03C0, 0x07C0, + 0x07C0, 0x0000, 0x0000, 0x0000, 0x07C0, 0x07C0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [?] + 0x03F8, 0x0FFE, 0x1F1E, 0x3E0F, 0x3C7F, 0x78FF, 0x79EF, 0x73C7, 0xF3C7, 0xF38F, 0xF38F, 0xF38F, 0xF39F, 0xF39F, + 0x73FF, 0x7BFF, 0x79F7, 0x3C00, 0x1F1C, 0x0FFC, 0x03F8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [@] + 0x0000, 0x0000, 0x0000, 0x03E0, 0x03E0, 0x07F0, 0x07F0, 0x07F0, 0x0F78, 0x0F78, 0x0E7C, 0x1E3C, 0x1E3C, 0x3C3E, + 0x3FFE, 0x3FFF, 0x781F, 0x780F, 0xF00F, 0xF007, 0xF007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [A] + 0x0000, 0x0000, 0x0000, 0x3FF8, 0x3FFC, 0x3C3E, 0x3C1E, 0x3C1E, 0x3C1E, 0x3C3E, 0x3C7C, 0x3FF0, 0x3FF8, 0x3C7E, + 0x3C1F, 0x3C1F, 0x3C0F, 0x3C0F, 0x3C1F, 0x3FFE, 0x3FF8, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [B] + 0x0000, 0x0000, 0x0000, 0x01FF, 0x07FF, 0x1F87, 0x3E00, 0x3C00, 0x7C00, 0x7800, 0x7800, 0x7800, 0x7800, 0x7800, + 0x7C00, 0x7C00, 0x3E00, 0x3F00, 0x1F83, 0x07FF, 0x01FF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [C] + 0x0000, 0x0000, 0x0000, 0x7FF0, 0x7FFC, 0x787E, 0x781F, 0x781F, 0x780F, 0x780F, 0x780F, 0x780F, 0x780F, 0x780F, + 0x780F, 0x780F, 0x781F, 0x781E, 0x787E, 0x7FF8, 0x7FE0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [D] + 0x0000, 0x0000, 0x0000, 0x3FFF, 0x3FFF, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3FFE, 0x3FFE, 0x3E00, + 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3FFF, 0x3FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [E] + 0x0000, 0x0000, 0x0000, 0x1FFF, 0x1FFF, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1FFF, 0x1FFF, 0x1E00, + 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [F] + 0x0000, 0x0000, 0x0000, 0x03FE, 0x0FFF, 0x1F87, 0x3E00, 0x7C00, 0x7C00, 0x7800, 0xF800, 0xF800, 0xF87F, 0xF87F, + 0x780F, 0x7C0F, 0x7C0F, 0x3E0F, 0x1F8F, 0x0FFF, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [G] + 0x0000, 0x0000, 0x0000, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x7FFF, 0x7FFF, 0x7C1F, + 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [H] + 0x0000, 0x0000, 0x0000, 0x3FFF, 0x3FFF, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, + 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x3FFF, 0x3FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [I] + 0x0000, 0x0000, 0x0000, 0x1FFC, 0x1FFC, 0x007C, 0x007C, 0x007C, 0x007C, 0x007C, 0x007C, 0x007C, 0x007C, 0x007C, + 0x007C, 0x007C, 0x0078, 0x0078, 0x38F8, 0x3FF0, 0x3FC0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [J] + 0x0000, 0x0000, 0x0000, 0x3C1F, 0x3C1E, 0x3C3C, 0x3C78, 0x3CF0, 0x3DE0, 0x3FE0, 0x3FC0, 0x3F80, 0x3FC0, 0x3FE0, + 0x3DF0, 0x3CF0, 0x3C78, 0x3C7C, 0x3C3E, 0x3C1F, 0x3C0F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [K] + 0x0000, 0x0000, 0x0000, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, + 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3FFF, 0x3FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [L] + 0x0000, 0x0000, 0x0000, 0xF81F, 0xFC1F, 0xFC1F, 0xFE3F, 0xFE3F, 0xFE3F, 0xFF7F, 0xFF77, 0xFF77, 0xF7F7, 0xF7E7, + 0xF3E7, 0xF3E7, 0xF3C7, 0xF007, 0xF007, 0xF007, 0xF007, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [M] + 0x0000, 0x0000, 0x0000, 0x7C0F, 0x7C0F, 0x7E0F, 0x7F0F, 0x7F0F, 0x7F8F, 0x7F8F, 0x7FCF, 0x7BEF, 0x79EF, 0x79FF, + 0x78FF, 0x78FF, 0x787F, 0x783F, 0x783F, 0x781F, 0x781F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [N] + 0x0000, 0x0000, 0x0000, 0x07F0, 0x1FFC, 0x3E3E, 0x7C1F, 0x780F, 0x780F, 0xF80F, 0xF80F, 0xF80F, 0xF80F, 0xF80F, + 0xF80F, 0x780F, 0x780F, 0x7C1F, 0x3E3E, 0x1FFC, 0x07F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [O] + 0x0000, 0x0000, 0x0000, 0x3FFC, 0x3FFF, 0x3E1F, 0x3E0F, 0x3E0F, 0x3E0F, 0x3E0F, 0x3E1F, 0x3E3F, 0x3FFC, 0x3FF0, + 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x3E00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [P] + 0x0000, 0x0000, 0x0000, 0x07F0, 0x1FFC, 0x3E3E, 0x7C1F, 0x780F, 0x780F, 0xF80F, 0xF80F, 0xF80F, 0xF80F, 0xF80F, + 0xF80F, 0x780F, 0x780F, 0x7C1F, 0x3E3E, 0x1FFC, 0x07F8, 0x007C, 0x003F, 0x000F, 0x0003, 0x0000, // Ascii = [Q] + 0x0000, 0x0000, 0x0000, 0x3FF0, 0x3FFC, 0x3C7E, 0x3C3E, 0x3C1E, 0x3C1E, 0x3C3E, 0x3C3C, 0x3CFC, 0x3FF0, 0x3FE0, + 0x3DF0, 0x3CF8, 0x3C7C, 0x3C3E, 0x3C1E, 0x3C1F, 0x3C0F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [R] + 0x0000, 0x0000, 0x0000, 0x07FC, 0x1FFE, 0x3E0E, 0x3C00, 0x3C00, 0x3C00, 0x3E00, 0x1FC0, 0x0FF8, 0x03FE, 0x007F, + 0x001F, 0x000F, 0x000F, 0x201F, 0x3C3E, 0x3FFC, 0x1FF0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [S] + 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, + 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [T] + 0x0000, 0x0000, 0x0000, 0x7C0F, 0x7C0F, 0x7C0F, 0x7C0F, 0x7C0F, 0x7C0F, 0x7C0F, 0x7C0F, 0x7C0F, 0x7C0F, 0x7C0F, + 0x7C0F, 0x7C0F, 0x3C1E, 0x3C1E, 0x3E3E, 0x1FFC, 0x07F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [U] + 0x0000, 0x0000, 0x0000, 0xF007, 0xF007, 0xF807, 0x780F, 0x7C0F, 0x3C1E, 0x3C1E, 0x3E1E, 0x1E3C, 0x1F3C, 0x1F78, + 0x0F78, 0x0FF8, 0x07F0, 0x07F0, 0x07F0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [V] + 0x0000, 0x0000, 0x0000, 0xE003, 0xF003, 0xF003, 0xF007, 0xF3E7, 0xF3E7, 0xF3E7, 0x73E7, 0x7BF7, 0x7FF7, 0x7FFF, + 0x7F7F, 0x7F7F, 0x7F7E, 0x3F7E, 0x3E3E, 0x3E3E, 0x3E3E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [W] + 0x0000, 0x0000, 0x0000, 0xF807, 0x7C0F, 0x3E1E, 0x3E3E, 0x1F3C, 0x0FF8, 0x07F0, 0x07E0, 0x03E0, 0x03E0, 0x07F0, + 0x0FF8, 0x0F7C, 0x1E7C, 0x3C3E, 0x781F, 0x780F, 0xF00F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [X] + 0x0000, 0x0000, 0x0000, 0xF807, 0x7807, 0x7C0F, 0x3C1E, 0x3E1E, 0x1F3C, 0x0F78, 0x0FF8, 0x07F0, 0x03E0, 0x03E0, + 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [Y] + 0x0000, 0x0000, 0x0000, 0x7FFF, 0x7FFF, 0x000F, 0x001F, 0x003E, 0x007C, 0x00F8, 0x00F0, 0x01E0, 0x03E0, 0x07C0, + 0x0F80, 0x0F00, 0x1E00, 0x3E00, 0x7C00, 0x7FFF, 0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [Z] + 0x07FF, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, + 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x07FF, 0x07FF, 0x0000, // Ascii = [[] + 0x7800, 0x7800, 0x3C00, 0x3C00, 0x1E00, 0x1E00, 0x0F00, 0x0F00, 0x0780, 0x0780, 0x03C0, 0x03C0, 0x01E0, 0x01E0, + 0x00F0, 0x00F0, 0x0078, 0x0078, 0x003C, 0x003C, 0x001E, 0x001E, 0x000F, 0x000F, 0x0007, 0x0000, // Ascii = [\] + 0x7FF0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, + 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x00F0, 0x7FF0, 0x7FF0, 0x0000, // Ascii = []] + 0x00C0, 0x01C0, 0x01C0, 0x03E0, 0x03E0, 0x07F0, 0x07F0, 0x0778, 0x0F78, 0x0F38, 0x1E3C, 0x1E3C, 0x3C1E, 0x3C1E, + 0x380F, 0x780F, 0x7807, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [^] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF, 0x0000, 0x0000, 0x0000, // Ascii = [_] + 0x00F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [`] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0FF8, 0x3FFC, 0x3C7C, 0x003E, 0x003E, 0x003E, 0x07FE, 0x1FFE, + 0x3E3E, 0x7C3E, 0x783E, 0x7C3E, 0x7C7E, 0x3FFF, 0x1FCF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [a] + 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3DF8, 0x3FFE, 0x3F3E, 0x3E1F, 0x3C0F, 0x3C0F, 0x3C0F, 0x3C0F, + 0x3C0F, 0x3C0F, 0x3C1F, 0x3C1E, 0x3F3E, 0x3FFC, 0x3BF0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [b] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03FE, 0x0FFF, 0x1F87, 0x3E00, 0x3E00, 0x3C00, 0x7C00, 0x7C00, + 0x7C00, 0x3C00, 0x3E00, 0x3E00, 0x1F87, 0x0FFF, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [c] + 0x001F, 0x001F, 0x001F, 0x001F, 0x001F, 0x001F, 0x07FF, 0x1FFF, 0x3E3F, 0x3C1F, 0x7C1F, 0x7C1F, 0x7C1F, 0x781F, + 0x781F, 0x7C1F, 0x7C1F, 0x3C3F, 0x3E7F, 0x1FFF, 0x0FDF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [d] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03F8, 0x0FFC, 0x1F3E, 0x3E1E, 0x3C1F, 0x7C1F, 0x7FFF, 0x7FFF, + 0x7C00, 0x7C00, 0x3C00, 0x3E00, 0x1F07, 0x0FFF, 0x03FE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [e] + 0x01FF, 0x03E1, 0x03C0, 0x07C0, 0x07C0, 0x07C0, 0x7FFF, 0x7FFF, 0x07C0, 0x07C0, 0x07C0, 0x07C0, 0x07C0, 0x07C0, + 0x07C0, 0x07C0, 0x07C0, 0x07C0, 0x07C0, 0x07C0, 0x07C0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [f] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07EF, 0x1FFF, 0x3E7F, 0x3C1F, 0x7C1F, 0x7C1F, 0x781F, 0x781F, + 0x781F, 0x7C1F, 0x7C1F, 0x3C3F, 0x3E7F, 0x1FFF, 0x0FDF, 0x001E, 0x001E, 0x001E, 0x387C, 0x3FF8, // Ascii = [g] + 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3DFC, 0x3FFE, 0x3F9E, 0x3F1F, 0x3E1F, 0x3C1F, 0x3C1F, 0x3C1F, + 0x3C1F, 0x3C1F, 0x3C1F, 0x3C1F, 0x3C1F, 0x3C1F, 0x3C1F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [h] + 0x01F0, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x7FE0, 0x7FE0, 0x01E0, 0x01E0, 0x01E0, 0x01E0, 0x01E0, 0x01E0, + 0x01E0, 0x01E0, 0x01E0, 0x01E0, 0x01E0, 0x01E0, 0x01E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [i] + 0x00F8, 0x00F8, 0x0000, 0x0000, 0x0000, 0x0000, 0x3FF8, 0x3FF8, 0x00F8, 0x00F8, 0x00F8, 0x00F8, 0x00F8, 0x00F8, + 0x00F8, 0x00F8, 0x00F8, 0x00F8, 0x00F8, 0x00F8, 0x00F8, 0x00F8, 0x00F8, 0x00F0, 0x71F0, 0x7FE0, // Ascii = [j] + 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3C1F, 0x3C3E, 0x3C7C, 0x3CF8, 0x3DF0, 0x3DE0, 0x3FC0, 0x3FC0, + 0x3FE0, 0x3DF0, 0x3CF8, 0x3C7C, 0x3C3E, 0x3C1F, 0x3C1F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [k] + 0x7FF0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, + 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x01F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [l] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF79E, 0xFFFF, 0xFFFF, 0xFFFF, 0xFBE7, 0xF9E7, 0xF1C7, 0xF1C7, + 0xF1C7, 0xF1C7, 0xF1C7, 0xF1C7, 0xF1C7, 0xF1C7, 0xF1C7, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [m] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3DFC, 0x3FFE, 0x3F9E, 0x3F1F, 0x3E1F, 0x3C1F, 0x3C1F, 0x3C1F, + 0x3C1F, 0x3C1F, 0x3C1F, 0x3C1F, 0x3C1F, 0x3C1F, 0x3C1F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [n] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07F0, 0x1FFC, 0x3E3E, 0x3C1F, 0x7C1F, 0x780F, 0x780F, 0x780F, + 0x780F, 0x780F, 0x7C1F, 0x3C1F, 0x3E3E, 0x1FFC, 0x07F0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [o] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3DF8, 0x3FFE, 0x3F3E, 0x3E1F, 0x3C0F, 0x3C0F, 0x3C0F, 0x3C0F, + 0x3C0F, 0x3C0F, 0x3C1F, 0x3E1E, 0x3F3E, 0x3FFC, 0x3FF8, 0x3C00, 0x3C00, 0x3C00, 0x3C00, 0x3C00, // Ascii = [p] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07EE, 0x1FFE, 0x3E7E, 0x3C1E, 0x7C1E, 0x781E, 0x781E, 0x781E, + 0x781E, 0x781E, 0x7C1E, 0x7C3E, 0x3E7E, 0x1FFE, 0x0FDE, 0x001E, 0x001E, 0x001E, 0x001E, 0x001E, // Ascii = [q] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1F7F, 0x1FFF, 0x1FE7, 0x1FC7, 0x1F87, 0x1F00, 0x1F00, 0x1F00, + 0x1F00, 0x1F00, 0x1F00, 0x1F00, 0x1F00, 0x1F00, 0x1F00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [r] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07FC, 0x1FFE, 0x1E0E, 0x3E00, 0x3E00, 0x3F00, 0x1FE0, 0x07FC, + 0x00FE, 0x003E, 0x001E, 0x001E, 0x3C3E, 0x3FFC, 0x1FF0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [s] + 0x0000, 0x0000, 0x0000, 0x0780, 0x0780, 0x0780, 0x7FFF, 0x7FFF, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, + 0x0780, 0x0780, 0x0780, 0x0780, 0x07C0, 0x03FF, 0x01FF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [t] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3C1E, 0x3C1E, 0x3C1E, 0x3C1E, 0x3C1E, 0x3C1E, 0x3C1E, 0x3C1E, + 0x3C1E, 0x3C1E, 0x3C3E, 0x3C7E, 0x3EFE, 0x1FFE, 0x0FDE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [u] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF007, 0x780F, 0x780F, 0x3C1E, 0x3C1E, 0x3E1E, 0x1E3C, 0x1E3C, + 0x0F78, 0x0F78, 0x0FF0, 0x07F0, 0x07F0, 0x03E0, 0x03E0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [v] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF003, 0xF1E3, 0xF3E3, 0xF3E7, 0xF3F7, 0xF3F7, 0x7FF7, 0x7F77, + 0x7F7F, 0x7F7F, 0x7F7F, 0x3E3E, 0x3E3E, 0x3E3E, 0x3E3E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [w] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7C0F, 0x3E1E, 0x3E3C, 0x1F3C, 0x0FF8, 0x07F0, 0x07F0, 0x03E0, + 0x07F0, 0x07F8, 0x0FF8, 0x1E7C, 0x3E3E, 0x3C1F, 0x781F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [x] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xF807, 0x780F, 0x7C0F, 0x3C1E, 0x3C1E, 0x1E3C, 0x1E3C, 0x1F3C, + 0x0F78, 0x0FF8, 0x07F0, 0x07F0, 0x03E0, 0x03E0, 0x03C0, 0x03C0, 0x03C0, 0x0780, 0x0F80, 0x7F00, // Ascii = [y] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3FFF, 0x3FFF, 0x001F, 0x003E, 0x007C, 0x00F8, 0x01F0, 0x03E0, + 0x07C0, 0x0F80, 0x1F00, 0x1E00, 0x3C00, 0x7FFF, 0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [z] + 0x01FE, 0x03E0, 0x03C0, 0x03C0, 0x03C0, 0x03C0, 0x01E0, 0x01E0, 0x01E0, 0x01C0, 0x03C0, 0x3F80, 0x3F80, 0x03C0, + 0x01C0, 0x01E0, 0x01E0, 0x01E0, 0x03C0, 0x03C0, 0x03C0, 0x03C0, 0x03E0, 0x01FE, 0x007E, 0x0000, // Ascii = [{] + 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, + 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x01C0, 0x0000, // Ascii = [|] + 0x3FC0, 0x03E0, 0x01E0, 0x01E0, 0x01E0, 0x01E0, 0x01C0, 0x03C0, 0x03C0, 0x01C0, 0x01E0, 0x00FE, 0x00FE, 0x01E0, + 0x01C0, 0x03C0, 0x03C0, 0x01C0, 0x01E0, 0x01E0, 0x01E0, 0x01E0, 0x03E0, 0x3FC0, 0x3F00, 0x0000, // Ascii = [}] + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3F07, 0x7FC7, 0x73E7, + 0xF1FF, 0xF07E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // Ascii = [~] +}; +static const unsigned short FONT6X8[] = { + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // sp + 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x0000, 0x2000, 0x0000, // ! + 0x5000, 0x5000, 0x5000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // " + 0x5000, 0x5000, 0xf800, 0x5000, 0xf800, 0x5000, 0x5000, 0x0000, // # + 0x2000, 0x7800, 0xa000, 0x7000, 0x2800, 0xf000, 0x2000, 0x0000, // $ + 0xc000, 0xc800, 0x1000, 0x2000, 0x4000, 0x9800, 0x1800, 0x0000, // % + 0x4000, 0xa000, 0xa000, 0x4000, 0xa800, 0x9000, 0x6800, 0x0000, // & + 0x3000, 0x3000, 0x2000, 0x4000, 0x0000, 0x0000, 0x0000, 0x0000, // ' + 0x1000, 0x2000, 0x4000, 0x4000, 0x4000, 0x2000, 0x1000, 0x0000, // ( + 0x4000, 0x2000, 0x1000, 0x1000, 0x1000, 0x2000, 0x4000, 0x0000, // ) + 0x2000, 0xa800, 0x7000, 0xf800, 0x7000, 0xa800, 0x2000, 0x0000, // * + 0x0000, 0x2000, 0x2000, 0xf800, 0x2000, 0x2000, 0x0000, 0x0000, // + + 0x0000, 0x0000, 0x0000, 0x0000, 0x3000, 0x3000, 0x2000, 0x0000, // , + 0x0000, 0x0000, 0x0000, 0xf800, 0x0000, 0x0000, 0x0000, 0x0000, // - + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3000, 0x3000, 0x0000, // . + 0x0000, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x0000, 0x0000, // / + 0x7000, 0x8800, 0x9800, 0xa800, 0xc800, 0x8800, 0x7000, 0x0000, // 0 + 0x2000, 0x6000, 0x2000, 0x2000, 0x2000, 0x2000, 0x7000, 0x0000, // 1 + 0x7000, 0x8800, 0x0800, 0x7000, 0x8000, 0x8000, 0xf800, 0x0000, // 2 + 0xf800, 0x0800, 0x1000, 0x3000, 0x0800, 0x8800, 0x7000, 0x0000, // 3 + 0x1000, 0x3000, 0x5000, 0x9000, 0xf800, 0x1000, 0x1000, 0x0000, // 4 + 0xf800, 0x8000, 0xf000, 0x0800, 0x0800, 0x8800, 0x7000, 0x0000, // 5 + 0x3800, 0x4000, 0x8000, 0xf000, 0x8800, 0x8800, 0x7000, 0x0000, // 6 + 0xf800, 0x0800, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x0000, // 7 + 0x7000, 0x8800, 0x8800, 0x7000, 0x8800, 0x8800, 0x7000, 0x0000, // 8 + 0x7000, 0x8800, 0x8800, 0x7800, 0x0800, 0x1000, 0xe000, 0x0000, // 9 + 0x0000, 0x0000, 0x2000, 0x0000, 0x2000, 0x0000, 0x0000, 0x0000, // : + 0x0000, 0x0000, 0x2000, 0x0000, 0x2000, 0x2000, 0x4000, 0x0000, // ; + 0x0800, 0x1000, 0x2000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0000, // < + 0x0000, 0x0000, 0xf800, 0x0000, 0xf800, 0x0000, 0x0000, 0x0000, // = + 0x4000, 0x2000, 0x1000, 0x0800, 0x1000, 0x2000, 0x4000, 0x0000, // > + 0x7000, 0x8800, 0x0800, 0x3000, 0x2000, 0x0000, 0x2000, 0x0000, // ? + 0x7000, 0x8800, 0xa800, 0xb800, 0xb000, 0x8000, 0x7800, 0x0000, // @ + 0x2000, 0x5000, 0x8800, 0x8800, 0xf800, 0x8800, 0x8800, 0x0000, // A + 0xf000, 0x8800, 0x8800, 0xf000, 0x8800, 0x8800, 0xf000, 0x0000, // B + 0x7000, 0x8800, 0x8000, 0x8000, 0x8000, 0x8800, 0x7000, 0x0000, // C + 0xf000, 0x8800, 0x8800, 0x8800, 0x8800, 0x8800, 0xf000, 0x0000, // D + 0xf800, 0x8000, 0x8000, 0xf000, 0x8000, 0x8000, 0xf800, 0x0000, // E + 0xf800, 0x8000, 0x8000, 0xf000, 0x8000, 0x8000, 0x8000, 0x0000, // F + 0x7800, 0x8800, 0x8000, 0x8000, 0x9800, 0x8800, 0x7800, 0x0000, // G + 0x8800, 0x8800, 0x8800, 0xf800, 0x8800, 0x8800, 0x8800, 0x0000, // H + 0x7000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x7000, 0x0000, // I + 0x3800, 0x1000, 0x1000, 0x1000, 0x1000, 0x9000, 0x6000, 0x0000, // J + 0x8800, 0x9000, 0xa000, 0xc000, 0xa000, 0x9000, 0x8800, 0x0000, // K + 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0xf800, 0x0000, // L + 0x8800, 0xd800, 0xa800, 0xa800, 0xa800, 0x8800, 0x8800, 0x0000, // M + 0x8800, 0x8800, 0xc800, 0xa800, 0x9800, 0x8800, 0x8800, 0x0000, // N + 0x7000, 0x8800, 0x8800, 0x8800, 0x8800, 0x8800, 0x7000, 0x0000, // O + 0xf000, 0x8800, 0x8800, 0xf000, 0x8000, 0x8000, 0x8000, 0x0000, // P + 0x7000, 0x8800, 0x8800, 0x8800, 0xa800, 0x9000, 0x6800, 0x0000, // Q + 0xf000, 0x8800, 0x8800, 0xf000, 0xa000, 0x9000, 0x8800, 0x0000, // R + 0x7000, 0x8800, 0x8000, 0x7000, 0x0800, 0x8800, 0x7000, 0x0000, // S + 0xf800, 0xa800, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x0000, // T + 0x8800, 0x8800, 0x8800, 0x8800, 0x8800, 0x8800, 0x7000, 0x0000, // U + 0x8800, 0x8800, 0x8800, 0x8800, 0x8800, 0x5000, 0x2000, 0x0000, // V + 0x8800, 0x8800, 0x8800, 0xa800, 0xa800, 0xa800, 0x5000, 0x0000, // W + 0x8800, 0x8800, 0x5000, 0x2000, 0x5000, 0x8800, 0x8800, 0x0000, // X + 0x8800, 0x8800, 0x5000, 0x2000, 0x2000, 0x2000, 0x2000, 0x0000, // Y + 0xf800, 0x0800, 0x1000, 0x7000, 0x4000, 0x8000, 0xf800, 0x0000, // Z + 0x7800, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x7800, 0x0000, // [ + 0x0000, 0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0000, 0x0000, /* \ */ + 0x7800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x7800, 0x0000, // ] + 0x2000, 0x5000, 0x8800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ^ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xf800, 0x0000, // _ + 0x6000, 0x6000, 0x2000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, // ` + 0x0000, 0x0000, 0x6000, 0x1000, 0x7000, 0x9000, 0x7800, 0x0000, // a + 0x8000, 0x8000, 0xb000, 0xc800, 0x8800, 0xc800, 0xb000, 0x0000, // b + 0x0000, 0x0000, 0x7000, 0x8800, 0x8000, 0x8800, 0x7000, 0x0000, // c + 0x0800, 0x0800, 0x6800, 0x9800, 0x8800, 0x9800, 0x6800, 0x0000, // d + 0x0000, 0x0000, 0x7000, 0x8800, 0xf800, 0x8000, 0x7000, 0x0000, // e + 0x1000, 0x2800, 0x2000, 0x7000, 0x2000, 0x2000, 0x2000, 0x0000, // f + 0x0000, 0x0000, 0x7000, 0x9800, 0x9800, 0x6800, 0x0800, 0x0000, // g + 0x8000, 0x8000, 0xb000, 0xc800, 0x8800, 0x8800, 0x8800, 0x0000, // h + 0x2000, 0x0000, 0x6000, 0x2000, 0x2000, 0x2000, 0x7000, 0x0000, // i + 0x1000, 0x0000, 0x1000, 0x1000, 0x1000, 0x9000, 0x6000, 0x0000, // j + 0x8000, 0x8000, 0x9000, 0xa000, 0xc000, 0xa000, 0x9000, 0x0000, // k + 0x6000, 0x2000, 0x2000, 0x2000, 0x2000, 0x2000, 0x7000, 0x0000, // l + 0x0000, 0x0000, 0xd000, 0xa800, 0xa800, 0xa800, 0xa800, 0x0000, // m + 0x0000, 0x0000, 0xb000, 0xc800, 0x8800, 0x8800, 0x8800, 0x0000, // n + 0x0000, 0x0000, 0x7000, 0x8800, 0x8800, 0x8800, 0x7000, 0x0000, // o + 0x0000, 0x0000, 0xb000, 0xc800, 0xc800, 0xb000, 0x8000, 0x0000, // p + 0x0000, 0x0000, 0x6800, 0x9800, 0x9800, 0x6800, 0x0800, 0x0000, // q + 0x0000, 0x0000, 0xb000, 0xc800, 0x8000, 0x8000, 0x8000, 0x0000, // r + 0x0000, 0x0000, 0x7800, 0x8000, 0x7000, 0x0800, 0xf000, 0x0000, // s + 0x2000, 0x2000, 0xf800, 0x2000, 0x2000, 0x2800, 0x1000, 0x0000, // t + 0x0000, 0x0000, 0x8800, 0x8800, 0x8800, 0x9800, 0x6800, 0x0000, // u + 0x0000, 0x0000, 0x8800, 0x8800, 0x8800, 0x5000, 0x2000, 0x0000, // v + 0x0000, 0x0000, 0x8800, 0x8800, 0xa800, 0xa800, 0x5000, 0x0000, // w + 0x0000, 0x0000, 0x8800, 0x5000, 0x2000, 0x5000, 0x8800, 0x0000, // x + 0x0000, 0x0000, 0x8800, 0x8800, 0x7800, 0x0800, 0x8800, 0x0000, // y + 0x0000, 0x0000, 0xf800, 0x1000, 0x2000, 0x4000, 0xf800, 0x0000, // z + 0x1000, 0x2000, 0x2000, 0x4000, 0x2000, 0x2000, 0x1000, 0x0000, // { + 0x2000, 0x2000, 0x2000, 0x0000, 0x2000, 0x2000, 0x2000, 0x0000, // | + 0x4000, 0x2000, 0x2000, 0x1000, 0x2000, 0x2000, 0x4000, 0x0000, // } + 0x4000, 0xa800, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // ~ +}; + +font_def g_font_7x10 = {7, 10, FONT7X10}; +font_def g_font_6x8 = {6, 8, FONT6X8}; +font_def g_font_11x18 = {11, 18, FONT11X18}; +font_def g_font_16x26 = {16, 26, FONT16X26}; \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/inc/paj7620u2.h b/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/inc/paj7620u2.h new file mode 100644 index 0000000000000000000000000000000000000000..6c23239f61a635968a165af82687595031785bda --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/inc/paj7620u2.h @@ -0,0 +1,106 @@ +#ifndef PAJ_7620_U2_H +#define PAJ_7620_U2_H + +// i2c address +#define PAJ_7620_U2_I2C_ADDRESS 0x73 +// Register Bank select +#define PAJ_BANK_SELECT 0xEF /* Bank0=0x00,Bank1=0x01 */ +// Register Bank 0 +#define PAJ_SUSPEND \ + 0x03 /* I2C suspend command (Write 0x01 to enter suspend state). I2C wake-up command is slave ID wake-up. Refer to \ + topic ��I2C Bus Timing Characteristics and Protocol�� */ +#define PAJ_INT_FLAG1_MASK 0x41 /* Gesture detection interrupt flag mask */ +#define PAJ_INT_FLAG2_MASK 0x42 /* Gesture/PS detection interrupt flag mask */ +#define PAJ_INT_FLAG1 0x43 /* Gesture detection interrupt flag */ +#define PAJ_INT_FLAG2 0x44 /* Gesture/PS detection interrupt flag */ +#define PAJ_STATE 0x45 /* State indicator for gesture detection (Only functional at gesture detection mode) */ +#define PAJ_PS_HIGH_THRESHOLD 0x69 /* PS hysteresis high threshold (Only functional at proximity detection mode) */ +#define PAJ_PS_LOW_THRESHOLD 0x6A /* PS hysteresis low threshold (Only functional at proximity detection mode) */ +#define PAJ_PS_APPROACH_STATE \ + 0x6B /* PS approach state, Approach = 1 , (8 bits PS data >= PS high threshold), Not Approach = 0 , (8 bits PS \ + data <= PS low threshold)(Only functional at proximity detection mode) */ +#define PAJ_PS_DATA 0x6C /* PS 8 bit data(Only functional at gesture detection mode) */ +#define PAJ_OBJ_BRIGHTNESS 0xB0 /* Object Brightness (Max. 255) */ +#define PAJ_OBJ_SIZE_L 0xB1 /* Object Size(Low 8 bit) */ +#define PAJ_OBJ_SIZE_H 0xB2 /* Object Size(High 8 bit) */ + +// Register Bank 1 +#define PAJ_PS_GAIN 0x44 /* PS gain setting (Only functional at proximity detection mode) */ +#define PAJ_IDLE_S1_STEP_L 0x67 /* IDLE S1 Step, for setting the S1, Response Factor(Low 8 bit) */ +#define PAJ_IDLE_S1_STEP_H 0x68 /* IDLE S1 Step, for setting the S1, Response Factor(High 8 bit) */ +#define PAJ_IDLE_S2_STEP_L 0x69 /* IDLE S2 Step, for setting the S2, Response Factor(Low 8 bit) */ +#define PAJ_IDLE_S2_STEP_H 0x6A /* IDLE S2 Step, for setting the S2, Response Factor(High 8 bit) */ +#define PAJ_OPTOS1_TIME_L \ + 0x6B /* OPtoS1 Step, for setting the OPtoS1 time of operation state to standby 1 state(Low 8 bit) */ +#define PAJ_OPTOS2_TIME_H \ + 0x6C /* OPtoS1 Step, for setting the OPtoS1 time of operation state to standby 1 stateHigh 8 bit) */ +#define PAJ_S1TOS2_TIME_L \ + 0x6D /* S1toS2 Step, for setting the S1toS2 time of standby 1 state to standby 2 state(Low 8 bit) */ +#define PAJ_S1TOS2_TIME_H \ + 0x6E /* S1toS2 Step, for setting the S1toS2 time of standby 1 state to standby 2 stateHigh 8 bit) */ +#define PAJ_EN 0x72 /* Enable/Disable PAJ7620U2 */ +#define PAJ_INIT_OK 0x20 +// Gesture detection interrupt flag +#define PAJ_UP 0x01 +#define PAJ_DOWN 0x02 +#define PAJ_LEFT 0x04 +#define PAJ_RIGHT 0x08 +#define PAJ_FORWARD 0x10 +#define PAJ_BACKWARD 0x20 +#define PAJ_CLOCKWISE 0x40 +#define PAJ_COUNT_CLOCKWISE 0x80 +#define PAJ_WAVE 0x100 + +// Gesture detection string +#define STR_UP "Up" +#define STR_DOWN "Down" +#define STR_LEFT "Left" +#define STR_RIGHT "Right" +#define STR_FORWARD "Forward" +#define STR_BACKWARD "Backward" +#define STR_CLOCKWISE "Clockwise" +#define STR_COUNT_CLOCKWISE "AntiClockwise" +#define STR_WAVE "Wave" + +#define STR_UP_LEN 2 +#define STR_DOWN_LEN 4 +#define STR_LEFT_LEN 4 +#define STR_RIGHT_LEN 5 +#define STR_FORWARD_LEN 7 +#define STR_BACKWARD_LEN 8 +#define STR_CLOCKWISE_LEN 9 +#define STR_COUNT_CLOCKWISE_LEN 13 +#define STR_WAVE_LEN 4 + +// Power up initialize array +unsigned char g_init_register_array[][2] = { + {0xEF, 0x00}, {0x37, 0x07}, {0x38, 0x17}, {0x39, 0x06}, {0x41, 0x00}, {0x42, 0x00}, {0x46, 0x2D}, {0x47, 0x0F}, + {0x48, 0x3C}, {0x49, 0x00}, {0x4A, 0x1E}, {0x4C, 0x20}, {0x51, 0x10}, {0x5E, 0x10}, {0x60, 0x27}, {0x80, 0x42}, + {0x81, 0x44}, {0x82, 0x04}, {0x8B, 0x01}, {0x90, 0x06}, {0x95, 0x0A}, {0x96, 0x0C}, {0x97, 0x05}, {0x9A, 0x14}, + {0x9C, 0x3F}, {0xA5, 0x19}, {0xCC, 0x19}, {0xCD, 0x0B}, {0xCE, 0x13}, {0xCF, 0x64}, {0xD0, 0x21}, {0xEF, 0x01}, + {0x02, 0x0F}, {0x03, 0x10}, {0x04, 0x02}, {0x25, 0x01}, {0x27, 0x39}, {0x28, 0x7F}, {0x29, 0x08}, {0x3E, 0xFF}, + {0x5E, 0x3D}, {0x65, 0x96}, {0x67, 0x97}, {0x69, 0xCD}, {0x6A, 0x01}, {0x6D, 0x2C}, {0x6E, 0x01}, {0x72, 0x01}, + {0x73, 0x35}, {0x74, 0x00}, {0x77, 0x01}, +}; +// Approaches register initialization array +unsigned char g_init_ps_array[][2] = { + {0xEF, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0x48, 0x3C}, {0x49, 0x00}, {0x51, 0x13}, {0x83, 0x20}, + {0x84, 0x20}, {0x85, 0x00}, {0x86, 0x10}, {0x87, 0x00}, {0x88, 0x05}, {0x89, 0x18}, {0x8A, 0x10}, + {0x9f, 0xf8}, {0x69, 0x96}, {0x6A, 0x02}, {0xEF, 0x01}, {0x01, 0x1E}, {0x02, 0x0F}, {0x03, 0x10}, + {0x04, 0x02}, {0x41, 0x50}, {0x43, 0x34}, {0x65, 0xCE}, {0x66, 0x0B}, {0x67, 0xCE}, {0x68, 0x0B}, + {0x69, 0xE9}, {0x6A, 0x05}, {0x6B, 0x50}, {0x6C, 0xC3}, {0x6D, 0x50}, {0x6E, 0xC3}, {0x74, 0x05}, +}; + +// Gesture register initializes array +const unsigned char GESTURE_INIT_ARRAY[][2] = { + {0xEF, 0x00}, {0x41, 0x00}, {0x42, 0x00}, {0xEF, 0x00}, {0x48, 0x3C}, {0x49, 0x00}, {0x51, 0x10}, {0x83, 0x20}, + {0x9F, 0xF9}, {0xEF, 0x01}, {0x01, 0x1E}, {0x02, 0x0F}, {0x03, 0x10}, {0x04, 0x02}, {0x41, 0x40}, {0x43, 0x30}, + {0x65, 0x96}, {0x66, 0x00}, {0x67, 0x97}, {0x68, 0x01}, {0x69, 0xCD}, {0x6A, 0x01}, {0x6B, 0xB0}, {0x6C, 0x04}, + {0x6D, 0x2C}, {0x6E, 0x01}, {0x74, 0x00}, {0xEF, 0x00}, {0x41, 0xFF}, {0x42, 0x01}, +}; + +// Initialize array size +#define INIT_ARRAY (sizeof(g_init_register_array) / 2) +#define PS_ARRAY_SIZE (sizeof(g_init_ps_array) / 2) +#define GESTURE_ARRAY_SIZE (sizeof(GESTURE_INIT_ARRAY) / 2) +#endif diff --git a/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/inc/paj7620u2_entry.h b/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/inc/paj7620u2_entry.h new file mode 100644 index 0000000000000000000000000000000000000000..7beff343c9b0b7d2f6be3fdeca89c902ab395124 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/inc/paj7620u2_entry.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Soon.Liao. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * @Author: soon.liao + * @Date: 2024-08-30 17:01:26 + * @LastEditors: soon.liao + * @LastEditTime: 2024-11-02 10:04:45 + * @FilePath: \user\paj7620u2\inc\paj7620u2_entry.h + * @Description: Create Date : 2024 + * NA + */ +#ifndef PAJ_7620_U2_ENTRY_H +#define PAJ_7620_U2_ENTRY_H + +BASE_StatusType paj7620u2_entry(void); +void paj7620u2_event(void); + +#endif \ No newline at end of file diff --git a/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/src/paj7620u2.c b/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/src/paj7620u2.c new file mode 100644 index 0000000000000000000000000000000000000000..6b6722e363c589524b3e07cfda70c29bea91a51f --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/paj7620u2/src/paj7620u2.c @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2024 Soon.Liao. All rights reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include +#include +#include +#include +#include +#include + +#include "i2c.h" +#include "gpio.h" +#include "main.h" +#include "debug.h" +#include "i2c_common.h" +#include "ssd1306.h" +#include "paj7620u2.h" +#include "paj7620u2_entry.h" + +#define PAJ_7620_U2_ENTRY_TIME 200 // 等待I2C初始化完成时间ms +#define PAJ_7620_U2_QUIT_TIME 300 // 每次查询时间间隔单位ms +#define PAJ_7620_U2_DEFAULT_RW_LEN 1 +#define PAJ_7620_U2_DEFAULT_RWU16_LEN 2 +// I2C settings +#define PAJ_7620_U2_MASTER_WRITE_ADDR ((PAJ_7620_U2_I2C_ADDRESS << 1) + 0) +#define PAJ_7620_U2_MASTER_READ_ADDR ((PAJ_7620_U2_I2C_ADDRESS << 1) + 1) +#define PAJ_7620_U2_BYTE_LEN 8 + +static unsigned int paj7620u2_byte_combine(unsigned char b1, unsigned char b2) +{ + return (unsigned int)((b2) << PAJ_7620_U2_BYTE_LEN) + (b1); +} + +/** + * @brief Write the address of paj7620u2. + * @param addrBuffer The address of paj7620u2. + * @param length The length of data buffer. + * @retval BASE status type: OK, ERROR, BUSY, TIMEOUT. + */ +static BASE_StatusType paj7620u2_write(unsigned char *addrBuffer, unsigned int length) +{ + BASE_StatusType ret = BASE_STATUS_OK; + BASE_FUNC_DELAY_MS(IIC_READ_WRITE_DELAY_MS); /* Delay 5 ms. */ + ret = HAL_I2C_MasterWriteDMA(&g_i2c0_master, PAJ_7620_U2_MASTER_WRITE_ADDR, addrBuffer, length); + if (ret != BASE_STATUS_OK) { + DBG_PRINTF("LINE:%d,Write Data Fail,ret:%d\r\n", __LINE__, ret); + return ret; + } + /* Waiting for write completion or failure */ + while (!(get_tx_done_flag() || get_error_flag())) { + ; + } + set_tx_done_flag(BASE_CFG_UNSET); + if (get_error_flag() == BASE_CFG_SET) { + set_error_flag(BASE_CFG_UNSET); /* Reset g_error_flag. */ + DBG_PRINTF("LINE:%d,Write Data Fail\r\n", __LINE__); + return BASE_STATUS_ERROR; + } + return ret; +} + +static BASE_StatusType paj7620u2_read(unsigned char *buffer, unsigned int buffLen) +{ + BASE_FUNC_DELAY_MS(IIC_READ_WRITE_DELAY_MS); /* Delay 5 ms. */ + BASE_StatusType retval = HAL_I2C_MasterReadDMA(&g_i2c0_master, PAJ_7620_U2_MASTER_READ_ADDR, buffer, buffLen); + if (retval != BASE_STATUS_OK) { + DBG_PRINTF("paj7620u2_read(0x%X) failed, %0X!\n", buffer[1], retval); + return retval; + } + /* Waiting for read completion or failure */ + while (!(get_rx_done_flag() || get_error_flag())) { + ; + } + set_rx_done_flag(BASE_CFG_UNSET); + if (get_error_flag() == BASE_CFG_SET) { + DBG_PRINTF("LINE:%d,Read Data Fail\r\n", __LINE__); + set_error_flag(BASE_CFG_UNSET); + return BASE_STATUS_ERROR; + } + return BASE_STATUS_OK; +} + +/******************* PAJ7620U2 Driver Interface *****************************/ +static unsigned char i2c_read_byte(int reg) +{ + BASE_StatusType retval = 0; + unsigned char addr_buff[1] = {reg}; + unsigned char buffer[1] = {0x00}; + retval = paj7620u2_write(addr_buff, PAJ_7620_U2_DEFAULT_RW_LEN); + if (retval != 0) { + DBG_PRINTF("PAJ7620U2 i2c_read_byte fail line:%d", __LINE__); + return retval; + } + retval = paj7620u2_read(buffer, PAJ_7620_U2_DEFAULT_RW_LEN); + if (retval != 0) { + DBG_PRINTF("PAJ7620U2 i2c_read_byte fail line:%d", __LINE__); + return retval; + } + return buffer[0]; +} + +static unsigned int i2c_read_u16(int reg) +{ + int ret; + unsigned int data = 0x00; + unsigned char addr_buf[1] = {reg}; + unsigned char read_buf[2]; + ret = paj7620u2_write(addr_buf, PAJ_7620_U2_DEFAULT_RW_LEN); + if (ret != 0) { + DBG_PRINTF("PAJ7620U2 i2c_read_u16 fail line:%d", __LINE__); + return ret; + } + ret = paj7620u2_read(read_buf, PAJ_7620_U2_DEFAULT_RWU16_LEN); + if (ret != BASE_STATUS_OK) { + DBG_PRINTF("PAJ7620U2 i2c_read_u16 0x%X,0x%X ret=%d\r\n", read_buf[0], read_buf[1], ret); + return ret; + } + data = paj7620u2_byte_combine(read_buf[0], read_buf[1]); + return data; +} + +static void i2c_write_byte(int reg, int val) +{ + BASE_StatusType retval = 0; + unsigned char data_send[2] = {reg, val}; + retval = paj7620u2_write(data_send, PAJ_7620_U2_DEFAULT_RWU16_LEN); + if (retval != BASE_STATUS_OK) { + DBG_PRINTF("I2C_writeByte(reg=0x%X,val=0x%X) failed, retval=%d!\r\n", reg, val, retval); + return; + } + return; +} + +static void paj7620u2_show_data(char *data, unsigned int len) +{ + BASE_FUNC_UNUSED(len); + int x = 0; + int y = 20; + ssd1306_fill(BLACK); + ssd1306_set_cursor(x, y); + ssd1306_draw_string(data, g_font_7x10, WHITE); + ssd1306_update_screen(); +} + +static void on_paj7620u2_event_up(void) +{ + unsigned int gesture_data; + BASE_FUNC_DELAY_MS(PAJ_7620_U2_QUIT_TIME); + gesture_data = i2c_read_u16(PAJ_INT_FLAG1); + DBG_PRINTF("Double Confirm Gesture Sensor gesture_data=0x%x\r\n ", gesture_data); + if (gesture_data == PAJ_CLOCKWISE) { + DBG_PRINTF("Clockwise\r\n"); + paj7620u2_show_data(STR_CLOCKWISE, STR_CLOCKWISE_LEN); + } else { + DBG_PRINTF("Up\r\n"); + paj7620u2_show_data(STR_UP, STR_UP_LEN); + } +} + +static void on_paj7620u2_event_down(void) +{ + unsigned int gesture_data; + BASE_FUNC_DELAY_MS(PAJ_7620_U2_QUIT_TIME); + gesture_data = i2c_read_u16(PAJ_INT_FLAG1); + DBG_PRINTF("Double Confirm Gesture Sensor gesture_data=0x%x\r\n ", gesture_data); + if (gesture_data == PAJ_CLOCKWISE) { + DBG_PRINTF("AntiClockwise\r\n"); + paj7620u2_show_data(STR_COUNT_CLOCKWISE, STR_COUNT_CLOCKWISE_LEN); + } else { + DBG_PRINTF("Down\r\n"); + paj7620u2_show_data(STR_DOWN, STR_DOWN_LEN); + } +} + +static void on_paj7620u2_event_left(void) +{ + unsigned int gesture_data; + BASE_FUNC_DELAY_MS(PAJ_7620_U2_QUIT_TIME); + gesture_data = i2c_read_u16(PAJ_INT_FLAG1); + DBG_PRINTF("Double Confirm Gesture Sensor gesture_data=0x%x\r\n ", gesture_data); + if (gesture_data == PAJ_CLOCKWISE) { + DBG_PRINTF("AntiClockwise\r\n"); + paj7620u2_show_data(STR_COUNT_CLOCKWISE, STR_COUNT_CLOCKWISE_LEN); + } else { + DBG_PRINTF("Left\r\n"); + paj7620u2_show_data(STR_LEFT, STR_LEFT_LEN); + } +} + +static void on_paj7620u2_event_right(void) +{ + unsigned int gesture_data; + BASE_FUNC_DELAY_MS(PAJ_7620_U2_QUIT_TIME); + gesture_data = i2c_read_u16(PAJ_INT_FLAG1); + DBG_PRINTF("Double Confirm Gesture Sensor gesture_data=0x%x\r\n ", gesture_data); + if (gesture_data == PAJ_CLOCKWISE) { + DBG_PRINTF("Clockwise\r\n"); + paj7620u2_show_data(STR_CLOCKWISE, STR_CLOCKWISE_LEN); + } else { + DBG_PRINTF("Right\r\n"); + paj7620u2_show_data(STR_RIGHT, STR_RIGHT_LEN); + } +} + +static void on_paj7620u2_event_forward(void) +{ + DBG_PRINTF("Forward\r\n"); + paj7620u2_show_data(STR_FORWARD, STR_FORWARD_LEN); +} + +static void on_paj7620u2_event_backward(void) +{ + DBG_PRINTF("Backward\r\n"); + paj7620u2_show_data(STR_BACKWARD, STR_BACKWARD_LEN); +} + +static void on_paj7620u2_event_clockwise(void) +{ + DBG_PRINTF("Clockwise\r\n"); + paj7620u2_show_data(STR_CLOCKWISE, STR_CLOCKWISE_LEN); +} + +static void on_paj7620u2_event_anticlockwise(void) +{ + DBG_PRINTF("AntiClockwise\r\n"); + paj7620u2_show_data(STR_COUNT_CLOCKWISE, STR_COUNT_CLOCKWISE_LEN); +} + +static void on_paj7620u2_event_wave(void) +{ + DBG_PRINTF("Wave\r\n"); + paj7620u2_show_data(STR_WAVE, STR_WAVE_LEN); +} + +void paj7620u2_event(void) +{ + unsigned int gesture_data; + BASE_FUNC_DELAY_MS(PAJ_7620_U2_QUIT_TIME); + gesture_data = i2c_read_u16(PAJ_INT_FLAG1); + if (gesture_data) { + DBG_PRINTF("Gesture Sensor gesture_data=0x%x\r\n ", gesture_data); + switch (gesture_data) { + case PAJ_UP: + on_paj7620u2_event_up(); + break; + case PAJ_DOWN: + on_paj7620u2_event_down(); + break; + case PAJ_LEFT: + on_paj7620u2_event_left(); + break; + case PAJ_RIGHT: + on_paj7620u2_event_right(); + break; + case PAJ_FORWARD: + on_paj7620u2_event_forward(); + break; + case PAJ_BACKWARD: + on_paj7620u2_event_backward(); + break; + case PAJ_CLOCKWISE: + on_paj7620u2_event_clockwise(); + break; + case PAJ_COUNT_CLOCKWISE: + on_paj7620u2_event_anticlockwise(); + break; + case PAJ_WAVE: + on_paj7620u2_event_wave(); + break; + default: + break; + } + gesture_data = 0; + } +} + +static unsigned int paj7620u2_init(void) +{ + unsigned char i, state; + + state = i2c_read_byte(0x00); // Read state + DBG_PRINTF("Gesture Sensor state =0x%x\r\n", state); + if (state != PAJ_INIT_OK) { + return BASE_STATUS_ERROR; + } // Wake up failed + i2c_write_byte(PAJ_BANK_SELECT, 0); // Select Bank 0 + for (i = 0; i < INIT_ARRAY; i++) { + i2c_write_byte(g_init_register_array[i][0], g_init_register_array[i][1]); // Power up initialize + } + i2c_write_byte(PAJ_BANK_SELECT, 0); + return BASE_STATUS_OK; +} + +BASE_StatusType paj7620u2_entry(void) +{ + int ret = -1; + unsigned int i; + DBG_PRINTF("Gesture Sensor Program Paj7620U2Task init start...\r\n"); + BASE_FUNC_DELAY_MS(PAJ_7620_U2_ENTRY_TIME); + ret = paj7620u2_init(); + if (ret != BASE_STATUS_OK) { + DBG_PRINTF("Gesture Sensor Error\r\n"); + return BASE_STATUS_ERROR; + } + DBG_PRINTF("Gesture Sensor Entry2\r\n"); + i2c_write_byte(PAJ_BANK_SELECT, 0); // Select Bank 0 + for (i = 0; i < GESTURE_ARRAY_SIZE; i++) { + i2c_write_byte(GESTURE_INIT_ARRAY[i][0], GESTURE_INIT_ARRAY[i][1]); // Gesture register initializes + } + DBG_PRINTF("Gesture Sensor OK\r\n"); + return BASE_STATUS_OK; +} diff --git a/vendor/other/demo/02_paj7620u2_gesture/readme.md b/vendor/other/demo/02_paj7620u2_gesture/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..d015b393cc4b954170ee1e6829f4737b9447ffa7 --- /dev/null +++ b/vendor/other/demo/02_paj7620u2_gesture/readme.md @@ -0,0 +1,150 @@ +# 2024年上海海思MCU开发者体验官活动 02 基于MCU Solarec开发套件的手势识别案例开发 + +## 1.1 介绍 + +本项目基于上海海思MCU开发者体验官活动,使用[3061M开发板](https://gitee.com/HiSpark/open_mcu/tree/master/docs/hardware/3061M)作为主板,结合PAJ7620U2手势识别传感器和SSD1306 OLED显示屏,实现9种手势的识别并在OLED屏幕上显示。通过此项目,开发者可以深入了解海思MCU的开发流程,体验3061M开发套件的优势,并熟悉手势识别与OLED显示的应用。 + +### 1.1.1 **应用场景:** + +**智能家居控制** + +场景描述:用户可以通过手势识别系统来控制智能家居设备,如灯光、空调、窗帘等。例如,挥手表示打开或关闭灯光,手指向上或向下滑动表示调节空调温度,手掌向前或向后移动表示打开或关闭窗帘。 + +优势:无需直接接触设备,减少了物理按键的磨损和清洁成本,同时提高了操作的便捷性和趣味性。 + +**人机交互界面** + +场景描述:在智能机器人、自助服务终端等设备上,手势识别系统可以作为人机交互的补充方式。用户可以通过手势来指示机器人执行特定任务,或在自助服务终端上选择菜单项。 + +优势:提高了设备的交互性和用户友好性,使得操作更加直观和易于理解。 + +**健康监测与康复** + +场景描述:在医疗领域,手势识别系统可以用于监测患者的运动能力和康复进展。例如,通过识别患者的手势动作来评估其关节活动度和肌肉力量,为康复计划提供数据支持。 + +优势:非侵入性的监测方式,减少了患者的不适感,同时提供了客观、准确的评估数据。 + +**游戏与娱乐** + +场景描述:手势识别系统可以应用于游戏和娱乐领域,为玩家提供更加沉浸式的体验。例如,在VR游戏中,玩家可以通过手势来控制游戏角色或进行互动操作。 + +优势:增强了游戏的互动性和真实感,提高了玩家的参与度和满意度。 + +**工业自动化与远程操作** + +场景描述:在工业自动化领域,手势识别系统可以用于远程操作机器人或机械设备。操作员可以通过手势来指示机器人执行特定的任务或调整工作参数。 + +优势:提高了工业生产的效率和安全性,减少了操作员与危险环境的直接接触。 + +### 1.1.2 **软件概述:** + +使用I2C0 DMA方式实现PAJ7620U2、SSD1306 OLED初始化和功能配置。 + +### 1.1.3 **硬件概述:** + +硬件采用3061M核心板,通过板杜邦线连接PAJ7620U2和SSD1306 OLED。 + +#### 1.1.3.1 **PAJ7620U2 手势模块连接** + +PAJ7620U2 手势模块是一款功能强大的光学数组式传感器,凭借其出色的手势识别能力和接近检测功能,在多个领域得到了广泛应用。模块支持 9 种手势类型,包括上、下、左、右、前、后、顺时针旋转、逆时针旋转、挥动,并支持输出手势中断结果。 + +![paj7620u2](./images/paj7620u2.png) + +[paj7620u2 规格书见 doc 目录](./doc/PAJ7620U2_spec.pdf),模块接线说明如下: + +**接线说明** +| PAJ7620U2 | 3061M/底板 | +| ------------------------- | ------------------------------- | +| VCC| 3.3V 或 5V| +| GND| GND| +| SDA| PIN26/GPIO4_3/(J2_26)| +| SCL| PIN25/GPIO4_2/(J2_25)| +| INT| NC| + +#### 1.1.3.2 **SSD1306 OLED显示模块连接** + +SSD1306 OLED显示模块采用星闪派中的显示模块,与PAJ7620U2共用I2C0。 + +![ssd1306_oled](./images/ssd1306_oled.png) + +[SSD1306 规格书见 doc 目录](./doc/SSD1306.pdf),模块接线说明如下: +**接线说明** +| SSD1306 OLED | 3061M/底板 | +| ------------------------- | ------------------------------- | +| VCC| 3.3V| +| GND| GND| +| SDA| PIN26/GPIO4_3/(J2_26)| +| SCL| PIN25/GPIO4_2/(J2_25)| + +整体硬件搭建要求如图所示: + +![image-20240829165616356](./images/hw_connect.jpg) + +## 1.2 约束与限制 + +### 1.2.1 支持应用运行的芯片和开发板 + + 本示例支持开发板:3061M + +### 1.2.2 支持API版本、SDK版本 + + 本示例支持版本号:SolarA2_1.0.1.2 + +### 1.2.3 支持IDE版本 + + 本示例支持IDE版本号:1.0.0.6; + +## 1.3 效果预览 + + 当用户烧录编译后的示例代码后,初始化和配置完成后,在OLED屏幕上会显示“Hello Paj7620U2!!!”字样,当在Paj7620U2操作手势,会在SSD1306 OLED屏幕上显示识别到的手势名称。 +## 1.3.1 初始化 +![init_display](./images/init_display.jpg) +## 1.3.2 手势识别 +![down_display](./images/down_display.jpg) +## 1.3.3 演示视频 + +海思MCU体验官 +https://www.alipan.com/s/UUXKx8BtA4r +提取码: k7s3 + +## 1.4 工程配置 + +#### 1.4.1 管脚视图 +![project_pin_view](./images/project_pin_view.png) + +#### 1.4.2 I2C0 配置 +![I2C0_config](./images/I2C0_config.png) + +#### 1.4.3 Uart0 配置 +![uart0_config](./images/uart0_config.png) + +#### 1.4.4 MACRO 配置 +![macro_config](./images/macro_config.png) + +## 1.5 实验流程 + +- 步骤一:在xxx\vendor\other\demo\02_paj7620u2_gesture/文件夹里面内容复制替换到xxx/user/目录下。 + + ![image-20240829174750105](../../../../docs/pic/sample_gpio_key/image-20240829174750105.png) + + +- 步骤二:点击编译按钮![image-20240528173107958](../../../../docs/pic/sample_gpio_key/image-20240528173107958-17249242848691.png),编译成功后终端窗口输出如下图所示。 + ![build_success](./images/build_success.png) + + + +- 步骤三:进入工程配置界面。打开要烧录的工程后,单击顶部![image-20240624154427635](../../../../docs/pic/sample_gpio_key/image-20240624154427635-17249243742892.png)的图标,进入工程配置界面->进入程序加载。选择传输方式为“swd”,并配置其他参数。(具体[参考tools目录README搭建环境](https://gitee.com/HiSpark/open_mcu/tree/master/tools)) + + ![image-20240829174913995](../../../../docs/pic/sample_gpio_key/image-20240829174913995.png) + +- 步骤四:单击“烧录”![image-20240624162016190](../../../../docs/pic/tools/image-20240624162016190.png) 按钮,开始烧录。烧录成功后终端窗口输出如下图所示。 + + ![image-20240624162037834](../../../../docs/pic/sample_gpio_key/image-20240624162037834-17249245112874.png) + +* 步骤五 : 当用户烧录编译后的示例代码后,初始化和配置完成后,可以在paj7620u2做出相应的手势进行识别,paj7620u2成功识别后会显示对应识别出来的手势,显示效果见预览。串口打印日志如下图: + +![serial_log](./images/serial_log.png) + + + + \ No newline at end of file