Init commit.
This commit is contained in:
commit
89b2799fb0
36
.devcontainer/Dockerfile
Normal file
36
.devcontainer/Dockerfile
Normal file
@ -0,0 +1,36 @@
|
||||
FROM espressif/idf:release-v4.3
|
||||
|
||||
ARG DEBIAN_FRONTEND=nointeractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt install -y -q \
|
||||
cmake \
|
||||
git \
|
||||
libglib2.0-0 \
|
||||
libnuma1 \
|
||||
libpixman-1-0
|
||||
|
||||
RUN ./opt/esp/entrypoint.sh && pip install --no-cache-dir idf-component-manager
|
||||
|
||||
# QEMU
|
||||
ENV QEMU_REL=esp-develop-20210220
|
||||
ENV QEMU_SHA256=44c130226bdce9aff6abf0aeaab44f09fe4f2d71a5f9225ac1708d68e4852c02
|
||||
ENV QEMU_DIST=qemu-${QEMU_REL}.tar.bz2
|
||||
ENV QEMU_URL=https://github.com/espressif/qemu/releases/download/${QEMU_REL}/${QEMU_DIST}
|
||||
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV IDF_PYTHON_ENV_PATH=/opt/esp/python_env/idf4.3_py3.6_env
|
||||
|
||||
RUN wget --no-verbose ${QEMU_URL} \
|
||||
&& echo "${QEMU_SHA256} *${QEMU_DIST}" | sha256sum --check --strict - \
|
||||
&& tar -xf $QEMU_DIST -C /opt \
|
||||
&& rm ${QEMU_DIST}
|
||||
|
||||
ENV PATH=/opt/qemu/bin:${PATH}
|
||||
|
||||
RUN echo $($IDF_PATH/tools/idf_tools.py export) >> $HOME/.bashrc
|
||||
|
||||
ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
|
||||
|
||||
CMD ["/bin/bash"]
|
30
.devcontainer/devcontainer.json
Normal file
30
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,30 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/ubuntu
|
||||
{
|
||||
"name": "ESP-IDF QEMU",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"settings": {
|
||||
"terminal.integrated.defaultProfile.linux": "bash",
|
||||
"idf.espIdfPath": "/opt/esp/idf",
|
||||
"idf.customExtraPaths": "",
|
||||
"idf.pythonBinPath": "/opt/esp/python_env/idf4.3_py3.6_env/bin/python",
|
||||
"idf.toolsPath": "/opt/esp",
|
||||
"idf.gitPath": "/usr/bin/git"
|
||||
},
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-vscode.cpptools",
|
||||
"espressif.esp-idf-extension"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "bash /opt/esp/entrypoint.sh",
|
||||
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
// "remoteUser": "vscodeuser"
|
||||
}
|
87
.gitignore
vendored
Normal file
87
.gitignore
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
*.obj
|
||||
*.elf
|
||||
|
||||
# Linker output
|
||||
*.ilk
|
||||
*.map
|
||||
*.exp
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Libraries
|
||||
*.lib
|
||||
*.a
|
||||
*.la
|
||||
*.lo
|
||||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.su
|
||||
*.idb
|
||||
*.pdb
|
||||
|
||||
# Kernel Module Compile Results
|
||||
*.mod*
|
||||
*.cmd
|
||||
.tmp_versions/
|
||||
modules.order
|
||||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
|
||||
build/
|
||||
trace/
|
28
.vscode/c_cpp_properties.json
vendored
Normal file
28
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "ESP-IDF",
|
||||
"compilerPath": "/Users/ivan/.espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gcc",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++17",
|
||||
"includePath": [
|
||||
"${config:idf.espIdfPath}/components/**",
|
||||
"${config:idf.espIdfPathWin}/components/**",
|
||||
"${config:idf.espAdfPath}/components/**",
|
||||
"${config:idf.espAdfPathWin}/components/**",
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"browse": {
|
||||
"path": [
|
||||
"${config:idf.espIdfPath}/components",
|
||||
"${config:idf.espIdfPathWin}/components",
|
||||
"${config:idf.espAdfPath}/components/**",
|
||||
"${config:idf.espAdfPathWin}/components/**",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
10
.vscode/launch.json
vendored
Normal file
10
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "espidf",
|
||||
"name": "Launch",
|
||||
"request": "launch"
|
||||
}
|
||||
]
|
||||
}
|
27
.vscode/settings.json
vendored
Normal file
27
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"C_Cpp.intelliSenseEngine": "Tag Parser",
|
||||
"files.associations": {
|
||||
"*.ejs": "html",
|
||||
"css": "postcss",
|
||||
"scss": "postcss",
|
||||
"*.cjson": "jsonc",
|
||||
"*.wxss": "css",
|
||||
"*.wxs": "javascript",
|
||||
"task.h": "c",
|
||||
"freertos.h": "c",
|
||||
"*.tcc": "c",
|
||||
"*.ipp": "c",
|
||||
"*.inc": "c",
|
||||
"unordered_map": "c",
|
||||
"fstream": "c",
|
||||
"istream": "c",
|
||||
"ostream": "c",
|
||||
"sstream": "c"
|
||||
},
|
||||
"idf.port": "/dev/cu.usbmodem142201",
|
||||
"idf.adapterTargetName": "esp32c3",
|
||||
"idf.openOcdConfigs": [
|
||||
"board/esp32c3-builtin.cfg"
|
||||
],
|
||||
"idf.flashType": "JTAG"
|
||||
}
|
300
.vscode/tasks.json
vendored
Normal file
300
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,300 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build - Build project",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py build",
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py build",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Set ESP-IDF Target",
|
||||
"type": "shell",
|
||||
"command": "${command:espIdf.setTarget}",
|
||||
"problemMatcher": {
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^(.*):(//d+):(//d+)://s+(warning|error)://s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Clean - Clean the project",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py fullclean",
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py fullclean",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Flash - Flash the device",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} -b ${config:idf.flashBaudRate} flash",
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py flash -p ${config:idf.portWin} -b ${config:idf.flashBaudRate}",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Monitor: Start the monitor",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} monitor",
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py -p ${config:idf.portWin} monitor",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
],
|
||||
"dependsOn": "Flash - Flash the device"
|
||||
},
|
||||
{
|
||||
"label": "OpenOCD: Start openOCD",
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "never",
|
||||
"focus": false,
|
||||
"panel": "new"
|
||||
},
|
||||
"command": "openocd -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}",
|
||||
"windows": {
|
||||
"command": "openocd.exe -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": {
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "adapter",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath}",
|
||||
"isBackground": true,
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}",
|
||||
"PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter"
|
||||
}
|
||||
},
|
||||
"problemMatcher": {
|
||||
"background": {
|
||||
"beginsPattern": "\bDEBUG_ADAPTER_STARTED\b",
|
||||
"endsPattern": "DEBUG_ADAPTER_READY2CONNECT",
|
||||
"activeOnStart": true
|
||||
},
|
||||
"pattern": {
|
||||
"regexp": "(\\d+)-(\\d+)-(\\d+)\\s(\\d+):(\\d+):(\\d+),(\\d+)\\s-(.+)\\s(ERROR)",
|
||||
"file": 8,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 9
|
||||
}
|
||||
},
|
||||
"args": [
|
||||
"${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter_main.py",
|
||||
"-e",
|
||||
"${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
|
||||
"-s",
|
||||
"${command:espIdf.getOpenOcdScriptValue}",
|
||||
"-ip",
|
||||
"localhost",
|
||||
"-dn",
|
||||
"${config:idf.adapterTargetName}",
|
||||
"-om",
|
||||
"connect_to_instance"
|
||||
],
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin}",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}",
|
||||
"PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
8
CMakeLists.txt
Normal file
8
CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
# For more information about build system see
|
||||
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
|
||||
# The following five lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(ivan-ups)
|
32
README.md
Normal file
32
README.md
Normal file
@ -0,0 +1,32 @@
|
||||
# _Sample project_
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
This is the simplest buildable example. The example is used by command `idf.py create-project`
|
||||
that copies the project to user specified path and set it's name. For more information follow the [docs page](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html#start-a-new-project)
|
||||
|
||||
|
||||
|
||||
## How to use example
|
||||
We encourage the users to use the example as a template for the new projects.
|
||||
A recommended way is to follow the instructions on a [docs page](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html#start-a-new-project).
|
||||
|
||||
## Example folder contents
|
||||
|
||||
The project **sample_project** contains one source file in C language [main.c](main/main.c). The file is located in folder [main](main).
|
||||
|
||||
ESP-IDF projects are built using CMake. The project build configuration is contained in `CMakeLists.txt`
|
||||
files that provide set of directives and instructions describing the project's source files and targets
|
||||
(executable, library, or both).
|
||||
|
||||
Below is short explanation of remaining files in the project folder.
|
||||
|
||||
```
|
||||
├── CMakeLists.txt
|
||||
├── main
|
||||
│ ├── CMakeLists.txt
|
||||
│ └── main.c
|
||||
└── README.md This is the file you are currently reading
|
||||
```
|
||||
Additionally, the sample project contains Makefile and component.mk files, used for the legacy Make based build system.
|
||||
They are not used or needed when building with CMake and idf.py.
|
3
debug.log
Normal file
3
debug.log
Normal file
@ -0,0 +1,3 @@
|
||||
2022-04-05 20:36:20,353 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STARTED
|
||||
2022-04-05 20:36:20,355 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_READY2CONNECT
|
||||
2022-04-05 20:36:30,863 - Debug Adapter (main) - CRITICAL - Debug adapter -> Extension: DEBUG_ADAPTER_STOPPED
|
2
main/CMakeLists.txt
Normal file
2
main/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
||||
idf_component_register(SRCS "main.c" "ring.c" "power-out-control.c" "screen.c"
|
||||
INCLUDE_DIRS ".")
|
445
main/codetab.h
Normal file
445
main/codetab.h
Normal file
@ -0,0 +1,445 @@
|
||||
/************************************************************************************
|
||||
* Copyright (c), 2013, HelTec Automatic Technology co.,LTD.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Http: www.heltec.cn
|
||||
* Email: cn.heltec@gmail.com
|
||||
* WebShop: shop105719768.taobao.com
|
||||
*
|
||||
* File name: codetab.h
|
||||
* Project : OLED
|
||||
* Processor: STC89C52
|
||||
* Compiler : Keil C51 Compiler
|
||||
*
|
||||
* Author : 小林
|
||||
* Version: 1.00
|
||||
* Date : 2013.8.8
|
||||
* Email : hello14blog@gmail.com
|
||||
* Modification: none
|
||||
*
|
||||
* Description:
|
||||
* 1. 128*64点整OLED模块功能演示程序的字表,仅适用heltec.taobao.com所售产品;
|
||||
* 2. 字表由打包资料中的“取字软件”计算得出;
|
||||
* 3. 取字方式 -- 共阴、列行式、逆向输出
|
||||
*
|
||||
* Others: none;
|
||||
*
|
||||
* Function List:
|
||||
*
|
||||
* 1. void delay(unsigned int z) -- 主函数中用于调整显示效果的延时函数,STC89C52 12MHZ z=1时大约延时1ms,其他频率需要自己计算
|
||||
* 2. void main(void) -- 主函数
|
||||
*
|
||||
* History: none;
|
||||
*
|
||||
*************************************************************************************/
|
||||
|
||||
//#include "reg52.h"
|
||||
/***************************16*16的点阵字体取模方式:共阴——列行式——逆向输出*********/
|
||||
uint8_t F16x16[] =
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*" ",0*/
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*" ",0*/
|
||||
|
||||
0x00, 0x02, 0x02, 0xFA, 0xFA, 0xAA, 0xAA, 0xFF, 0xFF, 0xAA, 0xAA, 0xFA, 0xFA, 0x02, 0x02, 0x00,
|
||||
0x00, 0x42, 0x72, 0x72, 0x3A, 0x7A, 0x42, 0x4B, 0x5B, 0x52, 0x62, 0x62, 0x13, 0x77, 0x66, 0x00, /*"惠",1*/
|
||||
|
||||
0x20, 0x3C, 0x1C, 0xFF, 0xFF, 0xB0, 0xB4, 0x24, 0x24, 0x3F, 0x3F, 0xE4, 0xE4, 0x24, 0x24, 0x20,
|
||||
0x02, 0x02, 0x03, 0xFF, 0xFF, 0x00, 0x01, 0x05, 0x1D, 0x59, 0xC1, 0xFF, 0x7F, 0x01, 0x01, 0x01, /*"特",2*/
|
||||
|
||||
0x00, 0x00, 0x00, 0xF8, 0xF8, 0x48, 0x4C, 0x4F, 0x4B, 0x4A, 0x48, 0x48, 0xF8, 0xF8, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xFF, 0xFF, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0xFF, 0xFF, 0x00, 0x00, /*"自",3*/
|
||||
|
||||
0x20, 0x24, 0x24, 0xE4, 0xE4, 0x24, 0x24, 0x24, 0x30, 0x10, 0xFF, 0xFF, 0x10, 0xF0, 0xF0, 0x00,
|
||||
0x08, 0x1C, 0x1F, 0x0B, 0x0C, 0x0D, 0x4F, 0x6E, 0x34, 0x1C, 0x0F, 0x23, 0x60, 0x7F, 0x3F, 0x00, /*"动",4*/
|
||||
|
||||
0x80, 0xC0, 0x60, 0xF8, 0xFF, 0x07, 0x02, 0x00, 0xFF, 0xFF, 0xE0, 0x70, 0x3C, 0x1C, 0x08, 0x00,
|
||||
0x00, 0x00, 0x00, 0x7F, 0x7F, 0x04, 0x06, 0x03, 0x3F, 0x7F, 0x40, 0x40, 0x40, 0x78, 0x78, 0x00, /*"化",5*/
|
||||
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*" ",6*/
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*" ",6*/
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*" ",7*/
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*" ",7*/
|
||||
|
||||
0x10, 0x21, 0x86, 0x70, 0x00, 0x7E, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x7E, 0x00, 0x00, 0x00, 0x00,
|
||||
0x02, 0xFE, 0x01, 0x40, 0x7F, 0x41, 0x41, 0x7F, 0x41, 0x41, 0x7F, 0x41, 0x41, 0x7F, 0x40, 0x00, /*"温",8*/
|
||||
0x00, 0x00, 0xFC, 0x04, 0x24, 0x24, 0xFC, 0xA5, 0xA6, 0xA4, 0xFC, 0x24, 0x24, 0x24, 0x04, 0x00,
|
||||
0x80, 0x60, 0x1F, 0x80, 0x80, 0x42, 0x46, 0x2A, 0x12, 0x12, 0x2A, 0x26, 0x42, 0xC0, 0x40, 0x00, /*"度",9*/
|
||||
0x08, 0x08, 0x08, 0xFF, 0x88, 0x48, 0x00, 0x98, 0x48, 0x28, 0x0A, 0x2C, 0x48, 0xD8, 0x08, 0x00,
|
||||
0x02, 0x42, 0x81, 0x7F, 0x00, 0x00, 0x40, 0x42, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x40, 0x00, /*"控",10*/
|
||||
0x00, 0x50, 0x4F, 0x4A, 0x48, 0xFF, 0x48, 0x48, 0x48, 0x00, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3F, 0x01, 0x01, 0xFF, 0x21, 0x61, 0x3F, 0x00, 0x0F, 0x40, 0x80, 0x7F, 0x00, 0x00, /*"制",11*/
|
||||
0x00, 0x90, 0x8C, 0xA4, 0xA4, 0xA4, 0xA5, 0xA6, 0xA4, 0xA4, 0xA4, 0xA4, 0x94, 0x8C, 0x04, 0x00,
|
||||
0x00, 0x80, 0x40, 0x20, 0x18, 0x07, 0x00, 0x00, 0x00, 0x3F, 0x40, 0x40, 0x40, 0x70, 0x00, 0x00, /*"完",12*/
|
||||
0x00, 0x04, 0x74, 0xD4, 0xFF, 0xD4, 0x74, 0x04, 0x10, 0x0C, 0xB7, 0x44, 0xB4, 0x0C, 0x04, 0x00,
|
||||
0x00, 0x42, 0x43, 0x7A, 0x43, 0x42, 0x43, 0x7E, 0x4B, 0x4B, 0x4A, 0x4A, 0x42, 0x43, 0x01, 0x00, /*"整",13*/
|
||||
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xF9, 0x4A, 0x4C, 0x48, 0x48, 0xC8, 0x08, 0x08, 0x08, 0x00,
|
||||
0x40, 0x40, 0x20, 0x10, 0x0C, 0x03, 0x00, 0x00, 0x20, 0x40, 0x40, 0x3F, 0x00, 0x00, 0x00, 0x00, /*"方",14*/
|
||||
0x00, 0x20, 0x2C, 0x24, 0x64, 0x74, 0xAD, 0xA6, 0xE4, 0x34, 0x24, 0x24, 0x2C, 0x24, 0x00, 0x00,
|
||||
0x00, 0x24, 0x24, 0x25, 0x15, 0x15, 0x0D, 0xFE, 0x04, 0x0D, 0x17, 0x14, 0x24, 0x64, 0x24, 0x00, /*"案",15*/
|
||||
|
||||
0x00, 0x00, 0x00, 0xF8, 0x48, 0x48, 0x4C, 0x4B, 0x4A, 0x48, 0x48, 0x48, 0xF8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xFF, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0xFF, 0x00, 0x00, 0x00, /*"自",16*/
|
||||
0x20, 0x24, 0x24, 0xE4, 0x24, 0x24, 0x24, 0x20, 0x10, 0x10, 0xFF, 0x10, 0x10, 0xF0, 0x00, 0x00,
|
||||
0x08, 0x1C, 0x0B, 0x08, 0x0C, 0x05, 0x4E, 0x24, 0x10, 0x0C, 0x03, 0x20, 0x40, 0x3F, 0x00, 0x00, /*"动",17*/
|
||||
0x08, 0x08, 0x08, 0xFF, 0x88, 0x48, 0x00, 0x98, 0x48, 0x28, 0x0A, 0x2C, 0x48, 0xD8, 0x08, 0x00,
|
||||
0x02, 0x42, 0x81, 0x7F, 0x00, 0x00, 0x40, 0x42, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x40, 0x00, /*"控",18*/
|
||||
0x00, 0x50, 0x4F, 0x4A, 0x48, 0xFF, 0x48, 0x48, 0x48, 0x00, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3F, 0x01, 0x01, 0xFF, 0x21, 0x61, 0x3F, 0x00, 0x0F, 0x40, 0x80, 0x7F, 0x00, 0x00, /*"制",19*/
|
||||
0x08, 0x07, 0xFA, 0xAA, 0xAE, 0xAA, 0xAA, 0xA8, 0xAC, 0xAB, 0xAA, 0xFE, 0x0A, 0x02, 0x02, 0x00,
|
||||
0x08, 0x08, 0x8B, 0x6A, 0x1E, 0x0A, 0x0A, 0x0A, 0x0A, 0xFE, 0x0A, 0x0B, 0x08, 0x08, 0x08, 0x00, /*"算",20*/
|
||||
0x10, 0x60, 0x01, 0xC6, 0x30, 0x00, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00,
|
||||
0x04, 0x04, 0xFE, 0x01, 0x00, 0x41, 0x61, 0x51, 0x4D, 0x43, 0x41, 0x41, 0x51, 0xE1, 0x01, 0x00, /*"法",21*/
|
||||
0x40, 0x41, 0xCE, 0x04, 0x00, 0x80, 0x40, 0xBE, 0x82, 0x82, 0x82, 0xBE, 0xC0, 0x40, 0x40, 0x00,
|
||||
0x00, 0x00, 0x7F, 0x20, 0x90, 0x80, 0x40, 0x43, 0x2C, 0x10, 0x10, 0x2C, 0x43, 0xC0, 0x40, 0x00, /*"设",22*/
|
||||
0x20, 0x21, 0x2E, 0xE4, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0xFF, 0x20, 0x20, 0x20, 0x20, 0x00,
|
||||
0x00, 0x00, 0x00, 0x7F, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, /*"计",23*/
|
||||
|
||||
0x00, 0x00, 0xF8, 0x48, 0x48, 0x48, 0x48, 0xFF, 0x48, 0x48, 0x48, 0x48, 0xF8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x0F, 0x04, 0x04, 0x04, 0x04, 0x3F, 0x44, 0x44, 0x44, 0x44, 0x4F, 0x40, 0x70, 0x00, /*"电",24*/
|
||||
0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0xE2, 0x12, 0x0A, 0x06, 0x02, 0x00, 0x80, 0x00, 0x00,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x41, 0x81, 0x7F, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, /*"子",25*/
|
||||
0x00, 0x20, 0x20, 0x22, 0x22, 0xE2, 0x22, 0x22, 0x22, 0xE2, 0x22, 0x22, 0x22, 0x20, 0x20, 0x00,
|
||||
0x00, 0x40, 0x20, 0x10, 0x0C, 0x03, 0x00, 0x00, 0x00, 0x3F, 0x40, 0x40, 0x40, 0x40, 0x70, 0x00, /*"元",26*/
|
||||
0x40, 0x20, 0xF8, 0x0F, 0x82, 0x60, 0x1E, 0x14, 0x10, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00,
|
||||
0x00, 0x00, 0xFF, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, /*"件",27*/
|
||||
0x00, 0x00, 0x00, 0x00, 0x7E, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0xCC, 0x08, 0x00,
|
||||
0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x24, 0x46, 0x44, 0x20, 0x1F, 0x00, 0x00, /*"与",28*/
|
||||
0x84, 0x94, 0x94, 0xFF, 0x94, 0x94, 0x80, 0x24, 0x24, 0x24, 0xFC, 0x12, 0x13, 0x12, 0x00, 0x00,
|
||||
0x20, 0x18, 0x06, 0xFF, 0x02, 0x1C, 0x0A, 0x02, 0x02, 0x02, 0x3F, 0x41, 0x41, 0x41, 0x71, 0x00, /*"耗",29*/
|
||||
0x10, 0x10, 0xD0, 0xFE, 0x50, 0x90, 0x00, 0x10, 0x10, 0x10, 0xD0, 0xFE, 0x10, 0x10, 0x10, 0x00,
|
||||
0x08, 0x06, 0x01, 0xFF, 0x00, 0x01, 0x10, 0x08, 0x04, 0x43, 0x80, 0x7F, 0x00, 0x00, 0x00, 0x00, /*"材",30*/
|
||||
0x90, 0x88, 0xA7, 0xA2, 0xA6, 0xBA, 0xA2, 0xF8, 0xA7, 0xA2, 0xA6, 0xBA, 0xA2, 0x82, 0x80, 0x00,
|
||||
0x00, 0x04, 0x04, 0x04, 0x04, 0x0C, 0x34, 0x04, 0x44, 0x84, 0x7F, 0x04, 0x04, 0x04, 0x00, 0x00, /*"等",31*/
|
||||
};
|
||||
|
||||
/************************************6*8的点阵************************************/
|
||||
const uint8_t F6x8[] =
|
||||
{
|
||||
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 uint8_t F8X16[] =
|
||||
{
|
||||
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
|
||||
};
|
||||
|
||||
uint8_t BMP1[] =
|
||||
{
|
||||
0x00, 0x03, 0x05, 0x09, 0x11, 0xFF, 0x11, 0x89, 0x05, 0xC3, 0x00, 0xE0, 0x00, 0xF0, 0x00, 0xF8,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0xFF, 0x11, 0xAA, 0x44, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x01, 0x38, 0x44, 0x82, 0x92,
|
||||
0x92, 0x74, 0x01, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x44, 0xC7, 0x01, 0x7D,
|
||||
0x7D, 0x7D, 0x7D, 0x01, 0x7D, 0x7D, 0x7D, 0x7D, 0x01, 0x7D, 0x7D, 0x7D, 0x7D, 0x01, 0xFF, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00,
|
||||
0x6D, 0x6D, 0x6D, 0x6D, 0x6D, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x40, 0x40,
|
||||
0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x00, 0x00,
|
||||
0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x00, 0x00, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x00, 0x00, 0xDB, 0xDB,
|
||||
0xDB, 0xDB, 0xDB, 0x00, 0x00, 0xDA, 0xDA, 0xDA, 0xDA, 0xDA, 0x00, 0x00, 0xD8, 0xD8, 0xD8, 0xD8,
|
||||
0xD8, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00,
|
||||
0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x80,
|
||||
0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00,
|
||||
0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x06, 0x06,
|
||||
0x06, 0x06, 0x06, 0x00, 0x00, 0x06, 0x06, 0x06, 0xE6, 0x66, 0x20, 0x00, 0x06, 0x06, 0x86, 0x06,
|
||||
0x06, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x86, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00,
|
||||
0x00, 0x86, 0x86, 0x86, 0x86, 0x86, 0x80, 0x80, 0x86, 0x86, 0x06, 0x86, 0x86, 0xC0, 0xC0, 0x86,
|
||||
0x86, 0x86, 0x06, 0x06, 0xD0, 0x30, 0x76, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x06, 0x06, 0x06,
|
||||
0x06, 0x06, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06,
|
||||
0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1C, 0x00, 0xFE, 0x00, 0x01,
|
||||
0x02, 0x00, 0xC4, 0x18, 0x20, 0x02, 0x9E, 0x63, 0xB2, 0x0E, 0x00, 0xFF, 0x81, 0x81, 0xFF, 0x00,
|
||||
0x00, 0x80, 0x40, 0x30, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x23, 0xEA, 0xAA, 0xBF, 0xAA,
|
||||
0xEA, 0x03, 0x3F, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0C, 0x08, 0x00, 0x00, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x81, 0x80, 0x80, 0x81, 0x80,
|
||||
0x81, 0x80, 0x80, 0x80, 0x80, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x01, 0x01, 0x09, 0x0C, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0,
|
||||
0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00,
|
||||
0x00, 0x1E, 0x21, 0x40, 0x40, 0x50, 0x21, 0x5E, 0x00, 0x1E, 0x21, 0x40, 0x40, 0x50, 0x21, 0x5E,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC1, 0xC1, 0xFF,
|
||||
0xFF, 0xC1, 0xC1, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x80, 0xFC, 0xF3, 0xEF, 0xF3, 0xFC,
|
||||
0x80, 0xFF, 0x80, 0xEE, 0xEE, 0xEE, 0xF5, 0xFB, 0xFF, 0x9C, 0xBE, 0xB6, 0xB6, 0x88, 0xFF, 0x00, /*"D:\DreamSpark\OLED\MP3_UI.bmp",0*/
|
||||
};
|
||||
|
||||
uint8_t BMP2[] =
|
||||
{
|
||||
0x00, 0x03, 0x05, 0x09, 0x11, 0xFF, 0x11, 0x89, 0x05, 0xC3, 0x00, 0xE0, 0x00, 0xF0, 0x00, 0xF8,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x28, 0xFF, 0x11, 0xAA, 0x44, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x01, 0x38, 0x44, 0x82, 0x92,
|
||||
0x92, 0x74, 0x01, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x44, 0xFF, 0x01, 0x7D,
|
||||
0x7D, 0x7D, 0x7D, 0x01, 0x7D, 0x7D, 0x7D, 0x7D, 0x01, 0x7D, 0x7D, 0x7D, 0x7D, 0x01, 0xFF, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8,
|
||||
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0xF8, 0x18, 0x60, 0x80, 0x00, 0x00, 0x00, 0x80,
|
||||
0x60, 0x18, 0xF8, 0x00, 0x00, 0x00, 0x20, 0x20, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0,
|
||||
0x10, 0x08, 0x08, 0x08, 0x08, 0x10, 0xE0, 0x00, 0x00, 0x00, 0x20, 0x20, 0xF8, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x88, 0x68,
|
||||
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x01, 0x06, 0x18, 0x06, 0x01,
|
||||
0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x40, 0x40, 0x7F, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x1F,
|
||||
0x20, 0x40, 0x40, 0x40, 0x40, 0x20, 0x1F, 0x00, 0x00, 0x00, 0x40, 0x40, 0x7F, 0x40, 0x40, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x18, 0x06, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x20, 0x20, 0xC0, 0x00, 0x00, 0xE0, 0x20, 0x20, 0x20,
|
||||
0xE0, 0x00, 0x00, 0x00, 0x40, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x20, 0x20, 0xE0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xE0, 0x20, 0x20, 0x20, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20,
|
||||
0x20, 0x20, 0xC0, 0x00, 0x00, 0x40, 0x20, 0x20, 0x20, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0A, 0x0A, 0x09, 0x0C, 0x00, 0x00, 0x0F, 0x08, 0x08, 0x08,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x08, 0x0F, 0x08, 0x00, 0x00, 0x00, 0x0C, 0x08, 0x09, 0x09, 0x0E, 0x00,
|
||||
0x00, 0x0C, 0x00, 0x00, 0x0F, 0x09, 0x09, 0x09, 0x0F, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0C, 0x0A,
|
||||
0x0A, 0x09, 0x0C, 0x00, 0x00, 0x0C, 0x0A, 0x0A, 0x09, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80,
|
||||
0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x7F, 0x03, 0x0C, 0x30, 0x0C, 0x03, 0x7F, 0x00, 0x00, 0x38, 0x54, 0x54, 0x58, 0x00, 0x00,
|
||||
0x7C, 0x04, 0x04, 0x78, 0x00, 0x00, 0x3C, 0x40, 0x40, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xAA, 0xAA, 0xAA,
|
||||
0x28, 0x08, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x03, 0x0C, 0x30, 0x0C, 0x03, 0x7F,
|
||||
0x00, 0x00, 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, 0x00, 0x7F, 0x02, 0x04, 0x08, 0x10, 0x7F, 0x00, /*"D:\共享\show2.bmp",0*/
|
||||
};
|
212
main/main.c
Normal file
212
main/main.c
Normal file
@ -0,0 +1,212 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/timers.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/adc.h"
|
||||
#include "driver/ledc.h"
|
||||
#include "esp_adc_cal.h"
|
||||
#include "esp_log.h"
|
||||
#include "screen.c"
|
||||
|
||||
#define LED_BLUE_GPIO (5)
|
||||
#define LED_GREEN_GPIO (4)
|
||||
#define LED_RED_GPIO (3)
|
||||
|
||||
#define POWER_OUT_CTL_GPIO (6)
|
||||
|
||||
#define ATTEN_DB ADC_ATTEN_DB_11
|
||||
#define ADC_CANNEL ADC1_CHANNEL_1
|
||||
|
||||
#define BEEP_GPIO LED_RED_GPIO
|
||||
#define BEEP_FREQ (650)
|
||||
|
||||
static uint32_t adc_raw;
|
||||
static esp_adc_cal_characteristics_t adc_chars;
|
||||
|
||||
static bool adc_calibration_init(void)
|
||||
{
|
||||
esp_err_t ret;
|
||||
bool cali_enable = false;
|
||||
|
||||
ret = esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_TP);
|
||||
if (ret == ESP_ERR_NOT_SUPPORTED)
|
||||
{
|
||||
ESP_LOGW("ADC", "Calibration scheme not supported, skip software calibration");
|
||||
}
|
||||
else if (ret == ESP_ERR_INVALID_VERSION)
|
||||
{
|
||||
ESP_LOGW("ADC", "eFuse not burnt, skip software calibration");
|
||||
}
|
||||
else if (ret == ESP_OK)
|
||||
{
|
||||
cali_enable = true;
|
||||
esp_adc_cal_characterize(ADC_UNIT_1, ATTEN_DB, ADC_WIDTH_BIT_12, 1100, &adc_chars);
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGE("ADC", "Invalid arg");
|
||||
}
|
||||
|
||||
return cali_enable;
|
||||
}
|
||||
|
||||
static bool cali_enable;
|
||||
|
||||
void initAdc()
|
||||
{
|
||||
gpio_reset_pin(LED_BLUE_GPIO);
|
||||
gpio_set_direction(LED_BLUE_GPIO, GPIO_MODE_OUTPUT);
|
||||
gpio_reset_pin(LED_GREEN_GPIO);
|
||||
gpio_set_direction(LED_GREEN_GPIO, GPIO_MODE_OUTPUT);
|
||||
gpio_reset_pin(LED_RED_GPIO);
|
||||
gpio_set_direction(LED_RED_GPIO, GPIO_MODE_OUTPUT);
|
||||
cali_enable = adc_calibration_init();
|
||||
|
||||
ESP_ERROR_CHECK(adc1_config_width(ADC_WIDTH_BIT_12));
|
||||
ESP_ERROR_CHECK(adc1_config_channel_atten(ADC_CANNEL, ATTEN_DB));
|
||||
}
|
||||
|
||||
void initLEDc()
|
||||
{
|
||||
ledc_timer_config_t ledc_timer = {
|
||||
.duty_resolution = LEDC_TIMER_10_BIT,
|
||||
.freq_hz = BEEP_FREQ,
|
||||
.speed_mode = LEDC_LOW_SPEED_MODE,
|
||||
.timer_num = LEDC_TIMER_0};
|
||||
ESP_ERROR_CHECK(ledc_timer_config(&ledc_timer));
|
||||
|
||||
ledc_channel_config_t ledc_channel = {
|
||||
.channel = LEDC_CHANNEL_0,
|
||||
.duty = 128,
|
||||
.hpoint = 0,
|
||||
.gpio_num = BEEP_GPIO,
|
||||
.speed_mode = LEDC_LOW_SPEED_MODE,
|
||||
.timer_sel = LEDC_TIMER_0};
|
||||
ESP_ERROR_CHECK(ledc_channel_config(&ledc_channel));
|
||||
}
|
||||
|
||||
void blink_task(void *pvParameter)
|
||||
{
|
||||
uint8_t s_blink_state = 0;
|
||||
ESP_LOGI("BLINK", "Started");
|
||||
|
||||
while (1)
|
||||
{
|
||||
s_blink_state = !s_blink_state;
|
||||
gpio_set_level(LED_BLUE_GPIO, s_blink_state);
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
void powerOutOff(TimerHandle_t pxTimer)
|
||||
{
|
||||
ESP_LOGW("POWER", "OFF");
|
||||
gpio_set_level(POWER_OUT_CTL_GPIO, 1);
|
||||
}
|
||||
void powerOutOn()
|
||||
{
|
||||
ESP_LOGW("POWER", "ON");
|
||||
ESP_ERROR_CHECK(gpio_set_level(POWER_OUT_CTL_GPIO, 0));
|
||||
}
|
||||
|
||||
void getVoltage(void *pvParameter)
|
||||
{
|
||||
uint32_t voltage = 0;
|
||||
uint8_t beep_state = 0;
|
||||
|
||||
TimerHandle_t power_out_off_timer = NULL;
|
||||
|
||||
display_print8_str(0, 0, "Poser Monitor");
|
||||
gpio_reset_pin(POWER_OUT_CTL_GPIO);
|
||||
gpio_set_direction(POWER_OUT_CTL_GPIO, GPIO_MODE_OUTPUT);
|
||||
powerOutOn();
|
||||
|
||||
while (1)
|
||||
{
|
||||
|
||||
adc_raw = adc1_get_raw(ADC_CANNEL);
|
||||
if (cali_enable)
|
||||
{
|
||||
voltage = esp_adc_cal_raw_to_voltage(adc_raw, &adc_chars);
|
||||
char voltageStr[8];
|
||||
itoa(voltage, voltageStr, 10);
|
||||
if (voltage > 1000)
|
||||
{
|
||||
display_print8_str(32, 3, voltageStr);
|
||||
}
|
||||
else if (voltage > 100)
|
||||
{
|
||||
display_print8_str(32, 3, " ");
|
||||
display_print8_str(40, 3, voltageStr);
|
||||
}
|
||||
else if (voltage > 10)
|
||||
{
|
||||
display_print8_str(32, 3, " ");
|
||||
display_print8_str(48, 3, voltageStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
display_print8_str(32, 3, " ");
|
||||
display_print8_str(56, 3, voltageStr);
|
||||
}
|
||||
display_print8_str(72, 3, "mV");
|
||||
|
||||
if (voltage > 100)
|
||||
{
|
||||
ESP_ERROR_CHECK(ledc_stop(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, 0));
|
||||
beep_state = 0;
|
||||
if (power_out_off_timer != NULL)
|
||||
{
|
||||
xTimerStop(power_out_off_timer, 0);
|
||||
power_out_off_timer = NULL;
|
||||
powerOutOn();
|
||||
printf("POWER_HAS_BEEN_RESTORED\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (beep_state == 0)
|
||||
{
|
||||
ESP_ERROR_CHECK(ledc_set_freq(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, BEEP_FREQ));
|
||||
ESP_ERROR_CHECK(ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0));
|
||||
}
|
||||
else if (beep_state == 1)
|
||||
{
|
||||
ESP_ERROR_CHECK(ledc_set_freq(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, BEEP_FREQ - 50));
|
||||
if (power_out_off_timer == NULL)
|
||||
{
|
||||
ESP_LOGW("POWER", "PRE POWER OFF");
|
||||
power_out_off_timer = xTimerCreate("power_out_off_timer", pdMS_TO_TICKS(10 * 1000), pdFALSE, NULL, powerOutOff);
|
||||
xTimerStart(power_out_off_timer, 0);
|
||||
printf("POWER_SUPPLY_FAILURE\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_ERROR_CHECK(ledc_stop(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0, 0));
|
||||
}
|
||||
if (++beep_state > 6)
|
||||
{
|
||||
beep_state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vTaskDelay(pdMS_TO_TICKS(500));
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
initAdc();
|
||||
initDisplay();
|
||||
initLEDc();
|
||||
|
||||
xTaskCreate(blink_task, "BLINK", 4096, NULL, 1, NULL);
|
||||
xTaskCreate(getVoltage, "Voltage", 4096, NULL, 10, NULL);
|
||||
}
|
0
main/power-out-control.c
Normal file
0
main/power-out-control.c
Normal file
0
main/ring.c
Normal file
0
main/ring.c
Normal file
135
main/screen.c
Normal file
135
main/screen.c
Normal file
@ -0,0 +1,135 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "driver/i2c.h"
|
||||
#include "esp_log.h"
|
||||
#include "codetab.h"
|
||||
|
||||
#define Brightness 0xCF
|
||||
#define X_WIDTH 128
|
||||
#define Y_WIDTH 64
|
||||
|
||||
#define I2C_ADDRESS 0x78
|
||||
|
||||
#define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
|
||||
#define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
|
||||
#define I2C_MASTER_SDA_IO 9
|
||||
#define I2C_MASTER_SCL_IO 10
|
||||
#define I2C_MASTER_FREQ_HZ 400000 /*!< I2C master clock frequency */
|
||||
#define I2C_MASTER_NUM I2C_NUM_0
|
||||
|
||||
void initI2c()
|
||||
{
|
||||
int i2c_master_port = I2C_MASTER_NUM;
|
||||
|
||||
i2c_config_t conf = {
|
||||
.mode = I2C_MODE_MASTER,
|
||||
.sda_io_num = I2C_MASTER_SDA_IO,
|
||||
.scl_io_num = I2C_MASTER_SCL_IO,
|
||||
.sda_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.scl_pullup_en = GPIO_PULLUP_ENABLE,
|
||||
.master.clk_speed = I2C_MASTER_FREQ_HZ,
|
||||
};
|
||||
i2c_param_config(i2c_master_port, &conf);
|
||||
ESP_LOGI("I2C", "Enabling I2C");
|
||||
ESP_ERROR_CHECK(i2c_driver_install(i2c_master_port, conf.mode, I2C_MASTER_RX_BUF_DISABLE, I2C_MASTER_TX_BUF_DISABLE, 0));
|
||||
|
||||
ESP_LOGI("SCR", "I2C initialized successfully");
|
||||
}
|
||||
|
||||
void i2cWriteByte(uint8_t reg, uint8_t data)
|
||||
{
|
||||
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
|
||||
i2c_master_start(cmd);
|
||||
i2c_master_write_byte(cmd, I2C_ADDRESS | I2C_MASTER_WRITE, true);
|
||||
i2c_master_write_byte(cmd, reg, true);
|
||||
i2c_master_write_byte(cmd, data, true);
|
||||
i2c_master_stop(cmd);
|
||||
i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
}
|
||||
|
||||
void i2cWriteCommand(uint8_t data)
|
||||
{
|
||||
i2cWriteByte(0x00, data);
|
||||
}
|
||||
|
||||
void i2cWriteData(uint8_t data)
|
||||
{
|
||||
i2cWriteByte(0x40, data);
|
||||
}
|
||||
|
||||
void display_fill(uint8_t bmpData)
|
||||
{
|
||||
for (int y = 0; y < 8; y++)
|
||||
{
|
||||
i2cWriteCommand(0xB0 + y);
|
||||
i2cWriteCommand(0x01);
|
||||
i2cWriteCommand(0x10);
|
||||
for (int x = 0; x < X_WIDTH; x++)
|
||||
{
|
||||
i2cWriteData(bmpData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void display_set_pos(uint8_t x, uint8_t y)
|
||||
{
|
||||
i2cWriteCommand(0xB0 + y);
|
||||
i2cWriteCommand(((x & 0xF0) >> 4) | 0x10);
|
||||
i2cWriteCommand((x & 0x0F) | 0x01);
|
||||
}
|
||||
|
||||
void display_print8_str(uint8_t x, uint8_t y, char str[])
|
||||
{
|
||||
uint8_t c;
|
||||
for (uint8_t ch, ci = 0; ch = str[ci], ch != '\0'; ci++, x += 8)
|
||||
{
|
||||
c = ch - 0x20;
|
||||
display_set_pos(x, y);
|
||||
for(uint8_t cx = 0; cx < 8; cx++)
|
||||
{
|
||||
i2cWriteData(F8X16[c*16+cx]);
|
||||
}
|
||||
display_set_pos(x, y + 1);
|
||||
for (uint8_t cx = 0; cx < 8; cx++)
|
||||
{
|
||||
i2cWriteData(F8X16[c * 16 + cx + 8]);
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
void initDisplay()
|
||||
{
|
||||
initI2c();
|
||||
|
||||
i2cWriteCommand(0xAE); // display off
|
||||
i2cWriteCommand(0x00); // set lower column address
|
||||
i2cWriteCommand(0x10); // set higher column address
|
||||
i2cWriteCommand(0x40); // set start line address
|
||||
i2cWriteCommand(0x81); // set contrast control register
|
||||
i2cWriteCommand(0xCF); // set contrast
|
||||
i2cWriteCommand(0xA1); // set segment re-map
|
||||
i2cWriteCommand(0xC8); // set COM output scan direction
|
||||
i2cWriteCommand(0xA6); // set normal display
|
||||
i2cWriteCommand(0xA8); // set multiplex ratio(1 to 64)
|
||||
i2cWriteCommand(0x3F); // 1/64 duty
|
||||
i2cWriteCommand(0xD3); // set display offset
|
||||
i2cWriteCommand(0x00); // not offset
|
||||
i2cWriteCommand(0xD5); // set display clock divide ratio/oscillator frequency
|
||||
i2cWriteCommand(0x80); // set divide ratio
|
||||
i2cWriteCommand(0xD9); // set pre-charge period
|
||||
i2cWriteCommand(0xF1); // set pre-charge voltage
|
||||
i2cWriteCommand(0xDA); // set com pins hardware configuration
|
||||
i2cWriteCommand(0x12);
|
||||
i2cWriteCommand(0xDB); // set vcomh
|
||||
i2cWriteCommand(0x40); // 0.77*vcc
|
||||
i2cWriteCommand(0x20); // set memory addressing mode
|
||||
i2cWriteCommand(0x02); // set page addressing mode
|
||||
i2cWriteCommand(0x8D); // set charge pump enable/disable
|
||||
i2cWriteCommand(0x14); // set(0x10) disable
|
||||
i2cWriteCommand(0xAF); // display on
|
||||
|
||||
display_fill(0x00);
|
||||
display_set_pos(0, 0);
|
||||
}
|
1520
sdkconfig.old
Normal file
1520
sdkconfig.old
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user