first
This commit is contained in:
commit
46d9ee7795
3
.ci/attachconfig/kernel/klibc-printf.attach
Normal file
3
.ci/attachconfig/kernel/klibc-printf.attach
Normal file
@ -0,0 +1,3 @@
|
||||
# scons: --strict
|
||||
|
||||
CONFIG_RT_KLIBC_USING_PRINTF_LONGLONG=y
|
4
.ci/attachconfig/kernel/klibc-stdlib.attach
Normal file
4
.ci/attachconfig/kernel/klibc-stdlib.attach
Normal file
@ -0,0 +1,4 @@
|
||||
# scons: --strict
|
||||
|
||||
CONFIG_RT_KLIBC_USING_STDLIB=y
|
||||
CONFIG_RT_KLIBC_USING_STDLIB_MEMORY=y
|
3
.ci/attachconfig/kernel/klibc-tinysize.attach
Normal file
3
.ci/attachconfig/kernel/klibc-tinysize.attach
Normal file
@ -0,0 +1,3 @@
|
||||
# scons: --strict
|
||||
|
||||
CONFIG_RT_KLIBC_USING_TINY_SIZE=y
|
2
.ci/attachconfig/nano.attach
Normal file
2
.ci/attachconfig/nano.attach
Normal file
@ -0,0 +1,2 @@
|
||||
# scons: --strict
|
||||
CONFIG_RT_USING_NANO=y
|
91
.ci/attachconfig/online-packages/iot/at_devices.attach
Normal file
91
.ci/attachconfig/online-packages/iot/at_devices.attach
Normal file
@ -0,0 +1,91 @@
|
||||
# scons: --strict
|
||||
|
||||
CONFIG_PKG_USING_AT_DEVICE=y
|
||||
|
||||
# Quectel M26/MC20
|
||||
CONFIG_AT_DEVICE_USING_M26=y
|
||||
CONFIG_AT_DEVICE_M26_INIT_ASYN=y
|
||||
|
||||
# Quectel EC20
|
||||
CONFIG_AT_DEVICE_USING_EC20=y
|
||||
CONFIG_AT_DEVICE_EC20_INIT_ASYN=y
|
||||
|
||||
# Espressif ESP32
|
||||
CONFIG_AT_DEVICE_USING_ESP32=y
|
||||
CONFIG_AT_DEVICE_ESP32_INIT_ASYN=y
|
||||
|
||||
# Espressif ESP8266
|
||||
CONFIG_AT_DEVICE_USING_ESP8266=y
|
||||
CONFIG_AT_DEVICE_ESP8266_INIT_ASYN=y
|
||||
|
||||
# Realthread RW007
|
||||
CONFIG_AT_DEVICE_USING_RW007=y
|
||||
CONFIG_AT_DEVICE_RW007_INIT_ASYN=y
|
||||
|
||||
# SIMCom SIM800C
|
||||
CONFIG_AT_DEVICE_USING_SIM800C=y
|
||||
CONFIG_AT_DEVICE_SIM800C_INIT_ASYN=y
|
||||
|
||||
# SIMCom SIM76XX
|
||||
CONFIG_AT_DEVICE_USING_SIM76XX=y
|
||||
CONFIG_AT_DEVICE_SIM76XX_INIT_ASYN=y
|
||||
|
||||
# Notion MW31
|
||||
CONFIG_AT_DEVICE_USING_MW31=y
|
||||
CONFIG_AT_DEVICE_MW31_INIT_ASYN=y
|
||||
|
||||
# WinnerMicro W60X
|
||||
CONFIG_AT_DEVICE_USING_W60X=y
|
||||
CONFIG_AT_DEVICE_W60X_INIT_ASYN=y
|
||||
|
||||
# Ai-Think A9G
|
||||
CONFIG_AT_DEVICE_USING_A9G=y
|
||||
CONFIG_AT_DEVICE_A9G_INIT_ASYN=y
|
||||
|
||||
# Quectel BC26
|
||||
CONFIG_AT_DEVICE_USING_BC26=y
|
||||
CONFIG_AT_DEVICE_BC26_INIT_ASYN=y
|
||||
|
||||
# luat Air720
|
||||
CONFIG_AT_DEVICE_USING_AIR720=y
|
||||
CONFIG_AT_DEVICE_AIR720_INIT_ASYN=y
|
||||
|
||||
# Gosuncn ME3616
|
||||
CONFIG_AT_DEVICE_USING_ME3616=y
|
||||
CONFIG_AT_DEVICE_ME3616_INIT_ASYN=y
|
||||
|
||||
# ChinaMobile M6315
|
||||
CONFIG_AT_DEVICE_USING_M6315=y
|
||||
CONFIG_AT_DEVICE_M6315_INIT_ASYN=y
|
||||
|
||||
# Quectel BC28
|
||||
CONFIG_AT_DEVICE_USING_BC28=y
|
||||
CONFIG_AT_DEVICE_BC28_INIT_ASYN=y
|
||||
|
||||
# Quectel EC200T/EC200S
|
||||
CONFIG_AT_DEVICE_USING_EC200X=y
|
||||
CONFIG_AT_DEVICE_EC200X_INIT_ASYN=y
|
||||
|
||||
# Neoway N21
|
||||
CONFIG_AT_DEVICE_USING_N21=y
|
||||
CONFIG_AT_DEVICE_N21_INIT_ASYN=y
|
||||
|
||||
# Neoway N58
|
||||
CONFIG_AT_DEVICE_USING_N58=y
|
||||
CONFIG_AT_DEVICE_N58_INIT_ASYN=y
|
||||
|
||||
# ChinaMobile M5311
|
||||
CONFIG_AT_DEVICE_USING_M5311=y
|
||||
CONFIG_AT_DEVICE_M5311_INIT_ASYN=y
|
||||
|
||||
# Fibocom L610
|
||||
CONFIG_AT_DEVICE_USING_L610=y
|
||||
CONFIG_AT_DEVICE_L610_INIT_ASYN=y
|
||||
|
||||
# Neoway N720
|
||||
CONFIG_AT_DEVICE_USING_N720=y
|
||||
CONFIG_AT_DEVICE_N720_INIT_ASYN=y
|
||||
|
||||
# Gosuncn ML305
|
||||
CONFIG_AT_DEVICE_USING_ML305=y
|
||||
CONFIG_AT_DEVICE_ML305_INIT_ASYN=y
|
4
.ci/attachconfig/online-packages/misc/misc.attach
Normal file
4
.ci/attachconfig/online-packages/misc/misc.attach
Normal file
@ -0,0 +1,4 @@
|
||||
# scons: --strict
|
||||
|
||||
# MultiButton
|
||||
CONFIG_PKG_USING_MULTIBUTTON=y
|
16
.ci/attachconfig/online-packages/misc/vi.attach
Normal file
16
.ci/attachconfig/online-packages/misc/vi.attach
Normal file
@ -0,0 +1,16 @@
|
||||
# scons: --strict
|
||||
CONFIG_PKG_USING_VI=y
|
||||
# CONFIG_VI_ENABLE_8BIT=y
|
||||
CONFIG_VI_ENABLE_COLON=y
|
||||
CONFIG_VI_ENABLE_COLON_EXPAND=y
|
||||
CONFIG_VI_ENABLE_YANKMARK=y
|
||||
CONFIG_VI_ENABLE_SEARCH=y
|
||||
CONFIG_VI_ENABLE_DOT_CMD=y
|
||||
CONFIG_VI_ENABLE_READONLY=y
|
||||
CONFIG_VI_ENABLE_SETOPTS=y
|
||||
CONFIG_VI_ENABLE_SET=y
|
||||
CONFIG_VI_ENABLE_WIN_RESIZE=y
|
||||
CONFIG_VI_ENABLE_VI_ASK_TERMINAL=y
|
||||
CONFIG_VI_ENABLE_UNDO=y
|
||||
CONFIG_VI_ENABLE_UNDO_QUEUE=y
|
||||
CONFIG_VI_ENABLE_VERBOSE_STATUS=y
|
@ -0,0 +1,4 @@
|
||||
# scons: --strict
|
||||
CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE=y
|
||||
CONFIG_PKG_USING_RT_MEMCPY_CM=y
|
||||
CONFIG_PKG_USING_RT_VSNPRINTF_FULL=y
|
@ -0,0 +1,2 @@
|
||||
# scons: --strict
|
||||
CONFIG_PKG_USING_FREERTOS_WRAPPER=y
|
1
.ci/attachconfig/peripheral/aht21.attach
Normal file
1
.ci/attachconfig/peripheral/aht21.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_AHT21=y
|
1
.ci/attachconfig/peripheral/ap3216c.attach
Normal file
1
.ci/attachconfig/peripheral/ap3216c.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_AP3216C=y
|
1
.ci/attachconfig/peripheral/ethernet_28j60.attach
Normal file
1
.ci/attachconfig/peripheral/ethernet_28j60.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_ENC28j60=y
|
1
.ci/attachconfig/peripheral/fal_easyflash.attach
Normal file
1
.ci/attachconfig/peripheral/fal_easyflash.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_EASYFLASH=y
|
2
.ci/attachconfig/peripheral/filesystem.attach
Normal file
2
.ci/attachconfig/peripheral/filesystem.attach
Normal file
@ -0,0 +1,2 @@
|
||||
CONFIG_BSP_USING_FS=y
|
||||
CONFIG_BSP_USING_FLASH_FATFS=y
|
1
.ci/attachconfig/peripheral/icm20608.attach
Normal file
1
.ci/attachconfig/peripheral/icm20608.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_ICM20608=y
|
1
.ci/attachconfig/peripheral/lcd_st7787.attach
Normal file
1
.ci/attachconfig/peripheral/lcd_st7787.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_ONBOARD_LCD=y
|
1
.ci/attachconfig/peripheral/led_matrix.attach
Normal file
1
.ci/attachconfig/peripheral/led_matrix.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_ONBOARD_LED_MATRIX=y
|
1
.ci/attachconfig/peripheral/lvgl.attach
Normal file
1
.ci/attachconfig/peripheral/lvgl.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_LVGL=y
|
1
.ci/attachconfig/peripheral/rs485.attach
Normal file
1
.ci/attachconfig/peripheral/rs485.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_RS485=y
|
1
.ci/attachconfig/peripheral/rw007.attach
Normal file
1
.ci/attachconfig/peripheral/rw007.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_RW007_WLAN=y
|
1
.ci/attachconfig/peripheral/spi_flash_w25q64.attach
Normal file
1
.ci/attachconfig/peripheral/spi_flash_w25q64.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_SPI_FLASH=y
|
1
.ci/attachconfig/peripheral/sram.attach
Normal file
1
.ci/attachconfig/peripheral/sram.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_SRAM=y
|
1
.ci/attachconfig/peripheral/usb_mouse.attach
Normal file
1
.ci/attachconfig/peripheral/usb_mouse.attach
Normal file
@ -0,0 +1 @@
|
||||
CONFIG_BSP_USING_USB_MOUSE=y
|
42
.gitignore
vendored
Normal file
42
.gitignore
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
*.pyc
|
||||
*.map
|
||||
*.dblite
|
||||
*.elf
|
||||
*.bin
|
||||
*.hex
|
||||
*.axf
|
||||
*.exe
|
||||
*.pdb
|
||||
*.idb
|
||||
*.ilk
|
||||
*.old
|
||||
build
|
||||
Debug
|
||||
documentation/html
|
||||
packages/
|
||||
*~
|
||||
*.o
|
||||
*.obj
|
||||
*.out
|
||||
*.bak
|
||||
*.dep
|
||||
*.lib
|
||||
*.i
|
||||
*.d
|
||||
.DS_Stor*
|
||||
.config 3
|
||||
.config 4
|
||||
.config 5
|
||||
Midea-X1
|
||||
*.uimg
|
||||
GPATH
|
||||
GRTAGS
|
||||
GTAGS
|
||||
.vscode
|
||||
JLinkLog.txt
|
||||
JLinkSettings.ini
|
||||
DebugConfig/
|
||||
RTE/
|
||||
settings/
|
||||
*.uvguix*
|
||||
cconfig.h
|
26
Kconfig
Normal file
26
Kconfig
Normal file
@ -0,0 +1,26 @@
|
||||
mainmenu "RT-Thread Configuration"
|
||||
|
||||
BSP_DIR := .
|
||||
|
||||
RTT_DIR := rt-thread
|
||||
|
||||
PKGS_DIR := packages
|
||||
|
||||
config SOC_STM32F407ZG
|
||||
bool
|
||||
select SOC_SERIES_STM32F4
|
||||
select RT_USING_COMPONENTS_INIT
|
||||
select RT_USING_USER_MAIN
|
||||
default y
|
||||
|
||||
config BOARD_STM32F407_SPARK
|
||||
bool
|
||||
default y
|
||||
|
||||
source "$(RTT_DIR)/Kconfig"
|
||||
osource "$PKGS_DIR/Kconfig"
|
||||
rsource "libraries/Kconfig"
|
||||
|
||||
if !RT_USING_NANO
|
||||
rsource "board/Kconfig"
|
||||
endif
|
116
README.md
Normal file
116
README.md
Normal file
@ -0,0 +1,116 @@
|
||||
# STM32F407 星火一号开发板 BSP 说明
|
||||
|
||||
## 简介
|
||||
|
||||
本文档为 RT-Thread 开发团队为 STM32F407 星火1号开发板提供的 BSP (板级支持包) 说明。
|
||||
|
||||
主要内容如下:
|
||||
|
||||
- 开发板资源介绍
|
||||
- BSP 快速上手
|
||||
- 进阶使用方法
|
||||
|
||||
通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。在进阶使用指南章节,将会介绍更多高级功能,帮助开发者利用 RT-Thread 驱动更多板载资源。
|
||||
|
||||
## 开发板介绍
|
||||
|
||||
星火号 STM32F407 是RT-THREAD推出的一款基于 ARM Cortex-M4 内核的开发板,最高主频为 168Mhz,该开发板具有丰富的板载资源,可以充分发挥 STM32F407 的芯片性能。
|
||||
|
||||
开发板外观如下图所示:
|
||||
|
||||

|
||||
|
||||
该开发板常用 **板载资源** 如下:
|
||||
|
||||
- MCU:STM32F407ZGT6,主频 168MHz,1024KB FLASH ,192KB RAM
|
||||
- 外部 FLASH:W25Q128(SPI,16MB)
|
||||
- 常用外设
|
||||
- LED:2个,LED_R(红色,PF12),LED_B(绿色,PF11)
|
||||
- 按键,4个,KEY_UP(兼具唤醒功能,PIN:PC5),KEY_DOWN(PIN:PC1),KEY_LEFT(PIN:PC0),KEY_RIGHT(PIN:PC4)
|
||||
- 常用接口:USB 转串口、SD 卡接口、USB SLAVE、USB HOST
|
||||
- 调试接口,标准ST-LINK
|
||||
|
||||
开发板更多详细信息请参考官方文档 [STM32 星火一号开发板介绍](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/hw-board/spark-1/spark-1)。
|
||||
|
||||
## 外设支持
|
||||
|
||||
本 BSP 目前对外设的支持情况如下:
|
||||
|
||||
| **板载外设** | **支持情况** | **备注** |
|
||||
| :------------ | :----------: | :-----------------------------------: |
|
||||
| USB 转串口(COM1) | 支持 | |
|
||||
| COM2 | 支持 | 和以太网、PWM 冲突,如需使用该外设,请使用 CubeMX 重新配置 UART2 管脚 |
|
||||
| COM3 | 支持 | |
|
||||
| **片上外设** | **支持情况** | **备注** |
|
||||
| UART | 支持 | UART1/2/3 |
|
||||
| SPI | 支持 | SPI1/2/3 |
|
||||
| ADC | 支持 | |
|
||||
| RTC | 支持 | 支持外部晶振和内部低速时钟 |
|
||||
| WDT | 支持 | |
|
||||
|
||||
|
||||
|
||||
## 使用说明
|
||||
|
||||
使用说明分为如下两个章节:
|
||||
|
||||
- 快速上手
|
||||
|
||||
本章节是为刚接触 RT-Thread 的新手准备的使用说明,遵循简单的步骤即可将 RT-Thread 操作系统运行在该开发板上,看到实验效果 。
|
||||
|
||||
- 进阶使用
|
||||
|
||||
本章节是为需要在 RT-Thread 操作系统上使用更多开发板资源的开发者准备的。通过使用 ENV 工具对 BSP 进行配置,可以开启更多板载资源,实现更多高级功能。
|
||||
|
||||
|
||||
### 快速上手
|
||||
|
||||
本 BSP 为开发者提供 MDK5 和 IAR 工程,并且支持 GCC 开发环境。下面以 MDK5 开发环境为例,介绍如何将系统运行起来。
|
||||
|
||||
#### 硬件连接
|
||||
|
||||
使用数据线连接开发板到 PC,打开电源开关。
|
||||
|
||||
#### 编译下载
|
||||
|
||||
双击 project.uvprojx 文件,打开 MDK5 工程,编译并下载程序到开发板。
|
||||
|
||||
> 工程默认配置使用 JLink 下载程序,在通过 JLink 连接开发板的基础上,点击下载按钮即可下载程序到开发板
|
||||
|
||||
#### 运行结果
|
||||
|
||||
下载程序成功之后,系统会自动运行,观察开发板上 LED 的运行效果,红色 LED 常亮、绿色 LED 会周期性闪烁。
|
||||
|
||||
连接开发板对应串口到 PC , 在终端工具里打开相应的串口(115200-8-1-N),复位设备后,可以看到 RT-Thread 的输出信息:
|
||||
|
||||
```bash
|
||||
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 5.0.1 build Jul 4 2023 07:49:10
|
||||
2006 - 2022 Copyright by RT-Thread team
|
||||
msh >
|
||||
```
|
||||
### 进阶使用
|
||||
|
||||
此 BSP 默认只开启了 GPIO 和 串口1 的功能,如果需使用 SD 卡、Flash 等更多高级功能,需要利用 ENV 工具对BSP 进行配置,步骤如下:
|
||||
|
||||
1. 在 bsp 下打开 env 工具。
|
||||
|
||||
2. 输入`menuconfig`命令配置工程,配置好之后保存退出。
|
||||
|
||||
3. 输入`pkgs --update`命令更新软件包。
|
||||
|
||||
4. 输入`scons --target=mdk5/iar` 命令重新生成工程。
|
||||
|
||||
本章节更多详细的介绍请参考 [STM32 系列 BSP 外设驱动使用教程](../docs/STM32系列BSP外设驱动使用教程.md)。
|
||||
|
||||
## 注意事项
|
||||
|
||||
暂无
|
||||
|
||||
## 联系人信息
|
||||
|
||||
维护人:
|
||||
|
||||
- [Supperthomas](https://github.com/supperthomas)
|
119
README_EN.md
Normal file
119
README_EN.md
Normal file
@ -0,0 +1,119 @@
|
||||
# STM32F407 RT-Thread Spark Board BSP Introduction
|
||||
|
||||
## Overview
|
||||
|
||||
This document is a description of the BSP (Board Support Package) provided by the RT-Thread development team for the STM32F407 RT-Thread Spark Board.
|
||||
|
||||
The main contents are as follows:
|
||||
|
||||
- Introduction of Development Board Resources
|
||||
- BSP Quick Start
|
||||
- Advanced Usage
|
||||
|
||||
By reading Quick Start Section, developers can quickly get started with the BSP and run RT-Thread on the board. In the Advanced Usage Section, more advanced features will be introduced to help developers utilize RT-Thread to drive more on-board resources.
|
||||
|
||||
## Spark-1 Introduction
|
||||
|
||||
The STM32F407 is a development board based on the ARM Cortex-M4 core from RT-THREAD, with a maximum main frequency of 168Mhz. The board has a wealth of on-board resources, which can fully utilize the performance of the STM32F407 chip.
|
||||
|
||||
The appearance of the board is shown in the figure below:
|
||||
|
||||

|
||||
|
||||
The development board commonly used **on-board resources** as follows:
|
||||
|
||||
- MCU: STM32F407ZGT6, 168MHz, 1024KB FLASH, 192KB RAM.
|
||||
- External FLASH: W25Q128 (SPI, 16MB)
|
||||
- Common Peripherals
|
||||
- LEDs: 2, LED_R (red, PF12), LED_B (green, PF11)
|
||||
- Keys, 4, KEY_UP (both wake-up function, PIN: PC5), KEY_DOWN (PIN: PC1), KEY_LEFT (PIN: PC0), KEY_RIGHT (PIN: PC4)
|
||||
- Common interfaces: USB to serial port, SD card interface, USB SLAVE, USB HOST
|
||||
- Debugging interface, standard ST-LINK
|
||||
|
||||
For more details about the board, please refer to the official document [Introduction to STM32 Spark-1 Development Board](https://www.rt-thread.org/document/site/#/rt-thread-version/rt-thread-standard/hw-board/spark-1/spark-1).
|
||||
|
||||
|
||||
## Peripheral Support
|
||||
|
||||
The BSP currently supports the following peripherals:
|
||||
| **Onboard peripherals** | **Support** | **note** |
|
||||
| :------------ | :----------: | :-----------------------------------: |
|
||||
| USB to Serial(COM1) | Support | |
|
||||
| COM2 | Support | Conflicts with Ethernet and PWM. Use CubeMX to reconfigure the UART2 pin if you want to use this peripheral. |
|
||||
| COM3 | Support | |
|
||||
| **On-chip peripherals** | **Supoort** | **Note** |
|
||||
| UART | Support | UART1/2/3 |
|
||||
| SPI | Support | SPI1/2/3 |
|
||||
| ADC | Support | |
|
||||
| RTC | Support | Support external crystal and internal low-speed clock |
|
||||
| WDT | Support | |
|
||||
|
||||
## Instructions for Use
|
||||
|
||||
The instructions for use are divided into two sections as follows:
|
||||
|
||||
- Quick Start
|
||||
|
||||
This section is intended for newcomers to RT-Thread. Follow the simple steps to get the RT-Thread operating system running on the board and see the results.
|
||||
|
||||
- Advanced Usage
|
||||
|
||||
This section is for developers who want to use more of the board's resources with the RT-Thread operating system. By using the ENV tool to configure the BSP, you can enable more on-board resources and realize more advanced functions.
|
||||
|
||||
### Quick Start
|
||||
|
||||
This BSP provides developers with MDK5 and IAR projects and supports GCC development environment. The following is an example of how to get the system up and running using the MDK5 development environment.
|
||||
|
||||
#### Hardware Connection
|
||||
|
||||
Connect the board to the PC with a cable and turn on the power switch.
|
||||
|
||||
#### Compile and Download
|
||||
|
||||
Double click the project.uvprojx file to open the MDK5 project, compile and download the program to the development board.
|
||||
|
||||
> The default configuration of the project is to use JLink to download the program. On the basis of connecting the development board via JLink, click the Download button to download the program to the development board.
|
||||
|
||||
#### Running Result
|
||||
|
||||
After successfully downloading the program, the system will run automatically. Observe the running effect of the LED on the development board, where the red LED is always on, the green LED will blink periodically.
|
||||
|
||||
Connect the corresponding serial port of the development board to PC, open the corresponding serial port (115200-8-1-N) in the terminal tool, and reset the device, you can see the output information of RT-Thread.
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 5.0.1 build Jul 4 2023 07:49:10
|
||||
2006 - 2022 Copyright by RT-Thread team
|
||||
msh >
|
||||
```
|
||||
|
||||
### Advanced Usage
|
||||
|
||||
This BSP only enables GPIO and Serial1 by default. If you want to use more advanced functions such as SD card, Flash, etc., you need to configure the BSP by using ENV utility, the steps are as below:
|
||||
|
||||
1. Open the env utility under bsp.
|
||||
|
||||
2. Input `menuconfig` command to configure the project, save and exit after configuration.
|
||||
|
||||
3. Enter the `pkgs --update` command to update the package.
|
||||
|
||||
4. Enter the `scons --target=mdk5/iar` command to regenerate the project.
|
||||
|
||||
For a more detailed description of this chapter, please refer to [STM32 Series BSP Peripheral Driver Tutorial](... /docs/STM32 Series BSP Peripheral Driver Tutorial.md).
|
||||
|
||||
## Notes
|
||||
|
||||
Not available at this time
|
||||
|
||||
## Connection
|
||||
|
||||
Maintainer:
|
||||
|
||||
- [Supperthomas](https://github.com/supperthomas)
|
||||
|
||||
|
||||
|
15
SConscript
Normal file
15
SConscript
Normal file
@ -0,0 +1,15 @@
|
||||
# for module compiling
|
||||
import os
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('objs')
|
63
SConstruct
Normal file
63
SConstruct
Normal file
@ -0,0 +1,63 @@
|
||||
import os
|
||||
import sys
|
||||
import rtconfig
|
||||
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
else:
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../../..')
|
||||
|
||||
# set RTT_ROOT
|
||||
if not os.getenv("RTT_ROOT"):
|
||||
RTT_ROOT="rt-thread"
|
||||
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
try:
|
||||
from building import *
|
||||
except:
|
||||
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
|
||||
print(RTT_ROOT)
|
||||
exit(-1)
|
||||
|
||||
TARGET = 'rt-thread.' + rtconfig.TARGET_EXT
|
||||
|
||||
DefaultEnvironment(tools=[])
|
||||
env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
|
||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||
|
||||
if rtconfig.PLATFORM in ['iccarm']:
|
||||
env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
||||
env.Replace(ARFLAGS = [''])
|
||||
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
|
||||
|
||||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
SDK_ROOT = os.path.abspath('./')
|
||||
|
||||
if os.path.exists(SDK_ROOT + '/libraries'):
|
||||
libraries_path_prefix = SDK_ROOT + '/libraries'
|
||||
else:
|
||||
libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
|
||||
|
||||
SDK_LIB = libraries_path_prefix
|
||||
Export('SDK_LIB')
|
||||
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||
|
||||
stm32_library = 'STM32F4xx_HAL'
|
||||
rtconfig.BSP_LIBRARY_TYPE = stm32_library
|
||||
|
||||
# include libraries
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, stm32_library, 'SConscript'), variant_dir='build/libraries/'+stm32_library, duplicate=0))
|
||||
# include drivers
|
||||
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'HAL_Drivers', 'SConscript'),variant_dir='build/libraries/'+'HAL_Drivers', duplicate=0))
|
||||
|
||||
# make a building
|
||||
DoBuilding(TARGET, objs)
|
15
applications/SConscript
Normal file
15
applications/SConscript
Normal file
@ -0,0 +1,15 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd]
|
||||
src = Glob('*.c')
|
||||
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for item in list:
|
||||
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(item, 'SConscript'))
|
||||
|
||||
Return('group')
|
50
applications/app_lcd.c
Normal file
50
applications/app_lcd.c
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2024-07-08 Nino the first version
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
|
||||
#include <drv_lcd.h>
|
||||
|
||||
void app_lcd_string(void){
|
||||
lcd_clear(WHITE);
|
||||
|
||||
/* set the background color and foreground color */
|
||||
lcd_set_color(WHITE, BLACK);
|
||||
|
||||
/* show some string on lcd */
|
||||
lcd_show_string(10, 69, 16, "Hello, RT-Thread!");
|
||||
lcd_show_string(10, 69 + 16, 24, "RT-Thread");
|
||||
lcd_show_string(10, 69 + 16 + 24, 32, "RT-Thread");
|
||||
|
||||
/* draw a line on lcd */
|
||||
lcd_draw_line(0, 69 + 16 + 24 + 32, 240, 69 + 16 + 24 + 32);
|
||||
rt_kprintf("string lcd\n");
|
||||
}
|
||||
|
||||
void app_lcd_circle(void){
|
||||
/* draw a concentric circles */
|
||||
lcd_draw_point(120, 194);
|
||||
for (int i = 0; i < 46; i += 4)
|
||||
{
|
||||
lcd_draw_circle(120, 194, i);
|
||||
}
|
||||
rt_kprintf("circle lcd\n");
|
||||
}
|
||||
|
||||
void app_lcd_clean(void){
|
||||
lcd_clear(WHITE);
|
||||
rt_kprintf("clean lcd\n");
|
||||
}
|
||||
|
||||
MSH_CMD_EXPORT(app_lcd_string, show string on LCD);
|
||||
MSH_CMD_EXPORT(app_lcd_circle, show circle on LCD);
|
||||
MSH_CMD_EXPORT(app_lcd_clean, clean LCD);
|
63
applications/init.c
Normal file
63
applications/init.c
Normal file
@ -0,0 +1,63 @@
|
||||
#include <rtthread.h>
|
||||
#include <rthw.h>
|
||||
#include <wlan_mgnt.h>
|
||||
#include <wlan_cfg.h>
|
||||
#include <wlan_prot.h>
|
||||
#include <ap3216c.h>
|
||||
#include "my_func.h"
|
||||
|
||||
static int board_init(void)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_BOARD_EXPORT(board_init);
|
||||
|
||||
static int prev_init(void)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_PREV_EXPORT(prev_init);
|
||||
|
||||
static int device_init(void)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_DEVICE_EXPORT(device_init);
|
||||
|
||||
static int component_init(void)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
INIT_COMPONENT_EXPORT(component_init);
|
||||
static int env_init(void)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_ENV_EXPORT(env_init);
|
||||
|
||||
static int app_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
INIT_APP_EXPORT(app_init);
|
||||
// extern int wifi_join(int argc, char *argv[]);
|
||||
int main_init(void)
|
||||
{
|
||||
|
||||
char str[] = "wifi join Dong abcd07691234";
|
||||
my_round(20);
|
||||
system(str);
|
||||
// rt_thread_mdelay(18000);
|
||||
// char *argv[] = {"wifi", "join", "Dong", "abcd07691234"};
|
||||
// wifi_join(4, argv);
|
||||
// char *ssid = "Dong";
|
||||
// char *key = "abcd07691234";
|
||||
// rt_wlan_connect(ssid, key);
|
||||
return 0;
|
||||
}
|
4
applications/init.h
Normal file
4
applications/init.h
Normal file
@ -0,0 +1,4 @@
|
||||
#ifndef __INIT_H__
|
||||
#define __INIT_H__
|
||||
int main_init(void);
|
||||
#endif // !__INIT_H__
|
116
applications/main.c
Normal file
116
applications/main.c
Normal file
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-5-10 ShiHao first version
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include "drv_common.h"
|
||||
#include <ntp.h>
|
||||
#define DBG_TAG "main"
|
||||
#define DBG_LVL DBG_LOG
|
||||
#include <rtdbg.h>
|
||||
#include "init.h"
|
||||
#include <drv_lcd.h>
|
||||
#include "my_func.h"
|
||||
#include <drv_gpio.h>
|
||||
|
||||
|
||||
/* 配置 LED 灯引脚 */
|
||||
#define PIN_LED_B GET_PIN(F, 11) // PF11 : LED_B --> LED
|
||||
#define PIN_LED_R GET_PIN(F, 12) // PF12 : LED_R --> LED
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
main_init();
|
||||
rt_pin_mode(PIN_LED_B, PIN_MODE_OUTPUT);
|
||||
rt_pin_write(PIN_LED_B, PIN_LOW);
|
||||
system("snake game");
|
||||
rt_wlan_config_autoreconnect(RT_TRUE);
|
||||
rt_wlan_connect("Dong", "abcd07691234");
|
||||
mytime();
|
||||
|
||||
/* init Wi-Fi auto connect feature */
|
||||
// wlan_autoconnect_init();
|
||||
/* enable auto reconnect on WLAN device */
|
||||
|
||||
// lcd_clear(WHITE);
|
||||
|
||||
// /* show RT-Thread logo */
|
||||
// lcd_show_image(0, 0, 240, 69, image_rttlogo);
|
||||
|
||||
// /* set the background color and foreground color */
|
||||
// lcd_set_color(WHITE, BLACK);
|
||||
|
||||
// /* show some string on lcd */
|
||||
// lcd_show_string(10, 69, 16, "Hello, RT-Thread!");
|
||||
// lcd_show_string(10, 69 + 16, 24, "RT-Thread");
|
||||
// lcd_show_string(10, 69 + 16 + 24, 32, "RT-Thread");
|
||||
|
||||
// /* draw a line on lcd */
|
||||
// lcd_draw_line(0, 69 + 16 + 24 + 32, 240, 69 + 16 + 24 + 32);
|
||||
|
||||
// /* draw a concentric circles */
|
||||
// lcd_draw_point(120, 194);
|
||||
// for (int i = 0; i < 46; i += 4)
|
||||
// {
|
||||
// lcd_draw_circle(120, 194, i);
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
// #include <rtthread.h>
|
||||
// #include <board.h>
|
||||
// #include "init.h"
|
||||
// #include <drv_gpio.h>
|
||||
// #ifndef RT_USING_NANO
|
||||
// #include <rtdevice.h>
|
||||
// #endif // !RT_USING_NANO
|
||||
|
||||
// #define GPIO_LED_B GET_PIN(F,11)
|
||||
// #define GPIO_LED_R GET_PIN(F,12)
|
||||
|
||||
// int main(void)
|
||||
// {
|
||||
// main_init();
|
||||
// // rt_pin_mode(GPIO_LED_B, PIN_MODE_OUTPUT);
|
||||
// // while(1)
|
||||
// // {
|
||||
// // rt_pin_write(GPIO_LED_B, PIN_HIGH);
|
||||
// // rt_thread_mdelay(500);
|
||||
// // rt_pin_write(GPIO_LED_B, PIN_LOW);
|
||||
// // rt_thread_mdelay(500);
|
||||
// // }
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
// static int onboard_sdcard_mount(void)
|
||||
// {
|
||||
// if (dfs_mount("sd0", "/sdcard", "elm", 0, 0) == RT_EOK)
|
||||
// {
|
||||
// LOG_I("SD card mount to '/sdcard'");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG_E("SD card mount to '/sdcard' failed!");
|
||||
// }
|
||||
|
||||
// return RT_EOK;
|
||||
// }
|
||||
|
||||
// #define WIFI_CS GET_PIN(F, 10)
|
||||
// void WIFI_CS_PULL_DOWM(void)
|
||||
// {
|
||||
// rt_pin_mode(WIFI_CS, PIN_MODE_OUTPUT);
|
||||
// rt_pin_write(WIFI_CS, PIN_LOW);
|
||||
// }
|
||||
// INIT_BOARD_EXPORT(WIFI_CS_PULL_DOWM);
|
BIN
applications/my_pro/660c6c04fddc1bd3ccbe4255df5d449.jpg
Normal file
BIN
applications/my_pro/660c6c04fddc1bd3ccbe4255df5d449.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 857 KiB |
66
applications/my_pro/AHT10.c
Normal file
66
applications/my_pro/AHT10.c
Normal file
@ -0,0 +1,66 @@
|
||||
#include <board.h>
|
||||
#include <rtthread.h>
|
||||
#include <drv_gpio.h>
|
||||
#include "aht10.h"
|
||||
|
||||
// AHT挂载的总线名字
|
||||
#define AHT10_I2C_BUS "i2c3"
|
||||
|
||||
// 创建AHT线程时待用
|
||||
#define THREAD_PRIORITY 25
|
||||
#define THREAD_STACK_SIZE 2048
|
||||
#define THREAD_TIMESLICE 5
|
||||
|
||||
// AHT线程指针
|
||||
rt_thread_t AHT10 = RT_NULL;
|
||||
|
||||
// AHT测试样例
|
||||
void AHT10_Test(void *parameter)
|
||||
{
|
||||
// AHT设备指针
|
||||
aht10_device_t Dev = RT_NULL;
|
||||
|
||||
// Humi:湿度值,Temp:温度值
|
||||
float Humi, Temp;
|
||||
|
||||
// 初始化设备
|
||||
Dev = aht10_init(AHT10_I2C_BUS);
|
||||
if (Dev == RT_NULL)
|
||||
{
|
||||
rt_kprintf("AHT10_init Fail");
|
||||
return;
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
// 读取温湿度值
|
||||
Humi = aht10_read_humidity(Dev);
|
||||
Temp = aht10_read_temperature(Dev);
|
||||
|
||||
// 没有下载rt_vsprintf_full软件包的时候
|
||||
rt_kprintf("Humi: %d.%d\n", (int)Humi, (int)(Humi * 10) % 10);
|
||||
rt_kprintf("Temp: %d.%d\n", (int)Temp, (int)(Temp * 10) % 10);
|
||||
|
||||
// 配合rt_vsnprintf_full软件包使用
|
||||
// rt_kprintf("Humi: %f, Temp: %f\n", Humi, Temp);
|
||||
|
||||
rt_thread_mdelay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void AHT10_Creat_Thread(void)
|
||||
{
|
||||
// 创建线程
|
||||
AHT10 = rt_thread_create("AHT10", AHT10_Test, RT_NULL, THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE);
|
||||
// 创建成功就启动
|
||||
if (AHT10 != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(AHT10);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("AHT10_Thread Create Fail");
|
||||
}
|
||||
}
|
||||
// 导出Shell命令
|
||||
MSH_CMD_EXPORT(AHT10_Creat_Thread, This Function will creat a AHT10 thread.);
|
6
applications/my_pro/README.md
Normal file
6
applications/my_pro/README.md
Normal file
@ -0,0 +1,6 @@
|
||||
#### LCD 显示温湿度
|
||||

|
||||
左上角是(0,0) →x,↓y
|
||||
|
||||
### 简易贪吃蛇
|
||||

|
15
applications/my_pro/SConscript
Normal file
15
applications/my_pro/SConscript
Normal file
@ -0,0 +1,15 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd]
|
||||
src = Glob('*.c')
|
||||
|
||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for item in list:
|
||||
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(item, 'SConscript'))
|
||||
|
||||
Return('group')
|
99
applications/my_pro/filesystem.c
Normal file
99
applications/my_pro/filesystem.c
Normal file
@ -0,0 +1,99 @@
|
||||
//记得在menuconfig中开启支持旧版本功能(Support legacy version)
|
||||
#include <board.h>
|
||||
#include <rtthread.h>
|
||||
#include <drv_gpio.h>
|
||||
#include <dfs_posix.h>//需要添加软件包进这里
|
||||
|
||||
//定义要写入的内容
|
||||
char String[] = "Hello, RT-Thread.Welcom to RSOC!\n temp: 123, humi: 789";
|
||||
|
||||
//定义接受文件内容的缓冲区
|
||||
char buffer[100] = {};
|
||||
|
||||
void FileSystem_Test(void *parameter)
|
||||
{
|
||||
//文件描述符
|
||||
int fd;
|
||||
|
||||
//用只写方式打开文件,如果没有该文件,则创建一个文件
|
||||
fd = open("/fal/FileTest.txt", O_WRONLY | O_CREAT);
|
||||
|
||||
//如果打开成功
|
||||
if (fd >= 0)
|
||||
{
|
||||
//写入文件
|
||||
write(fd, String, sizeof(String));
|
||||
|
||||
rt_kprintf("Write done.\n");
|
||||
|
||||
//关闭文件
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("File Open Fail.\n");
|
||||
}
|
||||
|
||||
//用只读方式打开文件
|
||||
fd = open("/fal/FileTest.txt", O_RDONLY);
|
||||
|
||||
if (fd>= 0)
|
||||
{
|
||||
//读取文件内容
|
||||
rt_uint32_t size = read(fd, buffer, sizeof(buffer));
|
||||
|
||||
if (size < 0)
|
||||
{
|
||||
rt_kprintf("Read File Fail.\n");
|
||||
return ;
|
||||
}
|
||||
|
||||
//输出文件内容
|
||||
rt_kprintf("Read from file test.txt : %s \n", buffer);
|
||||
|
||||
//关闭文件
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("File Open Fail.\n");
|
||||
}
|
||||
}
|
||||
//导出命令
|
||||
MSH_CMD_EXPORT(FileSystem_Test, FileSystem_Test);
|
||||
|
||||
static void readdir_sample(void)
|
||||
{
|
||||
DIR *dirp;
|
||||
struct dirent *d;
|
||||
|
||||
/* 打开 / dir_test 目录 */
|
||||
dirp = opendir("/fal");
|
||||
if (dirp == RT_NULL)
|
||||
{
|
||||
rt_kprintf("open directory error!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 读取目录 */
|
||||
while ((d = readdir(dirp)) != RT_NULL)
|
||||
{
|
||||
rt_kprintf("found %s\n", d->d_name);
|
||||
}
|
||||
|
||||
/* 关闭目录 */
|
||||
closedir(dirp);
|
||||
}
|
||||
}
|
||||
/* 导出到 msh 命令列表中 */
|
||||
MSH_CMD_EXPORT(readdir_sample, readdir sample);
|
||||
|
||||
/*
|
||||
#define WIFI_CS GET_PIN(F, 10)
|
||||
void WIFI_CS_PULL_DOWM(void)
|
||||
{
|
||||
rt_pin_mode(WIFI_CS, PIN_MODE_OUTPUT);
|
||||
rt_pin_write(WIFI_CS, PIN_LOW);
|
||||
}
|
||||
INIT_BOARD_EXPORT(WIFI_CS GET_PIN);
|
||||
*/
|
85
applications/my_pro/icm_20608_sample.c
Normal file
85
applications/my_pro/icm_20608_sample.c
Normal file
@ -0,0 +1,85 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include <icm20608.h>
|
||||
|
||||
#define LOG_TAG "icm.app"
|
||||
#define LOG_LVL LOG_LVL_DBG
|
||||
#include <ulog.h>
|
||||
|
||||
static void icm_thread_entry(void *parameter)
|
||||
{
|
||||
icm20608_device_t dev = RT_NULL;
|
||||
const char *i2c_bus_name = "i2c2";
|
||||
int count = 0;
|
||||
rt_err_t result;
|
||||
|
||||
/* 初始化 icm20608 传感器 */
|
||||
dev = icm20608_init(i2c_bus_name);
|
||||
if (dev == RT_NULL)
|
||||
{
|
||||
LOG_E("The sensor initializes failure");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_D("The sensor initializes success");
|
||||
}
|
||||
|
||||
/* 对 icm20608 进行零值校准:采样 10 次,求取平均值作为零值 */
|
||||
result = icm20608_calib_level(dev, 10);
|
||||
if (result == RT_EOK)
|
||||
{
|
||||
LOG_D("The sensor calibrates success");
|
||||
LOG_D("accel_offset: X%6d Y%6d Z%6d", dev->accel_offset.x, dev->accel_offset.y, dev->accel_offset.z);
|
||||
LOG_D("gyro_offset : X%6d Y%6d Z%6d", dev->gyro_offset.x, dev->gyro_offset.y, dev->gyro_offset.z);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("The sensor calibrates failure");
|
||||
icm20608_deinit(dev);
|
||||
}
|
||||
|
||||
while (count++ < 100)
|
||||
{
|
||||
rt_int16_t accel_x, accel_y, accel_z;
|
||||
rt_int16_t gyros_x, gyros_y, gyros_z;
|
||||
|
||||
/* 读取三轴加速度 */
|
||||
result = icm20608_get_accel(dev, &accel_x, &accel_y, &accel_z);
|
||||
if (result == RT_EOK)
|
||||
{
|
||||
LOG_D("current accelerometer: accel_x%6d, accel_y%6d, accel_z%6d", accel_x, accel_y, accel_z);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("The sensor does not work");
|
||||
}
|
||||
|
||||
/* 读取三轴陀螺仪 */
|
||||
result = icm20608_get_gyro(dev, &gyros_x, &gyros_y, &gyros_z);
|
||||
if (result == RT_EOK)
|
||||
{
|
||||
LOG_D("current gyroscope : gyros_x%6d, gyros_y%6d, gyros_z%6d", gyros_x, gyros_y, gyros_z);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("The sensor does not work");
|
||||
break;
|
||||
}
|
||||
rt_thread_mdelay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
static int icm_app(void)
|
||||
{
|
||||
rt_thread_t res = rt_thread_create("icm", icm_thread_entry, RT_NULL, 1024, 20, 50);
|
||||
if(res == RT_NULL)
|
||||
{
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
rt_thread_startup(res);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
MSH_CMD_EXPORT(icm_app, icm_app);
|
BIN
applications/my_pro/image-1.png
Normal file
BIN
applications/my_pro/image-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
BIN
applications/my_pro/image-2.png
Normal file
BIN
applications/my_pro/image-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
applications/my_pro/image-3.png
Normal file
BIN
applications/my_pro/image-3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
BIN
applications/my_pro/image.png
Normal file
BIN
applications/my_pro/image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
BIN
applications/my_pro/lcdtemp.jpg
Normal file
BIN
applications/my_pro/lcdtemp.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 222 KiB |
255
applications/my_pro/mqtt.c
Normal file
255
applications/my_pro/mqtt.c
Normal file
@ -0,0 +1,255 @@
|
||||
#include "rtthread.h"
|
||||
#include "dev_sign_api.h"
|
||||
#include "mqtt_api.h"
|
||||
#include <board.h>
|
||||
#include <drv_gpio.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "aht10.h"
|
||||
#include <dfs_posix.h>
|
||||
|
||||
char DEMO_PRODUCT_KEY[IOTX_PRODUCT_KEY_LEN + 1] = {0};
|
||||
char DEMO_DEVICE_NAME[IOTX_DEVICE_NAME_LEN + 1] = {0};
|
||||
char DEMO_DEVICE_SECRET[IOTX_DEVICE_SECRET_LEN + 1] = {0};
|
||||
|
||||
void *HAL_Malloc(uint32_t size);
|
||||
void HAL_Free(void *ptr);
|
||||
void HAL_Printf(const char *fmt, ...);
|
||||
int HAL_GetProductKey(char product_key[IOTX_PRODUCT_KEY_LEN + 1]);
|
||||
int HAL_GetDeviceName(char device_name[IOTX_DEVICE_NAME_LEN + 1]);
|
||||
int HAL_GetDeviceSecret(char device_secret[IOTX_DEVICE_SECRET_LEN]);
|
||||
uint64_t HAL_UptimeMs(void);
|
||||
int HAL_Snprintf(char *str, const int len, const char *fmt, ...);
|
||||
|
||||
//定义接受文件内容的缓冲区
|
||||
char buffer[1026] = {};
|
||||
char tmp[1026];
|
||||
|
||||
#define GPIO_LED_B GET_PIN(F,11)
|
||||
#define GPIO_LED_R GET_PIN(F,12)
|
||||
|
||||
// AHT挂载的总线名字
|
||||
#define AHT10_I2C_BUS "i2c3"
|
||||
|
||||
// AHT设备指针
|
||||
aht10_device_t Dev = RT_NULL;
|
||||
|
||||
// Humi:湿度值,Temp:温度值
|
||||
float Humi, Temp;
|
||||
|
||||
|
||||
#define EXAMPLE_TRACE(fmt, ...) \
|
||||
do { \
|
||||
HAL_Printf("%s|%03d :: ", __func__, __LINE__); \
|
||||
HAL_Printf(fmt, ##__VA_ARGS__); \
|
||||
HAL_Printf("%s", "\r\n"); \
|
||||
} while(0)
|
||||
|
||||
static void example_message_arrive(void *pcontext, void *pclient, iotx_mqtt_event_msg_pt msg)
|
||||
{
|
||||
iotx_mqtt_topic_info_t *topic_info = (iotx_mqtt_topic_info_pt) msg->msg;
|
||||
|
||||
switch (msg->event_type) {
|
||||
case IOTX_MQTT_EVENT_PUBLISH_RECEIVED:
|
||||
/* print topic name and topic message */
|
||||
EXAMPLE_TRACE("Message Arrived:");
|
||||
rt_pin_mode(GPIO_LED_R, PIN_MODE_OUTPUT);
|
||||
//topic_info->payload 为发送的内容,可以据此设置命令
|
||||
if(rt_pin_read(GPIO_LED_R) == PIN_HIGH)
|
||||
{
|
||||
// rt_kprintf("LED_R should be ON\n");
|
||||
rt_pin_write(GPIO_LED_R, PIN_LOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
// rt_kprintf("LED_R should be OFF\n");
|
||||
rt_pin_write(GPIO_LED_R, PIN_HIGH);
|
||||
}
|
||||
EXAMPLE_TRACE("Topic : %.*s", topic_info->topic_len, topic_info->ptopic);
|
||||
EXAMPLE_TRACE("Payload: %.*s", topic_info->payload_len, topic_info->payload);
|
||||
EXAMPLE_TRACE("\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int example_subscribe(void *handle)
|
||||
{
|
||||
int res = 0;
|
||||
const char *fmt = "/%s/%s/user/get";
|
||||
char *topic = NULL;
|
||||
int topic_len = 0;
|
||||
|
||||
topic_len = strlen(fmt) + strlen(DEMO_PRODUCT_KEY) + strlen(DEMO_DEVICE_NAME) + 1;
|
||||
topic = HAL_Malloc(topic_len);
|
||||
if (topic == NULL) {
|
||||
EXAMPLE_TRACE("memory not enough");
|
||||
return -1;
|
||||
}
|
||||
memset(topic, 0, topic_len);
|
||||
HAL_Snprintf(topic, topic_len, fmt, DEMO_PRODUCT_KEY, DEMO_DEVICE_NAME);
|
||||
|
||||
res = IOT_MQTT_Subscribe(handle, topic, IOTX_MQTT_QOS0, example_message_arrive, NULL);
|
||||
if (res < 0) {
|
||||
EXAMPLE_TRACE("subscribe failed");
|
||||
HAL_Free(topic);
|
||||
return -1;
|
||||
}
|
||||
|
||||
HAL_Free(topic);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void make_file()
|
||||
{
|
||||
//文件描述符
|
||||
int fd;
|
||||
|
||||
//用只写方式打开文件,如果没有该文件,则创建一个文件
|
||||
fd = open("/fal/test/Data.txt", O_WRONLY | O_CREAT | O_APPEND); //和原来相比,只是把O_TRUNC参数更改为O_APPEND,即更改为打开后,如果再进行写入,将从文件的末尾位置开始写。
|
||||
// rt_kprintf("\n%f %f tmp:%s\n",Humi,Temp,String);
|
||||
//如果打开成功
|
||||
if (fd >= 0)
|
||||
{
|
||||
//写入文件
|
||||
write(fd, tmp, sizeof(tmp));
|
||||
|
||||
// rt_kprintf("Write done.\n");
|
||||
|
||||
//关闭文件
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("File Open Fail.\n");
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
int cnt = 0;
|
||||
void tmp_payload(void)
|
||||
{
|
||||
// 读取温湿度值
|
||||
Humi = aht10_read_humidity(Dev);
|
||||
Temp = aht10_read_temperature(Dev);
|
||||
memset(tmp, 0, sizeof(tmp));
|
||||
sprintf(tmp, "Temp: %.1f;Humi: %.1f;Count: %d\n", Temp, Humi,++cnt);
|
||||
// rt_kprintf("\n%f %f tmp:%s\n",Humi,Temp,tmp);
|
||||
make_file();
|
||||
sprintf(tmp, "{\"params\":{\"temperature\":%.2f,\"humidity\":%.2f}}", Temp, Humi);
|
||||
return;
|
||||
}
|
||||
static int example_publish(void *handle)
|
||||
{
|
||||
|
||||
|
||||
tmp_payload();
|
||||
int res = 0;
|
||||
const char *fmt = "/sys/%s/%s/thing/event/property/post";
|
||||
// /k1lyriw1yGj/${deviceName}/user/get
|
||||
char *topic = NULL;
|
||||
int topic_len = 0;
|
||||
char *payload = tmp;
|
||||
// strcpy(payload,tmp_payload());
|
||||
// rt_kprintf("payload:%s\n",payload);
|
||||
topic_len = strlen(fmt) + strlen(DEMO_PRODUCT_KEY) + strlen(DEMO_DEVICE_NAME) + 1;
|
||||
topic = HAL_Malloc(topic_len);
|
||||
if (topic == NULL) {
|
||||
EXAMPLE_TRACE("memory not enough");
|
||||
return -1;
|
||||
}
|
||||
memset(topic, 0, topic_len);
|
||||
HAL_Snprintf(topic, topic_len, fmt, DEMO_PRODUCT_KEY, DEMO_DEVICE_NAME);
|
||||
|
||||
res = IOT_MQTT_Publish_Simple(0, topic, IOTX_MQTT_QOS0, payload, strlen(payload));
|
||||
if (res < 0) {
|
||||
EXAMPLE_TRACE("publish failed, res = %d", res);
|
||||
HAL_Free(topic);
|
||||
return -1;
|
||||
}
|
||||
|
||||
HAL_Free(topic);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void example_event_handle(void *pcontext, void *pclient, iotx_mqtt_event_msg_pt msg)
|
||||
{
|
||||
EXAMPLE_TRACE("msg->event_type : %d", msg->event_type);
|
||||
}
|
||||
|
||||
static void mqtt_example_main(void *parameter)
|
||||
{
|
||||
void *pclient = NULL;
|
||||
int res = 0;
|
||||
int loop_cnt = 0;
|
||||
iotx_mqtt_param_t mqtt_params;
|
||||
|
||||
HAL_GetProductKey(DEMO_PRODUCT_KEY);
|
||||
HAL_GetDeviceName(DEMO_DEVICE_NAME);
|
||||
HAL_GetDeviceSecret(DEMO_DEVICE_SECRET);
|
||||
|
||||
EXAMPLE_TRACE("mqtt example");
|
||||
|
||||
|
||||
memset(&mqtt_params, 0x0, sizeof(mqtt_params));
|
||||
|
||||
mqtt_params.handle_event.h_fp = example_event_handle;
|
||||
|
||||
pclient = IOT_MQTT_Construct(&mqtt_params);
|
||||
if (NULL == pclient) {
|
||||
EXAMPLE_TRACE("MQTT construct failed");
|
||||
return ;
|
||||
}
|
||||
|
||||
res = example_subscribe(pclient);
|
||||
if (res < 0) {
|
||||
IOT_MQTT_Destroy(&pclient);
|
||||
return ;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
if (0 == loop_cnt % 20) {
|
||||
example_publish(pclient);
|
||||
}
|
||||
|
||||
IOT_MQTT_Yield(pclient, 200);
|
||||
|
||||
loop_cnt += 1;
|
||||
}
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
#define THREAD_PRIORITY 25
|
||||
#define THREAD_STACK_SIZE 4096
|
||||
#define THREAD_TIMESLICE 5
|
||||
|
||||
rt_thread_t MQTT_Thread = RT_NULL;
|
||||
|
||||
void MQTT_Creat_Thread(void)
|
||||
{
|
||||
|
||||
// 初始化设备
|
||||
Dev = aht10_init(AHT10_I2C_BUS);
|
||||
if (Dev == RT_NULL)
|
||||
{
|
||||
rt_kprintf("AHT10_init Fail");
|
||||
return;
|
||||
}
|
||||
|
||||
MQTT_Thread = rt_thread_create("MTQQ_Thread", mqtt_example_main, RT_NULL, THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE);
|
||||
|
||||
if (MQTT_Thread != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(MQTT_Thread);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("MQTT Thread Create Failed!\n");
|
||||
}
|
||||
|
||||
}
|
||||
MSH_CMD_EXPORT(MQTT_Creat_Thread, create a MQTT_Thread);
|
108
applications/my_pro/my_func.c
Normal file
108
applications/my_pro/my_func.c
Normal file
@ -0,0 +1,108 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include <stdlib.h>
|
||||
#include <drv_lcd.h>
|
||||
#include <ntp.h>
|
||||
|
||||
#define LCD_MAX 240
|
||||
void lcd_black(int x, int y)
|
||||
{
|
||||
lcd_address_set(x, y, x, y);
|
||||
lcd_write_half_word(BLACK);
|
||||
}
|
||||
|
||||
void lcd_white(int x, int y)
|
||||
{
|
||||
lcd_address_set(x, y, x, y);
|
||||
lcd_write_half_word(WHITE);
|
||||
}
|
||||
int roundxy[4][2] = {
|
||||
{0, 0},
|
||||
{0, LCD_MAX},
|
||||
{LCD_MAX, 0},
|
||||
{LCD_MAX, LCD_MAX},
|
||||
};
|
||||
int xymove[4][2] = {
|
||||
{1, 1},
|
||||
{1, -1},
|
||||
{-1, 1},
|
||||
{-1, -1},
|
||||
};
|
||||
void mytime()
|
||||
{
|
||||
rt_thread_mdelay(10000);
|
||||
time_t cur_time;
|
||||
|
||||
cur_time = ntp_get_time(RT_NULL);
|
||||
if (cur_time)
|
||||
{
|
||||
rt_kprintf("NTP Server Time: %s", ctime((const time_t *)&cur_time));
|
||||
}
|
||||
lcd_show_string(20, 2, 16, ctime((const time_t *)&cur_time));
|
||||
}
|
||||
|
||||
void xy_round(int x, int y, int x2, int y2, int r, int ii)
|
||||
{
|
||||
// rt_kprintf("x:%d,y:%d,x2:%d,y2:%d,r:%d\n", x, y, x2, y2, r);
|
||||
for (int i = x; i != x2; i += xymove[ii][0])
|
||||
{
|
||||
for (int j = y; j != y2; j += xymove[ii][1])
|
||||
{
|
||||
int newi = x2 - i;
|
||||
int newj = y2 - j;
|
||||
// rt_kprintf("(%d,%d,%d)",(newi * newi + newj * newj), newi, newj);
|
||||
if ((newi * newi + newj * newj) > (r * r))
|
||||
{
|
||||
// rt_kprintf("x:%d,y:%d\n", i, j);
|
||||
lcd_black(i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void my_round(int r)
|
||||
{
|
||||
// 这个范围涂黑
|
||||
lcd_fill(0, 0, roundxy[2][0], roundxy[2][1], BLACK);
|
||||
lcd_write_half_word(BLACK);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
xy_round(roundxy[i][0], roundxy[i][1], roundxy[i][0] + r * xymove[i][0], roundxy[i][1] + r * xymove[i][1], r, i);
|
||||
}
|
||||
}
|
||||
void xy_sink()
|
||||
{
|
||||
for (int i = 0; i < 240; i++)
|
||||
{
|
||||
for (int j = 0; j <= 240; j++)
|
||||
{
|
||||
lcd_black(j, 240 - i);
|
||||
rt_thread_mdelay(1);
|
||||
}
|
||||
// rt_kprintf("(%d,...) Blacked\n", i);
|
||||
}
|
||||
}
|
||||
void snake_address(int x, int y, int r, const rt_uint16_t da)
|
||||
{
|
||||
int f = 0; // 使蛇身成节
|
||||
if (r > 5)
|
||||
{
|
||||
f = 1;
|
||||
}
|
||||
for (int i = x * r + f; i < x * r + r - f; i++)
|
||||
{
|
||||
for (int j = y * r + f; j < y * r + r - f; j++)
|
||||
{
|
||||
lcd_address_set(i, j, i, j);
|
||||
lcd_write_half_word(da);
|
||||
}
|
||||
}
|
||||
}
|
||||
// bt 命令行
|
||||
int color_cmd(int argc, char **argv)
|
||||
{
|
||||
snake_address(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]), BLACK);
|
||||
return 1;
|
||||
}
|
||||
MSH_CMD_EXPORT_ALIAS(color_cmd, snk, bt 命令行);
|
23
applications/my_pro/my_func.h
Normal file
23
applications/my_pro/my_func.h
Normal file
@ -0,0 +1,23 @@
|
||||
#include <drv_lcd.h>
|
||||
#include <rtthread.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
|
||||
// 当前方向
|
||||
void mytime();
|
||||
void xy_round(int x, int y, int x2, int y2, int r, int ii);
|
||||
void my_round(int r);
|
||||
void xy_sink();
|
||||
void lcd_black(int x, int y);
|
||||
void lcd_white(int x, int y);
|
||||
void snake_address(int x, int y, int r, const rt_uint16_t da);
|
||||
|
||||
|
||||
// typedef int QDataType;
|
||||
|
||||
// typedef struct QListNode
|
||||
// {
|
||||
// QDataType data;
|
||||
// struct QListNode* next;
|
||||
|
||||
// } QueueNode;
|
366
applications/my_pro/myproject.c
Normal file
366
applications/my_pro/myproject.c
Normal file
@ -0,0 +1,366 @@
|
||||
#include "rtthread.h"
|
||||
#include "dev_sign_api.h"
|
||||
#include "mqtt_api.h"
|
||||
#include <board.h>
|
||||
#include <drv_gpio.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "aht10.h"
|
||||
#include <ap3216c.h>
|
||||
#include <dfs_posix.h>
|
||||
#include <drv_lcd.h>
|
||||
#include "mysnake.h"
|
||||
|
||||
char DEMO_PRODUCT_KEY[IOTX_PRODUCT_KEY_LEN + 1] = {0};
|
||||
char DEMO_DEVICE_NAME[IOTX_DEVICE_NAME_LEN + 1] = {0};
|
||||
char DEMO_DEVICE_SECRET[IOTX_DEVICE_SECRET_LEN + 1] = {0};
|
||||
|
||||
void *HAL_Malloc(uint32_t size);
|
||||
void HAL_Free(void *ptr);
|
||||
void HAL_Printf(const char *fmt, ...);
|
||||
int HAL_GetProductKey(char product_key[IOTX_PRODUCT_KEY_LEN + 1]);
|
||||
int HAL_GetDeviceName(char device_name[IOTX_DEVICE_NAME_LEN + 1]);
|
||||
int HAL_GetDeviceSecret(char device_secret[IOTX_DEVICE_SECRET_LEN]);
|
||||
uint64_t HAL_UptimeMs(void);
|
||||
int HAL_Snprintf(char *str, const int len, const char *fmt, ...);
|
||||
|
||||
// 定义接受文件内容的缓冲区
|
||||
char buffer[1026] = {};
|
||||
char tmp[1026];
|
||||
extern int snake_len;
|
||||
rt_atomic_t page_chosen = 1;
|
||||
|
||||
#define PAGE_MAX 2
|
||||
|
||||
#define GPIO_LED_B GET_PIN(F, 11)
|
||||
#define GPIO_LED_R GET_PIN(F, 12)
|
||||
|
||||
// AHT挂载的总线名字
|
||||
#define AHT10_I2C_BUS "i2c3"
|
||||
|
||||
// AHT,ap3216c设备指针
|
||||
aht10_device_t Dev = RT_NULL;
|
||||
ap3216c_device_t dev;
|
||||
|
||||
// Humi:湿度值,Temp:温度值
|
||||
float Humi, Temp;
|
||||
rt_uint16_t ps_data;
|
||||
float brightness;
|
||||
int lcd_y;
|
||||
int int_tmp;
|
||||
|
||||
void ath_init(void);
|
||||
void mqt_init(void);
|
||||
int ap3_init(void);
|
||||
|
||||
#define EXAMPLE_TRACE(fmt, ...) \
|
||||
do \
|
||||
{ \
|
||||
HAL_Printf("%s|%03d :: ", __func__, __LINE__); \
|
||||
HAL_Printf(fmt, ##__VA_ARGS__); \
|
||||
HAL_Printf("%s", "\r\n"); \
|
||||
} while (0)
|
||||
|
||||
static void example_message_arrive(void *pcontext, void *pclient, iotx_mqtt_event_msg_pt msg)
|
||||
{
|
||||
iotx_mqtt_topic_info_t *topic_info = (iotx_mqtt_topic_info_pt)msg->msg;
|
||||
|
||||
switch (msg->event_type)
|
||||
{
|
||||
case IOTX_MQTT_EVENT_PUBLISH_RECEIVED:
|
||||
/* print topic name and topic message */
|
||||
EXAMPLE_TRACE("Message Arrived:");
|
||||
rt_pin_mode(GPIO_LED_R, PIN_MODE_OUTPUT);
|
||||
// topic_info->payload 为发送的内容,可以据此设置命令
|
||||
if (rt_pin_read(GPIO_LED_R) == PIN_HIGH)
|
||||
{
|
||||
// rt_kprintf("LED_R should be ON\n");
|
||||
rt_pin_write(GPIO_LED_R, PIN_LOW);
|
||||
}
|
||||
else
|
||||
{
|
||||
// rt_kprintf("LED_R should be OFF\n");
|
||||
rt_pin_write(GPIO_LED_R, PIN_HIGH);
|
||||
}
|
||||
EXAMPLE_TRACE("Topic : %.*s", topic_info->topic_len, topic_info->ptopic);
|
||||
EXAMPLE_TRACE("Payload: %.*s", topic_info->payload_len, topic_info->payload);
|
||||
EXAMPLE_TRACE("\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int example_subscribe(void *handle)
|
||||
{
|
||||
int res = 0;
|
||||
const char *fmt = "/%s/%s/user/get";
|
||||
char *topic = NULL;
|
||||
int topic_len = 0;
|
||||
|
||||
topic_len = strlen(fmt) + strlen(DEMO_PRODUCT_KEY) + strlen(DEMO_DEVICE_NAME) + 1;
|
||||
topic = HAL_Malloc(topic_len);
|
||||
if (topic == NULL)
|
||||
{
|
||||
EXAMPLE_TRACE("memory not enough");
|
||||
return -1;
|
||||
}
|
||||
memset(topic, 0, topic_len);
|
||||
HAL_Snprintf(topic, topic_len, fmt, DEMO_PRODUCT_KEY, DEMO_DEVICE_NAME);
|
||||
|
||||
res = IOT_MQTT_Subscribe(handle, topic, IOTX_MQTT_QOS0, example_message_arrive, NULL);
|
||||
if (res < 0)
|
||||
{
|
||||
EXAMPLE_TRACE("subscribe failed");
|
||||
HAL_Free(topic);
|
||||
return -1;
|
||||
}
|
||||
|
||||
HAL_Free(topic);
|
||||
return 0;
|
||||
}
|
||||
int plus_lcd_y(int pls)
|
||||
{
|
||||
int_tmp = lcd_y;
|
||||
lcd_y += pls;
|
||||
return int_tmp;
|
||||
}
|
||||
void easy_show_lcd(char *title, float Temp)
|
||||
{
|
||||
lcd_show_string(10, plus_lcd_y(24), 24, title);
|
||||
sprintf(tmp, "%f", Temp);
|
||||
lcd_show_string(10, plus_lcd_y(32), 32, tmp);
|
||||
}
|
||||
void show_lcd()
|
||||
{
|
||||
lcd_y = 10;
|
||||
easy_show_lcd("Temperature:", Temp);
|
||||
easy_show_lcd("Humidity:", Humi);
|
||||
easy_show_lcd("Brightness:(lux)", brightness);
|
||||
easy_show_lcd("Ps data:", (float)ps_data);
|
||||
// lcd_show_string(10, plus_lcd_y(10), 24, "Temperature:");
|
||||
// sprintf(tmp, "%f", Temp);
|
||||
// lcd_show_string(10, plus_lcd_y(24), 32, tmp);
|
||||
|
||||
// lcd_show_string(10, plus_lcd_y(32), 24, "Humidity:");
|
||||
// sprintf(tmp, "%f", Humi);
|
||||
// lcd_show_string(10, plus_lcd_y(24), 32, tmp);
|
||||
|
||||
// lcd_show_string(10, plus_lcd_y(32), 24, "Brightness:");
|
||||
// sprintf(tmp, "%f(lux)", brightness);
|
||||
// lcd_show_string(10, plus_lcd_y(24), 32, tmp);
|
||||
}
|
||||
|
||||
void make_file()
|
||||
{
|
||||
// 文件描述符
|
||||
int fd;
|
||||
// 用只写方式打开文件,如果没有该文件,则创建一个文件
|
||||
fd = open("/fal/test/Data.txt", O_WRONLY | O_CREAT | O_APPEND); // 和原来相比,只是把O_TRUNC参数更改为O_APPEND,即更改为打开后,如果再进行写入,将从文件的末尾位置开始写。
|
||||
// rt_kprintf("\n%f %f tmp:%s\n",Humi,Temp,String);
|
||||
// 如果打开成功
|
||||
if (fd >= 0)
|
||||
{
|
||||
// 写入文件
|
||||
write(fd, tmp, sizeof(tmp));
|
||||
// rt_kprintf("Write done.\n");
|
||||
// 关闭文件
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("File Open Fail.\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
int cnt = 0;
|
||||
void tmp_payload(void)
|
||||
{
|
||||
// 读取温湿度值
|
||||
Humi = aht10_read_humidity(Dev);
|
||||
Temp = aht10_read_temperature(Dev);
|
||||
brightness = ap3216c_read_ambient_light(dev);
|
||||
ps_data = ap3216c_read_ps_data(dev);
|
||||
if (ps_data > 14)
|
||||
{
|
||||
page_chosen = (page_chosen % PAGE_MAX) + 1;
|
||||
}
|
||||
// icm20608_get_accel(icm20608_device_t dev, rt_int16_t *accel_x, rt_int16_t *accel_y, rt_int16_t *accel_z)
|
||||
// memset(tmp, 0, sizeof(tmp));
|
||||
// sprintf(tmp, "Temp: %.1f;Humi: %.1f;Count: %d\n", Temp, Humi,++cnt);
|
||||
// rt_kprintf("\n%f %f tmp:%s\n",Humi,Temp,tmp);
|
||||
// make_file();
|
||||
if (page_chosen == 2)
|
||||
{
|
||||
show_lcd();
|
||||
}
|
||||
sprintf(tmp, "{\"params\":{\"temperature\":%.2f,\"humidity\":%.2f,\"LightLux\":%.2f,\"Psdata\":%d,\"Snakelen\":%d}}", Temp, Humi, brightness, ps_data, snake_len);
|
||||
return;
|
||||
}
|
||||
void test_lcd()
|
||||
{
|
||||
// show_str(10, 10+24+32+24+32, 100, 32, "你好", 32);
|
||||
ath_init();
|
||||
ap3_init();
|
||||
while (1)
|
||||
{
|
||||
tmp_payload();
|
||||
rt_thread_mdelay(100);
|
||||
}
|
||||
}
|
||||
MSH_CMD_EXPORT(test_lcd, run my project);
|
||||
static int example_publish(void *handle)
|
||||
{
|
||||
|
||||
tmp_payload();
|
||||
int res = 0;
|
||||
const char *fmt = "/sys/%s/%s/thing/event/property/post";
|
||||
// /k1lyriw1yGj/${deviceName}/user/get
|
||||
char *topic = NULL;
|
||||
int topic_len = 0;
|
||||
char *payload = tmp;
|
||||
// strcpy(payload,tmp_payload());
|
||||
// rt_kprintf("payload:%s\n",payload);
|
||||
topic_len = strlen(fmt) + strlen(DEMO_PRODUCT_KEY) + strlen(DEMO_DEVICE_NAME) + 1;
|
||||
topic = HAL_Malloc(topic_len);
|
||||
if (topic == NULL)
|
||||
{
|
||||
EXAMPLE_TRACE("memory not enough");
|
||||
return -1;
|
||||
}
|
||||
memset(topic, 0, topic_len);
|
||||
HAL_Snprintf(topic, topic_len, fmt, DEMO_PRODUCT_KEY, DEMO_DEVICE_NAME);
|
||||
|
||||
res = IOT_MQTT_Publish_Simple(0, topic, IOTX_MQTT_QOS0, payload, strlen(payload));
|
||||
if (res < 0)
|
||||
{
|
||||
EXAMPLE_TRACE("publish failed, res = %d", res);
|
||||
HAL_Free(topic);
|
||||
return -1;
|
||||
}
|
||||
|
||||
HAL_Free(topic);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void example_event_handle(void *pcontext, void *pclient, iotx_mqtt_event_msg_pt msg)
|
||||
{
|
||||
EXAMPLE_TRACE("msg->event_type : %d", msg->event_type);
|
||||
}
|
||||
|
||||
static void mqtt_example_main(void *parameter)
|
||||
{
|
||||
void *pclient = NULL;
|
||||
int res = 0;
|
||||
int loop_cnt = 0;
|
||||
iotx_mqtt_param_t mqtt_params;
|
||||
|
||||
HAL_GetProductKey(DEMO_PRODUCT_KEY);
|
||||
HAL_GetDeviceName(DEMO_DEVICE_NAME);
|
||||
HAL_GetDeviceSecret(DEMO_DEVICE_SECRET);
|
||||
|
||||
EXAMPLE_TRACE("mqtt example");
|
||||
|
||||
memset(&mqtt_params, 0x0, sizeof(mqtt_params));
|
||||
|
||||
mqtt_params.handle_event.h_fp = example_event_handle;
|
||||
|
||||
pclient = IOT_MQTT_Construct(&mqtt_params);
|
||||
if (NULL == pclient)
|
||||
{
|
||||
EXAMPLE_TRACE("MQTT construct failed");
|
||||
return;
|
||||
}
|
||||
|
||||
res = example_subscribe(pclient);
|
||||
if (res < 0)
|
||||
{
|
||||
IOT_MQTT_Destroy(&pclient);
|
||||
return;
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (0 == loop_cnt % 20)
|
||||
{
|
||||
example_publish(pclient);
|
||||
}
|
||||
|
||||
IOT_MQTT_Yield(pclient, 200);
|
||||
|
||||
loop_cnt += 1;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#define THREAD_PRIORITY 25
|
||||
#define THREAD_STACK_SIZE 4096
|
||||
#define THREAD_TIMESLICE 5
|
||||
|
||||
rt_thread_t MQTT_Thread = RT_NULL;
|
||||
rt_thread_t Snake_Thread = RT_NULL;
|
||||
|
||||
void ath_init(void)
|
||||
{
|
||||
// 初始化设备
|
||||
Dev = aht10_init(AHT10_I2C_BUS);
|
||||
if (Dev == RT_NULL)
|
||||
{
|
||||
rt_kprintf("AHT10_init Fail");
|
||||
return;
|
||||
}
|
||||
}
|
||||
void mqt_init(void)
|
||||
{
|
||||
MQTT_Thread = rt_thread_create("MTQQ_Thread", mqtt_example_main, RT_NULL, THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE);
|
||||
|
||||
if (MQTT_Thread != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(MQTT_Thread);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("MQTT Thread Create Failed!\n");
|
||||
}
|
||||
}
|
||||
int ap3_init(void)
|
||||
{
|
||||
const char *i2c_bus_name = "i2c2";
|
||||
|
||||
dev = ap3216c_init(i2c_bus_name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
void snk_init(void)
|
||||
{
|
||||
Snake_Thread = rt_thread_create("Snake_Thread", snake_entry, RT_NULL, THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE);
|
||||
|
||||
if (Snake_Thread != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(Snake_Thread);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_kprintf("Snake Thread Create Failed!\n");
|
||||
}
|
||||
}
|
||||
MSH_CMD_EXPORT_ALIAS(snk_init, snake, "snake game");
|
||||
// void i20_init(void)
|
||||
// {
|
||||
// const char* i2c_bus_name = "i2c2";
|
||||
|
||||
// icm20608_init(i2c_bus_name)
|
||||
|
||||
// return 0;
|
||||
|
||||
// }
|
||||
void my_project(void)
|
||||
{
|
||||
ath_init();
|
||||
|
||||
mqt_init();
|
||||
|
||||
ap3_init();
|
||||
}
|
||||
MSH_CMD_EXPORT_ALIAS(my_project, myproject, run my project);
|
116
applications/my_pro/mysnake.c
Normal file
116
applications/my_pro/mysnake.c
Normal file
@ -0,0 +1,116 @@
|
||||
#include <stdio.h>
|
||||
#include <rtthread.h>
|
||||
#include <stdbool.h>
|
||||
#include "my_func.h"
|
||||
#include "mysnake.h"
|
||||
#include <time.h>
|
||||
#include <rtatomic.h>
|
||||
|
||||
#define LCD_MAX 240
|
||||
#define SNAKE_SIZE 20
|
||||
#define SNAKE_MAX LCD_MAX / SNAKE_SIZE
|
||||
rt_atomic_t now_direction = 3;
|
||||
rt_atomic_t snake_pressed = 0;
|
||||
extern rt_atomic_t page_chosen;
|
||||
int snake_max = SNAKE_MAX * 3;
|
||||
int snake_len = 3;
|
||||
|
||||
// bool snake_table[SNAKE_MAX][SNAKE_MAX] = {0};
|
||||
// struct My_snake
|
||||
// {
|
||||
// int x;
|
||||
// int y;
|
||||
// }snake_list[SNAKE_MAX*SNAKE_MAX] = {0};
|
||||
// /* rt_event_t 是指向事件结构体的指针类型 */
|
||||
// typedef struct My_snake* my_snake_t;
|
||||
|
||||
void snake_entry(void *parameter)
|
||||
{
|
||||
system("irq");
|
||||
time_t t;
|
||||
/* 初始化随机数发生器 */
|
||||
srand((unsigned)time(&t));
|
||||
int snake_list[SNAKE_MAX + 1][2] = {0};
|
||||
int snake_direction[4][2] = {{0, -1}, {-1, 0}, {0, 1}, {1, 0}}; // 上,左,下,右
|
||||
int snake_food[2];
|
||||
bool food_flag = false;
|
||||
char snake_dirshow[4][7] = {"upup", "left", "down", "rigt"};
|
||||
char tmp[10];
|
||||
int snake_head = 2, snake_tail = 0; // 蛇头,蛇尾
|
||||
snake_list[1][0] = SNAKE_MAX / 2;
|
||||
snake_list[1][1] = SNAKE_MAX / 2;
|
||||
snake_list[0][0] = snake_list[1][0] - 1;
|
||||
snake_list[0][1] = snake_list[1][1];
|
||||
snake_list[2][0] = snake_list[1][0] + 1;
|
||||
snake_list[2][1] = snake_list[1][1];
|
||||
// snake_table[snake_list[0][0]][snake_list[0][1]] = 1;
|
||||
// snake_table[snake_list[1][0]][snake_list[1][1]] = 1;
|
||||
// snake_table[snake_list[2][0]][snake_list[2][1]] = 1;
|
||||
snake_address(snake_list[0][0], snake_list[0][1], SNAKE_SIZE, BLACK);
|
||||
snake_address(snake_list[1][0], snake_list[1][1], SNAKE_SIZE, BLACK);
|
||||
snake_address(snake_list[2][0], snake_list[2][1], SNAKE_SIZE, BLACK);
|
||||
snake_food[0] = rand() % SNAKE_MAX;
|
||||
snake_food[1] = rand() % SNAKE_MAX;
|
||||
snake_address(snake_food[0], snake_food[1], SNAKE_SIZE, GREEN);
|
||||
int new_head_x = 0, new_head_y = 0;
|
||||
int new_direction = 0;
|
||||
while (1)
|
||||
{
|
||||
if (page_chosen == 1)
|
||||
{
|
||||
if (!snake_pressed)
|
||||
{
|
||||
// 50%的概率保持当前方向,20%的概率随机改变方向
|
||||
if (rand() % 100 < 50)
|
||||
{
|
||||
new_direction = rand() % 3;
|
||||
now_direction = (now_direction + 3 + new_direction) % 4; // 防止反向,走回头路
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_atomic_add(&snake_pressed, -1);
|
||||
}
|
||||
|
||||
new_head_x = (snake_list[snake_head][0] + snake_direction[now_direction][0] + SNAKE_MAX) % (SNAKE_MAX);
|
||||
new_head_y = (snake_list[snake_head][1] + snake_direction[now_direction][1] + SNAKE_MAX) % (SNAKE_MAX);
|
||||
|
||||
sprintf(tmp, "(%d,%d)", new_head_x, new_head_y);
|
||||
// rt_kprintf("head:%d,%d\n", snake_list[snake_head][0], snake_list[snake_head][1]);
|
||||
lcd_show_string(20, 20, 16, snake_dirshow[now_direction]);
|
||||
lcd_show_string(20 + 16 * 4, 20, 16, tmp);
|
||||
|
||||
snake_address(new_head_x, new_head_y, SNAKE_SIZE, BLACK);
|
||||
if (new_head_x == snake_food[0] && new_head_y == snake_food[1])
|
||||
{
|
||||
snake_food[0] = rand() % SNAKE_MAX;
|
||||
snake_food[1] = rand() % SNAKE_MAX;
|
||||
snake_address(snake_food[0], snake_food[1], SNAKE_SIZE, GREEN);
|
||||
snake_len++;
|
||||
sprintf(tmp, "%d", snake_len);
|
||||
lcd_show_string(100, 105, 32, tmp);
|
||||
// 防止蛇咬尾出现bug
|
||||
if (snake_len >= SNAKE_MAX)
|
||||
{
|
||||
snake_address(snake_list[snake_tail][0], snake_list[snake_tail][1], SNAKE_SIZE, WHITE);
|
||||
snake_tail = (snake_tail + 1) % (SNAKE_MAX);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (snake_list[snake_tail][0] == snake_food[0] && snake_list[snake_tail][1] == snake_food[1])
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
snake_address(snake_list[snake_tail][0], snake_list[snake_tail][1], SNAKE_SIZE, WHITE);
|
||||
}
|
||||
snake_tail = (snake_tail + 1) % (SNAKE_MAX);
|
||||
}
|
||||
snake_head = (snake_head + 1) % (SNAKE_MAX);
|
||||
snake_list[snake_head][0] = new_head_x;
|
||||
snake_list[snake_head][1] = new_head_y;
|
||||
rt_thread_mdelay(900);
|
||||
}
|
||||
}
|
||||
}
|
6
applications/my_pro/mysnake.h
Normal file
6
applications/my_pro/mysnake.h
Normal file
@ -0,0 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <rtthread.h>
|
||||
#include <stdbool.h>
|
||||
#include "my_func.h"
|
||||
|
||||
void snake_entry(void *parameter);
|
8
applications/my_pro/note.md
Normal file
8
applications/my_pro/note.md
Normal file
@ -0,0 +1,8 @@
|
||||
### 使能了sd card
|
||||

|
||||
结果
|
||||

|
||||
关了就好了
|
||||

|
||||
### 开了soft rtc
|
||||

|
68
applications/my_pro/pin_irq_example.c
Normal file
68
applications/my_pro/pin_irq_example.c
Normal file
@ -0,0 +1,68 @@
|
||||
#include <drv_gpio.h>
|
||||
#include <rtdevice.h>
|
||||
#include <rtthread.h>
|
||||
#define LOG_TAG "pin.irq"
|
||||
#define LOG_LVL LOG_LVL_DBG
|
||||
#include <ulog.h>
|
||||
#include <rtatomic.h>
|
||||
#include "my_func.h"
|
||||
|
||||
#define KEY_UP GET_PIN(C, 5)
|
||||
#define KEY_DOWN GET_PIN(C, 1)
|
||||
#define KEY_LEFT GET_PIN(C, 0)
|
||||
#define KEY_RIGHT GET_PIN(C, 4)
|
||||
extern rt_atomic_t now_direction ;
|
||||
extern rt_atomic_t snake_pressed ;
|
||||
extern int snake_max;
|
||||
void key_up_callback(void *args)
|
||||
{
|
||||
rt_atomic_store(&snake_pressed, snake_max+1);
|
||||
if(rt_atomic_load(&now_direction) != 2) rt_atomic_store(&now_direction, 0);
|
||||
int value = rt_pin_read(KEY_UP);
|
||||
LOG_I("key up value: %d\n", value);
|
||||
}
|
||||
|
||||
void key_down_callback(void *args)
|
||||
{
|
||||
rt_atomic_store(&snake_pressed, snake_max+1);
|
||||
int value = rt_pin_read(KEY_DOWN);
|
||||
if(rt_atomic_load(&now_direction) != 0) rt_atomic_store(&now_direction, 2);
|
||||
LOG_I("key down value: %d\n", value);
|
||||
}
|
||||
|
||||
void key_left_callback(void *args)
|
||||
{
|
||||
rt_atomic_store(&snake_pressed, snake_max+1);
|
||||
if(rt_atomic_load(&now_direction) != 3) rt_atomic_store(&now_direction, 1);
|
||||
int value = rt_pin_read(KEY_LEFT);
|
||||
LOG_I("key left value: %d\n", value);
|
||||
}
|
||||
|
||||
void key_right_callback(void *args)
|
||||
{
|
||||
rt_atomic_store(&snake_pressed, snake_max+1);
|
||||
if(rt_atomic_load(&now_direction) != 1) rt_atomic_store(&now_direction, 3);
|
||||
int value = rt_pin_read(KEY_RIGHT);
|
||||
LOG_I("key right value: %d\n", value);
|
||||
}
|
||||
|
||||
static int rt_pin_irq_example(void)
|
||||
{
|
||||
rt_pin_mode(KEY_UP, PIN_MODE_INPUT_PULLUP);
|
||||
rt_pin_mode(KEY_DOWN, PIN_MODE_INPUT_PULLUP);
|
||||
rt_pin_mode(KEY_LEFT, PIN_MODE_INPUT_PULLUP);
|
||||
rt_pin_mode(KEY_RIGHT, PIN_MODE_INPUT_PULLUP);
|
||||
|
||||
rt_pin_attach_irq(KEY_UP, PIN_IRQ_MODE_FALLING, key_up_callback, RT_NULL);
|
||||
rt_pin_attach_irq(KEY_DOWN, PIN_IRQ_MODE_FALLING, key_down_callback, RT_NULL);
|
||||
rt_pin_attach_irq(KEY_LEFT, PIN_IRQ_MODE_FALLING, key_left_callback, RT_NULL);
|
||||
rt_pin_attach_irq(KEY_RIGHT, PIN_IRQ_MODE_FALLING, key_right_callback, RT_NULL);
|
||||
|
||||
rt_pin_irq_enable(KEY_UP,PIN_IRQ_ENABLE);
|
||||
rt_pin_irq_enable(KEY_DOWN,PIN_IRQ_ENABLE);
|
||||
rt_pin_irq_enable(KEY_LEFT,PIN_IRQ_ENABLE);
|
||||
rt_pin_irq_enable(KEY_RIGHT,PIN_IRQ_ENABLE);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
MSH_CMD_EXPORT_ALIAS(rt_pin_irq_example,irq, pin_irq_example);
|
18
applications/my_pro/test_drv_example.c
Normal file
18
applications/my_pro/test_drv_example.c
Normal file
@ -0,0 +1,18 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
|
||||
static int rt_device_test_init(void)
|
||||
{
|
||||
rt_device_t test_dev = rt_device_create(RT_Device_Class_Char,0);
|
||||
if(!test_dev)
|
||||
{
|
||||
rt_kprintf("test_dev create failed\n");
|
||||
return -RT_ERROR;
|
||||
}
|
||||
if(rt_device_register(test_dev,"test_dev",RT_DEVICE_FLAG_RDWR)!=RT_EOK)
|
||||
{
|
||||
rt_kprintf("test_dev register failed\n");
|
||||
}
|
||||
return RT_EOK;
|
||||
}
|
||||
MSH_CMD_EXPORT_ALIAS(rt_device_test_init,devtest, test device init);
|
2072
applications/rttlogo.h
Normal file
2072
applications/rttlogo.h
Normal file
File diff suppressed because it is too large
Load Diff
6
board/.ignore_format.yml
Normal file
6
board/.ignore_format.yml
Normal file
@ -0,0 +1,6 @@
|
||||
# files format check exclude path, please follow the instructions below to modify;
|
||||
# If you need to exclude an entire folder, add the folder path in dir_path;
|
||||
# If you need to exclude a file, add the path to the file in file_path.
|
||||
|
||||
dir_path:
|
||||
- CubeMX_Config
|
17
board/CubeMX_Config/.mxproject
Normal file
17
board/CubeMX_Config/.mxproject
Normal file
File diff suppressed because one or more lines are too long
365
board/CubeMX_Config/CubeMX_Config.ioc
Normal file
365
board/CubeMX_Config/CubeMX_Config.ioc
Normal file
@ -0,0 +1,365 @@
|
||||
#MicroXplorer Configuration settings - do not modify
|
||||
ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_1
|
||||
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,master,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag
|
||||
ADC1.NbrOfConversionFlag=1
|
||||
ADC1.Rank-0\#ChannelRegularConversion=1
|
||||
ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES
|
||||
ADC1.master=1
|
||||
ADC3.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_14
|
||||
ADC3.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag
|
||||
ADC3.NbrOfConversionFlag=1
|
||||
ADC3.Rank-0\#ChannelRegularConversion=1
|
||||
ADC3.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES
|
||||
CAD.formats=
|
||||
CAD.pinconfig=
|
||||
CAD.provider=
|
||||
FSMC.IPParameters=WriteOperation1
|
||||
FSMC.WriteOperation1=FSMC_WRITE_OPERATION_ENABLE
|
||||
File.Version=6
|
||||
GPIO.groupedBy=Group By Peripherals
|
||||
KeepUserPlacement=false
|
||||
Mcu.CPN=STM32F407ZGT6
|
||||
Mcu.Family=STM32F4
|
||||
Mcu.IP0=ADC1
|
||||
Mcu.IP1=ADC3
|
||||
Mcu.IP10=SYS
|
||||
Mcu.IP11=TIM1
|
||||
Mcu.IP12=TIM2
|
||||
Mcu.IP13=TIM3
|
||||
Mcu.IP14=TIM4
|
||||
Mcu.IP15=TIM11
|
||||
Mcu.IP16=TIM13
|
||||
Mcu.IP17=TIM14
|
||||
Mcu.IP18=USART1
|
||||
Mcu.IP19=USART2
|
||||
Mcu.IP2=DAC
|
||||
Mcu.IP20=USB_OTG_FS
|
||||
Mcu.IP3=FSMC
|
||||
Mcu.IP4=IWDG
|
||||
Mcu.IP5=NVIC
|
||||
Mcu.IP6=RCC
|
||||
Mcu.IP7=RTC
|
||||
Mcu.IP8=SDIO
|
||||
Mcu.IP9=SPI2
|
||||
Mcu.IPNb=21
|
||||
Mcu.Name=STM32F407Z(E-G)Tx
|
||||
Mcu.Package=LQFP144
|
||||
Mcu.Pin0=PC14-OSC32_IN
|
||||
Mcu.Pin1=PC15-OSC32_OUT
|
||||
Mcu.Pin10=PC3
|
||||
Mcu.Pin11=PA1
|
||||
Mcu.Pin12=PA2
|
||||
Mcu.Pin13=PA3
|
||||
Mcu.Pin14=PA4
|
||||
Mcu.Pin15=PA7
|
||||
Mcu.Pin16=PB1
|
||||
Mcu.Pin17=PE7
|
||||
Mcu.Pin18=PE8
|
||||
Mcu.Pin19=PE9
|
||||
Mcu.Pin2=PF4
|
||||
Mcu.Pin20=PE10
|
||||
Mcu.Pin21=PE11
|
||||
Mcu.Pin22=PE13
|
||||
Mcu.Pin23=PB10
|
||||
Mcu.Pin24=PB11
|
||||
Mcu.Pin25=PB13
|
||||
Mcu.Pin26=PD12
|
||||
Mcu.Pin27=PD13
|
||||
Mcu.Pin28=PD14
|
||||
Mcu.Pin29=PD15
|
||||
Mcu.Pin3=PF5
|
||||
Mcu.Pin30=PC8
|
||||
Mcu.Pin31=PC9
|
||||
Mcu.Pin32=PA9
|
||||
Mcu.Pin33=PA10
|
||||
Mcu.Pin34=PA11
|
||||
Mcu.Pin35=PA12
|
||||
Mcu.Pin36=PA13
|
||||
Mcu.Pin37=PA14
|
||||
Mcu.Pin38=PC10
|
||||
Mcu.Pin39=PC11
|
||||
Mcu.Pin4=PF6
|
||||
Mcu.Pin40=PC12
|
||||
Mcu.Pin41=PD0
|
||||
Mcu.Pin42=PD1
|
||||
Mcu.Pin43=PD2
|
||||
Mcu.Pin44=PD4
|
||||
Mcu.Pin45=PD5
|
||||
Mcu.Pin46=PG10
|
||||
Mcu.Pin47=PG11
|
||||
Mcu.Pin48=PG13
|
||||
Mcu.Pin49=PG14
|
||||
Mcu.Pin5=PF7
|
||||
Mcu.Pin50=VP_IWDG_VS_IWDG
|
||||
Mcu.Pin51=VP_RTC_VS_RTC_Activate
|
||||
Mcu.Pin52=VP_SYS_VS_Systick
|
||||
Mcu.Pin53=VP_TIM1_VS_ClockSourceINT
|
||||
Mcu.Pin54=VP_TIM2_VS_ClockSourceINT
|
||||
Mcu.Pin55=VP_TIM3_VS_ClockSourceINT
|
||||
Mcu.Pin56=VP_TIM11_VS_ClockSourceINT
|
||||
Mcu.Pin57=VP_TIM13_VS_ClockSourceINT
|
||||
Mcu.Pin58=VP_TIM14_VS_ClockSourceINT
|
||||
Mcu.Pin6=PF9
|
||||
Mcu.Pin7=PH0-OSC_IN
|
||||
Mcu.Pin8=PH1-OSC_OUT
|
||||
Mcu.Pin9=PC2
|
||||
Mcu.PinsNb=59
|
||||
Mcu.ThirdPartyNb=0
|
||||
Mcu.UserConstants=
|
||||
Mcu.UserName=STM32F407ZGTx
|
||||
MxCube.Version=6.11.0
|
||||
MxDb.Version=DB.6.0.110
|
||||
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.ForceEnableDMAVector=true
|
||||
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.OTG_FS_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
|
||||
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:false
|
||||
NVIC.USART1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
|
||||
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||
PA1.Signal=ADCx_IN1
|
||||
PA10.GPIOParameters=GPIO_PuPd
|
||||
PA10.GPIO_PuPd=GPIO_PULLUP
|
||||
PA10.Mode=Asynchronous
|
||||
PA10.Signal=USART1_RX
|
||||
PA11.Mode=Device_Only
|
||||
PA11.Signal=USB_OTG_FS_DM
|
||||
PA12.Mode=Device_Only
|
||||
PA12.Signal=USB_OTG_FS_DP
|
||||
PA13.Mode=Serial_Wire
|
||||
PA13.Signal=SYS_JTMS-SWDIO
|
||||
PA14.Mode=Serial_Wire
|
||||
PA14.Signal=SYS_JTCK-SWCLK
|
||||
PA2.Locked=true
|
||||
PA2.Mode=Asynchronous
|
||||
PA2.Signal=USART2_TX
|
||||
PA3.Locked=true
|
||||
PA3.Mode=Asynchronous
|
||||
PA3.Signal=USART2_RX
|
||||
PA4.Signal=COMP_DAC1_group
|
||||
PA7.Signal=S_TIM3_CH2
|
||||
PA9.GPIOParameters=GPIO_PuPd
|
||||
PA9.GPIO_PuPd=GPIO_PULLUP
|
||||
PA9.Mode=Asynchronous
|
||||
PA9.Signal=USART1_TX
|
||||
PB1.Signal=S_TIM3_CH4
|
||||
PB10.Signal=S_TIM2_CH3
|
||||
PB11.Signal=S_TIM2_CH4
|
||||
PB13.Mode=Full_Duplex_Master
|
||||
PB13.Signal=SPI2_SCK
|
||||
PC10.Mode=SD_4_bits_Wide_bus
|
||||
PC10.Signal=SDIO_D2
|
||||
PC11.Mode=SD_4_bits_Wide_bus
|
||||
PC11.Signal=SDIO_D3
|
||||
PC12.Mode=SD_4_bits_Wide_bus
|
||||
PC12.Signal=SDIO_CK
|
||||
PC14-OSC32_IN.Mode=LSE-External-Oscillator
|
||||
PC14-OSC32_IN.Signal=RCC_OSC32_IN
|
||||
PC15-OSC32_OUT.Mode=LSE-External-Oscillator
|
||||
PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
|
||||
PC2.Mode=Full_Duplex_Master
|
||||
PC2.Signal=SPI2_MISO
|
||||
PC3.Mode=Full_Duplex_Master
|
||||
PC3.Signal=SPI2_MOSI
|
||||
PC8.Mode=SD_4_bits_Wide_bus
|
||||
PC8.Signal=SDIO_D0
|
||||
PC9.Mode=SD_4_bits_Wide_bus
|
||||
PC9.Signal=SDIO_D1
|
||||
PD0.Signal=FSMC_D2_DA2
|
||||
PD1.Signal=FSMC_D3_DA3
|
||||
PD12.Signal=S_TIM4_CH1
|
||||
PD13.Signal=FSMC_A18
|
||||
PD14.Signal=FSMC_D0_DA0
|
||||
PD15.Signal=FSMC_D1_DA1
|
||||
PD2.Mode=SD_4_bits_Wide_bus
|
||||
PD2.Signal=SDIO_CMD
|
||||
PD4.Signal=FSMC_NOE
|
||||
PD5.Signal=FSMC_NWE
|
||||
PE10.Signal=FSMC_D7_DA7
|
||||
PE11.Locked=true
|
||||
PE11.Signal=S_TIM1_CH2
|
||||
PE13.Signal=S_TIM1_CH3
|
||||
PE7.Signal=FSMC_D4_DA4
|
||||
PE8.Signal=FSMC_D5_DA5
|
||||
PE9.Signal=FSMC_D6_DA6
|
||||
PF4.Locked=true
|
||||
PF4.Mode=IN14
|
||||
PF4.Signal=ADC3_IN14
|
||||
PF5.Locked=true
|
||||
PF5.Mode=IN15
|
||||
PF5.Signal=ADC3_IN15
|
||||
PF6.Locked=true
|
||||
PF6.Mode=IN4
|
||||
PF6.Signal=ADC3_IN4
|
||||
PF7.Locked=true
|
||||
PF7.Mode=IN5
|
||||
PF7.Signal=ADC3_IN5
|
||||
PF9.Signal=S_TIM14_CH1
|
||||
PG10.Mode=NorPsramChipSelect3_1
|
||||
PG10.Signal=FSMC_NE3
|
||||
PG11.Locked=true
|
||||
PG11.Signal=ETH_TX_EN
|
||||
PG13.Locked=true
|
||||
PG13.Signal=ETH_TXD0
|
||||
PG14.Locked=true
|
||||
PG14.Signal=ETH_TXD1
|
||||
PH0-OSC_IN.Mode=HSE-External-Oscillator
|
||||
PH0-OSC_IN.Signal=RCC_OSC_IN
|
||||
PH1-OSC_OUT.Mode=HSE-External-Oscillator
|
||||
PH1-OSC_OUT.Signal=RCC_OSC_OUT
|
||||
PinOutPanel.RotationAngle=0
|
||||
ProjectManager.AskForMigrate=true
|
||||
ProjectManager.BackupPrevious=false
|
||||
ProjectManager.CompilerOptimize=6
|
||||
ProjectManager.ComputerToolchain=false
|
||||
ProjectManager.CoupleFile=false
|
||||
ProjectManager.CustomerFirmwarePackage=
|
||||
ProjectManager.DefaultFWLocation=true
|
||||
ProjectManager.DeletePrevious=true
|
||||
ProjectManager.DeviceId=STM32F407ZGTx
|
||||
ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.27.1
|
||||
ProjectManager.FreePins=false
|
||||
ProjectManager.HalAssertFull=false
|
||||
ProjectManager.HeapSize=0x200
|
||||
ProjectManager.KeepUserCode=true
|
||||
ProjectManager.LastFirmware=true
|
||||
ProjectManager.LibraryCopy=0
|
||||
ProjectManager.MainLocation=Src
|
||||
ProjectManager.NoMain=false
|
||||
ProjectManager.PreviousToolchain=
|
||||
ProjectManager.ProjectBuild=false
|
||||
ProjectManager.ProjectFileName=CubeMX_Config.ioc
|
||||
ProjectManager.ProjectName=CubeMX_Config
|
||||
ProjectManager.ProjectStructure=
|
||||
ProjectManager.RegisterCallBack=
|
||||
ProjectManager.StackSize=0x400
|
||||
ProjectManager.TargetToolchain=MDK-ARM V5
|
||||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UAScriptAfterPath=
|
||||
ProjectManager.UAScriptBeforePath=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_SPI1_Init-SPI1-false-HAL-true,5-MX_RTC_Init-RTC-false-HAL-true,6-MX_IWDG_Init-IWDG-false-HAL-true,7-MX_TIM14_Init-TIM14-false-HAL-true,8-MX_TIM13_Init-TIM13-false-HAL-true,9-MX_TIM11_Init-TIM11-false-HAL-true,10-MX_SDIO_SD_Init-SDIO-false-HAL-true,11-MX_TIM2_Init-TIM2-false-HAL-true,12-MX_SPI2_Init-SPI2-false-HAL-true,13-MX_TIM4_Init-TIM4-false-HAL-true,14-MX_USB_OTG_FS_PCD_Init-USB_OTG_FS-false-HAL-true,15-MX_FSMC_Init-FSMC-false-HAL-true,16-MX_DAC_Init-DAC-false-HAL-true,17-MX_TIM3_Init-TIM3-false-HAL-true,18-MX_ADC1_Init-ADC1-false-HAL-true,19-MX_ADC3_Init-ADC3-false-HAL-true,20-MX_TIM1_Init-TIM1-false-HAL-true,21-MX_USART2_UART_Init-USART2-false-HAL-true
|
||||
RCC.48MHZClocksFreq_Value=48000000
|
||||
RCC.AHBFreq_Value=168000000
|
||||
RCC.APB1CLKDivider=RCC_HCLK_DIV4
|
||||
RCC.APB1Freq_Value=42000000
|
||||
RCC.APB1TimFreq_Value=84000000
|
||||
RCC.APB2CLKDivider=RCC_HCLK_DIV2
|
||||
RCC.APB2Freq_Value=84000000
|
||||
RCC.APB2TimFreq_Value=168000000
|
||||
RCC.CortexFreq_Value=168000000
|
||||
RCC.EthernetFreq_Value=168000000
|
||||
RCC.FCLKCortexFreq_Value=168000000
|
||||
RCC.FamilyName=M
|
||||
RCC.HCLKFreq_Value=168000000
|
||||
RCC.HSE_VALUE=8000000
|
||||
RCC.HSI_VALUE=16000000
|
||||
RCC.I2SClocksFreq_Value=192000000
|
||||
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,RCC_RTC_Clock_Source,RCC_RTC_Clock_SourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S
|
||||
RCC.LSI_VALUE=32000
|
||||
RCC.MCO2PinFreq_Value=168000000
|
||||
RCC.PLLCLKFreq_Value=168000000
|
||||
RCC.PLLM=4
|
||||
RCC.PLLN=168
|
||||
RCC.PLLQ=7
|
||||
RCC.PLLQCLKFreq_Value=48000000
|
||||
RCC.RCC_RTC_Clock_Source=RCC_RTCCLKSOURCE_LSE
|
||||
RCC.RCC_RTC_Clock_SourceVirtual=RCC_RTCCLKSOURCE_LSE
|
||||
RCC.RTCFreq_Value=32768
|
||||
RCC.RTCHSEDivFreq_Value=4000000
|
||||
RCC.SYSCLKFreq_VALUE=168000000
|
||||
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
||||
RCC.VCOI2SOutputFreq_Value=384000000
|
||||
RCC.VCOInputFreq_Value=2000000
|
||||
RCC.VCOOutputFreq_Value=336000000
|
||||
RCC.VcooutputI2S=192000000
|
||||
SH.ADCx_IN1.0=ADC1_IN1,IN1
|
||||
SH.ADCx_IN1.ConfNb=1
|
||||
SH.COMP_DAC1_group.0=DAC_OUT1,DAC_OUT1
|
||||
SH.COMP_DAC1_group.ConfNb=1
|
||||
SH.FSMC_A18.0=FSMC_A18,A18_1
|
||||
SH.FSMC_A18.ConfNb=1
|
||||
SH.FSMC_D0_DA0.0=FSMC_D0,8b-d1
|
||||
SH.FSMC_D0_DA0.ConfNb=1
|
||||
SH.FSMC_D1_DA1.0=FSMC_D1,8b-d1
|
||||
SH.FSMC_D1_DA1.ConfNb=1
|
||||
SH.FSMC_D2_DA2.0=FSMC_D2,8b-d1
|
||||
SH.FSMC_D2_DA2.ConfNb=1
|
||||
SH.FSMC_D3_DA3.0=FSMC_D3,8b-d1
|
||||
SH.FSMC_D3_DA3.ConfNb=1
|
||||
SH.FSMC_D4_DA4.0=FSMC_D4,8b-d1
|
||||
SH.FSMC_D4_DA4.ConfNb=1
|
||||
SH.FSMC_D5_DA5.0=FSMC_D5,8b-d1
|
||||
SH.FSMC_D5_DA5.ConfNb=1
|
||||
SH.FSMC_D6_DA6.0=FSMC_D6,8b-d1
|
||||
SH.FSMC_D6_DA6.ConfNb=1
|
||||
SH.FSMC_D7_DA7.0=FSMC_D7,8b-d1
|
||||
SH.FSMC_D7_DA7.ConfNb=1
|
||||
SH.FSMC_NOE.0=FSMC_NOE,Lcd1
|
||||
SH.FSMC_NOE.ConfNb=1
|
||||
SH.FSMC_NWE.0=FSMC_NWE,Lcd1
|
||||
SH.FSMC_NWE.ConfNb=1
|
||||
SH.S_TIM14_CH1.0=TIM14_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM14_CH1.ConfNb=1
|
||||
SH.S_TIM1_CH2.0=TIM1_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM1_CH2.ConfNb=1
|
||||
SH.S_TIM1_CH3.0=TIM1_CH3,PWM Generation3 CH3
|
||||
SH.S_TIM1_CH3.ConfNb=1
|
||||
SH.S_TIM2_CH3.0=TIM2_CH3,PWM Generation3 CH3
|
||||
SH.S_TIM2_CH3.ConfNb=1
|
||||
SH.S_TIM2_CH4.0=TIM2_CH4,PWM Generation4 CH4
|
||||
SH.S_TIM2_CH4.ConfNb=1
|
||||
SH.S_TIM3_CH2.0=TIM3_CH2,PWM Generation2 CH2
|
||||
SH.S_TIM3_CH2.ConfNb=1
|
||||
SH.S_TIM3_CH4.0=TIM3_CH4,PWM Generation4 CH4
|
||||
SH.S_TIM3_CH4.ConfNb=1
|
||||
SH.S_TIM4_CH1.0=TIM4_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM4_CH1.ConfNb=1
|
||||
SPI2.CalculateBaudRate=21.0 MBits/s
|
||||
SPI2.Direction=SPI_DIRECTION_2LINES
|
||||
SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
|
||||
SPI2.Mode=SPI_MODE_MASTER
|
||||
SPI2.VirtualType=VM_MASTER
|
||||
TIM1.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||
TIM1.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
||||
TIM1.IPParameters=Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3
|
||||
TIM14.Channel=TIM_CHANNEL_1
|
||||
TIM14.IPParameters=Channel
|
||||
TIM2.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
|
||||
TIM2.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
|
||||
TIM2.IPParameters=Channel-PWM Generation3 CH3,Channel-PWM Generation4 CH4
|
||||
TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
|
||||
TIM3.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
|
||||
TIM3.IPParameters=Channel-PWM Generation4 CH4,Channel-PWM Generation2 CH2
|
||||
TIM4.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
|
||||
TIM4.IPParameters=Channel-PWM Generation1 CH1
|
||||
USART1.IPParameters=VirtualMode
|
||||
USART1.VirtualMode=VM_ASYNC
|
||||
USART2.IPParameters=VirtualMode
|
||||
USART2.VirtualMode=VM_ASYNC
|
||||
USB_OTG_FS.IPParameters=VirtualMode
|
||||
USB_OTG_FS.VirtualMode=Device_Only
|
||||
VP_IWDG_VS_IWDG.Mode=IWDG_Activate
|
||||
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
|
||||
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
|
||||
VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
|
||||
VP_SYS_VS_Systick.Mode=SysTick
|
||||
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
|
||||
VP_TIM11_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM11_VS_ClockSourceINT.Signal=TIM11_VS_ClockSourceINT
|
||||
VP_TIM13_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM13_VS_ClockSourceINT.Signal=TIM13_VS_ClockSourceINT
|
||||
VP_TIM14_VS_ClockSourceINT.Mode=Enable_Timer
|
||||
VP_TIM14_VS_ClockSourceINT.Signal=TIM14_VS_ClockSourceINT
|
||||
VP_TIM1_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM1_VS_ClockSourceINT.Signal=TIM1_VS_ClockSourceINT
|
||||
VP_TIM2_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
|
||||
VP_TIM3_VS_ClockSourceINT.Mode=Internal
|
||||
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
|
||||
board=custom
|
92
board/CubeMX_Config/Inc/main.h
Normal file
92
board/CubeMX_Config/Inc/main.h
Normal file
@ -0,0 +1,92 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file : main.h
|
||||
* @brief : Header for main.c file.
|
||||
* This file contains the common defines of the application.
|
||||
******************************************************************************
|
||||
** This notice applies to any and all portions of this file
|
||||
* that are not between comment pairs USER CODE BEGIN and
|
||||
* USER CODE END. Other portions of this file, whether
|
||||
* inserted by the user or by software development tools
|
||||
* are owned by their respective copyright owners.
|
||||
*
|
||||
* COPYRIGHT(c) 2018 STMicroelectronics
|
||||
*
|
||||
* 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 STMicroelectronics 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __MAIN_H
|
||||
#define __MAIN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN ET */
|
||||
|
||||
/* USER CODE END ET */
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EM */
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void Error_Handler(void);
|
||||
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
/* Private defines -----------------------------------------------------------*/
|
||||
|
||||
/* USER CODE BEGIN Private defines */
|
||||
|
||||
/* USER CODE END Private defines */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MAIN_H */
|
495
board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
Normal file
495
board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
Normal file
@ -0,0 +1,495 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f4xx_hal_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @brief HAL configuration template file.
|
||||
* This file should be copied to the application folder and renamed
|
||||
* to stm32f4xx_hal_conf.h.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software is licensed under terms that can be found in the LICENSE file
|
||||
* in the root directory of this software component.
|
||||
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F4xx_HAL_CONF_H
|
||||
#define __STM32F4xx_HAL_CONF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* ########################## Module Selection ############################## */
|
||||
/**
|
||||
* @brief This is the list of modules to be used in the HAL driver
|
||||
*/
|
||||
#define HAL_MODULE_ENABLED
|
||||
|
||||
/* #define HAL_CRYP_MODULE_ENABLED */
|
||||
#define HAL_ADC_MODULE_ENABLED
|
||||
/* #define HAL_CAN_MODULE_ENABLED */
|
||||
/* #define HAL_CRC_MODULE_ENABLED */
|
||||
/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
#define HAL_DAC_MODULE_ENABLED
|
||||
/* #define HAL_DCMI_MODULE_ENABLED */
|
||||
/* #define HAL_DMA2D_MODULE_ENABLED */
|
||||
/* #define HAL_ETH_MODULE_ENABLED */
|
||||
/* #define HAL_ETH_LEGACY_MODULE_ENABLED */
|
||||
/* #define HAL_NAND_MODULE_ENABLED */
|
||||
/* #define HAL_NOR_MODULE_ENABLED */
|
||||
/* #define HAL_PCCARD_MODULE_ENABLED */
|
||||
#define HAL_SRAM_MODULE_ENABLED
|
||||
/* #define HAL_SDRAM_MODULE_ENABLED */
|
||||
/* #define HAL_HASH_MODULE_ENABLED */
|
||||
/* #define HAL_I2C_MODULE_ENABLED */
|
||||
/* #define HAL_I2S_MODULE_ENABLED */
|
||||
#define HAL_IWDG_MODULE_ENABLED
|
||||
/* #define HAL_LTDC_MODULE_ENABLED */
|
||||
/* #define HAL_RNG_MODULE_ENABLED */
|
||||
#define HAL_RTC_MODULE_ENABLED
|
||||
/* #define HAL_SAI_MODULE_ENABLED */
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
/* #define HAL_MMC_MODULE_ENABLED */
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_UART_MODULE_ENABLED
|
||||
/* #define HAL_USART_MODULE_ENABLED */
|
||||
/* #define HAL_IRDA_MODULE_ENABLED */
|
||||
/* #define HAL_SMARTCARD_MODULE_ENABLED */
|
||||
/* #define HAL_SMBUS_MODULE_ENABLED */
|
||||
/* #define HAL_WWDG_MODULE_ENABLED */
|
||||
#define HAL_PCD_MODULE_ENABLED
|
||||
/* #define HAL_HCD_MODULE_ENABLED */
|
||||
/* #define HAL_DSI_MODULE_ENABLED */
|
||||
/* #define HAL_QSPI_MODULE_ENABLED */
|
||||
/* #define HAL_QSPI_MODULE_ENABLED */
|
||||
/* #define HAL_CEC_MODULE_ENABLED */
|
||||
/* #define HAL_FMPI2C_MODULE_ENABLED */
|
||||
/* #define HAL_FMPSMBUS_MODULE_ENABLED */
|
||||
/* #define HAL_SPDIFRX_MODULE_ENABLED */
|
||||
/* #define HAL_DFSDM_MODULE_ENABLED */
|
||||
/* #define HAL_LPTIM_MODULE_ENABLED */
|
||||
#define HAL_GPIO_MODULE_ENABLED
|
||||
#define HAL_EXTI_MODULE_ENABLED
|
||||
#define HAL_DMA_MODULE_ENABLED
|
||||
#define HAL_RCC_MODULE_ENABLED
|
||||
#define HAL_FLASH_MODULE_ENABLED
|
||||
#define HAL_PWR_MODULE_ENABLED
|
||||
#define HAL_CORTEX_MODULE_ENABLED
|
||||
|
||||
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||
/**
|
||||
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSE is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSE_VALUE)
|
||||
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||
#endif /* HSE_VALUE */
|
||||
|
||||
#if !defined (HSE_STARTUP_TIMEOUT)
|
||||
#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
|
||||
#endif /* HSE_STARTUP_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief Internal High Speed oscillator (HSI) value.
|
||||
* This value is used by the RCC HAL module to compute the system frequency
|
||||
* (when HSI is used as system clock source, directly or through the PLL).
|
||||
*/
|
||||
#if !defined (HSI_VALUE)
|
||||
#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
|
||||
#endif /* HSI_VALUE */
|
||||
|
||||
/**
|
||||
* @brief Internal Low Speed oscillator (LSI) value.
|
||||
*/
|
||||
#if !defined (LSI_VALUE)
|
||||
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
|
||||
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||
The real value may vary depending on the variations
|
||||
in voltage and temperature.*/
|
||||
/**
|
||||
* @brief External Low Speed oscillator (LSE) value.
|
||||
*/
|
||||
#if !defined (LSE_VALUE)
|
||||
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||
#endif /* LSE_VALUE */
|
||||
|
||||
#if !defined (LSE_STARTUP_TIMEOUT)
|
||||
#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
|
||||
#endif /* LSE_STARTUP_TIMEOUT */
|
||||
|
||||
/**
|
||||
* @brief External clock source for I2S peripheral
|
||||
* This value is used by the I2S HAL module to compute the I2S clock source
|
||||
* frequency, this source is inserted directly through I2S_CKIN pad.
|
||||
*/
|
||||
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External audio frequency in Hz*/
|
||||
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||
|
||||
/* Tip: To avoid modifying this file each time you need to use different HSE,
|
||||
=== you can define the HSE value in your toolchain compiler preprocessor. */
|
||||
|
||||
/* ########################### System Configuration ######################### */
|
||||
/**
|
||||
* @brief This is the HAL system configuration section
|
||||
*/
|
||||
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||
#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */
|
||||
#define USE_RTOS 0U
|
||||
#define PREFETCH_ENABLE 1U
|
||||
#define INSTRUCTION_CACHE_ENABLE 1U
|
||||
#define DATA_CACHE_ENABLE 1U
|
||||
|
||||
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
|
||||
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
|
||||
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
|
||||
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
|
||||
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
|
||||
#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */
|
||||
#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */
|
||||
#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */
|
||||
#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */
|
||||
#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
|
||||
#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
|
||||
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
|
||||
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
|
||||
#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */
|
||||
#define USE_HAL_FMPSMBUS_REGISTER_CALLBACKS 0U /* FMPSMBUS register callback disabled */
|
||||
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
|
||||
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
|
||||
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
|
||||
#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */
|
||||
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
|
||||
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
|
||||
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
|
||||
#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
|
||||
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
|
||||
#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */
|
||||
#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
|
||||
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
|
||||
#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */
|
||||
#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
|
||||
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
|
||||
#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */
|
||||
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
|
||||
#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */
|
||||
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
|
||||
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
|
||||
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
|
||||
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
|
||||
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
|
||||
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
|
||||
|
||||
/* ########################## Assert Selection ############################## */
|
||||
/**
|
||||
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||
* HAL drivers code
|
||||
*/
|
||||
/* #define USE_FULL_ASSERT 1U */
|
||||
|
||||
/* ################## Ethernet peripheral configuration ##################### */
|
||||
|
||||
/* Section 1 : Ethernet peripheral configuration */
|
||||
|
||||
/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
|
||||
#define MAC_ADDR0 2U
|
||||
#define MAC_ADDR1 0U
|
||||
#define MAC_ADDR2 0U
|
||||
#define MAC_ADDR3 0U
|
||||
#define MAC_ADDR4 0U
|
||||
#define MAC_ADDR5 0U
|
||||
|
||||
/* Definition of the Ethernet driver buffers size and count */
|
||||
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
|
||||
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
|
||||
#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
|
||||
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
|
||||
|
||||
/* Section 2: PHY configuration section */
|
||||
|
||||
/* DP83848_PHY_ADDRESS Address*/
|
||||
#define DP83848_PHY_ADDRESS
|
||||
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||
#define PHY_RESET_DELAY 0x000000FFU
|
||||
/* PHY Configuration delay */
|
||||
#define PHY_CONFIG_DELAY 0x00000FFFU
|
||||
|
||||
#define PHY_READ_TO 0x0000FFFFU
|
||||
#define PHY_WRITE_TO 0x0000FFFFU
|
||||
|
||||
/* Section 3: Common PHY Registers */
|
||||
|
||||
#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */
|
||||
#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */
|
||||
|
||||
#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */
|
||||
#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */
|
||||
#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */
|
||||
#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */
|
||||
#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */
|
||||
#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */
|
||||
#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */
|
||||
#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */
|
||||
#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */
|
||||
#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */
|
||||
|
||||
#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */
|
||||
#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */
|
||||
#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */
|
||||
|
||||
/* Section 4: Extended PHY Registers */
|
||||
#define PHY_SR ((uint16_t)) /*!< PHY status register Offset */
|
||||
|
||||
#define PHY_SPEED_STATUS ((uint16_t)) /*!< PHY Speed mask */
|
||||
#define PHY_DUPLEX_STATUS ((uint16_t)) /*!< PHY Duplex mask */
|
||||
|
||||
/* ################## SPI peripheral configuration ########################## */
|
||||
|
||||
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||
* Activated: CRC code is present inside driver
|
||||
* Deactivated: CRC code cleaned from driver
|
||||
*/
|
||||
|
||||
#define USE_SPI_CRC 0U
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Include module's header file
|
||||
*/
|
||||
|
||||
#ifdef HAL_RCC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_rcc.h"
|
||||
#endif /* HAL_RCC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_gpio.h"
|
||||
#endif /* HAL_GPIO_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_EXTI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_exti.h"
|
||||
#endif /* HAL_EXTI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DMA_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dma.h"
|
||||
#endif /* HAL_DMA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CORTEX_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_cortex.h"
|
||||
#endif /* HAL_CORTEX_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ADC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_adc.h"
|
||||
#endif /* HAL_ADC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_can.h"
|
||||
#endif /* HAL_CAN_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_can_legacy.h"
|
||||
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CRC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_crc.h"
|
||||
#endif /* HAL_CRC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CRYP_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_cryp.h"
|
||||
#endif /* HAL_CRYP_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DMA2D_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dma2d.h"
|
||||
#endif /* HAL_DMA2D_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DAC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dac.h"
|
||||
#endif /* HAL_DAC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DCMI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dcmi.h"
|
||||
#endif /* HAL_DCMI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ETH_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_eth.h"
|
||||
#endif /* HAL_ETH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_ETH_LEGACY_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_eth_legacy.h"
|
||||
#endif /* HAL_ETH_LEGACY_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FLASH_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_flash.h"
|
||||
#endif /* HAL_FLASH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_sram.h"
|
||||
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NOR_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_nor.h"
|
||||
#endif /* HAL_NOR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_NAND_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_nand.h"
|
||||
#endif /* HAL_NAND_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCCARD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_pccard.h"
|
||||
#endif /* HAL_PCCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SDRAM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_sdram.h"
|
||||
#endif /* HAL_SDRAM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_HASH_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_hash.h"
|
||||
#endif /* HAL_HASH_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2C_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_i2c.h"
|
||||
#endif /* HAL_I2C_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMBUS_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_smbus.h"
|
||||
#endif /* HAL_SMBUS_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_I2S_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_i2s.h"
|
||||
#endif /* HAL_I2S_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IWDG_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_iwdg.h"
|
||||
#endif /* HAL_IWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_LTDC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_ltdc.h"
|
||||
#endif /* HAL_LTDC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PWR_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_pwr.h"
|
||||
#endif /* HAL_PWR_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_RNG_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_rng.h"
|
||||
#endif /* HAL_RNG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_RTC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_rtc.h"
|
||||
#endif /* HAL_RTC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SAI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_sai.h"
|
||||
#endif /* HAL_SAI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_sd.h"
|
||||
#endif /* HAL_SD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_spi.h"
|
||||
#endif /* HAL_SPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_TIM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_tim.h"
|
||||
#endif /* HAL_TIM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_uart.h"
|
||||
#endif /* HAL_UART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_USART_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_usart.h"
|
||||
#endif /* HAL_USART_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_IRDA_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_irda.h"
|
||||
#endif /* HAL_IRDA_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_smartcard.h"
|
||||
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_WWDG_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_wwdg.h"
|
||||
#endif /* HAL_WWDG_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_PCD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_pcd.h"
|
||||
#endif /* HAL_PCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_HCD_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_hcd.h"
|
||||
#endif /* HAL_HCD_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DSI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dsi.h"
|
||||
#endif /* HAL_DSI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_QSPI_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_qspi.h"
|
||||
#endif /* HAL_QSPI_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_CEC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_cec.h"
|
||||
#endif /* HAL_CEC_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FMPI2C_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_fmpi2c.h"
|
||||
#endif /* HAL_FMPI2C_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_FMPSMBUS_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_fmpsmbus.h"
|
||||
#endif /* HAL_FMPSMBUS_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_SPDIFRX_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_spdifrx.h"
|
||||
#endif /* HAL_SPDIFRX_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_DFSDM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_dfsdm.h"
|
||||
#endif /* HAL_DFSDM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_LPTIM_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_lptim.h"
|
||||
#endif /* HAL_LPTIM_MODULE_ENABLED */
|
||||
|
||||
#ifdef HAL_MMC_MODULE_ENABLED
|
||||
#include "stm32f4xx_hal_mmc.h"
|
||||
#endif /* HAL_MMC_MODULE_ENABLED */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#ifdef USE_FULL_ASSERT
|
||||
/**
|
||||
* @brief The assert_param macro is used for function's parameters check.
|
||||
* @param expr If expr is false, it calls assert_failed function
|
||||
* which reports the name of the source file and the source
|
||||
* line number of the call that failed.
|
||||
* If expr is true, it returns no value.
|
||||
* @retval None
|
||||
*/
|
||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void assert_failed(uint8_t* file, uint32_t line);
|
||||
#else
|
||||
#define assert_param(expr) ((void)0U)
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32F4xx_HAL_CONF_H */
|
84
board/CubeMX_Config/Inc/stm32f4xx_it.h
Normal file
84
board/CubeMX_Config/Inc/stm32f4xx_it.h
Normal file
@ -0,0 +1,84 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f4xx_it.h
|
||||
* @brief This file contains the headers of the interrupt handlers.
|
||||
******************************************************************************
|
||||
*
|
||||
* COPYRIGHT(c) 2018 STMicroelectronics
|
||||
*
|
||||
* 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 STMicroelectronics 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F4xx_IT_H
|
||||
#define __STM32F4xx_IT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN ET */
|
||||
|
||||
/* USER CODE END ET */
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EM */
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void NMI_Handler(void);
|
||||
void HardFault_Handler(void);
|
||||
void MemManage_Handler(void);
|
||||
void BusFault_Handler(void);
|
||||
void UsageFault_Handler(void);
|
||||
void SVC_Handler(void);
|
||||
void DebugMon_Handler(void);
|
||||
void PendSV_Handler(void);
|
||||
void SysTick_Handler(void);
|
||||
void USART1_IRQHandler(void);
|
||||
void OTG_FS_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32F4xx_IT_H */
|
1103
board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
Normal file
1103
board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
Normal file
File diff suppressed because it is too large
Load Diff
246
board/CubeMX_Config/Src/stm32f4xx_it.c
Normal file
246
board/CubeMX_Config/Src/stm32f4xx_it.c
Normal file
@ -0,0 +1,246 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32f4xx_it.c
|
||||
* @brief Interrupt Service Routines.
|
||||
******************************************************************************
|
||||
*
|
||||
* COPYRIGHT(c) 2018 STMicroelectronics
|
||||
*
|
||||
* 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 STMicroelectronics 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.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "stm32f4xx_it.h"
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN TD */
|
||||
|
||||
/* USER CODE END TD */
|
||||
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PD */
|
||||
|
||||
/* USER CODE END PD */
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PM */
|
||||
|
||||
/* USER CODE END PM */
|
||||
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
/* USER CODE END PV */
|
||||
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
/* USER CODE END PFP */
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/* External variables --------------------------------------------------------*/
|
||||
extern UART_HandleTypeDef huart1;
|
||||
extern PCD_HandleTypeDef hpcd_USB_OTG_FS;
|
||||
/* USER CODE BEGIN EV */
|
||||
|
||||
/* USER CODE END EV */
|
||||
|
||||
/******************************************************************************/
|
||||
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||
/******************************************************************************/
|
||||
/**
|
||||
* @brief This function handles Non maskable interrupt.
|
||||
*/
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
|
||||
|
||||
/* USER CODE END NonMaskableInt_IRQn 0 */
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
|
||||
|
||||
/* USER CODE END NonMaskableInt_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Hard fault interrupt.
|
||||
*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END HardFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
|
||||
/* USER CODE END W1_HardFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Memory management fault.
|
||||
*/
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN MemoryManagement_IRQn 0 */
|
||||
|
||||
/* USER CODE END MemoryManagement_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
|
||||
/* USER CODE END W1_MemoryManagement_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Pre-fetch fault, memory access fault.
|
||||
*/
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN BusFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END BusFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
|
||||
/* USER CODE END W1_BusFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Undefined instruction or illegal state.
|
||||
*/
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN UsageFault_IRQn 0 */
|
||||
|
||||
/* USER CODE END UsageFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
|
||||
/* USER CODE END W1_UsageFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System service call via SWI instruction.
|
||||
*/
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SVCall_IRQn 0 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 0 */
|
||||
/* USER CODE BEGIN SVCall_IRQn 1 */
|
||||
|
||||
/* USER CODE END SVCall_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Debug monitor.
|
||||
*/
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 0 */
|
||||
|
||||
/* USER CODE END DebugMonitor_IRQn 0 */
|
||||
/* USER CODE BEGIN DebugMonitor_IRQn 1 */
|
||||
|
||||
/* USER CODE END DebugMonitor_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Pendable request for system service.
|
||||
*/
|
||||
void PendSV_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN PendSV_IRQn 0 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 0 */
|
||||
/* USER CODE BEGIN PendSV_IRQn 1 */
|
||||
|
||||
/* USER CODE END PendSV_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles System tick timer.
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 0 */
|
||||
HAL_IncTick();
|
||||
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||
|
||||
/* USER CODE END SysTick_IRQn 1 */
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* STM32F4xx Peripheral Interrupt Handlers */
|
||||
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||
/* For the available peripheral interrupt handler names, */
|
||||
/* please refer to the startup file (startup_stm32f4xx.s). */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles USART1 global interrupt.
|
||||
*/
|
||||
void USART1_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN USART1_IRQn 0 */
|
||||
|
||||
/* USER CODE END USART1_IRQn 0 */
|
||||
HAL_UART_IRQHandler(&huart1);
|
||||
/* USER CODE BEGIN USART1_IRQn 1 */
|
||||
|
||||
/* USER CODE END USART1_IRQn 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles USB On The Go FS global interrupt.
|
||||
*/
|
||||
void OTG_FS_IRQHandler(void)
|
||||
{
|
||||
/* USER CODE BEGIN OTG_FS_IRQn 0 */
|
||||
//You can open usb device or usb host, but open both of them is fatal error.
|
||||
/* USER CODE END OTG_FS_IRQn 0 */
|
||||
HAL_PCD_IRQHandler(&hpcd_USB_OTG_FS);
|
||||
/* USER CODE BEGIN OTG_FS_IRQn 1 */
|
||||
|
||||
/* USER CODE END OTG_FS_IRQn 1 */
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
|
||||
/* USER CODE END 1 */
|
767
board/Kconfig
Normal file
767
board/Kconfig
Normal file
@ -0,0 +1,767 @@
|
||||
menu "Hardware Drivers Config"
|
||||
|
||||
menu "Onboard Peripheral Drivers"
|
||||
|
||||
config BSP_USING_ARDUINO
|
||||
bool "Compatible with Arduino Ecosystem (RTduino)"
|
||||
select PKG_USING_RTDUINO
|
||||
select BSP_USING_STLINK_TO_USART
|
||||
select BSP_USING_UART1
|
||||
select BSP_USING_UART2
|
||||
select BSP_USING_GPIO
|
||||
select BSP_USING_ADC
|
||||
select BSP_USING_ADC3
|
||||
select BSP_USING_DAC
|
||||
select BSP_USING_DAC1
|
||||
select BSP_USING_PWM
|
||||
select BSP_USING_PWM1
|
||||
select BSP_USING_PWM1_CH2
|
||||
select BSP_USING_PWM1_CH3
|
||||
select BSP_USING_PWM2
|
||||
select BSP_USING_PWM2_CH3
|
||||
select BSP_USING_PWM2_CH4
|
||||
select BSP_USING_PWM4
|
||||
select BSP_USING_PWM4_CH1
|
||||
select BSP_USING_I2C
|
||||
select BSP_USING_I2C4
|
||||
select BSP_USING_I2C5
|
||||
select BSP_USING_SOFT_SPI
|
||||
select BSP_USING_SOFT_SPI1
|
||||
imply RTDUINO_USING_SERVO
|
||||
imply RTDUINO_USING_WIRE
|
||||
imply RTDUINO_USING_SPI
|
||||
default n
|
||||
|
||||
config BSP_USING_USB_TO_USART
|
||||
bool "Enable USB TO USART (uart1)"
|
||||
select BSP_USING_UART
|
||||
select BSP_USING_UART1
|
||||
default y
|
||||
|
||||
config BSP_USING_COM2
|
||||
bool "Enable COM2 (uart2 pin conflict with Ethernet and PWM)"
|
||||
depends on (!BSP_USING_ETH && !BSP_USING_PWM)
|
||||
select BSP_USING_UART
|
||||
select BSP_USING_UART2
|
||||
default n
|
||||
|
||||
config BSP_USING_COM3
|
||||
bool "Enable COM3 (uart3)"
|
||||
select BSP_USING_UART
|
||||
select BSP_USING_UART3
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_RS485
|
||||
bool "Enable RS485 (uart6)"
|
||||
select BSP_USING_UART
|
||||
select BSP_USING_UART6
|
||||
default n
|
||||
if BSP_USING_RS485
|
||||
comment "set rts pin number "
|
||||
config BSP_RS485_RTS_PIN
|
||||
int "RS485 rts pin number"
|
||||
range 0 143
|
||||
default 104
|
||||
|
||||
config RS485_UART_DEVICE_NAME
|
||||
string "the uart name for rs485"
|
||||
default "uart6"
|
||||
|
||||
endif
|
||||
|
||||
config BSP_USING_SRAM
|
||||
bool "Enable SRAM"
|
||||
select BSP_USING_EXT_FMC_IO
|
||||
select BSP_USING_FMC
|
||||
default n
|
||||
|
||||
config BSP_USING_ONBOARD_LCD
|
||||
bool "Enable LCD(ST7787)"
|
||||
select BSP_USING_SRAM
|
||||
default n
|
||||
if BSP_USING_ONBOARD_LCD
|
||||
config BSP_USING_ONBOARD_LCD_PWM_BL
|
||||
bool "Enable pwm background light"
|
||||
default y
|
||||
select BSP_USING_PWM
|
||||
select BSP_USING_PWM14
|
||||
select BSP_USING_PWM14_CH1
|
||||
endif
|
||||
|
||||
config BSP_USING_ONBOARD_LED_MATRIX
|
||||
bool "Enable Led MATRIX"
|
||||
default n
|
||||
select BSP_USING_PWM
|
||||
select BSP_USING_PWM3
|
||||
select BSP_USING_PWM3_CH2
|
||||
if BSP_USING_ONBOARD_LED_MATRIX
|
||||
config BSP_USING_LED_MATRIX_RS485_DEMO
|
||||
bool "use led matrix rs485 example"
|
||||
default n
|
||||
select BSP_USING_RS485
|
||||
endif
|
||||
|
||||
config BSP_USING_LVGL
|
||||
bool "Enable LVGL for LCD"
|
||||
select BSP_USING_ONBOARD_LCD
|
||||
select PKG_USING_LVGL
|
||||
default n
|
||||
|
||||
if BSP_USING_LVGL
|
||||
config BSP_USING_LVGL_DEMO
|
||||
bool "Enable LVGL demo"
|
||||
select PKG_LVGL_USING_DEMOS
|
||||
default y
|
||||
endif
|
||||
|
||||
config BSP_USING_SPI_FLASH
|
||||
bool "Enable SPI FLASH (W25Q64 spi2)"
|
||||
select BSP_USING_SPI
|
||||
select BSP_USING_SPI2
|
||||
select RT_USING_SFUD
|
||||
select RT_SFUD_USING_SFDP
|
||||
default n
|
||||
|
||||
config BSP_USING_EEPROM
|
||||
bool "Enable I2C EEPROM (i2c1)"
|
||||
select BSP_USING_I2C1
|
||||
default n
|
||||
|
||||
config BSP_USING_ENC28j60
|
||||
bool "Enable Ethernet 28j60"
|
||||
default n
|
||||
select BSP_USING_SPI
|
||||
select BSP_USING_SPI1
|
||||
select RT_USING_ENC28J60
|
||||
|
||||
menuconfig BSP_USING_FS
|
||||
bool "Enable File System"
|
||||
select RT_USING_DFS
|
||||
select RT_USING_DFS_ROMFS
|
||||
default n
|
||||
|
||||
if BSP_USING_FS
|
||||
config BSP_USING_SDCARD_FATFS
|
||||
bool "Enable SDCARD (FATFS)"
|
||||
select BSP_USING_SDIO
|
||||
select RT_USING_DFS_ELMFAT
|
||||
default n
|
||||
if BSP_USING_SDCARD_FATFS
|
||||
menuconfig BSP_USING_FS_AUTO_MOUNT
|
||||
bool "Enable filesystem auto mount"
|
||||
default y
|
||||
endif
|
||||
|
||||
config BSP_USING_FLASH_FATFS
|
||||
bool "Enable FAL filesystem partition base on W25Q64"
|
||||
select BSP_USING_FAL
|
||||
default n
|
||||
if BSP_USING_FLASH_FATFS
|
||||
menuconfig BSP_USING_FLASH_FS_AUTO_MOUNT
|
||||
bool "Enable filesystem auto mount"
|
||||
default y
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_FAL
|
||||
bool "Enable FAL (enable on-chip flash and spi2 flash)"
|
||||
select BSP_USING_SPI_FLASH
|
||||
select RT_USING_FAL
|
||||
select FAL_DEBUG_CONFIG
|
||||
select FAL_PART_HAS_TABLE_CFG
|
||||
select FAL_USING_SFUD_PORT
|
||||
select BSP_USING_ON_CHIP_FLASH
|
||||
|
||||
if BSP_USING_FAL
|
||||
menuconfig BSP_USING_BOOTLOADER
|
||||
bool "Enable bootloader partition table"
|
||||
default n
|
||||
endif
|
||||
|
||||
|
||||
config BSP_USING_EASYFLASH
|
||||
bool "Enable Easy Flash base on FAL"
|
||||
select BSP_USING_FAL
|
||||
select PKG_USING_EASYFLASH
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_RW007_WLAN
|
||||
bool "Enable Rw007 Wlan Base on SPI2"
|
||||
default n
|
||||
select PKG_USING_RW007
|
||||
select BSP_USING_SPI
|
||||
select BSP_USING_SPI2
|
||||
if BSP_USING_RW007_WLAN && PKG_USING_RW007
|
||||
config RW007_SPI_MAX_HZ
|
||||
int "RW007 SPI Max Hz"
|
||||
default 30000000
|
||||
config RW007_CS_PIN
|
||||
int "RW007 CS pin index"
|
||||
default 90
|
||||
config RW007_BOOT0_PIN
|
||||
int "RW007 BOOT0 pin index (same as spi clk pin)"
|
||||
default 29
|
||||
config RW007_BOOT1_PIN
|
||||
int "RW007 BOOT1 pin index (same as spi cs pin)"
|
||||
default 90
|
||||
config RW007_INT_BUSY_PIN
|
||||
int "RW007 INT/BUSY pin index"
|
||||
default 107
|
||||
config RW007_RST_PIN
|
||||
int "RW007 RESET pin index"
|
||||
default 111
|
||||
endif
|
||||
|
||||
config BSP_USING_AHT21
|
||||
bool "Enable AHT21(i2c3)"
|
||||
select BSP_USING_I2C
|
||||
select BSP_USING_I2C3
|
||||
select PKG_USING_SENSORS_DRIVERS
|
||||
select PKG_USING_AHT10
|
||||
default n
|
||||
|
||||
config BSP_USING_AP3216C
|
||||
bool "Enable AP3216C(i2c2)"
|
||||
select BSP_USING_I2C
|
||||
select BSP_USING_I2C2
|
||||
select PKG_USING_SENSORS_DRIVERS
|
||||
select PKG_USING_AP3216C
|
||||
default n
|
||||
|
||||
config BSP_USING_ICM20608
|
||||
bool "Enable ICM20608(i2c2)"
|
||||
select BSP_USING_I2C
|
||||
select BSP_USING_I2C2
|
||||
select PKG_USING_SENSORS_DRIVERS
|
||||
select PKG_USING_ICM20608
|
||||
default n
|
||||
|
||||
config BSP_USING_USB_MOUSE
|
||||
bool "Enable Usb Mouse(usb hid device)"
|
||||
select BSP_USING_USBD
|
||||
select RT_USB_DEVICE_HID
|
||||
select RT_USB_DEVICE_HID_MOUSE
|
||||
select BSP_USING_ICM20608
|
||||
|
||||
menuconfig BSP_USING_CAN
|
||||
bool "Enable On Board CAN"
|
||||
select RT_USING_CAN
|
||||
default n
|
||||
if BSP_USING_CAN
|
||||
config BSP_USING_CAN1
|
||||
bool "Enable On Board CAN1"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_AUDIO
|
||||
bool "Enable Audio Device"
|
||||
select RT_USING_AUDIO
|
||||
select BSP_USING_I2C
|
||||
select BSP_USING_I2C2
|
||||
default n
|
||||
|
||||
if BSP_USING_AUDIO
|
||||
config BSP_USING_AUDIO_PLAY
|
||||
bool "Enable Audio Play"
|
||||
default y
|
||||
|
||||
config BSP_USING_AUDIO_RECORD
|
||||
bool "Enable Audio Record"
|
||||
default n
|
||||
endif
|
||||
|
||||
|
||||
endmenu
|
||||
|
||||
menu "On-chip Peripheral Drivers"
|
||||
|
||||
config BSP_USING_GPIO
|
||||
bool "Enable GPIO"
|
||||
select RT_USING_PIN
|
||||
default y
|
||||
|
||||
menuconfig BSP_USING_UART
|
||||
bool "Enable UART"
|
||||
default y
|
||||
select RT_USING_SERIAL
|
||||
if BSP_USING_UART
|
||||
config BSP_USING_UART1
|
||||
bool "Enable UART1"
|
||||
default y
|
||||
|
||||
config BSP_UART1_RX_USING_DMA
|
||||
bool "Enable UART1 RX DMA"
|
||||
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_UART1_TX_USING_DMA
|
||||
bool "Enable UART1 TX DMA"
|
||||
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_USING_UART2
|
||||
bool "Enable UART2"
|
||||
default n
|
||||
|
||||
config BSP_UART2_RX_USING_DMA
|
||||
bool "Enable UART2 RX DMA"
|
||||
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_UART2_TX_USING_DMA
|
||||
bool "Enable UART2 TX DMA"
|
||||
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_USING_UART3
|
||||
bool "Enable UART3"
|
||||
default n
|
||||
|
||||
config BSP_UART3_RX_USING_DMA
|
||||
bool "Enable UART3 RX DMA"
|
||||
depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_UART3_TX_USING_DMA
|
||||
bool "Enable UART3 TX DMA"
|
||||
depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_USING_UART4
|
||||
bool "Enable UART4"
|
||||
default n
|
||||
|
||||
config BSP_UART4_RX_USING_DMA
|
||||
bool "Enable UART4 RX DMA"
|
||||
depends on BSP_USING_UART4 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_UART4_TX_USING_DMA
|
||||
bool "Enable UART4 TX DMA"
|
||||
depends on BSP_USING_UART4 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_USING_UART5
|
||||
bool "Enable UART5"
|
||||
default n
|
||||
|
||||
config BSP_UART5_RX_USING_DMA
|
||||
bool "Enable UART5 RX DMA"
|
||||
depends on BSP_USING_UART5 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_UART5_TX_USING_DMA
|
||||
bool "Enable UART5 TX DMA"
|
||||
depends on BSP_USING_UART5 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_USING_UART6
|
||||
bool "Enable UART6"
|
||||
default n
|
||||
|
||||
config BSP_UART6_RX_USING_DMA
|
||||
bool "Enable UART6 RX DMA"
|
||||
depends on BSP_USING_UART6 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_UART6_TX_USING_DMA
|
||||
bool "Enable UART6 TX DMA"
|
||||
depends on BSP_USING_UART6 && RT_SERIAL_USING_DMA
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_TIM
|
||||
bool "Enable timer"
|
||||
default n
|
||||
select RT_USING_HWTIMER
|
||||
if BSP_USING_TIM
|
||||
config BSP_USING_TIM11
|
||||
bool "Enable TIM11"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM13
|
||||
bool "Enable TIM13"
|
||||
default n
|
||||
|
||||
config BSP_USING_TIM14
|
||||
bool "Enable TIM14"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PWM
|
||||
bool "Enable PWM"
|
||||
default n
|
||||
select RT_USING_PWM
|
||||
if BSP_USING_PWM
|
||||
menuconfig BSP_USING_PWM1
|
||||
bool "Enable timer1 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM1
|
||||
config BSP_USING_PWM1_CH2
|
||||
bool "Enable PWM1 channel2"
|
||||
default n
|
||||
config BSP_USING_PWM1_CH3
|
||||
bool "Enable PWM1 channel3"
|
||||
default n
|
||||
endif
|
||||
menuconfig BSP_USING_PWM2
|
||||
bool "Enable timer2 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM2
|
||||
config BSP_USING_PWM2_CH3
|
||||
bool "Enable PWM2 channel3"
|
||||
default n
|
||||
config BSP_USING_PWM2_CH4
|
||||
bool "Enable PWM2 channel4"
|
||||
default n
|
||||
endif
|
||||
menuconfig BSP_USING_PWM3
|
||||
bool "Enable timer3 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM3
|
||||
config BSP_USING_PWM3_CH2
|
||||
bool "Enable PWM3 channel2"
|
||||
default n
|
||||
endif
|
||||
if BSP_USING_PWM3
|
||||
config BSP_USING_PWM3_CH4
|
||||
bool "Enable PWM3 channel4"
|
||||
default n
|
||||
endif
|
||||
menuconfig BSP_USING_PWM4
|
||||
bool "Enable timer4 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM4
|
||||
config BSP_USING_PWM4_CH1
|
||||
bool "Enable PWM4 channel1"
|
||||
default n
|
||||
endif
|
||||
menuconfig BSP_USING_PWM14
|
||||
bool "Enable timer14 output PWM"
|
||||
default n
|
||||
if BSP_USING_PWM14
|
||||
config BSP_USING_PWM14_CH1
|
||||
bool "Enable PWM14 channel1"
|
||||
default n
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_ON_CHIP_FLASH
|
||||
bool "Enable on-chip FLASH"
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_SOFT_SPI
|
||||
bool "Enable soft SPI BUS"
|
||||
default n
|
||||
select RT_USING_SPI
|
||||
select RT_USING_SPI_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_SOFT_SPI
|
||||
menuconfig BSP_USING_SOFT_SPI1
|
||||
bool "Enable soft SPI1 BUS (software simulation)"
|
||||
default n
|
||||
if BSP_USING_SOFT_SPI1
|
||||
config BSP_S_SPI1_SCK_PIN
|
||||
int "soft spi1 sck pin number(G,5)"
|
||||
range 0 143
|
||||
default 101
|
||||
config BSP_S_SPI1_MISO_PIN
|
||||
int "soft spi1 miso pin numbe(G,3)"
|
||||
range 0 143
|
||||
default 99
|
||||
config BSP_S_SPI1_MOSI_PIN
|
||||
int "soft spi1 mosi pin number(G,1)"
|
||||
range 0 143
|
||||
default 97
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_SOFT_SPI2
|
||||
bool "Enable soft SPI2 BUS (software simulation)"
|
||||
default n
|
||||
if BSP_USING_SOFT_SPI2
|
||||
config BSP_S_SPI2_SCK_PIN
|
||||
int "soft spi2 sck pin number"
|
||||
range 0 143
|
||||
default 19
|
||||
config BSP_S_SPI2_MISO_PIN
|
||||
int "soft spi2 miso pin number"
|
||||
range 0 143
|
||||
default 20
|
||||
config BSP_S_SPI2_MOSI_PIN
|
||||
int "soft spi2 mosi pin number"
|
||||
range 0 143
|
||||
default 21
|
||||
endif
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_SPI
|
||||
bool "Enable SPI BUS"
|
||||
default n
|
||||
select RT_USING_SPI
|
||||
if BSP_USING_SPI
|
||||
config BSP_USING_SPI1
|
||||
bool "Enable SPI1 BUS"
|
||||
default n
|
||||
|
||||
config BSP_SPI1_TX_USING_DMA
|
||||
bool "Enable SPI1 TX DMA"
|
||||
depends on BSP_USING_SPI1
|
||||
default n
|
||||
|
||||
config BSP_SPI1_RX_USING_DMA
|
||||
bool "Enable SPI1 RX DMA"
|
||||
depends on BSP_USING_SPI1
|
||||
select BSP_SPI1_TX_USING_DMA
|
||||
default n
|
||||
|
||||
config BSP_USING_SPI2
|
||||
bool "Enable SPI2 BUS"
|
||||
default n
|
||||
|
||||
config BSP_SPI2_TX_USING_DMA
|
||||
bool "Enable SPI2 TX DMA"
|
||||
depends on BSP_USING_SPI2
|
||||
default n
|
||||
|
||||
config BSP_SPI2_RX_USING_DMA
|
||||
bool "Enable SPI2 RX DMA"
|
||||
depends on BSP_USING_SPI2
|
||||
select BSP_SPI2_TX_USING_DMA
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_ADC
|
||||
bool "Enable ADC"
|
||||
default n
|
||||
select RT_USING_ADC
|
||||
if BSP_USING_ADC
|
||||
config BSP_USING_ADC1
|
||||
bool "Enable ADC1"
|
||||
default n
|
||||
config BSP_USING_ADC3
|
||||
bool "Enable ADC3"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C
|
||||
bool "Enable I2C"
|
||||
default n
|
||||
if BSP_USING_I2C
|
||||
menuconfig BSP_USING_I2C1
|
||||
bool "Enable I2C1 BUS (software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C1
|
||||
config BSP_I2C1_SCL_PIN
|
||||
int "i2c1 scl pin number"
|
||||
range 0 143
|
||||
default 24
|
||||
config BSP_I2C1_SDA_PIN
|
||||
int "I2C1 sda pin number"
|
||||
range 0 143
|
||||
default 25
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C2
|
||||
bool "Enable I2C2 BUS for AP3216C/ICM20608/ES8388/ Onboard(software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C2
|
||||
config BSP_I2C2_SCL_PIN
|
||||
int "i2c2 scl pin number, PF1"
|
||||
range 0 143
|
||||
default 81
|
||||
config BSP_I2C2_SDA_PIN
|
||||
int "I2C2 sda pin number, PF0"
|
||||
range 0 143
|
||||
default 80
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C3
|
||||
bool "Enable I2C3 BUS for AHT21 Onboard(software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C3
|
||||
config BSP_I2C3_SCL_PIN
|
||||
int "i2c3 scl pin number, PE0"
|
||||
range 0 143
|
||||
default 64
|
||||
config BSP_I2C3_SDA_PIN
|
||||
int "I2C3 sda pin number, PE1"
|
||||
range 0 143
|
||||
default 65
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C4
|
||||
bool "Enable I2C4 BUS for RTduino(software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C4
|
||||
config BSP_I2C4_SCL_PIN
|
||||
int "i2c4 scl pin number, PG7"
|
||||
range 0 143
|
||||
default 103
|
||||
config BSP_I2C4_SDA_PIN
|
||||
int "I2C4 sda pin number, PD7"
|
||||
range 0 143
|
||||
default 55
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_I2C5
|
||||
bool "Enable I2C5 BUS for RTduino(software simulation)"
|
||||
default n
|
||||
select RT_USING_I2C
|
||||
select RT_USING_I2C_BITOPS
|
||||
select RT_USING_PIN
|
||||
if BSP_USING_I2C5
|
||||
config BSP_I2C5_SCL_PIN
|
||||
int "i2c5 scl pin number, PB6"
|
||||
range 0 143
|
||||
default 22
|
||||
config BSP_I2C5_SDA_PIN
|
||||
int "I2C5 sda pin number, PB7"
|
||||
range 0 143
|
||||
default 23
|
||||
endif
|
||||
endif
|
||||
|
||||
config BSP_USING_ONBOARD_PM
|
||||
bool "Enable Power Management"
|
||||
select RT_USING_PM
|
||||
select RT_USING_HOOK
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_DAC
|
||||
bool "Enable DAC"
|
||||
default n
|
||||
select RT_USING_DAC
|
||||
if BSP_USING_DAC
|
||||
config BSP_USING_DAC1
|
||||
bool "Enable DAC1"
|
||||
default n
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_ONCHIP_RTC
|
||||
bool "Enable RTC"
|
||||
select RT_USING_RTC
|
||||
default n
|
||||
if BSP_USING_ONCHIP_RTC
|
||||
choice
|
||||
prompt "Select clock source"
|
||||
default BSP_RTC_USING_LSE
|
||||
|
||||
config BSP_RTC_USING_LSE
|
||||
bool "RTC USING LSE"
|
||||
|
||||
config BSP_RTC_USING_LSI
|
||||
bool "RTC USING LSI"
|
||||
endchoice
|
||||
endif
|
||||
|
||||
config BSP_USING_WDT
|
||||
bool "Enable Watchdog Timer"
|
||||
select RT_USING_WDT
|
||||
default n
|
||||
|
||||
config BSP_USING_SDIO
|
||||
bool "Enable SDIO"
|
||||
select RT_USING_SDIO
|
||||
select RT_USING_DFS
|
||||
default n
|
||||
|
||||
config SDIO_MAX_FREQ
|
||||
int "sdio max freq"
|
||||
range 0 24000000
|
||||
depends on BSP_USING_SDIO
|
||||
default 1000000
|
||||
|
||||
config BSP_USING_USBD
|
||||
bool "Enable USB Device"
|
||||
select RT_USING_USB_DEVICE
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_USBH
|
||||
bool "Enable USB Host"
|
||||
select RT_USING_USB_HOST
|
||||
default n
|
||||
if BSP_USING_USBH
|
||||
menuconfig RT_USBH_MSTORAGE
|
||||
bool "Enable Udisk Drivers"
|
||||
default n
|
||||
if RT_USBH_MSTORAGE
|
||||
config UDISK_MOUNTPOINT
|
||||
string "Udisk mount dir"
|
||||
default "/"
|
||||
endif
|
||||
endif
|
||||
|
||||
menuconfig BSP_USING_PULSE_ENCODER
|
||||
bool "Enable Pulse Encoder"
|
||||
default n
|
||||
select RT_USING_PULSE_ENCODER
|
||||
if BSP_USING_PULSE_ENCODER
|
||||
config BSP_USING_PULSE_ENCODER4
|
||||
bool "Enable Pulse Encoder4"
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
config BSP_USING_EXT_FMC_IO
|
||||
bool
|
||||
default n
|
||||
|
||||
config BSP_USING_FMC
|
||||
bool
|
||||
default n
|
||||
source "$(BSP_DIR)/libraries/HAL_Drivers/drivers/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Board extended module Drivers"
|
||||
|
||||
config BSP_USING_TEST
|
||||
bool "Enable test driver"
|
||||
default n
|
||||
|
||||
menuconfig BSP_USING_AT_ESP8266
|
||||
bool "Enable ESP8266(AT Command, COM3)"
|
||||
default n
|
||||
select BSP_USING_COM3
|
||||
select PKG_USING_AT_DEVICE
|
||||
select AT_DEVICE_USING_ESP8266
|
||||
select AT_DEVICE_ESP8266_SAMPLE
|
||||
select AT_DEVICE_ESP8266_SAMPLE_BSP_TAKEOVER
|
||||
|
||||
if BSP_USING_AT_ESP8266
|
||||
|
||||
config ESP8266_SAMPLE_WIFI_SSID
|
||||
string "WIFI ssid"
|
||||
default "rtthread"
|
||||
|
||||
config ESP8266_SAMPLE_WIFI_PASSWORD
|
||||
string "WIFI password"
|
||||
default "12345678"
|
||||
|
||||
config ESP8266_SAMPLE_CLIENT_NAME
|
||||
string "AT client device name (Must be 'uart3')"
|
||||
default "uart3"
|
||||
|
||||
config ESP8266_SAMPLE_RECV_BUFF_LEN
|
||||
int "The maximum length of receive line buffer"
|
||||
default 512
|
||||
|
||||
comment "May adjust RT_SERIAL_RB_BUFSZ up to 512 if using the Serial V1 device driver"
|
||||
|
||||
endif
|
||||
|
||||
endmenu
|
||||
|
||||
endmenu
|
39
board/SConscript
Normal file
39
board/SConscript
Normal file
@ -0,0 +1,39 @@
|
||||
import os
|
||||
import rtconfig
|
||||
from building import *
|
||||
|
||||
Import('SDK_LIB')
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
# add general drivers
|
||||
src = Split('''
|
||||
board.c
|
||||
CubeMX_Config/Src/stm32f4xx_hal_msp.c
|
||||
''')
|
||||
path = [cwd]
|
||||
path += [cwd + '/CubeMX_Config/Inc']
|
||||
|
||||
|
||||
startup_path_prefix = SDK_LIB
|
||||
|
||||
if rtconfig.PLATFORM in ['gcc', 'llvm-arm']:
|
||||
src += [ cwd + '/startup_stm32f407xx.s']
|
||||
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f407xx.s']
|
||||
elif rtconfig.PLATFORM in ['iccarm']:
|
||||
src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f407xx.s']
|
||||
|
||||
CPPDEFINES = ['STM32F407xx']
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
|
||||
# if os.path.isfile(os.path.join(cwd, "ports", 'SConscript')):
|
||||
# group = group + SConscript(os.path.join("ports", 'SConscript'))
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for item in list:
|
||||
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(item, 'SConscript'))
|
||||
|
||||
Return('group')
|
60
board/board.c
Normal file
60
board/board.c
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-07-06 Supperthomas first version
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
#include <drv_common.h>
|
||||
|
||||
void SystemClock_Config(void)
|
||||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
|
||||
|
||||
/**Configure the main internal regulator output voltage
|
||||
*/
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE
|
||||
|RCC_OSCILLATORTYPE_LSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 4;
|
||||
RCC_OscInitStruct.PLL.PLLN = 168;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 7;
|
||||
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
/**Initializes the CPU, AHB and APB busses clocks
|
||||
*/
|
||||
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
|
||||
|
||||
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
|
||||
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
}
|
48
board/board.h
Normal file
48
board/board.h
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-07-06 Supperthomas first version
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __BOARD_H__
|
||||
#define __BOARD_H__
|
||||
|
||||
#include <stm32f4xx.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define STM32_SRAM_SIZE (128)
|
||||
#define STM32_SRAM_END (0x20000000 + STM32_SRAM_SIZE * 1024)
|
||||
|
||||
#define STM32_FLASH_START_ADRESS ((uint32_t)0x08000000)
|
||||
#define STM32_FLASH_SIZE (1024 * 1024)
|
||||
#define STM32_FLASH_END_ADDRESS ((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE))
|
||||
|
||||
#if defined(__ARMCC_VERSION)
|
||||
extern int Image$$RW_IRAM1$$ZI$$Limit;
|
||||
#define HEAP_BEGIN ((void *)&Image$$RW_IRAM1$$ZI$$Limit)
|
||||
#elif __ICCARM__
|
||||
#pragma section="CSTACK"
|
||||
#define HEAP_BEGIN (__segment_end("CSTACK"))
|
||||
#else
|
||||
extern int __bss_end;
|
||||
#define HEAP_BEGIN ((void *)&__bss_end)
|
||||
#endif
|
||||
|
||||
#define HEAP_END STM32_SRAM_END
|
||||
|
||||
void SystemClock_Config(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
30
board/linker_scripts/link.icf
Normal file
30
board/linker_scripts/link.icf
Normal file
@ -0,0 +1,30 @@
|
||||
/*###ICF### Section handled by ICF editor, don't touch! ****/
|
||||
/*-Editor annotation file-*/
|
||||
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
|
||||
/*-Specials-*/
|
||||
define symbol __ICFEDIT_intvec_start__ = 0x08000000;
|
||||
/*-Memory Regions-*/
|
||||
define symbol __ICFEDIT_region_ROM_start__ = 0x08000000;
|
||||
define symbol __ICFEDIT_region_ROM_end__ = 0x080FFFFF;
|
||||
define symbol __ICFEDIT_region_RAM1_start__ = 0x20000000;
|
||||
define symbol __ICFEDIT_region_RAM1_end__ = 0x2001FFFF;
|
||||
define symbol __ICFEDIT_region_RAM2_start__ = 0x10000000;
|
||||
define symbol __ICFEDIT_region_RAM2_end__ = 0x1000FFFF;
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x0400;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x000;
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
|
||||
define memory mem with size = 4G;
|
||||
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
|
||||
define region RAM1_region = mem:[from __ICFEDIT_region_RAM1_start__ to __ICFEDIT_region_RAM1_end__];
|
||||
|
||||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
|
||||
|
||||
initialize by copy { readwrite };
|
||||
do not initialize { section .noinit };
|
||||
|
||||
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
|
||||
|
||||
place in ROM_region { readonly };
|
||||
place in RAM1_region { readwrite, last block CSTACK };
|
245
board/linker_scripts/link.lds
Normal file
245
board/linker_scripts/link.lds
Normal file
@ -0,0 +1,245 @@
|
||||
/*
|
||||
* linker script for STM32F4xx with GNU ld
|
||||
* bernard.xiong 2009-10-14
|
||||
* flybreak 2018-11-19 Add support for RAM2
|
||||
*/
|
||||
|
||||
/* Program Entry, set to mark it as "used" and avoid gc */
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024k /* 1024KB - 128kB flash */
|
||||
RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128k /* 128K sram */
|
||||
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64k /* 64K ccm sram */
|
||||
}
|
||||
ENTRY(Reset_Handler)
|
||||
_system_stack_size = 0x400;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_stext = .;
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
|
||||
. = ALIGN(4);
|
||||
*(.text) /* remaining code */
|
||||
*(.text.*) /* remaining code */
|
||||
*(.rodata) /* read-only data (constants) */
|
||||
*(.rodata*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.gnu.linkonce.t*)
|
||||
|
||||
/* section information for finsh shell */
|
||||
. = ALIGN(4);
|
||||
__fsymtab_start = .;
|
||||
KEEP(*(FSymTab))
|
||||
__fsymtab_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
__vsymtab_start = .;
|
||||
KEEP(*(VSymTab))
|
||||
__vsymtab_end = .;
|
||||
|
||||
/* section information for initial. */
|
||||
. = ALIGN(4);
|
||||
__rt_init_start = .;
|
||||
KEEP(*(SORT(.rti_fn*)))
|
||||
__rt_init_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
|
||||
PROVIDE(__ctors_start__ = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array))
|
||||
PROVIDE(__ctors_end__ = .);
|
||||
|
||||
/* section information for utest */
|
||||
. = ALIGN(4);
|
||||
__rt_utest_tc_tab_start = .;
|
||||
KEEP(*(UtestTcTab))
|
||||
__rt_utest_tc_tab_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
|
||||
_etext = .;
|
||||
} > FLASH = 0
|
||||
|
||||
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
||||
__exidx_start = .;
|
||||
.ARM.exidx :
|
||||
{
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
_sidata = .;
|
||||
} > FLASH
|
||||
__exidx_end = .;
|
||||
|
||||
/* used by the startup to initialize data */
|
||||
_sidata = LOADADDR(.data);
|
||||
/* .data section which is used for initialized data */
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
_sdata = . ;
|
||||
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.gnu.linkonce.d*)
|
||||
|
||||
PROVIDE(__dtors_start__ = .);
|
||||
KEEP(*(SORT(.dtors.*)))
|
||||
KEEP(*(.dtors))
|
||||
PROVIDE(__dtors_end__ = .);
|
||||
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .data secion */
|
||||
_edata = . ;
|
||||
} >RAM AT> FLASH
|
||||
|
||||
_siccmdata = LOADADDR(.ccmdata); /* May be already present */
|
||||
|
||||
/* Initialized CCM-RAM section
|
||||
*
|
||||
* IMPORTANT NOTE!
|
||||
* If initialized variables will be placed in this section,
|
||||
* the startup code needs to be modified to copy the init-values.
|
||||
*/
|
||||
.ccmdata :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sccmdata = .; /* create a global symbol at data start */
|
||||
*(.ccmdata) /* .data sections */
|
||||
*(.ccmdata*) /* .data* sections */
|
||||
/*
|
||||
*data_reg.o(.data .data*)
|
||||
*monitor*.o(.data .data*)
|
||||
*sender*.o(.data .data*)
|
||||
*kernel*.o(.data .data*)
|
||||
*/
|
||||
. = ALIGN(4);
|
||||
_eccmdata = .; /* define a global symbol at data end */
|
||||
} >CCMRAM AT> FLASH
|
||||
|
||||
|
||||
/* _siccm_bss = LOADADDR(.ccm_bss); */
|
||||
/* CCM-RAM section
|
||||
*
|
||||
* IMPORTANT NOTE!
|
||||
* If initialized variables will be placed in this section,
|
||||
* the startup code needs to be modified to copy the init-values.
|
||||
*/
|
||||
.ccm_bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sccm_bss = .; /* create a global symbol at ccmram start */
|
||||
*(.ccm_bss)
|
||||
*(.ccm_bss*)
|
||||
|
||||
/* build\\core\\*.o(.bss .bss*) */
|
||||
build\\monitor\\**.o(.bss .bss*)
|
||||
build\\sender\\**.o(.bss .bss*)
|
||||
/* build\\mapping\\**.o(.bss .bss*) */
|
||||
|
||||
/* *board*.o(.bss .bss*) */
|
||||
/* *autosave.o(.bss .bss*)*/
|
||||
/* *application*autosave.o(.bss .bss*) */
|
||||
/* *data_send.o(.bss .bss*) */
|
||||
/* *isee_http.o(.bss .bss*) */
|
||||
/* *config.o(.bss .bss*) */
|
||||
/* *dio.o(.bss .bss*) */
|
||||
/* *eth.o(.bss .bss*) */
|
||||
/* *led.o(.bss .bss*) */
|
||||
|
||||
/* *packages*agile_telnet*.o(.bss .bss*) */
|
||||
/* *packages*agile_console*.o(.bss .bss*) */
|
||||
/* *packages*cJSON*.o(.bss .bss*) */
|
||||
/* *packages*CmBacktrace*.o(.bss .bss*)*/
|
||||
/* *packages*easyblink*.o(.bss .bss*) */
|
||||
/* *packages*webclient*.o(.bss .bss*) */
|
||||
/* *packages*netutils*.o(.bss .bss*) */
|
||||
/* *packages*syswatch*.o(.bss .bss*) */
|
||||
/* *packages*UrlEncode*.o(.bss .bss*) */
|
||||
|
||||
build\\kernel\\src\\*.o(.bss .bss*)
|
||||
/* build\\kernel\\libcpu\\*.o(.bss .bss*) */
|
||||
/* build\\kernel\\components\\libc\\*.o(.bss .bss*)
|
||||
/* build\\kernel\\components\\drivers\\*.o(.bss .bss*) */
|
||||
/* build\\kernel\\components\\dfs\\*.o(.bss .bss*) */
|
||||
build\\kernel\\components\\net\\lwip\\lwip-2.0.3\\*.o(.bss .bss*)
|
||||
/* build\\kernel\\components\\net\\lwip\\port\\**.o(.bss .bss*) */
|
||||
/* build\\kernel\\components\\net\\sal\\*.o(.bss .bss*) */
|
||||
/* build\\kernel\\components\\net\\netdev\\*.o(.bss .bss*) */
|
||||
/* build\\kernel\\components\\net\\sal_socket\\*.o(.bss .bss*) */
|
||||
|
||||
. = ALIGN(4);
|
||||
_eccm_bss = .; /* create a global symbol at ccmram end */
|
||||
} >CCMRAM
|
||||
|
||||
.stack :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sstack = .;
|
||||
. = . + _system_stack_size;
|
||||
. = ALIGN(4);
|
||||
_estack = .;
|
||||
} >RAM
|
||||
|
||||
__bss_start = .;
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .bss secion */
|
||||
_sbss = .;
|
||||
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
/* This is used by the startup in order to initialize the .bss secion */
|
||||
_ebss = . ;
|
||||
|
||||
*(.bss.init)
|
||||
} > RAM
|
||||
__bss_end = .;
|
||||
|
||||
_end = .;
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/* DWARF debug sections.
|
||||
* Symbols in the DWARF debugging sections are relative to the beginning
|
||||
* of the section so we begin them at 0. */
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
}
|
15
board/linker_scripts/link.sct
Normal file
15
board/linker_scripts/link.sct
Normal file
@ -0,0 +1,15 @@
|
||||
; *************************************************************
|
||||
; *** Scatter-Loading Description File generated by uVision ***
|
||||
; *************************************************************
|
||||
|
||||
LR_IROM1 0x08000000 0x00100000 { ; load region size_region
|
||||
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
|
||||
*.o (RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
RW_IRAM1 0x20000000 0x00020000 { ; RW data
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
}
|
||||
|
70
board/ports/SConscript
Normal file
70
board/ports/SConscript
Normal file
@ -0,0 +1,70 @@
|
||||
import os
|
||||
import rtconfig
|
||||
from building import *
|
||||
|
||||
Import('SDK_LIB')
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
# add general drivers
|
||||
src = []
|
||||
path = [cwd]
|
||||
|
||||
if GetDepend(['BSP_USING_ETH']):
|
||||
src += Glob('phy_reset.c')
|
||||
|
||||
if GetDepend(['BSP_USING_RS485']):
|
||||
src += Glob('drv_rs485.c')
|
||||
|
||||
if GetDepend(['BSP_USING_SOFT_SPI_FLASH']):
|
||||
src += Glob('soft_spi_flash_init.c')
|
||||
|
||||
if GetDepend(['BSP_USING_SPI_FLASH']):
|
||||
src += Glob('spi_flash_init.c')
|
||||
|
||||
if GetDepend(['BSP_USING_FS']):
|
||||
src += Glob('drv_filesystem.c')
|
||||
|
||||
if GetDepend(['BSP_USING_FAL']):
|
||||
src += Glob('fal/fal_spi_flash_sfud_port.c')
|
||||
path += [cwd + '/fal']
|
||||
|
||||
if GetDepend(['BSP_USING_SRAM']):
|
||||
src += Glob('drv_sram.c')
|
||||
|
||||
if GetDepend(['BSP_USING_ONBOARD_LCD']):
|
||||
src += Glob('lcd/drv_lcd.c')
|
||||
path += [cwd + '/lcd']
|
||||
|
||||
if GetDepend(['BSP_USING_ONBOARD_LED_MATRIX']):
|
||||
src += Glob('led_matrix/drv_matrix_led.c')
|
||||
path += [cwd + '/led_matrix']
|
||||
|
||||
if GetDepend(['BSP_USING_EASYFLASH']):
|
||||
src += Glob('ef_fal_port.c')
|
||||
|
||||
if GetDepend(['BSP_USING_ENC28j60']):
|
||||
src += Glob('drv_enc28j60.c')
|
||||
|
||||
if GetDepend(['BSP_USING_ONBOARD_PM']):
|
||||
src += Glob('pm/drv_pm.c')
|
||||
src += Glob('pm/drv_wakeup.c')
|
||||
path += [cwd + '/pm']
|
||||
|
||||
if GetDepend(['BSP_USING_AUDIO']):
|
||||
src += Glob('audio/drv_es8388.c')
|
||||
src += Glob('audio/drv_sound.c')
|
||||
path += [cwd + '/audio']
|
||||
|
||||
if GetDepend(['BSP_USING_AUDIO_RECORD']):
|
||||
src += Glob('audio/drv_mic.c')
|
||||
|
||||
CPPDEFINES = ['STM32F407xx']
|
||||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for item in list:
|
||||
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(item, 'SConscript'))
|
||||
|
||||
Return('group')
|
316
board/ports/audio/drv_es8388.c
Normal file
316
board/ports/audio/drv_es8388.c
Normal file
@ -0,0 +1,316 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Date Author Notes
|
||||
* 2019-07-31 Zero-Free first implementation
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include "drv_es8388.h"
|
||||
|
||||
/* ES8388 address */
|
||||
#define ES8388_ADDR 0x10 /*0x11:CE=1;0x10:CE=0*/
|
||||
|
||||
struct es8388_device
|
||||
{
|
||||
struct rt_i2c_bus_device *i2c;
|
||||
rt_uint16_t pin;
|
||||
};
|
||||
|
||||
static struct es8388_device es_dev = {0};
|
||||
|
||||
static rt_uint16_t reg_read(rt_uint8_t addr)
|
||||
{
|
||||
struct rt_i2c_msg msg[2] = {0};
|
||||
rt_uint8_t val = 0xff;
|
||||
|
||||
RT_ASSERT(es_dev.i2c != RT_NULL);
|
||||
|
||||
msg[0].addr = ES8388_ADDR;
|
||||
msg[0].flags = RT_I2C_WR;
|
||||
msg[0].len = 1;
|
||||
msg[0].buf = &addr;
|
||||
|
||||
msg[1].addr = ES8388_ADDR;
|
||||
msg[1].flags = RT_I2C_RD;
|
||||
msg[1].len = 1;
|
||||
msg[1].buf = &val;
|
||||
|
||||
if (rt_i2c_transfer(es_dev.i2c, msg, 2) != 2)
|
||||
{
|
||||
rt_kprintf("I2C read data failed, reg = 0x%02x. \n", addr);
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static void reg_write(rt_uint8_t addr, rt_uint8_t val)
|
||||
{
|
||||
struct rt_i2c_msg msgs[1] = {0};
|
||||
rt_uint8_t buff[2] = {0};
|
||||
|
||||
RT_ASSERT(es_dev.i2c != RT_NULL);
|
||||
|
||||
buff[0] = addr;
|
||||
buff[1] = val;
|
||||
|
||||
msgs[0].addr = ES8388_ADDR;
|
||||
msgs[0].flags = RT_I2C_WR;
|
||||
msgs[0].buf = buff;
|
||||
msgs[0].len = 2;
|
||||
|
||||
if (rt_i2c_transfer(es_dev.i2c, msgs, 1) != 1)
|
||||
{
|
||||
rt_kprintf("I2C write data failed, reg = 0x%2x. \n", addr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static int es8388_set_adc_dac_volume(int mode, int volume, int dot)
|
||||
{
|
||||
int res = 0;
|
||||
if (volume < -96 || volume > 0)
|
||||
{
|
||||
if (volume < -96)
|
||||
volume = -96;
|
||||
else
|
||||
volume = 0;
|
||||
}
|
||||
dot = (dot >= 5 ? 1 : 0);
|
||||
volume = (-volume << 1) + dot;
|
||||
if (mode == ES_MODE_ADC || mode == ES_MODE_DAC_ADC)
|
||||
{
|
||||
reg_write(ES8388_ADCCONTROL8, volume);
|
||||
reg_write(ES8388_ADCCONTROL9, volume); //ADC Right Volume=0db
|
||||
}
|
||||
if (mode == ES_MODE_DAC || mode == ES_MODE_DAC_ADC)
|
||||
{
|
||||
reg_write(ES8388_DACCONTROL5, volume);
|
||||
reg_write(ES8388_DACCONTROL4, volume);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void es8388_set_voice_mute(rt_bool_t enable)
|
||||
{
|
||||
rt_uint8_t reg = 0;
|
||||
|
||||
reg = reg_read(ES8388_DACCONTROL3);
|
||||
reg = reg & 0xFB;
|
||||
reg_write(ES8388_DACCONTROL3, reg | (((int)enable) << 2));
|
||||
}
|
||||
|
||||
rt_err_t es8388_init(const char *i2c_name, rt_uint16_t pin)
|
||||
{
|
||||
es_dev.i2c = rt_i2c_bus_device_find(i2c_name);
|
||||
if (es_dev.i2c == RT_NULL)
|
||||
{
|
||||
rt_kprintf("%s bus not found\n", i2c_name);
|
||||
return -RT_ERROR;
|
||||
}
|
||||
|
||||
es_dev.pin = pin;
|
||||
|
||||
reg_write(ES8388_DACCONTROL3, 0x04); // 0x04 mute/0x00 unmute&ramp;DAC unmute and disabled digital volume control soft ramp
|
||||
/* Chip Control and Power Management */
|
||||
reg_write(ES8388_CONTROL2, 0x50);
|
||||
reg_write(ES8388_CHIPPOWER, 0x00); //normal all and power up all
|
||||
reg_write(ES8388_MASTERMODE, 0x00); //TODO:CODEC IN I2S SLAVE MODE
|
||||
|
||||
/* dac */
|
||||
reg_write(ES8388_DACPOWER, 0xC0); //disable DAC and disable Lout/Rout/1/2
|
||||
reg_write(ES8388_CONTROL1, 0x12); //Enfr=0,Play&Record Mode,(0x17-both of mic&paly)
|
||||
// reg_write(ES8388_CONTROL2, 0); //LPVrefBuf=0,Pdn_ana=0
|
||||
reg_write(ES8388_DACCONTROL1, 0x18);//1a 0x18:16bit iis , 0x00:24
|
||||
reg_write(ES8388_DACCONTROL2, 0x02); //DACFsMode,SINGLE SPEED; DACFsRatio,256
|
||||
reg_write(ES8388_DACCONTROL16, 0x00); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2
|
||||
reg_write(ES8388_DACCONTROL17, 0x9C); // only left DAC to left mixer enable 0db
|
||||
reg_write(ES8388_DACCONTROL20, 0x9C); // only right DAC to right mixer enable 0db
|
||||
reg_write(ES8388_DACCONTROL21, 0x80); //set internal ADC and DAC use the same LRCK clock, ADC LRCK as internal LRCK
|
||||
reg_write(ES8388_DACCONTROL23, 0x00); //vroi=0
|
||||
es8388_set_adc_dac_volume(ES_MODE_DAC, 0, 0); // 0db
|
||||
|
||||
reg_write(ES8388_DACPOWER, 0x3c); //0x3c Enable DAC and Enable Lout/Rout/1/2
|
||||
/* adc */
|
||||
reg_write(ES8388_ADCPOWER, 0xFF);
|
||||
reg_write(ES8388_ADCCONTROL1, 0xbb); // MIC Left and Right channel PGA gain
|
||||
reg_write(ES8388_ADCCONTROL2, 0x00); //0x00 LINSEL & RINSEL, LIN1/RIN1 as ADC Input; DSSEL,use one DS Reg11; DSR, LINPUT1-RINPUT1
|
||||
reg_write(ES8388_ADCCONTROL3, 0x02);
|
||||
reg_write(ES8388_ADCCONTROL4, 0x0d); // Left/Right data, Left/Right justified mode, Bits length, I2S format
|
||||
reg_write(ES8388_ADCCONTROL5, 0x02); //ADCFsMode,singel SPEED,RATIO=256
|
||||
//ALC for Microphone
|
||||
es8388_set_adc_dac_volume(ES_MODE_ADC, 0, 0); // 0db
|
||||
reg_write(ES8388_ADCPOWER, 0x09); //Power on ADC, Enable LIN&RIN, Power off MICBIAS, set int1lp to low power mode
|
||||
/* enable es8388 PA */
|
||||
es8388_pa_power(RT_TRUE);
|
||||
|
||||
reg_write(ES8388_DACCONTROL24, 0x1E); // LOUT1VOL balanced noise: 0x18
|
||||
reg_write(ES8388_DACCONTROL25, 0x1E); // ROUT1VOL balanced noise: 0x18
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
rt_err_t es8388_start(enum es8388_mode mode)
|
||||
{
|
||||
int res = 0;
|
||||
rt_uint8_t prev_data = 0, data = 0;
|
||||
|
||||
prev_data = reg_read(ES8388_DACCONTROL21);
|
||||
if (mode == ES_MODE_LINE)
|
||||
{
|
||||
reg_write(ES8388_DACCONTROL16, 0x09); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2 by pass enable
|
||||
reg_write(ES8388_DACCONTROL17, 0x50); // left DAC to left mixer enable and LIN signal to left mixer enable 0db : bupass enable
|
||||
reg_write(ES8388_DACCONTROL20, 0x50); // right DAC to right mixer enable and LIN signal to right mixer enable 0db : bupass enable
|
||||
reg_write(ES8388_DACCONTROL21, 0xC0); //enable adc
|
||||
}
|
||||
else
|
||||
{
|
||||
reg_write(ES8388_DACCONTROL21, 0x80); //enable dac
|
||||
}
|
||||
data = reg_read(ES8388_DACCONTROL21);
|
||||
|
||||
if (prev_data != data)
|
||||
{
|
||||
reg_write(ES8388_CHIPPOWER, 0xF0); //start state machine
|
||||
// reg_write(ES8388_ADDR, ES8388_CONTROL1, 0x16);
|
||||
// reg_write(ES8388_ADDR, ES8388_CONTROL2, 0x50);
|
||||
reg_write(ES8388_CHIPPOWER, 0x00); //start state machine
|
||||
}
|
||||
if (mode == ES_MODE_ADC || mode == ES_MODE_DAC_ADC || mode == ES_MODE_LINE)
|
||||
{
|
||||
reg_write(ES8388_ADCPOWER, 0x00); //power up adc and line in
|
||||
}
|
||||
if (mode == ES_MODE_DAC || mode == ES_MODE_DAC_ADC || mode == ES_MODE_LINE)
|
||||
{
|
||||
reg_write(ES8388_DACPOWER, 0x3c); //power up dac and line out
|
||||
es8388_set_voice_mute(RT_FALSE);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
rt_err_t es8388_stop(enum es8388_mode mode)
|
||||
{
|
||||
int res = 0;
|
||||
if (mode == ES_MODE_LINE)
|
||||
{
|
||||
reg_write(ES8388_DACCONTROL21, 0x80); //enable dac
|
||||
reg_write(ES8388_DACCONTROL16, 0x00); // 0x00 audio on LIN1&RIN1, 0x09 LIN2&RIN2
|
||||
reg_write(ES8388_DACCONTROL17, 0x90); // only left DAC to left mixer enable 0db
|
||||
reg_write(ES8388_DACCONTROL20, 0x90); // only right DAC to right mixer enable 0db
|
||||
return res;
|
||||
}
|
||||
if (mode == ES_MODE_DAC || mode == ES_MODE_DAC_ADC)
|
||||
{
|
||||
reg_write(ES8388_DACPOWER, 0x00);
|
||||
es8388_set_voice_mute(RT_TRUE); //res |= Es8388SetAdcDacVolume(ES_MODULE_DAC, -96, 5); // 0db
|
||||
// reg_write(ES8388_ADDR, ES8388_DACPOWER, 0xC0); //power down dac and line out
|
||||
}
|
||||
if (mode == ES_MODE_ADC || mode == ES_MODE_DAC_ADC)
|
||||
{
|
||||
// Es8388SetAdcDacVolume(ES_MODULE_ADC, -96, 5); // 0db
|
||||
reg_write(ES8388_ADCPOWER, 0xFF); //power down adc and line in
|
||||
}
|
||||
if (mode == ES_MODE_DAC_ADC)
|
||||
{
|
||||
reg_write(ES8388_DACCONTROL21, 0x9C); //disable mclk
|
||||
// reg_write(ES8388_CONTROL1, 0x00);
|
||||
// reg_write(ES8388_CONTROL2, 0x58);
|
||||
// reg_write(ES8388_CHIPPOWER, 0xF3); //stop state machine
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
rt_err_t es8388_fmt_set(enum es8388_mode mode, enum es8388_format fmt)
|
||||
{
|
||||
rt_uint8_t reg = 0;
|
||||
|
||||
if (mode == ES_MODE_ADC || mode == ES_MODE_DAC_ADC)
|
||||
{
|
||||
reg = reg_read(ES8388_ADCCONTROL4);
|
||||
reg = reg & 0xfc;
|
||||
reg_write(ES8388_ADCCONTROL4, reg | fmt);
|
||||
}
|
||||
if (mode == ES_MODE_DAC || mode == ES_MODE_DAC_ADC)
|
||||
{
|
||||
reg = reg_read(ES8388_DACCONTROL1);
|
||||
reg = reg & 0xf9;
|
||||
reg_write(ES8388_DACCONTROL1, reg | (fmt << 1));
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
void es8388_volume_set(rt_uint8_t volume)
|
||||
{
|
||||
uint32_t real_vol = 0;
|
||||
volume = 100 - volume;
|
||||
if (volume > 100)
|
||||
volume = 100;
|
||||
|
||||
real_vol = 192 * volume / 100;
|
||||
|
||||
reg_write(ES8388_DACCONTROL4, (rt_uint8_t)real_vol); // DAC L
|
||||
reg_write(ES8388_DACCONTROL5, (rt_uint8_t)real_vol); // DAC R
|
||||
}
|
||||
|
||||
rt_uint8_t es8388_volume_get(void)
|
||||
{
|
||||
rt_uint8_t volume;
|
||||
|
||||
volume = reg_read(ES8388_DACCONTROL24);
|
||||
if (volume == 0xff)
|
||||
{
|
||||
volume = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
volume *= 3;
|
||||
if (volume == 99)
|
||||
volume = 100;
|
||||
}
|
||||
|
||||
return volume;
|
||||
}
|
||||
|
||||
void es8388_pa_power(rt_bool_t enable)
|
||||
{
|
||||
rt_pin_mode(es_dev.pin, PIN_MODE_OUTPUT);
|
||||
|
||||
if (enable)
|
||||
{
|
||||
rt_pin_write(es_dev.pin, PIN_HIGH);
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_pin_write(es_dev.pin, PIN_LOW);
|
||||
}
|
||||
}
|
||||
|
||||
void estest()
|
||||
{
|
||||
|
||||
// reg_write(ES8388_DACCONTROL24, volume);
|
||||
reg_write(ES8388_ADCCONTROL1, 0x88); /* R9,左右通道PGA增益设置 */
|
||||
reg_write(ES8388_ADCCONTROL2, 0x10); // 使用板载麦克风
|
||||
// reg_write(ES8388_ADCCONTROL2,0x50); // 使用耳机麦克风
|
||||
// reg_write(ES8388_ADCCONTROL3, 0xC0);
|
||||
reg_write(ES8388_ADCCONTROL8, 0x00); // LADCVOL
|
||||
reg_write(ES8388_ADCCONTROL9, 0x00); // RADCVOL
|
||||
reg_write(ES8388_DACCONTROL16, 0x1B); // LMIXSEL RMIXSEL
|
||||
reg_write(ES8388_DACCONTROL17, 0x40); // LI2LOVOL
|
||||
|
||||
reg_write(ES8388_DACCONTROL24, 0x21); // LOUT1VOL
|
||||
reg_write(ES8388_DACCONTROL25, 0x21); // ROUT1VOL
|
||||
|
||||
reg_write(ES8388_DACCONTROL24, 33); // LOUT1VOL balanced noise: 0x18
|
||||
reg_write(ES8388_DACCONTROL25, 33); // ROUT1VOL balanced noise: 0x18
|
||||
|
||||
|
||||
}
|
||||
MSH_CMD_EXPORT(estest, test mic loop)
|
95
board/ports/audio/drv_es8388.h
Normal file
95
board/ports/audio/drv_es8388.h
Normal file
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Date Author Notes
|
||||
* 2019-07-31 Zero-Free first implementation
|
||||
*/
|
||||
|
||||
#ifndef __DRV_ES8388_H__
|
||||
#define __DRV_ES8388_H__
|
||||
|
||||
/* ES8388 register space */
|
||||
#define ES8388_CONTROL1 0x00
|
||||
#define ES8388_CONTROL2 0x01
|
||||
#define ES8388_CHIPPOWER 0x02
|
||||
#define ES8388_ADCPOWER 0x03
|
||||
#define ES8388_DACPOWER 0x04
|
||||
#define ES8388_CHIPLOPOW1 0x05
|
||||
#define ES8388_CHIPLOPOW2 0x06
|
||||
#define ES8388_ANAVOLMANAG 0x07
|
||||
#define ES8388_MASTERMODE 0x08
|
||||
#define ES8388_ADCCONTROL1 0x09
|
||||
#define ES8388_ADCCONTROL2 0x0a
|
||||
#define ES8388_ADCCONTROL3 0x0b
|
||||
#define ES8388_ADCCONTROL4 0x0c
|
||||
#define ES8388_ADCCONTROL5 0x0d
|
||||
#define ES8388_ADCCONTROL6 0x0e
|
||||
#define ES8388_ADCCONTROL7 0x0f
|
||||
#define ES8388_ADCCONTROL8 0x10
|
||||
#define ES8388_ADCCONTROL9 0x11
|
||||
#define ES8388_ADCCONTROL10 0x12
|
||||
#define ES8388_ADCCONTROL11 0x13
|
||||
#define ES8388_ADCCONTROL12 0x14
|
||||
#define ES8388_ADCCONTROL13 0x15
|
||||
#define ES8388_ADCCONTROL14 0x16
|
||||
|
||||
#define ES8388_DACCONTROL1 0x17
|
||||
#define ES8388_DACCONTROL2 0x18
|
||||
#define ES8388_DACCONTROL3 0x19
|
||||
#define ES8388_DACCONTROL4 0x1a
|
||||
#define ES8388_DACCONTROL5 0x1b
|
||||
#define ES8388_DACCONTROL6 0x1c
|
||||
#define ES8388_DACCONTROL7 0x1d
|
||||
#define ES8388_DACCONTROL8 0x1e
|
||||
#define ES8388_DACCONTROL9 0x1f
|
||||
#define ES8388_DACCONTROL10 0x20
|
||||
#define ES8388_DACCONTROL11 0x21
|
||||
#define ES8388_DACCONTROL12 0x22
|
||||
#define ES8388_DACCONTROL13 0x23
|
||||
#define ES8388_DACCONTROL14 0x24
|
||||
#define ES8388_DACCONTROL15 0x25
|
||||
#define ES8388_DACCONTROL16 0x26
|
||||
#define ES8388_DACCONTROL17 0x27
|
||||
#define ES8388_DACCONTROL18 0x28
|
||||
#define ES8388_DACCONTROL19 0x29
|
||||
#define ES8388_DACCONTROL20 0x2a
|
||||
#define ES8388_DACCONTROL21 0x2b
|
||||
#define ES8388_DACCONTROL22 0x2c
|
||||
#define ES8388_DACCONTROL23 0x2d
|
||||
#define ES8388_DACCONTROL24 0x2e
|
||||
#define ES8388_DACCONTROL25 0x2f
|
||||
#define ES8388_DACCONTROL26 0x30
|
||||
#define ES8388_DACCONTROL27 0x31
|
||||
#define ES8388_DACCONTROL28 0x32
|
||||
#define ES8388_DACCONTROL29 0x33
|
||||
#define ES8388_DACCONTROL30 0x34
|
||||
|
||||
enum es8388_mode
|
||||
{
|
||||
ES_MODE_NONE = 0x00,
|
||||
ES_MODE_DAC = 0x01,
|
||||
ES_MODE_ADC = 0x02,
|
||||
ES_MODE_DAC_ADC = 0x03,
|
||||
ES_MODE_LINE = 0x04,
|
||||
ES_MODE_MAX = 0x06,
|
||||
};
|
||||
|
||||
enum es8388_format
|
||||
{
|
||||
ES_FMT_NORMAL = 0,
|
||||
ES_FMT_LEFT = 1,
|
||||
ES_FMT_RIGHT = 2,
|
||||
ES_FMT_DSP = 3,
|
||||
};
|
||||
|
||||
rt_err_t es8388_init(const char *i2c_name, rt_uint16_t pin);
|
||||
rt_err_t es8388_start(enum es8388_mode mode);
|
||||
rt_err_t es8388_stop(enum es8388_mode mode);
|
||||
rt_err_t es8388_fmt_set(enum es8388_mode mode, enum es8388_format fmt);
|
||||
void es8388_volume_set(rt_uint8_t volume);
|
||||
rt_uint8_t es8388_volume_get(void);
|
||||
void es8388_pa_power(rt_bool_t enable);
|
||||
|
||||
#endif
|
366
board/ports/audio/drv_mic.c
Normal file
366
board/ports/audio/drv_mic.c
Normal file
@ -0,0 +1,366 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Date Author Notes
|
||||
* 2019-07-31 Zero-Free first implementation
|
||||
*/
|
||||
|
||||
#include <board.h>
|
||||
|
||||
#include "drv_es8388.h"
|
||||
|
||||
#define DBG_TAG "drv.mic"
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
#define RX_FIFO_SIZE (1024)
|
||||
|
||||
struct mic_device
|
||||
{
|
||||
struct rt_audio_device audio;
|
||||
struct rt_audio_configure record_config;
|
||||
rt_uint8_t *rx_fifo;
|
||||
rt_uint8_t volume;
|
||||
};
|
||||
|
||||
static struct mic_device mic_dev = {0};
|
||||
static rt_uint16_t zero_frame[2] = {0};
|
||||
static I2S_HandleTypeDef I2S3_Handler = {0};
|
||||
static DMA_HandleTypeDef I2S3_RXDMA_Handler = {0};
|
||||
|
||||
static void I2S3_Init(void)
|
||||
{
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
|
||||
PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_I2S;
|
||||
PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
|
||||
PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
HAL_I2S_DeInit(&I2S3_Handler);
|
||||
|
||||
I2S3_Handler.Instance = I2S3ext;
|
||||
I2S3_Handler.Init.Mode = I2S_MODE_SLAVE_RX;
|
||||
I2S3_Handler.Init.Standard = I2S_STANDARD_PHILIPS;
|
||||
I2S3_Handler.Init.DataFormat = I2S_DATAFORMAT_16B;
|
||||
I2S3_Handler.Init.MCLKOutput = I2S_MCLKOUTPUT_ENABLE;
|
||||
I2S3_Handler.Init.AudioFreq = I2S_AUDIOFREQ_DEFAULT;
|
||||
I2S3_Handler.Init.CPOL = I2S_CPOL_LOW;
|
||||
I2S3_Handler.Init.ClockSource = I2S_CLOCK_PLL;
|
||||
I2S3_Handler.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_ENABLE;
|
||||
if (HAL_I2S_Init(&I2S3_Handler) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
SET_BIT(I2S3_Handler.Instance->CR2, SPI_CR2_RXDMAEN);
|
||||
__HAL_I2S_ENABLE(&I2S3_Handler);
|
||||
|
||||
/* Configure DMA used for I2S3 */
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
I2S3_RXDMA_Handler.Instance = DMA1_Stream2;
|
||||
I2S3_RXDMA_Handler.Init.Channel = DMA_CHANNEL_2;
|
||||
I2S3_RXDMA_Handler.Init.Direction = DMA_PERIPH_TO_MEMORY;
|
||||
I2S3_RXDMA_Handler.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||
I2S3_RXDMA_Handler.Init.MemInc = DMA_MINC_ENABLE;
|
||||
I2S3_RXDMA_Handler.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
|
||||
I2S3_RXDMA_Handler.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
|
||||
I2S3_RXDMA_Handler.Init.Mode = DMA_CIRCULAR;
|
||||
I2S3_RXDMA_Handler.Init.Priority = DMA_PRIORITY_MEDIUM;
|
||||
I2S3_RXDMA_Handler.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
|
||||
__HAL_LINKDMA(&I2S3_Handler,hdmarx,I2S3_RXDMA_Handler);
|
||||
HAL_DMA_DeInit(&I2S3_RXDMA_Handler);
|
||||
HAL_DMA_Init(&I2S3_RXDMA_Handler);
|
||||
|
||||
__HAL_DMA_DISABLE(&I2S3_RXDMA_Handler);
|
||||
__HAL_DMA_ENABLE_IT(&I2S3_RXDMA_Handler, DMA_IT_TC); /* 开启传输完成中断 */
|
||||
__HAL_DMA_CLEAR_FLAG(&I2S3_RXDMA_Handler, DMA_FLAG_TCIF2_6);
|
||||
|
||||
HAL_NVIC_SetPriority(DMA1_Stream2_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Stream2_IRQn);
|
||||
}
|
||||
|
||||
void DMA1_Stream2_IRQHandler(void)
|
||||
{
|
||||
rt_audio_rx_done(&mic_dev.audio, &mic_dev.rx_fifo[0], RX_FIFO_SIZE);
|
||||
HAL_DMA_IRQHandler(&I2S3_RXDMA_Handler);
|
||||
}
|
||||
|
||||
static rt_err_t mic_getcaps(struct rt_audio_device *audio, struct rt_audio_caps *caps)
|
||||
{
|
||||
rt_err_t result = RT_EOK;
|
||||
struct mic_device *mic_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
mic_dev = (struct mic_device *)audio->parent.user_data;
|
||||
|
||||
switch (caps->main_type)
|
||||
{
|
||||
case AUDIO_TYPE_QUERY: /* qurey the types of hw_codec device */
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_TYPE_QUERY:
|
||||
caps->udata.mask = AUDIO_TYPE_INPUT | AUDIO_TYPE_MIXER;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_TYPE_INPUT: /* Provide capabilities of INPUT unit */
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_DSP_PARAM:
|
||||
caps->udata.config.samplerate = mic_dev->record_config.samplerate;
|
||||
caps->udata.config.channels = mic_dev->record_config.channels;
|
||||
caps->udata.config.samplebits = mic_dev->record_config.samplebits;
|
||||
break;
|
||||
|
||||
case AUDIO_DSP_SAMPLERATE:
|
||||
caps->udata.config.samplerate = mic_dev->record_config.samplerate;
|
||||
break;
|
||||
|
||||
case AUDIO_DSP_CHANNELS:
|
||||
caps->udata.config.channels = mic_dev->record_config.channels;
|
||||
break;
|
||||
|
||||
case AUDIO_DSP_SAMPLEBITS:
|
||||
caps->udata.config.samplebits = mic_dev->record_config.samplebits;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_TYPE_MIXER: /* report the Mixer Units */
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_MIXER_QUERY:
|
||||
caps->udata.mask = AUDIO_MIXER_VOLUME | AUDIO_MIXER_LINE;
|
||||
break;
|
||||
|
||||
case AUDIO_MIXER_VOLUME:
|
||||
caps->udata.value = mic_dev->volume;
|
||||
break;
|
||||
|
||||
case AUDIO_MIXER_LINE:
|
||||
break;
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static rt_err_t mic_configure(struct rt_audio_device *audio, struct rt_audio_caps *caps)
|
||||
{
|
||||
rt_err_t result = RT_EOK;
|
||||
struct mic_device *mic_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
mic_dev = (struct mic_device *)audio->parent.user_data;
|
||||
|
||||
switch (caps->main_type)
|
||||
{
|
||||
case AUDIO_TYPE_MIXER:
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_MIXER_VOLUME:
|
||||
{
|
||||
rt_uint32_t volume = caps->udata.value;
|
||||
mic_dev->volume = volume;
|
||||
LOG_D("set volume %d", volume);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_TYPE_INPUT:
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_DSP_PARAM:
|
||||
{
|
||||
// SAIA_Frequency_Set(caps->udata.config.samplerate);
|
||||
HAL_I2S_DMAStop(&I2S3_Handler);
|
||||
// SAIB_Channels_Set(caps->udata.config.channels);
|
||||
HAL_I2S_Transmit(&I2S3_Handler, (uint16_t *)&zero_frame[0], 2, 0);
|
||||
HAL_I2S_Receive_DMA(&I2S3_Handler, (uint16_t *)mic_dev->rx_fifo, RX_FIFO_SIZE / 2);
|
||||
|
||||
/* save configs */
|
||||
mic_dev->record_config.samplerate = caps->udata.config.samplerate;
|
||||
mic_dev->record_config.channels = caps->udata.config.channels;
|
||||
mic_dev->record_config.samplebits = caps->udata.config.samplebits;
|
||||
LOG_D("set samplerate %d", mic_dev->record_config.samplerate);
|
||||
LOG_D("set channels %d", mic_dev->record_config.channels);
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_DSP_SAMPLERATE:
|
||||
{
|
||||
mic_dev->record_config.samplerate = caps->udata.config.samplerate;
|
||||
LOG_D("set channels %d", mic_dev->record_config.channels);
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_DSP_CHANNELS:
|
||||
{
|
||||
mic_dev->record_config.channels = caps->udata.config.channels;
|
||||
LOG_D("set channels %d", mic_dev->record_config.channels);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static rt_err_t mic_init(struct rt_audio_device *audio)
|
||||
{
|
||||
struct mic_device *mic_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
mic_dev = (struct mic_device *)audio->parent.user_data;
|
||||
|
||||
es8388_init("i2c2", RT_NULL);
|
||||
I2S3_Init();
|
||||
LOG_I("ES8388 init success.");
|
||||
/* set default params */
|
||||
// SAIB_Channels_Set(mic_dev->record_config.channels);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
static rt_err_t sound_init(struct rt_audio_device *audio)
|
||||
{
|
||||
rt_err_t result = RT_EOK;
|
||||
struct sound_device *snd_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
snd_dev = (struct sound_device *)audio->parent.user_data;
|
||||
|
||||
I2S3_Init();
|
||||
es8388_init("i2c2", RT_NULL);
|
||||
/* set default params */
|
||||
// I2S_Frequency_Set(snd_dev->replay_config.samplerate);
|
||||
// SAIA_Channels_Set(snd_dev->replay_config.channels);
|
||||
|
||||
return result;
|
||||
}
|
||||
static rt_err_t mic_start(struct rt_audio_device *audio, int stream)
|
||||
{
|
||||
struct mic_device *mic_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
mic_dev = (struct mic_device *)audio->parent.user_data;
|
||||
|
||||
if (stream == AUDIO_STREAM_RECORD)
|
||||
{
|
||||
es8388_start(ES_MODE_ADC);
|
||||
HAL_I2S_Transmit(&I2S3_Handler, (uint16_t *)&zero_frame[0], 2, 0);
|
||||
// HAL_I2S_Receive_DMA(&I2S3_Handler, (uint16_t *)mic_dev->rx_fifo, RX_FIFO_SIZE / 2);
|
||||
while(1)
|
||||
{
|
||||
HAL_I2S_Receive(&I2S3_Handler, (uint16_t *)mic_dev->rx_fifo, RX_FIFO_SIZE / 2,10);
|
||||
for(int i=0;i<RX_FIFO_SIZE;i++)
|
||||
{
|
||||
rt_kprintf("%x",mic_dev->rx_fifo[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static rt_err_t mic_stop(struct rt_audio_device *audio, int stream)
|
||||
{
|
||||
if (stream == AUDIO_STREAM_RECORD)
|
||||
{
|
||||
HAL_I2S_DMAStop(&I2S3_Handler);
|
||||
es8388_stop(ES_MODE_ADC);
|
||||
LOG_D("mic stop.");
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static struct rt_audio_ops mic_ops =
|
||||
{
|
||||
.getcaps = mic_getcaps,
|
||||
.configure = mic_configure,
|
||||
.init = mic_init,
|
||||
.start = mic_start,
|
||||
.stop = mic_stop,
|
||||
.transmit = RT_NULL,
|
||||
.buffer_info = RT_NULL,
|
||||
};
|
||||
|
||||
int rt_hw_mic_init(void)
|
||||
{
|
||||
rt_uint8_t *rx_fifo;
|
||||
|
||||
if (mic_dev.rx_fifo)
|
||||
return RT_EOK;
|
||||
|
||||
rx_fifo = rt_malloc(RX_FIFO_SIZE);
|
||||
if (rx_fifo == RT_NULL)
|
||||
return -RT_ENOMEM;
|
||||
rt_memset(rx_fifo, 0, RX_FIFO_SIZE);
|
||||
mic_dev.rx_fifo = rx_fifo;
|
||||
|
||||
/* init default configuration */
|
||||
{
|
||||
mic_dev.record_config.samplerate = 44100;
|
||||
mic_dev.record_config.channels = 2;
|
||||
mic_dev.record_config.samplebits = 16;
|
||||
mic_dev.volume = 55;
|
||||
}
|
||||
|
||||
/* register sound device */
|
||||
mic_dev.audio.ops = &mic_ops;
|
||||
rt_audio_register(&mic_dev.audio, "mic0", RT_DEVICE_FLAG_RDONLY, &mic_dev);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
INIT_DEVICE_EXPORT(rt_hw_mic_init);
|
514
board/ports/audio/drv_sound.c
Normal file
514
board/ports/audio/drv_sound.c
Normal file
@ -0,0 +1,514 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Date Author Notes
|
||||
* 2019-07-31 Zero-Free first implementation
|
||||
*/
|
||||
|
||||
#include <board.h>
|
||||
|
||||
#include "drv_sound.h"
|
||||
#include "drv_es8388.h"
|
||||
|
||||
#define DBG_TAG "drv.sound"
|
||||
#define DBG_LVL DBG_LOG
|
||||
#include <rtdbg.h>
|
||||
|
||||
#define TX_FIFO_SIZE (2048)
|
||||
|
||||
struct sound_device
|
||||
{
|
||||
struct rt_audio_device audio;
|
||||
struct rt_audio_configure replay_config;
|
||||
rt_uint8_t *tx_fifo;
|
||||
rt_uint8_t volume;
|
||||
};
|
||||
|
||||
static struct sound_device snd_dev = {0};
|
||||
static I2S_HandleTypeDef I2S3_Handler = {0};
|
||||
static DMA_HandleTypeDef I2S3_TXDMA_Handler = {0};
|
||||
|
||||
/**
|
||||
* 采样率计算公式:Fs=I2SxCLK/[256*(2*I2SDIV+ODD)]
|
||||
* I2SxCLK=(HSE/pllm)*PLLI2SN/PLLI2SR
|
||||
* 一般HSE=8Mhz
|
||||
* pllm:在Sys_Clock_Set设置的时候确定,一般是8
|
||||
* PLLI2SN:一般是192~432
|
||||
* PLLI2SR:2~7
|
||||
* I2SDIV:2~255
|
||||
* ODD:0/1
|
||||
* I2S分频系数表@pllm=8,HSE=8Mhz,即vco输入频率为1Mhz
|
||||
* 表格式:采样率/10,PLLI2SN,PLLI2SR,I2SDIV,ODD
|
||||
*/
|
||||
const uint16_t I2S_PSC_TBL[][5]=
|
||||
{
|
||||
{ 800, 256, 5, 12, 1 }, /* 8Khz采样率 */
|
||||
{ 1102, 429, 4, 19, 0 }, /* 11.025Khz采样率 */
|
||||
{ 1600, 213, 2, 13, 0 }, /* 16Khz采样率 */
|
||||
{ 2205, 429, 4, 9, 1 }, /* 22.05Khz采样率 */
|
||||
{ 3200, 213, 2, 6, 1 }, /* 32Khz采样率 */
|
||||
{ 4410, 271, 2, 6, 0 }, /* 44.1Khz采样率 */
|
||||
{ 4800, 258, 3, 3, 1 }, /* 48Khz采样率 */
|
||||
{ 8820, 316, 2, 3, 1 }, /* 88.2Khz采样率 */
|
||||
{ 9600, 344, 2, 3, 1 }, /* 96Khz采样率 */
|
||||
{ 17640, 361, 2, 2, 0 }, /* 176.4Khz采样率 */
|
||||
{ 19200, 393, 2, 2, 0 }, /* 192Khz采样率 */
|
||||
};
|
||||
|
||||
|
||||
static void I2S3_Init(void)
|
||||
{
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
|
||||
|
||||
PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_I2S;
|
||||
PeriphClkInitStruct.PLLI2S.PLLI2SN = 192;
|
||||
PeriphClkInitStruct.PLLI2S.PLLI2SR = 2;
|
||||
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
HAL_I2S_DeInit(&I2S3_Handler);
|
||||
|
||||
I2S3_Handler.Instance = SPI3;
|
||||
I2S3_Handler.Init.Mode = I2S_MODE_MASTER_TX;
|
||||
I2S3_Handler.Init.Standard = I2S_STANDARD_PHILIPS;
|
||||
I2S3_Handler.Init.DataFormat = I2S_DATAFORMAT_16B;
|
||||
I2S3_Handler.Init.MCLKOutput = I2S_MCLKOUTPUT_ENABLE;
|
||||
I2S3_Handler.Init.AudioFreq = I2S_AUDIOFREQ_44K;
|
||||
I2S3_Handler.Init.CPOL = I2S_CPOL_LOW;
|
||||
I2S3_Handler.Init.ClockSource = I2S_CLOCK_PLL;
|
||||
I2S3_Handler.Init.FullDuplexMode = I2S_FULLDUPLEXMODE_ENABLE;
|
||||
if (HAL_I2S_Init(&I2S3_Handler) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
SET_BIT(I2S3_Handler.Instance->CR2, SPI_CR2_TXDMAEN);
|
||||
__HAL_I2S_ENABLE(&I2S3_Handler);
|
||||
|
||||
/* Configure DMA used for I2S3 */
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
I2S3_TXDMA_Handler.Instance = DMA1_Stream7;
|
||||
I2S3_TXDMA_Handler.Init.Channel = DMA_CHANNEL_0;
|
||||
I2S3_TXDMA_Handler.Init.Direction = DMA_MEMORY_TO_PERIPH;
|
||||
I2S3_TXDMA_Handler.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||
I2S3_TXDMA_Handler.Init.MemInc = DMA_MINC_ENABLE;
|
||||
I2S3_TXDMA_Handler.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
|
||||
I2S3_TXDMA_Handler.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
|
||||
I2S3_TXDMA_Handler.Init.Mode = DMA_CIRCULAR;
|
||||
I2S3_TXDMA_Handler.Init.Priority = DMA_PRIORITY_HIGH;
|
||||
I2S3_TXDMA_Handler.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
|
||||
__HAL_LINKDMA(&I2S3_Handler,hdmatx,I2S3_TXDMA_Handler);
|
||||
HAL_DMA_DeInit(&I2S3_TXDMA_Handler);
|
||||
HAL_DMA_Init(&I2S3_TXDMA_Handler);
|
||||
// __HAL_DMA_ENABLE(&I2S3_TXDMA_Handler);
|
||||
|
||||
__HAL_DMA_DISABLE(&I2S3_TXDMA_Handler);
|
||||
__HAL_DMA_ENABLE_IT(&I2S3_TXDMA_Handler, DMA_IT_TC); /* 开启传输完成中断 */
|
||||
__HAL_DMA_CLEAR_FLAG(&I2S3_TXDMA_Handler, DMA_FLAG_TCIF0_4);
|
||||
|
||||
HAL_NVIC_SetPriority(DMA1_Stream7_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Stream7_IRQn);
|
||||
}
|
||||
|
||||
void DMA1_Stream7_IRQHandler(void)
|
||||
{
|
||||
rt_audio_tx_complete(&snd_dev.audio);
|
||||
HAL_DMA_IRQHandler(&I2S3_TXDMA_Handler);
|
||||
}
|
||||
|
||||
|
||||
//void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai)
|
||||
//{
|
||||
// if (hsai == &SAI1A_Handler)
|
||||
// {
|
||||
// rt_audio_tx_complete(&snd_dev.audio);
|
||||
// }
|
||||
//}
|
||||
|
||||
//void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
|
||||
//{
|
||||
// if (hsai == &SAI1A_Handler)
|
||||
// {
|
||||
// rt_audio_tx_complete(&snd_dev.audio);
|
||||
// }
|
||||
//}
|
||||
|
||||
void I2S_Frequency_Set(uint32_t samplerate)
|
||||
{
|
||||
|
||||
// uint8_t i = 0;
|
||||
// uint32_t tempreg = 0;
|
||||
|
||||
// RCC_PeriphCLKInitTypeDef rcc_i2s_clkinit_struct;
|
||||
|
||||
// for (i = 0; i < (sizeof(I2S_PSC_TBL) / 10); i++) /* 看看改采样率是否可以支持 */
|
||||
// {
|
||||
// if ((samplerate / 10) == I2S_PSC_TBL[i][0])
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (i == (sizeof(I2S_PSC_TBL) / 10))
|
||||
// {
|
||||
// LOG_E("samplerate not supported.");
|
||||
// // return 1; /* 找不到 */
|
||||
// }
|
||||
|
||||
// rcc_i2s_clkinit_struct.PeriphClockSelection = RCC_PERIPHCLK_I2S; /* 外设时钟源选择 */
|
||||
// rcc_i2s_clkinit_struct.PLLI2S.PLLI2SN = (uint32_t)I2S_PSC_TBL[i][1]; /* 设置PLLI2SN */
|
||||
// rcc_i2s_clkinit_struct.PLLI2S.PLLI2SR = (uint32_t)I2S_PSC_TBL[i][2]; /* 设置PLLI2SR */
|
||||
// HAL_RCCEx_PeriphCLKConfig(&rcc_i2s_clkinit_struct); /* 设置时钟 */
|
||||
|
||||
// RCC->CR |= 1 << 26; /* 开启I2S时钟 */
|
||||
// while((RCC->CR & 1 << 27) == 0); /* 等待I2S时钟开启成功. */
|
||||
// tempreg = I2S_PSC_TBL[i][3] << 0; /* 设置I2SDIV */
|
||||
// tempreg |= I2S_PSC_TBL[i][4] << 8; /* 设置ODD位 */
|
||||
// tempreg |= 1 << 9; /* 使能MCKOE位,输出MCK */
|
||||
// I2S3_Handler.Instance->I2SPR = tempreg; /* 设置I2SPR寄存器 */
|
||||
|
||||
// return 0;
|
||||
|
||||
// RCC_PeriphCLKInitTypeDef PeriphClkInit;
|
||||
|
||||
// HAL_RCCEx_GetPeriphCLKConfig(&PeriphClkInit);
|
||||
|
||||
// if ((frequency == SAI_AUDIO_FREQUENCY_11K) || (frequency == SAI_AUDIO_FREQUENCY_22K) || (frequency == SAI_AUDIO_FREQUENCY_44K))
|
||||
// {
|
||||
// /* Configure and enable PLLSAI1 clock to generate 45.714286MHz */
|
||||
// PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_SAI1;
|
||||
// PeriphClkInit.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLLSAI2;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2Source = RCC_PLLSOURCE_HSE;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2M = 1;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2N = 40;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2ClockOut = RCC_PLLSAI2_SAI2CLK;
|
||||
|
||||
// HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* Configure and enable PLLSAI1 clock to generate 49.142857MHz */
|
||||
// PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_SAI1;
|
||||
// PeriphClkInit.Sai1ClockSelection = RCC_SAI1CLKSOURCE_PLLSAI2;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2Source = RCC_PLLSOURCE_HSE;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2M = 1;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2N = 43;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2P = RCC_PLLP_DIV7;
|
||||
// PeriphClkInit.PLLSAI2.PLLSAI2ClockOut = RCC_PLLSAI2_SAI2CLK;
|
||||
|
||||
// HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
|
||||
// }
|
||||
|
||||
// /* Disable SAI peripheral to allow access to SAI internal registers */
|
||||
// __HAL_SAI_DISABLE(&SAI1A_Handler);
|
||||
// /* Update the SAI audio frequency configuration */
|
||||
// SAI1A_Handler.Init.AudioFrequency = frequency;
|
||||
// HAL_SAI_Init(&SAI1A_Handler);
|
||||
// /* Enable SAI peripheral to generate MCLK */
|
||||
// __HAL_SAI_ENABLE(&SAI1A_Handler);
|
||||
}
|
||||
|
||||
void SAIA_Channels_Set(uint8_t channels)
|
||||
{
|
||||
// if (channels == 1)
|
||||
// {
|
||||
// SAI1A_Handler.Init.MonoStereoMode = SAI_MONOMODE;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// SAI1A_Handler.Init.MonoStereoMode = SAI_STEREOMODE;
|
||||
// }
|
||||
|
||||
// __HAL_SAI_DISABLE(&SAI1A_Handler);
|
||||
// HAL_SAI_Init(&SAI1A_Handler);
|
||||
// __HAL_SAI_ENABLE(&SAI1A_Handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* RT-Thread Audio Device Driver Interface
|
||||
*/
|
||||
static rt_err_t sound_getcaps(struct rt_audio_device *audio, struct rt_audio_caps *caps)
|
||||
{
|
||||
rt_err_t result = RT_EOK;
|
||||
struct sound_device *snd_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
snd_dev = (struct sound_device *)audio->parent.user_data;
|
||||
|
||||
switch (caps->main_type)
|
||||
{
|
||||
case AUDIO_TYPE_QUERY: /* qurey the types of hw_codec device */
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_TYPE_QUERY:
|
||||
caps->udata.mask = AUDIO_TYPE_OUTPUT | AUDIO_TYPE_MIXER;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_TYPE_OUTPUT: /* Provide capabilities of OUTPUT unit */
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_DSP_PARAM:
|
||||
caps->udata.config.samplerate = snd_dev->replay_config.samplerate;
|
||||
caps->udata.config.channels = snd_dev->replay_config.channels;
|
||||
caps->udata.config.samplebits = snd_dev->replay_config.samplebits;
|
||||
break;
|
||||
|
||||
case AUDIO_DSP_SAMPLERATE:
|
||||
caps->udata.config.samplerate = snd_dev->replay_config.samplerate;
|
||||
break;
|
||||
|
||||
case AUDIO_DSP_CHANNELS:
|
||||
caps->udata.config.channels = snd_dev->replay_config.channels;
|
||||
break;
|
||||
|
||||
case AUDIO_DSP_SAMPLEBITS:
|
||||
caps->udata.config.samplebits = snd_dev->replay_config.samplebits;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_TYPE_MIXER: /* report the Mixer Units */
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_MIXER_QUERY:
|
||||
caps->udata.mask = AUDIO_MIXER_VOLUME;
|
||||
break;
|
||||
|
||||
case AUDIO_MIXER_VOLUME:
|
||||
caps->udata.value = es8388_volume_get();
|
||||
break;
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static rt_err_t sound_configure(struct rt_audio_device *audio, struct rt_audio_caps *caps)
|
||||
{
|
||||
rt_err_t result = RT_EOK;
|
||||
struct sound_device *snd_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
snd_dev = (struct sound_device *)audio->parent.user_data;
|
||||
|
||||
switch (caps->main_type)
|
||||
{
|
||||
case AUDIO_TYPE_MIXER:
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_MIXER_VOLUME:
|
||||
{
|
||||
rt_uint8_t volume = caps->udata.value;
|
||||
|
||||
es8388_volume_set(volume);
|
||||
snd_dev->volume = volume;
|
||||
LOG_D("set volume %d", volume);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_TYPE_OUTPUT:
|
||||
{
|
||||
switch (caps->sub_type)
|
||||
{
|
||||
case AUDIO_DSP_PARAM:
|
||||
{
|
||||
/* set samplerate */
|
||||
I2S_Frequency_Set(caps->udata.config.samplerate);
|
||||
/* set channels */
|
||||
SAIA_Channels_Set(caps->udata.config.channels);
|
||||
|
||||
/* save configs */
|
||||
snd_dev->replay_config.samplerate = caps->udata.config.samplerate;
|
||||
snd_dev->replay_config.channels = caps->udata.config.channels;
|
||||
snd_dev->replay_config.samplebits = caps->udata.config.samplebits;
|
||||
LOG_D("set samplerate %d", snd_dev->replay_config.samplerate);
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_DSP_SAMPLERATE:
|
||||
{
|
||||
I2S_Frequency_Set(caps->udata.config.samplerate);
|
||||
snd_dev->replay_config.samplerate = caps->udata.config.samplerate;
|
||||
LOG_D("set samplerate %d", snd_dev->replay_config.samplerate);
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_DSP_CHANNELS:
|
||||
{
|
||||
SAIA_Channels_Set(caps->udata.config.channels);
|
||||
snd_dev->replay_config.channels = caps->udata.config.channels;
|
||||
LOG_D("set channels %d", snd_dev->replay_config.channels);
|
||||
break;
|
||||
}
|
||||
|
||||
case AUDIO_DSP_SAMPLEBITS:
|
||||
{
|
||||
/* not support */
|
||||
snd_dev->replay_config.samplebits = caps->udata.config.samplebits;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
result = -RT_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static rt_err_t sound_init(struct rt_audio_device *audio)
|
||||
{
|
||||
rt_err_t result = RT_EOK;
|
||||
struct sound_device *snd_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
snd_dev = (struct sound_device *)audio->parent.user_data;
|
||||
|
||||
es8388_init("i2c2", RT_NULL);
|
||||
I2S3_Init();
|
||||
LOG_I("ES8388 init success.");
|
||||
/* set default params */
|
||||
I2S_Frequency_Set(snd_dev->replay_config.samplerate);
|
||||
SAIA_Channels_Set(snd_dev->replay_config.channels);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static rt_err_t sound_start(struct rt_audio_device *audio, int stream)
|
||||
{
|
||||
struct sound_device *snd_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
snd_dev = (struct sound_device *)audio->parent.user_data;
|
||||
|
||||
if (stream == AUDIO_STREAM_REPLAY)
|
||||
{
|
||||
LOG_D("sound start.");
|
||||
es8388_start(ES_MODE_DAC);
|
||||
HAL_I2S_Transmit_DMA(&I2S3_Handler, (uint16_t*)snd_dev->tx_fifo, TX_FIFO_SIZE / 2);
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static rt_err_t sound_stop(struct rt_audio_device *audio, int stream)
|
||||
{
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
|
||||
if (stream == AUDIO_STREAM_REPLAY)
|
||||
{
|
||||
HAL_I2S_DMAStop(&I2S3_Handler);
|
||||
es8388_stop(ES_MODE_DAC);
|
||||
LOG_D("sound stop.");
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
static void sound_buffer_info(struct rt_audio_device *audio, struct rt_audio_buf_info *info)
|
||||
{
|
||||
struct sound_device *snd_dev;
|
||||
|
||||
RT_ASSERT(audio != RT_NULL);
|
||||
snd_dev = (struct sound_device *)audio->parent.user_data;
|
||||
|
||||
/**
|
||||
* TX_FIFO
|
||||
* +----------------+----------------+
|
||||
* | block1 | block2 |
|
||||
* +----------------+----------------+
|
||||
* \ block_size /
|
||||
*/
|
||||
info->buffer = snd_dev->tx_fifo;
|
||||
info->total_size = TX_FIFO_SIZE;
|
||||
info->block_size = TX_FIFO_SIZE / 2;
|
||||
info->block_count = 2;
|
||||
}
|
||||
|
||||
static struct rt_audio_ops snd_ops =
|
||||
{
|
||||
.getcaps = sound_getcaps,
|
||||
.configure = sound_configure,
|
||||
.init = sound_init,
|
||||
.start = sound_start,
|
||||
.stop = sound_stop,
|
||||
.transmit = RT_NULL,
|
||||
.buffer_info = sound_buffer_info,
|
||||
};
|
||||
|
||||
int rt_hw_sound_init(void)
|
||||
{
|
||||
rt_uint8_t *tx_fifo;
|
||||
|
||||
if (snd_dev.tx_fifo)
|
||||
return RT_EOK;
|
||||
|
||||
tx_fifo = rt_malloc(TX_FIFO_SIZE);
|
||||
if (tx_fifo == RT_NULL)
|
||||
return -RT_ENOMEM;
|
||||
rt_memset(tx_fifo, 0, TX_FIFO_SIZE);
|
||||
snd_dev.tx_fifo = tx_fifo;
|
||||
|
||||
/* init default configuration */
|
||||
{
|
||||
snd_dev.replay_config.samplerate = 44100;
|
||||
snd_dev.replay_config.channels = 2;
|
||||
snd_dev.replay_config.samplebits = 16;
|
||||
snd_dev.volume = 55;
|
||||
}
|
||||
|
||||
/* register sound device */
|
||||
snd_dev.audio.ops = &snd_ops;
|
||||
rt_audio_register(&snd_dev.audio, "sound0", RT_DEVICE_FLAG_WRONLY, &snd_dev);
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
// INIT_DEVICE_EXPORT(rt_hw_sound_init);
|
16
board/ports/audio/drv_sound.h
Normal file
16
board/ports/audio/drv_sound.h
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Date Author Notes
|
||||
* 2019-07-31 Zero-Free first implementation
|
||||
*/
|
||||
|
||||
#ifndef __DRV_SOUND_H__
|
||||
#define __DRV_SOUND_H__
|
||||
|
||||
int rt_hw_sound_init(void);
|
||||
int rt_hw_mic_init(void);
|
||||
|
||||
#endif
|
35
board/ports/drv_enc28j60.c
Normal file
35
board/ports/drv_enc28j60.c
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-08-27 ZYLX the first version
|
||||
*/
|
||||
|
||||
#include <rtdevice.h>
|
||||
#include <enc28j60.h>
|
||||
#include <drv_spi.h>
|
||||
#include <drv_gpio.h>
|
||||
#include <board.h>
|
||||
|
||||
#define PIN_NRF_IRQ GET_PIN(E,2)
|
||||
#define PIN_SPI_CS GET_PIN(A,4)
|
||||
|
||||
int enc28j60_init(void)
|
||||
{
|
||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||
rt_hw_spi_device_attach("spi1", "spi11", PIN_SPI_CS);
|
||||
|
||||
/* attach enc28j60 to spi. spi11 cs - PA4 */
|
||||
enc28j60_attach("spi11");
|
||||
|
||||
/* init interrupt pin */
|
||||
rt_pin_mode(PIN_NRF_IRQ, PIN_MODE_INPUT_PULLUP);
|
||||
rt_pin_attach_irq(PIN_NRF_IRQ, PIN_IRQ_MODE_FALLING, (void(*)(void*))enc28j60_isr, RT_NULL);
|
||||
rt_pin_irq_enable(PIN_NRF_IRQ, PIN_IRQ_ENABLE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
INIT_COMPONENT_EXPORT(enc28j60_init);
|
164
board/ports/drv_filesystem.c
Normal file
164
board/ports/drv_filesystem.c
Normal file
@ -0,0 +1,164 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-13 balanceTWK add sdcard port file
|
||||
* 2021-05-10 Meco Man fix a bug that cannot use fatfs in the main thread at starting up
|
||||
* 2021-07-28 Meco Man implement romfs as the root filesystem
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <dfs_romfs.h>
|
||||
#include <dfs_fs.h>
|
||||
#include <dfs_file.h>
|
||||
|
||||
#if DFS_FILESYSTEMS_MAX < 4
|
||||
#error "Please define DFS_FILESYSTEMS_MAX more than 4"
|
||||
#endif
|
||||
#if DFS_FILESYSTEM_TYPES_MAX < 4
|
||||
#error "Please define DFS_FILESYSTEM_TYPES_MAX more than 4"
|
||||
#endif
|
||||
|
||||
#define DBG_TAG "app.filesystem"
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
#ifdef BSP_USING_FS_AUTO_MOUNT
|
||||
#ifdef BSP_USING_SDCARD_FATFS
|
||||
static int onboard_sdcard_mount(void)
|
||||
{
|
||||
if (dfs_mount("sd", "/sdcard", "elm", 0, 0) == RT_EOK)
|
||||
{
|
||||
LOG_I("SD card mount to '/sdcard'");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("SD card mount to '/sdcard' failed!");
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
#endif /* BSP_USING_SDCARD_FATFS */
|
||||
#endif /* BSP_USING_FS_AUTO_MOUNT */
|
||||
|
||||
#ifdef BSP_USING_FLASH_FS_AUTO_MOUNT
|
||||
#ifdef BSP_USING_FLASH_FATFS
|
||||
#define FS_PARTITION_NAME "filesystem"
|
||||
|
||||
static int onboard_fal_mount(void)
|
||||
{
|
||||
/* 初始化 fal 功能 */
|
||||
extern int fal_init(void);
|
||||
extern struct rt_device *fal_blk_device_create(const char *parition_name);
|
||||
fal_init();
|
||||
/* 在 spi flash 中名为 "filesystem" 的分区上创建一个块设备 */
|
||||
struct rt_device *flash_dev = fal_blk_device_create(FS_PARTITION_NAME);
|
||||
// fal_blk_device_create("font");
|
||||
if (flash_dev == NULL)
|
||||
{
|
||||
LOG_E("Can't create a block device on '%s' partition.", FS_PARTITION_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_D("Create a block device on the %s partition of flash successful.", FS_PARTITION_NAME);
|
||||
}
|
||||
|
||||
/* 挂载 spi flash 中名为 "filesystem" 的分区上的文件系统 */
|
||||
if (dfs_mount(flash_dev->parent.name, "/fal", "elm", 0, 0) == 0)
|
||||
{
|
||||
LOG_I("Filesystem initialized!");
|
||||
}
|
||||
else
|
||||
{
|
||||
dfs_mkfs("elm", flash_dev->parent.name);
|
||||
if (dfs_mount(flash_dev->parent.name, "/fal", "elm", 0, 0) == 0)
|
||||
{
|
||||
LOG_I("Filesystem initialized!");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("Failed to initialize filesystem!");
|
||||
LOG_D("You should create a filesystem on the block device first!");
|
||||
}
|
||||
}
|
||||
|
||||
int ret;
|
||||
|
||||
// /* 创建目录 */
|
||||
// ret = mkdir("/fal/test", 0x777);
|
||||
// if (ret < 0)
|
||||
// {
|
||||
// /* 创建目录失败 */
|
||||
// rt_kprintf("dir error!\n");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// /* 创建目录成功 */
|
||||
// rt_kprintf("mkdir ok!\n");
|
||||
// }
|
||||
// /* 挂载块设备"font"到 DFS 目录/fal/test中 */
|
||||
// if (dfs_mount("font", "/fal/test", "elm", 0, 0) == 0)
|
||||
// {
|
||||
// LOG_I("font initialized!");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// dfs_mkfs("elm", "font");
|
||||
// if (dfs_mount("font", "/fal/test", "elm", 0, 0) == 0)
|
||||
// {
|
||||
// LOG_I("font initialized!");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LOG_E("Failed to initialize font!");
|
||||
// LOG_D("You should create a filesystem(font) on the block device first!");
|
||||
// }
|
||||
// }
|
||||
return RT_EOK;
|
||||
}
|
||||
#endif /*BSP_USING_FLASH_FATFS*/
|
||||
#endif /*BSP_USING_FLASH_FS_AUTO_MOUNT*/
|
||||
|
||||
|
||||
const struct romfs_dirent _romfs_root[] =
|
||||
{
|
||||
#ifdef BSP_USING_SDCARD_FATFS
|
||||
{ROMFS_DIRENT_DIR, "sdcard", RT_NULL, 0},
|
||||
#endif
|
||||
|
||||
#ifdef BSP_USING_FLASH_FATFS
|
||||
{ROMFS_DIRENT_DIR, "fal", RT_NULL, 0},
|
||||
#endif
|
||||
};
|
||||
|
||||
const struct romfs_dirent romfs_root =
|
||||
{
|
||||
ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_romfs_root, sizeof(_romfs_root) / sizeof(_romfs_root[0])
|
||||
};
|
||||
|
||||
static int filesystem_mount(void)
|
||||
{
|
||||
|
||||
#ifdef BSP_USING_FS
|
||||
if (dfs_mount(RT_NULL, "/", "rom", 0, &(romfs_root)) != 0)
|
||||
{
|
||||
LOG_E("rom mount to '/' failed!");
|
||||
}
|
||||
|
||||
/* 确保块设备注册成功之后再挂载文件系统 */
|
||||
rt_thread_delay(500);
|
||||
#endif
|
||||
#ifdef BSP_USING_FS_AUTO_MOUNT
|
||||
onboard_sdcard_mount();
|
||||
#endif /* BSP_USING_FS_AUTO_MOUNT */
|
||||
|
||||
#ifdef BSP_USING_FLASH_FS_AUTO_MOUNT
|
||||
onboard_fal_mount();
|
||||
#endif
|
||||
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_APP_EXPORT(filesystem_mount);
|
210
board/ports/ef_fal_port.c
Normal file
210
board/ports/ef_fal_port.c
Normal file
@ -0,0 +1,210 @@
|
||||
/*
|
||||
* This file is part of the EasyFlash Library.
|
||||
*
|
||||
* Copyright (c) 2015, Armink, <armink.ztl@gmail.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Function: Portable interface for FAL (Flash Abstraction Layer) partition.
|
||||
* Created on: 2018-05-19
|
||||
*/
|
||||
|
||||
#include <easyflash.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <rthw.h>
|
||||
#include <rtthread.h>
|
||||
#include <fal.h>
|
||||
|
||||
/* EasyFlash partition name on FAL partition table */
|
||||
#define FAL_EF_PART_NAME "easyflash"
|
||||
|
||||
/* default ENV set for user */
|
||||
static const ef_env default_env_set[] = {
|
||||
{"iap_need_copy_app", "0"},
|
||||
{"iap_need_crc32_check", "0"},
|
||||
{"iap_copy_app_size", "0"},
|
||||
{"stop_in_bootloader", "0"},
|
||||
};
|
||||
|
||||
static char log_buf[RT_CONSOLEBUF_SIZE];
|
||||
static struct rt_semaphore env_cache_lock;
|
||||
static const struct fal_partition *part = NULL;
|
||||
|
||||
/**
|
||||
* Flash port for hardware initialize.
|
||||
*
|
||||
* @param default_env default ENV set for user
|
||||
* @param default_env_size default ENV size
|
||||
*
|
||||
* @return result
|
||||
*/
|
||||
EfErrCode ef_port_init(ef_env const **default_env, size_t *default_env_size) {
|
||||
EfErrCode result = EF_NO_ERR;
|
||||
|
||||
*default_env = default_env_set;
|
||||
*default_env_size = sizeof(default_env_set) / sizeof(default_env_set[0]);
|
||||
|
||||
rt_sem_init(&env_cache_lock, "env lock", 1, RT_IPC_FLAG_PRIO);
|
||||
|
||||
part = fal_partition_find(FAL_EF_PART_NAME);
|
||||
EF_ASSERT(part);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read data from flash.
|
||||
* @note This operation's units is word.
|
||||
*
|
||||
* @param addr flash address
|
||||
* @param buf buffer to store read data
|
||||
* @param size read bytes size
|
||||
*
|
||||
* @return result
|
||||
*/
|
||||
EfErrCode ef_port_read(uint32_t addr, uint32_t *buf, size_t size) {
|
||||
EfErrCode result = EF_NO_ERR;
|
||||
|
||||
fal_partition_read(part, addr, (uint8_t *)buf, size);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Erase data on flash.
|
||||
* @note This operation is irreversible.
|
||||
* @note This operation's units is different which on many chips.
|
||||
*
|
||||
* @param addr flash address
|
||||
* @param size erase bytes size
|
||||
*
|
||||
* @return result
|
||||
*/
|
||||
EfErrCode ef_port_erase(uint32_t addr, size_t size) {
|
||||
EfErrCode result = EF_NO_ERR;
|
||||
|
||||
/* make sure the start address is a multiple of FLASH_ERASE_MIN_SIZE */
|
||||
EF_ASSERT(addr % EF_ERASE_MIN_SIZE == 0);
|
||||
|
||||
if (fal_partition_erase(part, addr, size) < 0)
|
||||
{
|
||||
result = EF_ERASE_ERR;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Write data to flash.
|
||||
* @note This operation's units is word.
|
||||
* @note This operation must after erase. @see flash_erase.
|
||||
*
|
||||
* @param addr flash address
|
||||
* @param buf the write data buffer
|
||||
* @param size write bytes size
|
||||
*
|
||||
* @return result
|
||||
*/
|
||||
EfErrCode ef_port_write(uint32_t addr, const uint32_t *buf, size_t size) {
|
||||
EfErrCode result = EF_NO_ERR;
|
||||
|
||||
if (fal_partition_write(part, addr, (uint8_t *)buf, size) < 0)
|
||||
{
|
||||
result = EF_WRITE_ERR;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* lock the ENV ram cache
|
||||
*/
|
||||
void ef_port_env_lock(void) {
|
||||
rt_sem_take(&env_cache_lock, RT_WAITING_FOREVER);
|
||||
}
|
||||
|
||||
/**
|
||||
* unlock the ENV ram cache
|
||||
*/
|
||||
void ef_port_env_unlock(void) {
|
||||
rt_sem_release(&env_cache_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is print flash debug info.
|
||||
*
|
||||
* @param file the file which has call this function
|
||||
* @param line the line number which has call this function
|
||||
* @param format output format
|
||||
* @param ... args
|
||||
*
|
||||
*/
|
||||
void ef_log_debug(const char *file, const long line, const char *format, ...) {
|
||||
|
||||
#ifdef PRINT_DEBUG
|
||||
|
||||
va_list args;
|
||||
|
||||
/* args point to the first variable parameter */
|
||||
va_start(args, format);
|
||||
ef_print("[Flash] (%s:%ld) ", file, line);
|
||||
/* must use vprintf to print */
|
||||
rt_vsprintf(log_buf, format, args);
|
||||
ef_print("%s", log_buf);
|
||||
va_end(args);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is print flash routine info.
|
||||
*
|
||||
* @param format output format
|
||||
* @param ... args
|
||||
*/
|
||||
void ef_log_info(const char *format, ...) {
|
||||
va_list args;
|
||||
|
||||
/* args point to the first variable parameter */
|
||||
va_start(args, format);
|
||||
ef_print("[Flash] ");
|
||||
/* must use vprintf to print */
|
||||
rt_vsprintf(log_buf, format, args);
|
||||
ef_print("%s", log_buf);
|
||||
va_end(args);
|
||||
}
|
||||
/**
|
||||
* This function is print flash non-package info.
|
||||
*
|
||||
* @param format output format
|
||||
* @param ... args
|
||||
*/
|
||||
void ef_print(const char *format, ...) {
|
||||
va_list args;
|
||||
|
||||
/* args point to the first variable parameter */
|
||||
va_start(args, format);
|
||||
/* must use vprintf to print */
|
||||
rt_vsprintf(log_buf, format, args);
|
||||
rt_kprintf("%s", log_buf);
|
||||
va_end(args);
|
||||
}
|
60
board/ports/fal/fal_cfg.h
Normal file
60
board/ports/fal/fal_cfg.h
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-12-5 SummerGift first version
|
||||
*/
|
||||
|
||||
#ifndef _FAL_CFG_H_
|
||||
#define _FAL_CFG_H_
|
||||
|
||||
#include <board.h>
|
||||
#include <fal_def.h>
|
||||
|
||||
#define FLASH_SIZE_GRANULARITY_16K (4 * 16 * 1024)
|
||||
#define FLASH_SIZE_GRANULARITY_64K (8 * 64 * 1024)
|
||||
#define FLASH_SIZE_GRANULARITY_128K (8 * 128 * 1024)
|
||||
#define STM32_FLASH_START_ADRESS_16K STM32_FLASH_START_ADRESS
|
||||
#define STM32_FLASH_START_ADRESS_64K STM32_FLASH_START_ADRESS
|
||||
#define STM32_FLASH_START_ADRESS_128K STM32_FLASH_START_ADRESS
|
||||
|
||||
extern const struct fal_flash_dev stm32_onchip_flash_16k;
|
||||
extern const struct fal_flash_dev stm32_onchip_flash_64k;
|
||||
extern const struct fal_flash_dev stm32_onchip_flash_128k;
|
||||
extern struct fal_flash_dev w25q64;
|
||||
|
||||
/* flash device table */
|
||||
#define FAL_FLASH_DEV_TABLE \
|
||||
{ \
|
||||
&stm32_onchip_flash_128k, \
|
||||
&w25q64, \
|
||||
}
|
||||
|
||||
/* ====================== Partition Configuration ========================== */
|
||||
#ifdef BSP_USING_BOOTLOADER
|
||||
#define FAL_PART_TABLE \
|
||||
{ \
|
||||
{FAL_PART_MAGIC_WROD, "bootloader", "onchip_flash_128k", 0, 128 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 128 * 1024, 384 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "easyflash", "W25Q64", 0, 512 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "download", "W25Q64", 512 * 1024, 1024 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "wifi_image", "W25Q64", (512 + 1024) * 1024, 512 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "font", "W25Q64", (512 + 1024 + 512) * 1024, 3 * 1024 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "filesystem", "W25Q64", (512 + 1024 + 512 + 3 * 1024) * 1024, 3 * 1024 * 1024, 0}, \
|
||||
}
|
||||
#else
|
||||
#define FAL_PART_TABLE \
|
||||
{ \
|
||||
{FAL_PART_MAGIC_WROD, "app", "onchip_flash_128k", 0, 384 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "param", "onchip_flash_128k", 384 * 1024, 640 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "easyflash", "W25Q64", 0, 512 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "download", "W25Q64", 512 * 1024, 1024 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "wifi_image", "W25Q64", (512 + 1024) * 1024, 512 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "font", "W25Q64", (512 + 1024 + 512) * 1024, 3 * 1024 * 1024, 0}, \
|
||||
{FAL_PART_MAGIC_WROD, "filesystem", "W25Q64", (512 + 1024 + 512 + 3 * 1024) * 1024, 3 * 1024 * 1024, 0}, \
|
||||
}
|
||||
#endif /*FAL_PART_TABLE*/
|
||||
#endif /*BSP_USING_BOOTLOADER*/
|
80
board/ports/fal/fal_spi_flash_sfud_port.c
Normal file
80
board/ports/fal/fal_spi_flash_sfud_port.c
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-08-07 Meco Man first version
|
||||
*/
|
||||
|
||||
#include <fal.h>
|
||||
#include <sfud.h>
|
||||
|
||||
#ifdef RT_USING_SFUD
|
||||
#include <spi_flash_sfud.h>
|
||||
#endif
|
||||
|
||||
static int init(void);
|
||||
static int read(long offset, uint8_t *buf, size_t size);
|
||||
static int write(long offset, const uint8_t *buf, size_t size);
|
||||
static int erase(long offset, size_t size);
|
||||
|
||||
static sfud_flash_t sfud_dev = NULL;
|
||||
struct fal_flash_dev w25q64 =
|
||||
{
|
||||
.name = "W25Q64",
|
||||
.addr = 0,
|
||||
.len = 8 * 1024 * 1024,
|
||||
.blk_size = 4096,
|
||||
.ops = {init, read, write, erase},
|
||||
.write_gran = 1
|
||||
};
|
||||
|
||||
static int init(void)
|
||||
{
|
||||
sfud_dev = rt_sfud_flash_find_by_dev_name("W25Q64");
|
||||
if (RT_NULL == sfud_dev)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* update the flash chip information */
|
||||
w25q64.blk_size = sfud_dev->chip.erase_gran;
|
||||
w25q64.len = sfud_dev->chip.capacity;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int read(long offset, uint8_t *buf, size_t size)
|
||||
{
|
||||
assert(sfud_dev);
|
||||
assert(sfud_dev->init_ok);
|
||||
sfud_read(sfud_dev, w25q64.addr + offset, size, buf);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static int write(long offset, const uint8_t *buf, size_t size)
|
||||
{
|
||||
assert(sfud_dev);
|
||||
assert(sfud_dev->init_ok);
|
||||
if (sfud_write(sfud_dev, w25q64.addr + offset, size, buf) != SFUD_SUCCESS)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static int erase(long offset, size_t size)
|
||||
{
|
||||
assert(sfud_dev);
|
||||
assert(sfud_dev->init_ok);
|
||||
if (sfud_erase(sfud_dev, w25q64.addr + offset, size) != SFUD_SUCCESS)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
1490
board/ports/lcd/drv_lcd.c
Normal file
1490
board/ports/lcd/drv_lcd.c
Normal file
File diff suppressed because it is too large
Load Diff
109
board/ports/lcd/drv_lcd.h
Normal file
109
board/ports/lcd/drv_lcd.h
Normal file
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-12-28 unknow copy by STemwin
|
||||
*/
|
||||
#ifndef __DRV_LCD_H
|
||||
#define __DRV_LCD_H
|
||||
#include <rtthread.h>
|
||||
#include "rtdevice.h"
|
||||
#include <drv_common.h>
|
||||
#ifdef PKG_USING_QRCODE
|
||||
#include <qrcode.h>
|
||||
#endif
|
||||
|
||||
#define LCD_BASE ((uint32_t)(0x68000000 | 0x0003FFFE)) // A18 link to DCX
|
||||
#define LCD ((LCD_CONTROLLER_TypeDef *)LCD_BASE)
|
||||
#define LCD_W 240
|
||||
#define LCD_H 240
|
||||
|
||||
//LCD重要参数集
|
||||
typedef struct
|
||||
{
|
||||
uint16_t width; //LCD 宽度
|
||||
uint16_t height; //LCD 高度
|
||||
uint16_t id; //LCD ID
|
||||
uint8_t dir; //横屏还是竖屏控制:0,竖屏;1,横屏。
|
||||
uint16_t wramcmd; //开始写gram指令
|
||||
uint16_t setxcmd; //设置x坐标指令
|
||||
uint16_t setycmd; //设置y坐标指令
|
||||
}_lcd_dev;
|
||||
|
||||
//LCD参数
|
||||
extern _lcd_dev lcddev; //管理LCD重要参数
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile uint8_t _u8_REG;
|
||||
volatile uint8_t RESERVED;
|
||||
volatile uint8_t _u8_RAM;
|
||||
volatile uint16_t _u16_RAM;
|
||||
}LCD_CONTROLLER_TypeDef;
|
||||
|
||||
|
||||
//POINT_COLOR
|
||||
#define WHITE 0xFFFF
|
||||
#define BLACK 0x0000
|
||||
#define BLUE 0x001F
|
||||
#define BRED 0XF81F
|
||||
#define GRED 0XFFE0
|
||||
#define GBLUE 0X07FF
|
||||
#define RED 0xF800
|
||||
#define MAGENTA 0xF81F
|
||||
#define GREEN 0x07E0
|
||||
#define CYAN 0x7FFF
|
||||
#define YELLOW 0xFFE0
|
||||
#define BROWN 0XBC40
|
||||
#define BRRED 0XFC07
|
||||
#define GRAY 0X8430
|
||||
#define GRAY175 0XAD75
|
||||
#define GRAY151 0X94B2
|
||||
#define GRAY187 0XBDD7
|
||||
#define GRAY240 0XF79E
|
||||
|
||||
//扫描方向定义
|
||||
#define L2R_U2D 0 //从左到右,从上到下
|
||||
#define L2R_D2U 1 //从左到右,从下到上
|
||||
#define R2L_U2D 2 //从右到左,从上到下
|
||||
#define R2L_D2U 3 //从右到左,从下到上
|
||||
|
||||
#define U2D_L2R 4 //从上到下,从左到右
|
||||
#define U2D_R2L 5 //从上到下,从右到左
|
||||
#define D2U_L2R 6 //从下到上,从左到右
|
||||
#define D2U_R2L 7 //从下到上,从右到左
|
||||
|
||||
int drv_lcd_init(void);
|
||||
void lcd_clear(rt_uint16_t color);
|
||||
void lcd_address_set(rt_uint16_t x1, rt_uint16_t y1, rt_uint16_t x2, rt_uint16_t y2);
|
||||
void lcd_set_color(rt_uint16_t back, rt_uint16_t fore);
|
||||
|
||||
rt_uint16_t change_byte_order(rt_uint16_t word);
|
||||
void lcd_draw_point(rt_uint16_t x, rt_uint16_t y);
|
||||
void lcd_draw_circle(rt_uint16_t x0, rt_uint16_t y0, rt_uint8_t r);
|
||||
void lcd_draw_line(rt_uint16_t x1, rt_uint16_t y1, rt_uint16_t x2, rt_uint16_t y2);
|
||||
void lcd_draw_rectangle(rt_uint16_t x1, rt_uint16_t y1, rt_uint16_t x2, rt_uint16_t y2);
|
||||
void lcd_fill(rt_uint16_t x_start, rt_uint16_t y_start, rt_uint16_t x_end, rt_uint16_t y_end, rt_uint16_t color);
|
||||
|
||||
void lcd_address_set(rt_uint16_t x1, rt_uint16_t y1, rt_uint16_t x2, rt_uint16_t y2);
|
||||
rt_err_t lcd_write_half_word(const rt_uint16_t da);
|
||||
rt_err_t lcd_write_data_buffer(const void *send_buf, rt_size_t length);
|
||||
|
||||
void lcd_show_num(rt_uint16_t x, rt_uint16_t y, rt_uint32_t num, rt_uint8_t len, rt_uint32_t size);
|
||||
rt_err_t lcd_show_string(rt_uint16_t x, rt_uint16_t y, rt_uint32_t size, const char *fmt, ...);
|
||||
rt_err_t lcd_show_image(rt_uint16_t x, rt_uint16_t y, rt_uint16_t length, rt_uint16_t wide, const rt_uint8_t *p);
|
||||
#ifdef PKG_USING_QRCODE
|
||||
rt_err_t lcd_show_qrcode(rt_uint16_t x, rt_uint16_t y, rt_uint8_t version, rt_uint8_t ecc, const char *data, rt_uint8_t enlargement);
|
||||
#endif
|
||||
|
||||
void lcd_enter_sleep(void);
|
||||
void lcd_exit_sleep(void);
|
||||
void lcd_display_on(void);
|
||||
void lcd_display_off(void);
|
||||
|
||||
void lcd_fill_array(rt_uint16_t x_start, rt_uint16_t y_start, rt_uint16_t x_end, rt_uint16_t y_end, void *pcolor);
|
||||
|
||||
#endif
|
795
board/ports/lcd/drv_lcd_font.h
Normal file
795
board/ports/lcd/drv_lcd_font.h
Normal file
@ -0,0 +1,795 @@
|
||||
#ifndef __DRV_LCD_FONT_H__
|
||||
#define __DRV_LCD_FONT_H__
|
||||
#include <stdint.h>
|
||||
/* DejaVu Sans Mono */
|
||||
/*
|
||||
(0) !(1) "(2) #(3) $(4) %(5) &(6) '(7)
|
||||
((8) )(9) *(10) +(11) ,(12) -(13) .(14) /(15)
|
||||
0(16) 1(17) 2(18) 3(19) 4(20) 5(21) 6(22) 7(23)
|
||||
8(24) 9(25) :(26) ;(27) <(28) =(29) >(30) ?(31)
|
||||
@(32) A(33) B(34) C(35) D(36) E(37) F(38) G(39)
|
||||
H(40) I(41) J(42) K(43) L(44) M(45) N(46) O(47)
|
||||
P(48) Q(49) R(50) S(51) T(52) U(53) V(54) W(55)
|
||||
X(56) Y(57) Z(58) [(59) \(60) ](61) ^(62) _(63)
|
||||
`(64) a(65) b(66) c(67) d(68) e(69) f(70) g(71)
|
||||
h(72) i(73) j(74) k(75) l(76) m(77) n(78) o(79)
|
||||
p(80) q(81) r(82) s(83) t(84) u(85) v(86) w(87)
|
||||
x(88) y(89) z(90) {(91) |(92) }(93)
|
||||
*/
|
||||
|
||||
#define ASC2_1608
|
||||
#define ASC2_2412
|
||||
#define ASC2_3216
|
||||
|
||||
#if !defined(ASC2_1608) && !defined(ASC2_2412) && !defined(ASC2_2416) && !defined(ASC2_3216)
|
||||
#error "There is no any define ASC2_1608 && ASC2_2412 && ASC2_2416 && ASC2_3216 !"
|
||||
#endif
|
||||
|
||||
#ifdef ASC2_1608
|
||||
const uint8_t asc2_1608[]={
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*" ",0*/
|
||||
0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x10,0x10,0x00,0x00,0x00,/*"!",1*/
|
||||
0x00,0x00,0x00,0x28,0x28,0x28,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*""",2*/
|
||||
0x00,0x00,0x00,0x12,0x12,0x16,0x7F,0x24,0x24,0xFE,0x28,0x48,0x48,0x00,0x00,0x00,/*"#",3*/
|
||||
0x00,0x00,0x08,0x08,0x3E,0x49,0x48,0x68,0x3E,0x0B,0x09,0x49,0x3E,0x08,0x08,0x00,/*"$",4*/
|
||||
0x00,0x00,0x00,0x60,0x90,0x90,0x62,0x0C,0x30,0x46,0x09,0x09,0x06,0x00,0x00,0x00,/*"%",5*/
|
||||
0x00,0x00,0x00,0x1C,0x20,0x20,0x30,0x30,0x49,0x45,0x45,0x62,0x3D,0x00,0x00,0x00,/*"&",6*/
|
||||
0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"'",7*/
|
||||
0x00,0x00,0x0C,0x08,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04,0x00,0x00,/*"(",8*/
|
||||
0x00,0x00,0x30,0x10,0x10,0x08,0x08,0x08,0x08,0x08,0x08,0x10,0x10,0x30,0x00,0x00,/*")",9*/
|
||||
0x00,0x00,0x00,0x08,0x49,0x3E,0x1C,0x6B,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"*",10*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x10,0x10,0x10,0xFE,0x10,0x10,0x10,0x00,0x00,0x00,0x00,/*"+",11*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x10,0x20,0x00,/*",",12*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,/*"-",13*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,/*".",14*/
|
||||
0x00,0x00,0x00,0x02,0x04,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x20,0x20,0x40,0x00,/*"/",15*/
|
||||
0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x49,0x41,0x41,0x41,0x22,0x1C,0x00,0x00,0x00,/*"0",16*/
|
||||
0x00,0x00,0x00,0x18,0x28,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3E,0x00,0x00,0x00,/*"1",17*/
|
||||
0x00,0x00,0x00,0x3E,0x43,0x01,0x01,0x02,0x06,0x0C,0x10,0x20,0x7F,0x00,0x00,0x00,/*"2",18*/
|
||||
0x00,0x00,0x00,0x3E,0x41,0x01,0x03,0x1C,0x03,0x01,0x01,0x43,0x3E,0x00,0x00,0x00,/*"3",19*/
|
||||
0x00,0x00,0x00,0x06,0x0A,0x1A,0x12,0x22,0x42,0x7F,0x02,0x02,0x02,0x00,0x00,0x00,/*"4",20*/
|
||||
0x00,0x00,0x00,0x7E,0x40,0x40,0x7C,0x42,0x01,0x01,0x01,0x42,0x3C,0x00,0x00,0x00,/*"5",21*/
|
||||
0x00,0x00,0x00,0x1E,0x31,0x60,0x40,0x5E,0x63,0x41,0x41,0x23,0x1E,0x00,0x00,0x00,/*"6",22*/
|
||||
0x00,0x00,0x00,0x7F,0x03,0x02,0x04,0x04,0x08,0x08,0x10,0x10,0x20,0x00,0x00,0x00,/*"7",23*/
|
||||
0x00,0x00,0x00,0x3E,0x41,0x41,0x41,0x3E,0x63,0x41,0x41,0x63,0x3E,0x00,0x00,0x00,/*"8",24*/
|
||||
0x00,0x00,0x00,0x3C,0x62,0x41,0x41,0x63,0x3D,0x01,0x03,0x46,0x3C,0x00,0x00,0x00,/*"9",25*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,/*":",26*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x10,0x20,0x00,/*";",27*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x01,0x0E,0x38,0x40,0x38,0x0E,0x01,0x00,0x00,0x00,0x00,/*"<",28*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,/*"=",29*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x40,0x38,0x0E,0x01,0x0E,0x38,0x40,0x00,0x00,0x00,0x00,/*">",30*/
|
||||
0x00,0x00,0x00,0x38,0x44,0x04,0x0C,0x18,0x10,0x10,0x00,0x10,0x10,0x00,0x00,0x00,/*"?",31*/
|
||||
0x00,0x00,0x00,0x1E,0x33,0x21,0x47,0x49,0x49,0x49,0x49,0x47,0x20,0x30,0x0E,0x00,/*"@",32*/
|
||||
0x00,0x00,0x00,0x08,0x14,0x14,0x14,0x14,0x22,0x3E,0x22,0x41,0x41,0x00,0x00,0x00,/*"A",33*/
|
||||
0x00,0x00,0x00,0x7E,0x41,0x41,0x41,0x7E,0x43,0x41,0x41,0x43,0x7E,0x00,0x00,0x00,/*"B",34*/
|
||||
0x00,0x00,0x00,0x1E,0x21,0x40,0x40,0x40,0x40,0x40,0x40,0x21,0x1E,0x00,0x00,0x00,/*"C",35*/
|
||||
0x00,0x00,0x00,0x7C,0x42,0x41,0x41,0x41,0x41,0x41,0x41,0x42,0x7C,0x00,0x00,0x00,/*"D",36*/
|
||||
0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,/*"E",37*/
|
||||
0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x7F,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,/*"F",38*/
|
||||
0x00,0x00,0x00,0x1E,0x21,0x40,0x40,0x40,0x43,0x41,0x41,0x21,0x1E,0x00,0x00,0x00,/*"G",39*/
|
||||
0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x7F,0x41,0x41,0x41,0x41,0x41,0x00,0x00,0x00,/*"H",40*/
|
||||
0x00,0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,0x00,/*"I",41*/
|
||||
0x00,0x00,0x00,0x1C,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x38,0x00,0x00,0x00,/*"J",42*/
|
||||
0x00,0x00,0x00,0x42,0x44,0x48,0x50,0x70,0x78,0x48,0x44,0x46,0x42,0x00,0x00,0x00,/*"K",43*/
|
||||
0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,/*"L",44*/
|
||||
0x00,0x00,0x00,0x63,0x63,0x55,0x55,0x55,0x49,0x41,0x41,0x41,0x41,0x00,0x00,0x00,/*"M",45*/
|
||||
0x00,0x00,0x00,0x61,0x61,0x51,0x51,0x49,0x49,0x45,0x45,0x43,0x43,0x00,0x00,0x00,/*"N",46*/
|
||||
0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x41,0x41,0x41,0x41,0x22,0x1C,0x00,0x00,0x00,/*"O",47*/
|
||||
0x00,0x00,0x00,0x7E,0x43,0x41,0x41,0x43,0x7E,0x40,0x40,0x40,0x40,0x00,0x00,0x00,/*"P",48*/
|
||||
0x00,0x00,0x00,0x1C,0x22,0x41,0x41,0x41,0x41,0x41,0x41,0x22,0x1E,0x06,0x02,0x00,/*"Q",49*/
|
||||
0x00,0x00,0x00,0x7E,0x43,0x41,0x41,0x43,0x7C,0x42,0x41,0x41,0x40,0x00,0x00,0x00,/*"R",50*/
|
||||
0x00,0x00,0x00,0x1E,0x61,0x40,0x40,0x30,0x0E,0x01,0x01,0x43,0x3E,0x00,0x00,0x00,/*"S",51*/
|
||||
0x00,0x00,0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,/*"T",52*/
|
||||
0x00,0x00,0x00,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x63,0x3E,0x00,0x00,0x00,/*"U",53*/
|
||||
0x00,0x00,0x00,0x41,0x41,0x22,0x22,0x22,0x14,0x14,0x14,0x14,0x08,0x00,0x00,0x00,/*"V",54*/
|
||||
0x00,0x00,0x00,0x81,0x81,0x81,0x5A,0x5A,0x5A,0x66,0x66,0x66,0x66,0x00,0x00,0x00,/*"W",55*/
|
||||
0x00,0x00,0x00,0x41,0x22,0x14,0x14,0x08,0x14,0x14,0x22,0x22,0x41,0x00,0x00,0x00,/*"X",56*/
|
||||
0x00,0x00,0x00,0x82,0x44,0x44,0x28,0x38,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,/*"Y",57*/
|
||||
0x00,0x00,0x00,0x7F,0x03,0x02,0x04,0x08,0x08,0x10,0x20,0x60,0x7F,0x00,0x00,0x00,/*"Z",58*/
|
||||
0x00,0x00,0x1C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1C,0x00,0x00,/*"[",59*/
|
||||
0x00,0x00,0x00,0x40,0x20,0x20,0x20,0x10,0x10,0x08,0x08,0x04,0x04,0x04,0x02,0x00,/*"\",60*/
|
||||
0x00,0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x38,0x00,0x00,/*"]",61*/
|
||||
0x00,0x00,0x00,0x10,0x28,0x44,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"^",62*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,/*"_",63*/
|
||||
0x00,0x30,0x10,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"`",64*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x02,0x3E,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,/*"a",65*/
|
||||
0x00,0x00,0x40,0x40,0x40,0x7C,0x64,0x42,0x42,0x42,0x42,0x64,0x5C,0x00,0x00,0x00,/*"b",66*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x1C,0x22,0x40,0x40,0x40,0x40,0x22,0x1C,0x00,0x00,0x00,/*"c",67*/
|
||||
0x00,0x00,0x02,0x02,0x02,0x3E,0x26,0x42,0x42,0x42,0x42,0x26,0x3A,0x00,0x00,0x00,/*"d",68*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x3C,0x26,0x42,0x7E,0x40,0x40,0x22,0x1C,0x00,0x00,0x00,/*"e",69*/
|
||||
0x00,0x00,0x0C,0x10,0x10,0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,/*"f",70*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x3A,0x26,0x42,0x42,0x42,0x42,0x26,0x3A,0x02,0x22,0x1C,/*"g",71*/
|
||||
0x00,0x00,0x40,0x40,0x40,0x5C,0x62,0x42,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,/*"h",72*/
|
||||
0x00,0x00,0x10,0x10,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x7C,0x00,0x00,0x00,/*"i",73*/
|
||||
0x00,0x00,0x08,0x08,0x00,0x38,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x70,/*"j",74*/
|
||||
0x00,0x00,0x40,0x40,0x40,0x44,0x48,0x50,0x70,0x48,0x48,0x44,0x42,0x00,0x00,0x00,/*"k",75*/
|
||||
0x00,0x00,0x70,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x0E,0x00,0x00,0x00,/*"l",76*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x7E,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x00,0x00,0x00,/*"m",77*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x5C,0x62,0x42,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,/*"n",78*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,/*"o",79*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x5C,0x64,0x42,0x42,0x42,0x42,0x64,0x7C,0x40,0x40,0x40,/*"p",80*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x3A,0x26,0x42,0x42,0x42,0x42,0x26,0x3A,0x02,0x02,0x02,/*"q",81*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x3C,0x32,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,/*"r",82*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x3C,0x42,0x40,0x70,0x0E,0x02,0x42,0x3C,0x00,0x00,0x00,/*"s",83*/
|
||||
0x00,0x00,0x00,0x10,0x10,0x7E,0x10,0x10,0x10,0x10,0x10,0x10,0x0E,0x00,0x00,0x00,/*"t",84*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x46,0x3A,0x00,0x00,0x00,/*"u",85*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x24,0x24,0x24,0x18,0x18,0x18,0x00,0x00,0x00,/*"v",86*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x81,0x81,0x5A,0x5A,0x5A,0x5A,0x24,0x24,0x00,0x00,0x00,/*"w",87*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x18,0x18,0x18,0x24,0x24,0x42,0x00,0x00,0x00,/*"x",88*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x42,0x22,0x24,0x24,0x14,0x18,0x18,0x08,0x08,0x10,0x30,/*"y",89*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x7E,0x02,0x04,0x08,0x10,0x20,0x40,0x7E,0x00,0x00,0x00,/*"z",90*/
|
||||
0x00,0x00,0x0C,0x10,0x10,0x10,0x10,0x10,0x60,0x10,0x10,0x10,0x10,0x10,0x0C,0x00,/*"{",91*/
|
||||
0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,/*"|",92*/
|
||||
0x00,0x00,0x60,0x10,0x10,0x10,0x10,0x10,0x0C,0x10,0x10,0x10,0x10,0x10,0x60,0x00,/*"}",93*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef ASC2_2412
|
||||
const uint8_t asc2_2412[]={
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
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,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"!",1*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x80,0x19,0x80,0x19,0x80,0x19,0x80,
|
||||
0x19,0x80,0x19,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,/*""",2*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x60,0x04,0x40,0x0C,0xC0,0x0C,0xC0,
|
||||
0x7F,0xF0,0x7F,0xF0,0x08,0x80,0x19,0x80,0x19,0x80,0xFF,0xE0,0xFF,0xE0,0x33,0x00,
|
||||
0x33,0x00,0x22,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"#",3*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x00,0x0F,0x80,0x1F,0xC0,0x3A,0x40,
|
||||
0x32,0x00,0x32,0x00,0x3A,0x00,0x1F,0x00,0x07,0xC0,0x02,0xE0,0x02,0x60,0x02,0x60,
|
||||
0x22,0xE0,0x3F,0xC0,0x1F,0x80,0x02,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00,/*"$",4*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x48,0x00,0xCC,0x00,0xCC,0x00,
|
||||
0xCC,0x00,0x48,0x40,0x79,0xC0,0x0E,0x00,0x73,0xC0,0x02,0x40,0x06,0x60,0x06,0x60,
|
||||
0x06,0x60,0x02,0x40,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"%",5*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x1F,0x80,0x18,0x00,0x18,0x00,
|
||||
0x18,0x00,0x0C,0x00,0x1E,0x00,0x36,0x30,0x63,0x30,0x63,0xB0,0x61,0xA0,0x60,0xE0,
|
||||
0x30,0xC0,0x3F,0x60,0x0E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"&",6*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,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,/*"'",7*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x02,0x00,0x02,0x00,0x06,0x00,0x06,0x00,
|
||||
0x04,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,
|
||||
0x04,0x00,0x06,0x00,0x06,0x00,0x02,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,/*"(",8*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x04,0x00,0x04,0x00,0x06,0x00,0x06,0x00,
|
||||
0x02,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,
|
||||
0x02,0x00,0x06,0x00,0x06,0x00,0x04,0x00,0x04,0x00,0x08,0x00,0x00,0x00,0x00,0x00,/*")",9*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x04,0x00,0x44,0x40,0x35,0x80,
|
||||
0x0E,0x00,0x0E,0x00,0x35,0x80,0x44,0x40,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"*",10*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x7F,0xE0,0x7F,0xE0,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"+",11*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,/*",",12*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"-",13*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*".",14*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0xC0,0x00,0xC0,0x01,0x80,
|
||||
0x01,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,
|
||||
0x18,0x00,0x18,0x00,0x30,0x00,0x30,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"/",15*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x3F,0x80,0x31,0x80,0x71,0xC0,
|
||||
0x60,0xC0,0x60,0xC0,0x66,0xC0,0x66,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x71,0xC0,
|
||||
0x31,0x80,0x3F,0x80,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"0",16*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x1F,0x00,0x1B,0x00,0x03,0x00,
|
||||
0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,
|
||||
0x03,0x00,0x1F,0xE0,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"1",17*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x7F,0x80,0x41,0xC0,0x00,0xC0,
|
||||
0x00,0xC0,0x00,0xC0,0x01,0xC0,0x01,0x80,0x03,0x00,0x06,0x00,0x0C,0x00,0x18,0x00,
|
||||
0x30,0x00,0x7F,0xC0,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"2",18*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x7F,0x80,0x41,0xC0,0x00,0xC0,
|
||||
0x00,0xC0,0x01,0xC0,0x0F,0x80,0x0F,0x80,0x01,0x80,0x00,0xC0,0x00,0xC0,0x00,0xC0,
|
||||
0x41,0xC0,0x7F,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"3",19*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0x80,0x07,0x80,0x05,0x80,
|
||||
0x0D,0x80,0x09,0x80,0x19,0x80,0x31,0x80,0x31,0x80,0x61,0x80,0x7F,0xE0,0x7F,0xE0,
|
||||
0x01,0x80,0x01,0x80,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"4",20*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x3F,0x80,0x30,0x00,0x30,0x00,
|
||||
0x30,0x00,0x3F,0x00,0x3F,0x80,0x21,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,
|
||||
0x41,0x80,0x7F,0x80,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"5",21*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x1F,0x80,0x38,0x80,0x30,0x00,
|
||||
0x70,0x00,0x60,0x00,0x6F,0x00,0x7F,0x80,0x71,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x31,0xC0,0x3F,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"6",22*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xC0,0x7F,0xC0,0x01,0x80,0x01,0x80,
|
||||
0x01,0x80,0x03,0x00,0x03,0x00,0x03,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,
|
||||
0x0C,0x00,0x0C,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"7",23*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x3F,0x80,0x71,0xC0,0x60,0xC0,
|
||||
0x60,0xC0,0x31,0x80,0x1F,0x00,0x3F,0x80,0x31,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x71,0xC0,0x3F,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"8",24*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x3F,0x80,0x71,0x80,0x60,0xC0,
|
||||
0x60,0xC0,0x60,0xC0,0x71,0xC0,0x3F,0xC0,0x1E,0xC0,0x00,0xC0,0x00,0xC0,0x01,0x80,
|
||||
0x23,0x80,0x3F,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"9",25*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*":",26*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,/*";",27*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
|
||||
0x01,0xE0,0x07,0x80,0x1E,0x00,0x70,0x00,0x70,0x00,0x1E,0x00,0x07,0x80,0x01,0xE0,
|
||||
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"<",28*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x7F,0xE0,0x7F,0xE0,0x00,0x00,0x00,0x00,0x7F,0xE0,0x7F,0xE0,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"=",29*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,
|
||||
0x78,0x00,0x1E,0x00,0x07,0x80,0x00,0xE0,0x00,0xE0,0x07,0x80,0x1E,0x00,0x78,0x00,
|
||||
0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*">",30*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x1F,0xC0,0x10,0x60,0x00,0x60,
|
||||
0x00,0xE0,0x01,0xC0,0x03,0x80,0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"?",31*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x18,0xC0,0x30,0x60,
|
||||
0x30,0x60,0x23,0xE0,0x62,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,
|
||||
0x62,0x60,0x33,0xE0,0x30,0x00,0x18,0x00,0x1C,0x00,0x07,0x80,0x00,0x00,0x00,0x00,/*"@",32*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x0F,0x00,0x0F,0x00,
|
||||
0x0F,0x00,0x1F,0x80,0x19,0x80,0x19,0x80,0x19,0x80,0x3F,0xC0,0x3F,0xC0,0x30,0xC0,
|
||||
0x30,0xC0,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"A",33*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x7F,0x80,0x61,0xC0,0x60,0xC0,
|
||||
0x60,0xC0,0x61,0xC0,0x7F,0x80,0x7F,0x80,0x60,0xC0,0x60,0x60,0x60,0x60,0x60,0x60,
|
||||
0x60,0xE0,0x7F,0xC0,0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"B",34*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x1F,0xE0,0x38,0x20,0x30,0x00,
|
||||
0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x30,0x00,
|
||||
0x38,0x20,0x1F,0xE0,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C",35*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x7F,0x80,0x61,0xC0,0x60,0xC0,
|
||||
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xC0,
|
||||
0x61,0xC0,0x7F,0x80,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"D",36*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xE0,0x7F,0xE0,0x60,0x00,0x60,0x00,
|
||||
0x60,0x00,0x60,0x00,0x7F,0xE0,0x7F,0xE0,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x60,0x00,0x7F,0xE0,0x7F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"E",37*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xE0,0x7F,0xE0,0x60,0x00,0x60,0x00,
|
||||
0x60,0x00,0x60,0x00,0x7F,0xC0,0x7F,0xC0,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"F",38*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x1F,0xC0,0x38,0x40,0x30,0x00,
|
||||
0x60,0x00,0x60,0x00,0x60,0x00,0x61,0xE0,0x61,0xE0,0x60,0x60,0x60,0x60,0x30,0x60,
|
||||
0x38,0x60,0x1F,0xE0,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"G",39*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
|
||||
0x60,0x60,0x60,0x60,0x7F,0xE0,0x7F,0xE0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
|
||||
0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"H",40*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x3F,0xC0,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x3F,0xC0,0x3F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"I",41*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x1F,0x80,0x01,0x80,0x01,0x80,
|
||||
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
|
||||
0x43,0x80,0x7F,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"J",42*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0xC0,0x61,0x80,0x63,0x00,
|
||||
0x66,0x00,0x6C,0x00,0x7C,0x00,0x7E,0x00,0x76,0x00,0x63,0x00,0x63,0x80,0x61,0x80,
|
||||
0x60,0xC0,0x60,0xE0,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"K",43*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x60,0x00,0x7F,0xE0,0x7F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"L",44*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xE0,0x70,0xE0,0x70,0xE0,0x79,0xE0,
|
||||
0x69,0x60,0x69,0x60,0x6F,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x60,0x60,0x60,0x60,
|
||||
0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"M",45*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x60,0x70,0x60,0x78,0x60,0x78,0x60,
|
||||
0x6C,0x60,0x6C,0x60,0x64,0x60,0x66,0x60,0x62,0x60,0x63,0x60,0x63,0x60,0x61,0xE0,
|
||||
0x61,0xE0,0x60,0xE0,0x60,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"N",46*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x3F,0xC0,0x30,0xC0,0x70,0xE0,
|
||||
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0xE0,
|
||||
0x30,0xC0,0x3F,0xC0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"O",47*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0xC0,0x60,0xE0,0x60,0x60,
|
||||
0x60,0x60,0x60,0x60,0x60,0xE0,0x7F,0xC0,0x7F,0x80,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"P",48*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x3F,0xC0,0x30,0xC0,0x70,0xE0,
|
||||
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x70,0xE0,
|
||||
0x30,0xC0,0x1F,0x80,0x0F,0x00,0x01,0x80,0x00,0xC0,0x00,0x80,0x00,0x00,0x00,0x00,/*"Q",49*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x7F,0xC0,0x60,0xE0,0x60,0x60,
|
||||
0x60,0x60,0x60,0x60,0x60,0xC0,0x7F,0xC0,0x7F,0x80,0x61,0xC0,0x60,0xC0,0x60,0x60,
|
||||
0x60,0x60,0x60,0x30,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"R",50*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,0x3F,0xC0,0x70,0x40,0x60,0x00,
|
||||
0x60,0x00,0x70,0x00,0x3E,0x00,0x1F,0x80,0x01,0xC0,0x00,0x60,0x00,0x60,0x00,0x60,
|
||||
0x40,0xE0,0x7F,0xC0,0x3F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"S",51*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xF0,0xFF,0xF0,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"T",52*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
|
||||
0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
|
||||
0x70,0xE0,0x3F,0xC0,0x1F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"U",53*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x30,0xC0,0x30,0xC0,
|
||||
0x30,0xC0,0x30,0xC0,0x19,0x80,0x19,0x80,0x19,0x80,0x1F,0x80,0x0F,0x00,0x0F,0x00,
|
||||
0x0F,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"V",54*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x30,0xC0,0x30,0xC0,0x30,0x60,0x60,
|
||||
0x66,0x60,0x66,0x60,0x6F,0x60,0x6F,0x60,0x69,0x60,0x69,0x60,0x39,0xC0,0x39,0xC0,
|
||||
0x39,0xC0,0x30,0xC0,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"W",55*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xE0,0x30,0xC0,0x39,0xC0,0x19,0x80,
|
||||
0x0F,0x00,0x0F,0x00,0x06,0x00,0x06,0x00,0x0F,0x00,0x0F,0x00,0x1B,0x80,0x19,0x80,
|
||||
0x31,0xC0,0x30,0xC0,0x60,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"X",56*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x70,0x60,0x60,0x30,0xC0,0x30,0xC0,
|
||||
0x19,0x80,0x1F,0x80,0x0F,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"Y",57*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xE0,0x7F,0xE0,0x00,0xC0,0x01,0xC0,
|
||||
0x01,0x80,0x03,0x00,0x07,0x00,0x06,0x00,0x0E,0x00,0x0C,0x00,0x18,0x00,0x38,0x00,
|
||||
0x30,0x00,0x7F,0xE0,0x7F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"Z",58*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x07,0x80,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x07,0x80,0x07,0x80,0x00,0x00,0x00,0x00,/*"[",59*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x30,0x00,0x30,0x00,0x18,0x00,
|
||||
0x18,0x00,0x0C,0x00,0x0C,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x03,0x00,0x03,0x00,
|
||||
0x01,0x80,0x01,0x80,0x00,0xC0,0x00,0xC0,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,/*"\",60*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x0F,0x00,0x03,0x00,0x03,0x00,0x03,0x00,
|
||||
0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,
|
||||
0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x0F,0x00,0x0F,0x00,0x00,0x00,0x00,0x00,/*"]",61*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x0F,0x80,0x0D,0x80,0x18,0xC0,
|
||||
0x30,0x60,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"^",62*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,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,0xF0,0xFF,0xF0,/*"_",63*/
|
||||
0x00,0x00,0x00,0x00,0x18,0x00,0x0C,0x00,0x06,0x00,0x03,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"`",64*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x1F,0x00,0x3F,0x80,0x21,0xC0,0x00,0xC0,0x1F,0xC0,0x3F,0xC0,0x70,0xC0,0x60,0xC0,
|
||||
0x61,0xC0,0x7F,0xC0,0x1C,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"a",65*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x6F,0x00,0x7F,0x80,0x71,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x71,0x80,0x7F,0x80,0x6F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"b",66*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x0F,0x00,0x3F,0x80,0x30,0x80,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x30,0x80,0x3F,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"c",67*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,
|
||||
0x1E,0xC0,0x3F,0xC0,0x31,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x31,0xC0,0x3F,0xC0,0x1E,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"d",68*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x0F,0x00,0x3F,0x80,0x31,0xC0,0x60,0xC0,0x7F,0xC0,0x7F,0xC0,0x60,0x00,0x60,0x00,
|
||||
0x30,0x40,0x3F,0xC0,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"e",69*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xE0,0x03,0xE0,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x3F,0xE0,0x3F,0xE0,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"f",70*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x1E,0xC0,0x3F,0xC0,0x31,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x31,0xC0,0x3F,0xC0,0x1E,0xC0,0x00,0xC0,0x21,0xC0,0x3F,0x80,0x1F,0x00,0x00,0x00,/*"g",71*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x67,0x00,0x7F,0x80,0x71,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x60,0xC0,0x60,0xC0,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"h",72*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x3E,0x00,0x3E,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x7F,0xE0,0x7F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"i",73*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x1F,0x00,0x1F,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,
|
||||
0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x3E,0x00,0x3C,0x00,0x00,0x00,/*"j",74*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,
|
||||
0x61,0xC0,0x63,0x80,0x67,0x00,0x6E,0x00,0x7C,0x00,0x7C,0x00,0x76,0x00,0x67,0x00,
|
||||
0x63,0x00,0x61,0x80,0x61,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"k",75*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x00,0xFC,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,
|
||||
0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,
|
||||
0x0E,0x00,0x07,0xC0,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"l",76*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x6D,0xC0,0x7F,0xE0,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x66,0x60,
|
||||
0x66,0x60,0x66,0x60,0x66,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"m",77*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x67,0x00,0x7F,0x80,0x71,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x60,0xC0,0x60,0xC0,0x60,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"n",78*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x1F,0x00,0x3F,0x80,0x31,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x31,0x80,0x3F,0x80,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"o",79*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x6F,0x00,0x7F,0x80,0x71,0x80,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x71,0x80,0x7F,0x80,0x6F,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x60,0x00,0x00,0x00,/*"p",80*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x1E,0xC0,0x3F,0xC0,0x31,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x31,0xC0,0x3F,0xC0,0x1E,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0x00,/*"q",81*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x0C,0xE0,0x0D,0xF0,0x0F,0x10,0x0E,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,
|
||||
0x0C,0x00,0x0C,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"r",82*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x1F,0x80,0x3F,0xC0,0x60,0x40,0x60,0x00,0x7F,0x00,0x1F,0x80,0x01,0xC0,0x00,0xC0,
|
||||
0x41,0xC0,0x7F,0x80,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"s",83*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,
|
||||
0x7F,0xC0,0x7F,0xC0,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,
|
||||
0x0C,0x00,0x0F,0xC0,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"t",84*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,0x60,0xC0,
|
||||
0x71,0xC0,0x3F,0xC0,0x1C,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"u",85*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0xC0,0x71,0xC0,0x31,0x80,0x31,0x80,0x3B,0x80,0x1B,0x00,0x1B,0x00,0x1B,0x00,
|
||||
0x0E,0x00,0x0E,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"v",86*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0xC0,0x30,0xC0,0x30,0x60,0x60,0x66,0x60,0x66,0x60,0x66,0x60,0x3F,0xC0,0x39,0xC0,
|
||||
0x39,0xC0,0x39,0xC0,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"w",87*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x71,0xC0,0x31,0x80,0x1B,0x00,0x1F,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x1F,0x00,
|
||||
0x1B,0x00,0x31,0x80,0x71,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"x",88*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x60,0xC0,0x31,0x80,0x31,0x80,0x31,0x80,0x1B,0x00,0x1B,0x00,0x1F,0x00,0x0E,0x00,
|
||||
0x0E,0x00,0x06,0x00,0x0C,0x00,0x0C,0x00,0x0C,0x00,0x38,0x00,0x38,0x00,0x00,0x00,/*"y",89*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x7F,0xC0,0x7F,0xC0,0x03,0x80,0x03,0x00,0x07,0x00,0x0E,0x00,0x1C,0x00,0x18,0x00,
|
||||
0x30,0x00,0x7F,0xC0,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"z",90*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x07,0xC0,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x3C,0x00,0x3C,0x00,0x0E,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x07,0xC0,0x03,0xC0,0x00,0x00,0x00,0x00,/*"{",91*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,/*"|",92*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x3E,0x00,0x06,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x03,0xC0,0x03,0xC0,0x07,0x00,0x06,0x00,0x06,0x00,
|
||||
0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x3E,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,/*"}",93*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef ASC2_3216
|
||||
const uint8_t asc2_3216[]={
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
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,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"!",1*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x30,0x06,0x30,
|
||||
0x06,0x30,0x06,0x30,0x06,0x30,0x06,0x30,0x06,0x30,0x06,0x30,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*""",2*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x8C,0x03,0x8C,0x03,0x0C,
|
||||
0x03,0x18,0x03,0x18,0x03,0x18,0x7F,0xFF,0x7F,0xFF,0x06,0x30,0x06,0x30,0x0E,0x30,
|
||||
0x0C,0x70,0x0C,0x60,0xFF,0xFE,0xFF,0xFE,0x18,0x60,0x18,0xC0,0x18,0xC0,0x18,0xC0,
|
||||
0x30,0xC0,0x31,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"#",3*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x80,
|
||||
0x03,0xF0,0x0F,0xFC,0x0E,0x8C,0x1C,0x80,0x1C,0x80,0x1C,0x80,0x1C,0x80,0x0E,0x80,
|
||||
0x0F,0xE0,0x03,0xF8,0x00,0xFC,0x00,0x9E,0x00,0x8E,0x00,0x8E,0x00,0x8E,0x10,0x9C,
|
||||
0x1F,0xF8,0x07,0xF0,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x00,0x00,0x00,/*"$",4*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x7E,0x00,
|
||||
0xE7,0x00,0xC3,0x00,0xC3,0x00,0xC3,0x00,0xE7,0x00,0x7E,0x1C,0x3C,0x78,0x01,0xC0,
|
||||
0x07,0x00,0x3C,0x78,0x70,0xFC,0x01,0xCE,0x01,0x86,0x01,0x86,0x01,0x86,0x01,0xCE,
|
||||
0x00,0xFC,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"%",5*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xC0,0x0F,0xE0,
|
||||
0x1E,0x20,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1E,0x00,0x0E,0x00,0x0F,0x00,0x1F,0x00,
|
||||
0x3F,0x83,0x33,0xC3,0x71,0xE3,0x70,0xE3,0x70,0xF6,0x70,0x7E,0x78,0x3C,0x3C,0x3E,
|
||||
0x1F,0xEE,0x07,0xCF,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,0x01,0x80,0x01,0x80,
|
||||
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,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,/*"'",7*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x60,0x00,0x60,
|
||||
0x00,0xE0,0x00,0xC0,0x01,0xC0,0x01,0xC0,0x01,0x80,0x03,0x80,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x01,0x80,0x01,0xC0,
|
||||
0x01,0xC0,0x00,0xC0,0x00,0xE0,0x00,0x60,0x00,0x60,0x00,0x30,0x00,0x00,0x00,0x00,/*"(",8*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x03,0x00,0x03,0x00,
|
||||
0x03,0x80,0x01,0x80,0x01,0xC0,0x01,0xC0,0x00,0xC0,0x00,0xE0,0x00,0xE0,0x00,0xE0,
|
||||
0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0x80,0x03,0x80,0x03,0x00,0x03,0x00,0x06,0x00,0x00,0x00,0x00,0x00,/*")",9*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,
|
||||
0x21,0x84,0x39,0x9C,0x0F,0xF0,0x03,0xC0,0x03,0xC0,0x0F,0xF0,0x39,0x9C,0x21,0x84,
|
||||
0x01,0x80,0x01,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,/*"*",10*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
|
||||
0x7F,0xFE,0x7F,0xFE,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"+",11*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,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,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0x80,0x03,0x80,0x03,0x80,0x03,0x00,0x00,0x00,0x00,0x00,/*",",12*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x07,0xF0,0x07,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"-",13*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*".",14*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x38,
|
||||
0x00,0x38,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0xE0,0x00,0xE0,0x01,0xC0,0x01,0xC0,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x07,0x00,0x07,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x38,0x00,0x38,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"/",15*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x0F,0xF8,
|
||||
0x0E,0x38,0x1C,0x1C,0x1C,0x1C,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x39,0xCE,0x39,0xCE,
|
||||
0x39,0xCE,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1C,0x1C,0x1C,0x0E,0x38,
|
||||
0x0F,0xF8,0x03,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"0",16*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x0F,0xE0,
|
||||
0x0C,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,
|
||||
0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,
|
||||
0x0F,0xFE,0x0F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"1",17*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x3F,0xF8,
|
||||
0x38,0x3C,0x20,0x1E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x1E,0x00,0x3C,
|
||||
0x00,0x7C,0x00,0xF8,0x00,0xF0,0x01,0xE0,0x03,0xC0,0x07,0x00,0x0E,0x00,0x1C,0x00,
|
||||
0x3F,0xFE,0x3F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"2",18*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF0,0x1F,0xF8,
|
||||
0x18,0x1C,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x3C,0x07,0xF0,0x07,0xF0,
|
||||
0x00,0x3C,0x00,0x1C,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x1E,0x30,0x3C,
|
||||
0x3F,0xF8,0x0F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"3",19*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0xF0,
|
||||
0x01,0xF0,0x01,0xF0,0x03,0x70,0x07,0x70,0x06,0x70,0x0C,0x70,0x0C,0x70,0x18,0x70,
|
||||
0x38,0x70,0x30,0x70,0x60,0x70,0x7F,0xFE,0x7F,0xFE,0x00,0x70,0x00,0x70,0x00,0x70,
|
||||
0x00,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"4",20*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x1F,0xFC,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1F,0xE0,0x1F,0xF8,0x10,0x3C,0x00,0x1C,
|
||||
0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x20,0x3C,
|
||||
0x3F,0xF8,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"5",21*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF8,0x07,0xFC,
|
||||
0x0F,0x04,0x1E,0x00,0x1C,0x00,0x1C,0x00,0x38,0x00,0x39,0xF0,0x3B,0xF8,0x3E,0x3C,
|
||||
0x3C,0x1E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x18,0x0E,0x1C,0x1C,0x0E,0x3C,
|
||||
0x0F,0xF8,0x03,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"6",22*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFE,0x3F,0xFE,
|
||||
0x00,0x1E,0x00,0x1C,0x00,0x1C,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x70,0x00,0x70,
|
||||
0x00,0xF0,0x00,0xE0,0x00,0xE0,0x01,0xE0,0x01,0xC0,0x01,0xC0,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"7",23*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF0,0x1F,0xFC,
|
||||
0x1C,0x1C,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1C,0x07,0xF0,0x0F,0xF8,
|
||||
0x1E,0x3C,0x1C,0x1C,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x3C,0x1E,0x1E,0x3C,
|
||||
0x0F,0xF8,0x07,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"8",24*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x0F,0xF8,
|
||||
0x1E,0x38,0x3C,0x1C,0x38,0x0C,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x3C,0x1E,
|
||||
0x1E,0x3E,0x0F,0xEE,0x07,0xCE,0x00,0x0E,0x00,0x1C,0x00,0x1C,0x00,0x3C,0x10,0x78,
|
||||
0x1F,0xF0,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"9",25*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*":",26*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x00,0x07,0x00,0x07,0x00,0x06,0x00,0x00,0x00,0x00,0x00,/*";",27*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x1E,0x00,0x7E,0x01,0xF8,0x0F,0xC0,0x3F,0x00,
|
||||
0x78,0x00,0x78,0x00,0x3F,0x00,0x0F,0xC0,0x01,0xF8,0x00,0x7E,0x00,0x1E,0x00,0x02,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"<",28*/
|
||||
0x00,0x00,0x00,0x00,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,0xFE,0x7F,0xFE,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x7F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"=",29*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x40,0x00,0x78,0x00,0x7E,0x00,0x1F,0x80,0x03,0xF0,0x00,0xFC,
|
||||
0x00,0x1E,0x00,0x1E,0x00,0xFC,0x03,0xF0,0x1F,0x80,0x7E,0x00,0x78,0x00,0x40,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*">",30*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x0F,0xF8,
|
||||
0x1C,0x38,0x10,0x1C,0x00,0x1C,0x00,0x3C,0x00,0x3C,0x00,0x78,0x00,0xF0,0x01,0xE0,
|
||||
0x03,0xC0,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x00,0x00,0x00,0x00,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"?",31*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF8,
|
||||
0x07,0xFC,0x0E,0x0E,0x1C,0x06,0x18,0x03,0x30,0x03,0x30,0x7B,0x61,0xFF,0x61,0x87,
|
||||
0x63,0x03,0x63,0x03,0x63,0x03,0x63,0x03,0x63,0x03,0x61,0x87,0x71,0xFF,0x30,0x7B,
|
||||
0x30,0x00,0x18,0x00,0x1C,0x00,0x0F,0x04,0x03,0xFC,0x00,0xFC,0x00,0x00,0x00,0x00,/*"@",32*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x03,0xE0,
|
||||
0x03,0xE0,0x03,0xE0,0x03,0xE0,0x07,0x70,0x07,0x70,0x07,0x70,0x0F,0x78,0x0E,0x38,
|
||||
0x0E,0x38,0x0E,0x38,0x1F,0xFC,0x1F,0xFC,0x1C,0x1C,0x38,0x0E,0x38,0x0E,0x38,0x0E,
|
||||
0x78,0x0F,0x70,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"A",33*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x3F,0xF8,
|
||||
0x38,0x38,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x38,0x3F,0xF0,0x3F,0xF0,
|
||||
0x38,0x3C,0x38,0x1C,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x1E,0x38,0x3C,
|
||||
0x3F,0xF8,0x3F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"B",34*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF8,0x07,0xFC,
|
||||
0x0F,0x0C,0x1E,0x04,0x1C,0x00,0x1C,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,
|
||||
0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x1C,0x00,0x1C,0x00,0x1E,0x04,0x0F,0x0C,
|
||||
0x07,0xFC,0x01,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C",35*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xC0,0x3F,0xF0,
|
||||
0x38,0x78,0x38,0x1C,0x38,0x1C,0x38,0x0C,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0C,0x38,0x1C,0x38,0x1C,0x38,0x78,
|
||||
0x3F,0xF0,0x3F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"D",36*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFE,0x1F,0xFE,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1F,0xFC,0x1F,0xFC,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1F,0xFE,0x1F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"E",37*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFE,0x1F,0xFE,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1F,0xFC,0x1F,0xFC,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"F",38*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF8,0x07,0xFC,
|
||||
0x0F,0x0C,0x1E,0x04,0x1C,0x00,0x1C,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x7E,
|
||||
0x38,0x7E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x0E,0x1C,0x0E,0x1C,0x0E,0x0F,0x1E,
|
||||
0x07,0xFE,0x01,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"G",39*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x0E,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x3F,0xFE,0x3F,0xFE,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"H",40*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x1F,0xFC,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x1F,0xFC,0x1F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"I",41*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF8,0x07,0xF8,
|
||||
0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,
|
||||
0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x00,0x38,0x20,0x38,0x30,0x70,
|
||||
0x3F,0xF0,0x0F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"J",42*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x07,0x38,0x0E,
|
||||
0x38,0x1C,0x38,0x38,0x38,0x70,0x38,0xE0,0x39,0xC0,0x3B,0x80,0x3F,0x80,0x3F,0xC0,
|
||||
0x3F,0xC0,0x3D,0xE0,0x38,0xF0,0x38,0x70,0x38,0x78,0x38,0x3C,0x38,0x1C,0x38,0x1E,
|
||||
0x38,0x0F,0x38,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"K",43*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1F,0xFE,0x1F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"L",44*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x1E,0x78,0x1E,
|
||||
0x7C,0x3E,0x7C,0x3E,0x7C,0x3E,0x76,0x6E,0x76,0x6E,0x76,0x6E,0x72,0x4E,0x73,0xCE,
|
||||
0x73,0xCE,0x71,0x8E,0x71,0x8E,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x70,0x0E,
|
||||
0x70,0x0E,0x70,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"M",45*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x0E,0x3C,0x0E,
|
||||
0x3E,0x0E,0x3E,0x0E,0x3E,0x0E,0x3B,0x0E,0x3B,0x0E,0x3B,0x8E,0x39,0x8E,0x39,0x8E,
|
||||
0x38,0xCE,0x38,0xCE,0x38,0xEE,0x38,0x6E,0x38,0x6E,0x38,0x3E,0x38,0x3E,0x38,0x3E,
|
||||
0x38,0x1E,0x38,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"N",46*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x0F,0xF8,
|
||||
0x0E,0x38,0x1C,0x1C,0x1C,0x1C,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1C,0x1C,0x1C,0x0E,0x38,
|
||||
0x0F,0xF8,0x03,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"O",47*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xF0,0x1F,0xFC,
|
||||
0x1C,0x1E,0x1C,0x0F,0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1C,0x0F,0x1C,0x1E,
|
||||
0x1F,0xFC,0x1F,0xF0,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"P",48*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x0F,0xF8,
|
||||
0x0E,0x38,0x1C,0x1C,0x1C,0x1C,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1C,0x1C,0x1C,0x0E,0x38,
|
||||
0x0F,0xF8,0x03,0xE0,0x00,0x70,0x00,0x38,0x00,0x1C,0x00,0x10,0x00,0x00,0x00,0x00,/*"Q",49*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xE0,0x3F,0xF0,
|
||||
0x38,0x78,0x38,0x3C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x38,
|
||||
0x3F,0xF0,0x3F,0xE0,0x38,0xF0,0x38,0x78,0x38,0x38,0x38,0x3C,0x38,0x1C,0x38,0x1E,
|
||||
0x38,0x0E,0x38,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"R",50*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x0F,0xFC,
|
||||
0x1E,0x0C,0x3C,0x04,0x38,0x00,0x38,0x00,0x38,0x00,0x3E,0x00,0x1F,0xC0,0x0F,0xF8,
|
||||
0x03,0xFC,0x00,0x3C,0x00,0x1E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x20,0x1E,0x38,0x3C,
|
||||
0x3F,0xF8,0x0F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"S",51*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x7F,0xFF,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"T",52*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x1C,0x38,0x1C,
|
||||
0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,
|
||||
0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x1C,0x38,
|
||||
0x0F,0xF0,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"U",53*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x07,0x78,0x0F,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1E,0x3C,0x0E,0x38,
|
||||
0x0E,0x38,0x0E,0x38,0x07,0x70,0x07,0x70,0x07,0x70,0x03,0xE0,0x03,0xE0,0x03,0xE0,
|
||||
0x03,0xE0,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"V",54*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x07,0xE0,0x07,
|
||||
0xE0,0x07,0x70,0x0E,0x70,0x0E,0x70,0x0E,0x73,0xCE,0x73,0xCE,0x73,0xCE,0x73,0xCE,
|
||||
0x3B,0xDC,0x3E,0x7C,0x3E,0x7C,0x3E,0x7C,0x3E,0x7C,0x3C,0x3C,0x3C,0x3C,0x1C,0x38,
|
||||
0x1C,0x38,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"W",55*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x07,0x3C,0x0F,
|
||||
0x1C,0x0E,0x1E,0x1E,0x0F,0x3C,0x07,0x38,0x07,0xF0,0x03,0xF0,0x01,0xE0,0x01,0xE0,
|
||||
0x01,0xE0,0x03,0xF0,0x07,0xF0,0x07,0x78,0x0F,0x3C,0x0E,0x1C,0x1E,0x1E,0x3C,0x0E,
|
||||
0x38,0x07,0x78,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"X",56*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x0F,0x38,0x0E,
|
||||
0x3C,0x1E,0x1C,0x1C,0x1E,0x3C,0x0E,0x38,0x07,0x70,0x07,0xF0,0x03,0xE0,0x03,0xE0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"Y",57*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFE,0x3F,0xFE,
|
||||
0x00,0x1E,0x00,0x1C,0x00,0x3C,0x00,0x78,0x00,0x70,0x00,0xF0,0x00,0xE0,0x01,0xE0,
|
||||
0x03,0xC0,0x03,0x80,0x07,0x80,0x07,0x00,0x0F,0x00,0x1E,0x00,0x1C,0x00,0x3C,0x00,
|
||||
0x3F,0xFE,0x3F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"Z",58*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x03,0xF0,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0xF0,0x03,0xF0,0x00,0x00,0x00,0x00,/*"[",59*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x38,0x00,
|
||||
0x38,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x0E,0x00,0x0E,0x00,0x07,0x00,0x07,0x00,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x01,0xC0,0x01,0xC0,0x00,0xE0,0x00,0xE0,0x00,0x70,
|
||||
0x00,0x70,0x00,0x70,0x00,0x38,0x00,0x38,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,/*"\",60*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x07,0xE0,0x00,0xE0,
|
||||
0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,
|
||||
0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,
|
||||
0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x07,0xE0,0x07,0xE0,0x00,0x00,0x00,0x00,/*"]",61*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x03,0xC0,
|
||||
0x07,0xE0,0x0E,0x70,0x0C,0x30,0x18,0x18,0x38,0x1C,0x70,0x0E,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"^",62*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,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,/*"_",63*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x07,0x00,0x03,0x00,0x01,0x80,
|
||||
0x00,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,/*"`",64*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF0,0x1F,0xFC,0x18,0x1C,0x00,0x0E,0x00,0x0E,
|
||||
0x07,0xFE,0x0F,0xFE,0x1C,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x1E,0x38,0x1E,0x3C,0x3E,
|
||||
0x1F,0xEE,0x07,0xCE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"a",65*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0xF8,0x1F,0xFC,0x1F,0x1E,0x1E,0x0E,0x1C,0x07,
|
||||
0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1E,0x0E,0x1F,0x1E,
|
||||
0x1F,0xFC,0x1C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"b",66*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x07,0xF8,0x0F,0x0C,0x0E,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1E,0x00,0x0E,0x00,0x0F,0x0C,
|
||||
0x07,0xF8,0x01,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"c",67*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x0E,0x00,0x0E,
|
||||
0x00,0x0E,0x00,0x0E,0x00,0x0E,0x07,0xCE,0x0F,0xFE,0x1E,0x3E,0x1C,0x1E,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1E,0x1E,0x3E,
|
||||
0x0F,0xFE,0x07,0xCE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"d",68*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x0F,0xF8,0x1E,0x3C,0x1C,0x1C,0x3C,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x3F,0xFE,0x3F,0xFE,0x38,0x00,0x38,0x00,0x1C,0x04,0x1E,0x0C,
|
||||
0x0F,0xF8,0x03,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"e",69*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0xFE,0x01,0xE0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x1F,0xFE,0x1F,0xFE,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"f",70*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xCE,0x0F,0xEE,0x1E,0x3E,0x1C,0x1E,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1E,0x1E,0x3E,
|
||||
0x0F,0xEE,0x07,0xCE,0x00,0x0E,0x00,0x0E,0x00,0x1C,0x08,0x3C,0x0F,0xF8,0x07,0xE0,/*"g",71*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0xF0,0x1D,0xF8,0x1E,0x3C,0x1E,0x1C,0x1C,0x1C,
|
||||
0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
|
||||
0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"h",72*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xC0,0x1F,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x3F,0xFE,0x3F,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"i",73*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0xE0,0x00,0xE0,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xE0,0x0F,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,
|
||||
0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,
|
||||
0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x01,0xC0,0x1F,0xC0,0x1F,0x00,/*"j",74*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,
|
||||
0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x0F,0x1C,0x1E,0x1C,0x3C,0x1C,0x78,0x1C,0xF0,
|
||||
0x1D,0xE0,0x1F,0xC0,0x1F,0xE0,0x1F,0xE0,0x1E,0xF0,0x1C,0x78,0x1C,0x3C,0x1C,0x1C,
|
||||
0x1C,0x1E,0x1C,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"k",75*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x01,0xC0,
|
||||
0x01,0xFC,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"l",76*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x1C,0x7F,0xBE,0x71,0xE7,0x71,0xC7,0x71,0xC7,
|
||||
0x71,0xC7,0x71,0xC7,0x71,0xC7,0x71,0xC7,0x71,0xC7,0x71,0xC7,0x71,0xC7,0x71,0xC7,
|
||||
0x71,0xC7,0x71,0xC7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"m",77*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF0,0x1D,0xF8,0x1E,0x3C,0x1E,0x1C,0x1C,0x1C,
|
||||
0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
|
||||
0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"n",78*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x0F,0xF8,0x1E,0x3C,0x1C,0x1C,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1C,0x1E,0x3C,
|
||||
0x0F,0xF8,0x03,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"o",79*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0xF8,0x1F,0xFC,0x1F,0x1E,0x1E,0x0E,0x1C,0x07,
|
||||
0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1C,0x07,0x1E,0x0E,0x1F,0x1E,
|
||||
0x1F,0xFC,0x1C,0xF8,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,0x1C,0x00,/*"p",80*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xCE,0x0F,0xFE,0x1E,0x3E,0x1C,0x1E,0x38,0x0E,
|
||||
0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1E,0x1E,0x3E,
|
||||
0x0F,0xFE,0x07,0xCE,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,0x00,0x0E,/*"q",81*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x3C,0x07,0x7E,0x07,0xC2,0x07,0x80,0x07,0x80,
|
||||
0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,
|
||||
0x07,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"r",82*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x0F,0xF8,0x1E,0x08,0x1C,0x00,0x1C,0x00,
|
||||
0x1F,0x00,0x0F,0xF0,0x07,0xF8,0x00,0xFC,0x00,0x3C,0x00,0x1C,0x00,0x1C,0x10,0x3C,
|
||||
0x1F,0xF8,0x07,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"s",83*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x3F,0xFE,0x3F,0xFE,0x03,0x80,0x03,0x80,0x03,0x80,
|
||||
0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0xC0,
|
||||
0x01,0xFE,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"t",84*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
|
||||
0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x3C,0x1E,0x3C,
|
||||
0x0F,0xDC,0x07,0x9C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"u",85*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0E,0x38,0x1C,0x38,0x1C,0x38,0x1C,0x1C,0x38,
|
||||
0x1C,0x38,0x1E,0x78,0x0E,0x70,0x0E,0x70,0x0F,0xF0,0x07,0xE0,0x07,0xE0,0x07,0xE0,
|
||||
0x03,0xC0,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"v",86*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x07,0xE0,0x07,0x70,0x0E,0x70,0x0E,0x71,0x8E,
|
||||
0x71,0x8E,0x7B,0xDE,0x3B,0xDC,0x3A,0x5C,0x3A,0x5C,0x3E,0x7C,0x1E,0x78,0x1C,0x38,
|
||||
0x1C,0x38,0x1C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"w",87*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x3C,0x1E,0x78,0x0E,0x70,0x0F,0xF0,0x07,0xE0,
|
||||
0x03,0xC0,0x03,0xC0,0x01,0x80,0x03,0xC0,0x07,0xE0,0x0F,0xF0,0x0E,0x70,0x1E,0x78,
|
||||
0x3C,0x3C,0x78,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"x",88*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x0E,0x38,0x1C,0x38,0x1C,0x3C,0x3C,0x1C,0x38,
|
||||
0x1C,0x38,0x1E,0x78,0x0E,0x70,0x0E,0x70,0x07,0xE0,0x07,0xE0,0x07,0xE0,0x03,0xC0,
|
||||
0x03,0xC0,0x03,0x80,0x03,0x80,0x03,0x80,0x07,0x00,0x0F,0x00,0x3E,0x00,0x3C,0x00,/*"y",89*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x1F,0xFC,0x00,0x3C,0x00,0x78,0x00,0x70,
|
||||
0x00,0xF0,0x01,0xE0,0x01,0xC0,0x03,0xC0,0x07,0x80,0x07,0x00,0x0F,0x00,0x1E,0x00,
|
||||
0x1F,0xFC,0x1F,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"z",90*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0xFC,0x01,0xE0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x03,0x80,0x1F,0x00,0x1F,0x00,0x03,0x80,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xE0,0x00,0xFC,0x00,0x7C,0x00,0x00,/*"{",91*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x01,0x80,0x01,0x80,
|
||||
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
|
||||
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,
|
||||
0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,0x01,0x80,/*"|",92*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x1F,0x80,0x03,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x00,0xE0,0x00,0x7C,0x00,0x7C,0x00,0xE0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
|
||||
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x03,0xC0,0x1F,0x80,0x1F,0x00,0x00,0x00,/*"}",93*/
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
305
board/ports/led_matrix/drv_matrix_led.c
Normal file
305
board/ports/led_matrix/drv_matrix_led.c
Normal file
@ -0,0 +1,305 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-05-22 yuanjie first version, function
|
||||
*/
|
||||
|
||||
/**
|
||||
* WS2812B serial LED data timing flow:
|
||||
* | T0H | H | 350ns | ±150ns |
|
||||
* | T0L | L | 800ns | ±150ns |
|
||||
* | T1H | H | 700ns | ±150ns |
|
||||
* | T1L | L | 600ns | ±150ns |
|
||||
* | RES | L | ≥50us | -- |
|
||||
* When using TIM peripheral, to meet 800kHz (1250ns) refresh rate:
|
||||
* - period is: 1250ns
|
||||
* - logic 0 is: 400ns(H) + 900ns(L)
|
||||
* - logic 1 is: 900ns(H) + 400ns(L)
|
||||
*/
|
||||
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
#include <drv_matrix_led.h>
|
||||
#include <drv_common.h>
|
||||
#include <drv_gpio.h>
|
||||
|
||||
#ifndef LED_NUM
|
||||
#define LED_NUM 19 // LED灯珠个数
|
||||
#endif
|
||||
#define LED_MATRIX_EN_PIN GET_PIN(F, 2)
|
||||
|
||||
TIM_HandleTypeDef htim3;
|
||||
DMA_HandleTypeDef hdma_tim3_ch2;
|
||||
|
||||
rt_align(RT_ALIGN_SIZE) uint8_t led_buffer[LED_NUM * 24 * 2];
|
||||
|
||||
extern void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
|
||||
|
||||
// 模拟bit码: 2为逻辑0, 7为逻辑1
|
||||
const uint8_t tile[] = {2, 7};
|
||||
|
||||
|
||||
// 常见颜色定义
|
||||
|
||||
const RGBColor_TypeDef DARK = {0, 0, 0};
|
||||
const RGBColor_TypeDef GREEN = {255, 0, 0};
|
||||
const RGBColor_TypeDef RED = {0, 255, 0};
|
||||
const RGBColor_TypeDef BLUE = {0, 0, 255};
|
||||
const RGBColor_TypeDef WHITE = {255, 255, 255};
|
||||
const RGBColor_TypeDef LT_RED = {0, 32, 0};
|
||||
const RGBColor_TypeDef LT_GREEN = {32, 0, 0};
|
||||
const RGBColor_TypeDef LT_BLUE = {0, 0, 32};
|
||||
const RGBColor_TypeDef LT_WHITE = {16, 16, 16};
|
||||
|
||||
// 灯颜色缓存
|
||||
RGBColor_TypeDef RGB_Data[LED_NUM] = {0};
|
||||
|
||||
void led_matrix_rst();
|
||||
/**
|
||||
* @brief This function handles DMA2 stream3 global interrupt.
|
||||
*/
|
||||
void DMA1_Stream5_IRQHandler(void)
|
||||
{
|
||||
HAL_DMA_IRQHandler(&hdma_tim3_ch2);
|
||||
}
|
||||
|
||||
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
|
||||
{
|
||||
if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_2)
|
||||
{
|
||||
__HAL_TIM_SetCompare(htim, TIM_CHANNEL_2,0); //占空比清0
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @brief matrix Initialization Function
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
static int matrix_init(void)
|
||||
{
|
||||
TIM_MasterConfigTypeDef sMasterConfig = {0};
|
||||
TIM_OC_InitTypeDef sConfigOC = {0};
|
||||
|
||||
/* TIM3_CH2 Init */
|
||||
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||
|
||||
htim3.Instance = TIM3;
|
||||
htim3.Init.Prescaler = 10-1;
|
||||
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
htim3.Init.Period = 10-1; // 840kHz
|
||||
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
htim3.Init.RepetitionCounter = 0;
|
||||
htim3.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
if (HAL_TIM_PWM_Init(&htim3) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
sConfigOC.OCMode = TIM_OCMODE_PWM1;
|
||||
sConfigOC.Pulse = 0;
|
||||
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
|
||||
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
|
||||
if (HAL_TIM_PWM_ConfigChannel(&htim3, &sConfigOC, TIM_CHANNEL_2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
|
||||
HAL_TIM_MspPostInit(&htim3);
|
||||
|
||||
/* TIM3 DMA Init */
|
||||
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||
|
||||
hdma_tim3_ch2.Instance = DMA1_Stream5;
|
||||
hdma_tim3_ch2.Init.Channel = DMA_CHANNEL_5;
|
||||
hdma_tim3_ch2.Init.Direction = DMA_MEMORY_TO_PERIPH;
|
||||
hdma_tim3_ch2.Init.PeriphInc = DMA_PINC_DISABLE;
|
||||
hdma_tim3_ch2.Init.MemInc = DMA_MINC_ENABLE;
|
||||
hdma_tim3_ch2.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
|
||||
hdma_tim3_ch2.Init.MemDataAlignment = DMA_PDATAALIGN_HALFWORD;
|
||||
hdma_tim3_ch2.Init.Mode = DMA_NORMAL;
|
||||
hdma_tim3_ch2.Init.Priority = DMA_PRIORITY_HIGH;
|
||||
hdma_tim3_ch2.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
|
||||
if (HAL_DMA_Init(&hdma_tim3_ch2) != HAL_OK)
|
||||
{
|
||||
Error_Handler();
|
||||
}
|
||||
__HAL_LINKDMA(&htim3, hdma[TIM_DMA_ID_CC2], hdma_tim3_ch2);
|
||||
|
||||
/* NVIC configuration for DMA transfer complete interrupt */
|
||||
HAL_NVIC_SetPriority(DMA1_Stream5_IRQn, 0, 0);
|
||||
HAL_NVIC_EnableIRQ(DMA1_Stream5_IRQn);
|
||||
|
||||
rt_pin_mode(LED_MATRIX_EN_PIN, PIN_MODE_OUTPUT);
|
||||
rt_pin_write(LED_MATRIX_EN_PIN, PIN_LOW);
|
||||
led_matrix_rst();
|
||||
return RT_EOK;
|
||||
|
||||
}
|
||||
|
||||
INIT_APP_EXPORT(matrix_init);
|
||||
|
||||
/**
|
||||
* @brief 设置灯带颜色发送缓存
|
||||
* @param[in] ID 颜色
|
||||
*/
|
||||
void Set_LEDColor(uint16_t LedId, RGBColor_TypeDef Color)
|
||||
{
|
||||
RGB_Data[LedId].G = Color.G;
|
||||
RGB_Data[LedId].R = Color.R;
|
||||
RGB_Data[LedId].B = Color.B;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TIM发送控制ws2812
|
||||
* @param[in] 待发送缓存
|
||||
*/
|
||||
static void TIM_Send_WS2812(uint8_t *rgb_buffer, uint32_t size)
|
||||
{
|
||||
// 判断上次DMA有没有传输完成
|
||||
while (HAL_DMA_GetState(&hdma_tim3_ch2) != HAL_DMA_STATE_READY);
|
||||
// 发送一个24bit的RGB数据
|
||||
HAL_TIM_PWM_Start_DMA(&htim3, TIM_CHANNEL_2, (uint32_t *)rgb_buffer, size);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 控制WS2812
|
||||
* @param[in] 待发送缓存
|
||||
*/
|
||||
|
||||
void RGB_Reflash(void)
|
||||
{
|
||||
uint8_t dat_b,dat_r,dat_g;
|
||||
// 将数组颜色转化为24个要发送的字节数据
|
||||
for (uint16_t i = 0; i < LED_NUM; i++)
|
||||
{
|
||||
dat_g = RGB_Data[i].G;
|
||||
dat_r = RGB_Data[i].R;
|
||||
dat_b = RGB_Data[i].B;
|
||||
for (uint16_t j = 0; j < 8; j++) {
|
||||
led_buffer[(14 + (i * 48))-(j<<1)] = tile[dat_g & 0x01];
|
||||
led_buffer[(14 + (i * 48))-(j<<1) + 1] = 0;
|
||||
led_buffer[(30 + (i * 48))-(j<<1)] = tile[dat_r & 0x01];
|
||||
led_buffer[(30 + (i * 48))-(j<<1) + 1] = 0;
|
||||
led_buffer[(46 + (i * 48))-(j<<1)] = tile[dat_b & 0x01];
|
||||
led_buffer[(46 + (i * 48))-(j<<1) + 1] = 0;
|
||||
dat_g >>=1;
|
||||
dat_r >>=1;
|
||||
dat_b >>=1;
|
||||
}
|
||||
}
|
||||
TIM_Send_WS2812(led_buffer, sizeof(led_buffer) / 2);
|
||||
|
||||
}
|
||||
void led_matrix_rst()
|
||||
{
|
||||
for (uint32_t i = 0; i < (LED_NUM * 24); i++)
|
||||
{
|
||||
led_buffer[ (i<<1) ] = 3;
|
||||
led_buffer[ (i<<1) + 1] = 0;
|
||||
}
|
||||
TIM_Send_WS2812(led_buffer, sizeof(led_buffer) / 2 );
|
||||
}
|
||||
|
||||
MSH_CMD_EXPORT(led_matrix_rst, Test led matrix on board)
|
||||
|
||||
void led_matrix_fill(RGBColor_TypeDef Color)
|
||||
{
|
||||
rt_memset(RGB_Data, 0x00, sizeof(RGB_Data));
|
||||
for (uint8_t i = 0; i < LED_NUM; i++)
|
||||
{
|
||||
Set_LEDColor(i, Color);
|
||||
}
|
||||
RGB_Reflash();
|
||||
}
|
||||
|
||||
void led_matrix_fill_test(uint8_t index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
led_matrix_fill(LT_RED);
|
||||
break;
|
||||
case 1:
|
||||
led_matrix_fill(LT_GREEN);
|
||||
break;
|
||||
case 2:
|
||||
led_matrix_fill(LT_BLUE);
|
||||
break;
|
||||
case 3:
|
||||
led_matrix_fill(LT_WHITE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void led_matrix_test1()
|
||||
{
|
||||
rt_memset(RGB_Data, 0x00, sizeof(RGB_Data));
|
||||
Set_LEDColor(0, RED);
|
||||
Set_LEDColor(1, GREEN);
|
||||
Set_LEDColor(2, BLUE);
|
||||
Set_LEDColor(3, RED);
|
||||
Set_LEDColor(4, GREEN);
|
||||
Set_LEDColor(5, BLUE);
|
||||
Set_LEDColor(6, RED);
|
||||
Set_LEDColor(7, GREEN);
|
||||
Set_LEDColor(8, BLUE);
|
||||
Set_LEDColor(9, WHITE);
|
||||
// led_matrix_rst();
|
||||
RGB_Reflash();
|
||||
}
|
||||
MSH_CMD_EXPORT(led_matrix_test1, Test led matrix on board)
|
||||
|
||||
void led_matrix_test2()
|
||||
{
|
||||
rt_memset(RGB_Data, 0x00, sizeof(RGB_Data));
|
||||
Set_LEDColor(0, BLUE);
|
||||
Set_LEDColor(1, RED);
|
||||
Set_LEDColor(2, GREEN);
|
||||
Set_LEDColor(3, BLUE);
|
||||
Set_LEDColor(4, RED);
|
||||
Set_LEDColor(5, GREEN);
|
||||
Set_LEDColor(6, BLUE);
|
||||
Set_LEDColor(7, RED);
|
||||
Set_LEDColor(8, GREEN);
|
||||
Set_LEDColor(9, RED);
|
||||
|
||||
Set_LEDColor(14, GREEN);
|
||||
Set_LEDColor(15, GREEN);
|
||||
Set_LEDColor(16, BLUE);
|
||||
Set_LEDColor(17, RED);
|
||||
Set_LEDColor(18, WHITE);
|
||||
|
||||
RGB_Reflash();
|
||||
}
|
||||
MSH_CMD_EXPORT(led_matrix_test2, Test led matrix on board)
|
||||
|
||||
void led_matrix_test3()
|
||||
{
|
||||
for (uint8_t i = 0; i < 4; i++)
|
||||
{
|
||||
led_matrix_fill_test(i);
|
||||
rt_thread_mdelay(1000);
|
||||
}
|
||||
led_matrix_rst();
|
||||
}
|
||||
|
||||
MSH_CMD_EXPORT(led_matrix_test3, Test led matrix on board)
|
||||
|
||||
void led_matrix_show_color(uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
RGBColor_TypeDef color = {g,r,b};
|
||||
led_matrix_fill(color);
|
||||
}
|
21
board/ports/led_matrix/drv_matrix_led.h
Normal file
21
board/ports/led_matrix/drv_matrix_led.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef _LED_MATRIX
|
||||
#define _LED_MATRIX
|
||||
#include <rtthread.h>
|
||||
|
||||
typedef struct RGBColor_TypeDef
|
||||
{
|
||||
uint8_t G;
|
||||
uint8_t R;
|
||||
uint8_t B;
|
||||
} RGBColor_TypeDef; // 颜色结构体
|
||||
|
||||
extern const RGBColor_TypeDef DARK;
|
||||
extern const RGBColor_TypeDef GREEN;
|
||||
extern const RGBColor_TypeDef RED;
|
||||
extern const RGBColor_TypeDef BLUE;
|
||||
extern const RGBColor_TypeDef WHITE;
|
||||
|
||||
extern void Set_LEDColor(uint16_t LedId, RGBColor_TypeDef Color);
|
||||
extern void RGB_Reflash(void);
|
||||
extern void led_matrix_rst();
|
||||
#endif
|
16
board/ports/lvgl/SConscript
Normal file
16
board/ports/lvgl/SConscript
Normal file
@ -0,0 +1,16 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
group = []
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = group + DefineGroup('LVGL-port', src, depend = ['BSP_USING_LVGL'], CPPPATH = CPPPATH)
|
||||
Return('group')
|
17
board/ports/lvgl/demo/SConscript
Normal file
17
board/ports/lvgl/demo/SConscript
Normal file
@ -0,0 +1,17 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
group = []
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = group + DefineGroup('LVGL-demo', src, depend = ['BSP_USING_LVGL', 'BSP_USING_LVGL_DEMO'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
30
board/ports/lvgl/demo/lv_demo.c
Normal file
30
board/ports/lvgl/demo/lv_demo.c
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-10-17 Meco Man first version
|
||||
* 2022-05-10 Meco Man improve rt-thread initialization process
|
||||
*/
|
||||
#include <lvgl.h>
|
||||
|
||||
void lv_user_gui_init(void)
|
||||
{
|
||||
/* display demo; you may replace with your LVGL application at here */
|
||||
// extern void lv_demo_pingpong(void);
|
||||
// extern lv_demo_calendar();
|
||||
// lv_demo_calendar();
|
||||
|
||||
|
||||
// extern void lv_demo_music(void);
|
||||
// lv_demo_music();
|
||||
|
||||
|
||||
extern void lv_demo_benchmark(void);
|
||||
lv_demo_benchmark();
|
||||
|
||||
// extern lv_demo_widgets();
|
||||
// lv_demo_widgets();
|
||||
}
|
50
board/ports/lvgl/demo/lv_demo_calendar.c
Normal file
50
board/ports/lvgl/demo/lv_demo_calendar.c
Normal file
@ -0,0 +1,50 @@
|
||||
#include <lvgl.h>
|
||||
#include <board.h>
|
||||
#include <drv_lcd.h>
|
||||
|
||||
static void event_handler(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
lv_obj_t * obj = lv_event_get_current_target(e);
|
||||
|
||||
if(code == LV_EVENT_VALUE_CHANGED) {
|
||||
lv_calendar_date_t date;
|
||||
if(lv_calendar_get_pressed_date(obj, &date)) {
|
||||
LV_LOG_USER("Clicked date: %02d.%02d.%d", date.day, date.month, date.year);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void lv_demo_calendar(void)
|
||||
{
|
||||
lv_obj_t * calendar = lv_calendar_create(lv_scr_act());
|
||||
lv_obj_set_size(calendar, LCD_W, LCD_H);
|
||||
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 0);
|
||||
lv_obj_add_event_cb(calendar, event_handler, LV_EVENT_ALL, NULL);
|
||||
|
||||
lv_calendar_set_today_date(calendar, 2021, 02, 23);
|
||||
lv_calendar_set_showed_date(calendar, 2021, 02);
|
||||
|
||||
/*Highlight a few days*/
|
||||
static lv_calendar_date_t highlighted_days[3]; /*Only its pointer will be saved so should be static*/
|
||||
highlighted_days[0].year = 2021;
|
||||
highlighted_days[0].month = 02;
|
||||
highlighted_days[0].day = 6;
|
||||
|
||||
highlighted_days[1].year = 2021;
|
||||
highlighted_days[1].month = 02;
|
||||
highlighted_days[1].day = 11;
|
||||
|
||||
highlighted_days[2].year = 2022;
|
||||
highlighted_days[2].month = 02;
|
||||
highlighted_days[2].day = 22;
|
||||
|
||||
lv_calendar_set_highlighted_dates(calendar, highlighted_days, 3);
|
||||
|
||||
#if LV_USE_CALENDAR_HEADER_DROPDOWN
|
||||
lv_calendar_header_dropdown_create(calendar);
|
||||
#elif LV_USE_CALENDAR_HEADER_ARROW
|
||||
lv_calendar_header_arrow_create(calendar);
|
||||
#endif
|
||||
lv_calendar_set_showed_date(calendar, 2021, 10);
|
||||
}
|
43
board/ports/lvgl/lv_conf.h
Normal file
43
board/ports/lvgl/lv_conf.h
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-10-18 Meco Man First version
|
||||
*/
|
||||
|
||||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
|
||||
#include <rtconfig.h>
|
||||
|
||||
#define LV_COLOR_DEPTH 16
|
||||
#define LV_USE_PERF_MONITOR 1
|
||||
#define MY_DISP_HOR_RES 240
|
||||
#define MY_DISP_VER_RES 240
|
||||
//#define LV_USE_LOG 1
|
||||
|
||||
#ifdef PKG_USING_LV_MUSIC_DEMO
|
||||
/* music player demo */
|
||||
#define LV_HOR_RES_MAX MY_DISP_HOR_RES
|
||||
#define LV_VER_RES_MAX MY_DISP_VER_RES
|
||||
#define LV_USE_DEMO_RTT_MUSIC 1
|
||||
#define LV_DEMO_RTT_MUSIC_AUTO_PLAY 1
|
||||
#define LV_FONT_MONTSERRAT_12 1
|
||||
#define LV_FONT_MONTSERRAT_16 1
|
||||
#define LV_COLOR_SCREEN_TRANSP 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define LV_USE_DEMO_BENCHMARK 1
|
||||
|
||||
|
||||
//#define LV_USE_DEMO_WIDGETS 1
|
||||
|
||||
|
||||
//#define LV_USE_DEMO_MUSIC 1
|
||||
|
||||
#endif
|
189
board/ports/lvgl/lv_port_disp.c
Normal file
189
board/ports/lvgl/lv_port_disp.c
Normal file
@ -0,0 +1,189 @@
|
||||
/**
|
||||
* @file lv_port_disp_templ.c
|
||||
*
|
||||
*/
|
||||
|
||||
/*Copy this file as "lv_port_disp.c" and set this value to "1" to enable content*/
|
||||
#if 1
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <lv_conf.h>
|
||||
#include "lv_port_disp.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#ifndef MY_DISP_HOR_RES
|
||||
#warning Please define or replace the macro MY_DISP_HOR_RES with the actual screen width, default value 320 is used for now.
|
||||
#define MY_DISP_HOR_RES 240
|
||||
#endif
|
||||
|
||||
#ifndef MY_DISP_VER_RES
|
||||
#warning Please define or replace the macro MY_DISP_HOR_RES with the actual screen height, default value 240 is used for now.
|
||||
#define MY_DISP_VER_RES 240
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
static void disp_init(void);
|
||||
|
||||
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p);
|
||||
//static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
|
||||
// const lv_area_t * fill_area, lv_color_t color);
|
||||
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
void lv_port_disp_init(void)
|
||||
{
|
||||
/*-------------------------
|
||||
* Initialize your display
|
||||
* -----------------------*/
|
||||
disp_init();
|
||||
|
||||
/*-----------------------------
|
||||
* Create a buffer for drawing
|
||||
*----------------------------*/
|
||||
|
||||
/**
|
||||
* LVGL requires a buffer where it internally draws the widgets.
|
||||
* Later this buffer will passed to your display driver's `flush_cb` to copy its content to your display.
|
||||
* The buffer has to be greater than 1 display row
|
||||
*
|
||||
* There are 3 buffering configurations:
|
||||
* 1. Create ONE buffer:
|
||||
* LVGL will draw the display's content here and writes it to your display
|
||||
*
|
||||
* 2. Create TWO buffer:
|
||||
* LVGL will draw the display's content to a buffer and writes it your display.
|
||||
* You should use DMA to write the buffer's content to the display.
|
||||
* It will enable LVGL to draw the next part of the screen to the other buffer while
|
||||
* the data is being sent form the first buffer. It makes rendering and flushing parallel.
|
||||
*
|
||||
* 3. Double buffering
|
||||
* Set 2 screens sized buffers and set disp_drv.full_refresh = 1.
|
||||
* This way LVGL will always provide the whole rendered screen in `flush_cb`
|
||||
* and you only need to change the frame buffer's address.
|
||||
*/
|
||||
|
||||
/* Example for 1) */
|
||||
static lv_disp_draw_buf_t draw_buf_dsc_1;
|
||||
|
||||
/*GCC*/
|
||||
#if defined ( __GNUC__ )
|
||||
static lv_color_t buf_1[MY_DISP_HOR_RES * MY_DISP_HOR_RES / 2] __attribute__((section(".LVGLccm"))); /*A buffer for 10 rows*/
|
||||
/*MDK*/
|
||||
#elif defined ( __CC_ARM )
|
||||
__attribute__((at(0x10000000))) lv_color_t buf_1[LCD_H * LCD_W / 2];
|
||||
#endif
|
||||
|
||||
lv_disp_draw_buf_init(&draw_buf_dsc_1, buf_1, NULL, MY_DISP_HOR_RES * MY_DISP_HOR_RES / 2); /*Initialize the display buffer*/
|
||||
/*-----------------------------------
|
||||
* Register the display in LVGL
|
||||
*----------------------------------*/
|
||||
|
||||
static lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
|
||||
lv_disp_drv_init(&disp_drv); /*Basic initialization*/
|
||||
|
||||
/*Set up the functions to access to your display*/
|
||||
|
||||
/*Set the resolution of the display*/
|
||||
disp_drv.hor_res = MY_DISP_HOR_RES;
|
||||
disp_drv.ver_res = MY_DISP_VER_RES;
|
||||
|
||||
/*Used to copy the buffer's content to the display*/
|
||||
disp_drv.flush_cb = disp_flush;
|
||||
|
||||
/*Set a display buffer*/
|
||||
disp_drv.draw_buf = &draw_buf_dsc_1;
|
||||
|
||||
/*Required for Example 3)*/
|
||||
//disp_drv.full_refresh = 1;
|
||||
|
||||
/* Fill a memory array with a color if you have GPU.
|
||||
* Note that, in lv_conf.h you can enable GPUs that has built-in support in LVGL.
|
||||
* But if you have a different GPU you can use with this callback.*/
|
||||
//disp_drv.gpu_fill_cb = gpu_fill;
|
||||
|
||||
/*Finally register the driver*/
|
||||
lv_disp_drv_register(&disp_drv);
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/*Initialize your display and the required peripherals.*/
|
||||
static void disp_init(void)
|
||||
{
|
||||
/*You code here*/
|
||||
}
|
||||
|
||||
volatile bool disp_flush_enabled = true;
|
||||
|
||||
/* Enable updating the screen (the flushing process) when disp_flush() is called by LVGL
|
||||
*/
|
||||
void disp_enable_update(void)
|
||||
{
|
||||
disp_flush_enabled = true;
|
||||
}
|
||||
|
||||
/* Disable updating the screen (the flushing process) when disp_flush() is called by LVGL
|
||||
*/
|
||||
void disp_disable_update(void)
|
||||
{
|
||||
disp_flush_enabled = false;
|
||||
}
|
||||
|
||||
/*Flush the content of the internal buffer the specific area on the display
|
||||
*You can use DMA or any hardware acceleration to do this operation in the background but
|
||||
*'lv_disp_flush_ready()' has to be called when finished.*/
|
||||
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
|
||||
{
|
||||
extern void lcd_fill_array(rt_uint16_t x_start, rt_uint16_t y_start, rt_uint16_t x_end, rt_uint16_t y_end, void *pcolor);
|
||||
lcd_fill_array(area->x1, area->y1, area->x2, area->y2, color_p);
|
||||
|
||||
lv_disp_flush_ready(disp_drv);
|
||||
}
|
||||
|
||||
/*OPTIONAL: GPU INTERFACE*/
|
||||
|
||||
/*If your MCU has hardware accelerator (GPU) then you can use it to fill a memory with a color*/
|
||||
//static void gpu_fill(lv_disp_drv_t * disp_drv, lv_color_t * dest_buf, lv_coord_t dest_width,
|
||||
// const lv_area_t * fill_area, lv_color_t color)
|
||||
//{
|
||||
// /*It's an example code which should be done by your GPU*/
|
||||
// int32_t x, y;
|
||||
// dest_buf += dest_width * fill_area->y1; /*Go to the first line*/
|
||||
//
|
||||
// for(y = fill_area->y1; y <= fill_area->y2; y++) {
|
||||
// for(x = fill_area->x1; x <= fill_area->x2; x++) {
|
||||
// dest_buf[x] = color;
|
||||
// }
|
||||
// dest_buf+=dest_width; /*Go to the next line*/
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
#else /*Enable this file at the top*/
|
||||
|
||||
/*This dummy typedef exists purely to silence -Wpedantic.*/
|
||||
typedef int keep_pedantic_happy;
|
||||
#endif
|
57
board/ports/lvgl/lv_port_disp.h
Normal file
57
board/ports/lvgl/lv_port_disp.h
Normal file
@ -0,0 +1,57 @@
|
||||
/**
|
||||
* @file lv_port_disp_templ.h
|
||||
*
|
||||
*/
|
||||
|
||||
/*Copy this file as "lv_port_disp.h" and set this value to "1" to enable content*/
|
||||
#if 1
|
||||
|
||||
#ifndef LV_PORT_DISP_TEMPL_H
|
||||
#define LV_PORT_DISP_TEMPL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl.h"
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
/* Initialize low level display driver */
|
||||
void lv_port_disp_init(void);
|
||||
|
||||
/* Enable updating the screen (the flushing process) when disp_flush() is called by LVGL
|
||||
*/
|
||||
void disp_enable_update(void);
|
||||
|
||||
/* Disable updating the screen (the flushing process) when disp_flush() is called by LVGL
|
||||
*/
|
||||
void disp_disable_update(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_PORT_DISP_TEMPL_H*/
|
||||
|
||||
#endif /*Disable/Enable content*/
|
18
board/ports/lvgl/lv_port_indev.c
Normal file
18
board/ports/lvgl/lv_port_indev.c
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2021-10-18 Meco Man The first version
|
||||
*/
|
||||
#include <lvgl.h>
|
||||
#include <stdbool.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
|
||||
void lv_port_indev_init(void)
|
||||
{
|
||||
|
||||
}
|
28
board/ports/phy_reset.c
Normal file
28
board/ports/phy_reset.c
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-11-23 flybreak first version
|
||||
*/
|
||||
|
||||
#include <board.h>
|
||||
|
||||
#define RESET_IO GET_PIN(D, 3)
|
||||
|
||||
void phy_reset(void)
|
||||
{
|
||||
rt_pin_write(RESET_IO, PIN_LOW);
|
||||
rt_thread_mdelay(50);
|
||||
rt_pin_write(RESET_IO, PIN_HIGH);
|
||||
}
|
||||
|
||||
int phy_init(void)
|
||||
{
|
||||
rt_pin_mode(RESET_IO, PIN_MODE_OUTPUT);
|
||||
rt_pin_write(RESET_IO, PIN_HIGH);
|
||||
return RT_EOK;
|
||||
}
|
||||
INIT_BOARD_EXPORT(phy_init);
|
121
board/ports/pm/drv_pm.c
Normal file
121
board/ports/pm/drv_pm.c
Normal file
@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2023, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-07-31 tanek first version
|
||||
*/
|
||||
|
||||
#include <rthw.h>
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <board.h>
|
||||
/**
|
||||
* This function will put STM32F4xx into sleep mode.
|
||||
*
|
||||
* @param pm pointer to power manage structure
|
||||
*/
|
||||
static void sleep(struct rt_pm *pm, uint8_t mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case PM_SLEEP_MODE_NONE:
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_IDLE:
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_LIGHT:
|
||||
HAL_SuspendTick(); /* 关闭系统时钟中断 */
|
||||
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI); /* 进入 F407 sleep 模式,这个模式会停掉所有时钟,可被任意中断唤醒 */
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_DEEP:
|
||||
HAL_SuspendTick(); /* 关闭系统时钟中断 */
|
||||
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); /* 进入 F407 stop 模式,这个模式会停掉所有时钟,可被任意中断唤醒 */
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_STANDBY:
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_SHUTDOWN:
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will be Called in Wake up interrupt callback
|
||||
*
|
||||
* @param pm pointer to power manage structure
|
||||
*/
|
||||
|
||||
static struct rt_device *device = RT_NULL;
|
||||
static struct rt_pm *pm = RT_NULL;
|
||||
|
||||
void pm_wk_up()
|
||||
{
|
||||
|
||||
switch (pm->sleep_mode)
|
||||
{
|
||||
case PM_SLEEP_MODE_NONE:
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_IDLE:
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_LIGHT:
|
||||
HAL_ResumeTick(); /* 启动系统时钟中断 */
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_DEEP:
|
||||
SystemClock_Config(); /* 重新配置系统时钟 */
|
||||
HAL_ResumeTick(); /* 启动系统时钟中断 */
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_STANDBY:
|
||||
break;
|
||||
|
||||
case PM_SLEEP_MODE_SHUTDOWN:
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function initialize the power manager
|
||||
*/
|
||||
static int drv_pm_hw_init(void)
|
||||
{
|
||||
static const struct rt_pm_ops _ops =
|
||||
{
|
||||
sleep,
|
||||
RT_NULL,
|
||||
RT_NULL,
|
||||
RT_NULL,
|
||||
RT_NULL
|
||||
};
|
||||
|
||||
/* initialize system pm module */
|
||||
rt_system_pm_init(&_ops, 0, RT_NULL);
|
||||
|
||||
/* get pm device */
|
||||
device = rt_device_find("pm");
|
||||
if(device == RT_NULL)
|
||||
{
|
||||
rt_kprintf("rt_pm find error");
|
||||
return 0;
|
||||
}
|
||||
pm = rt_container_of(device,struct rt_pm,parent);
|
||||
return 1;
|
||||
}
|
||||
INIT_DEVICE_EXPORT(drv_pm_hw_init);
|
44
board/ports/pm/drv_wakeup.c
Normal file
44
board/ports/pm/drv_wakeup.c
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-08-07 Tanek first implementation
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <stm32F4xx.h>
|
||||
#include "board.h"
|
||||
#include "drv_gpio.h"
|
||||
|
||||
#define USER_WAKEUP_PIN GET_PIN(C, 5)
|
||||
#define DRV_WKUP_PIN_IRQ_MODE PIN_IRQ_MODE_FALLING
|
||||
|
||||
static void (*_wakeup_hook)(void);
|
||||
|
||||
void bsp_register_wakeup(void (*hook)(void))
|
||||
{
|
||||
RT_ASSERT(hook != RT_NULL);
|
||||
|
||||
_wakeup_hook = hook;
|
||||
}
|
||||
|
||||
static void _wakeup_callback(void *args)
|
||||
{
|
||||
extern void pm_wk_up();
|
||||
pm_wk_up(); /* wakeup from deep sleep */
|
||||
if (_wakeup_hook)
|
||||
_wakeup_hook();
|
||||
}
|
||||
|
||||
static int rt_hw_wakeup_init(void)
|
||||
{
|
||||
rt_pin_mode(USER_WAKEUP_PIN, PIN_MODE_INPUT_PULLUP);
|
||||
rt_pin_attach_irq(USER_WAKEUP_PIN, DRV_WKUP_PIN_IRQ_MODE, _wakeup_callback, RT_NULL);
|
||||
rt_pin_irq_enable(USER_WAKEUP_PIN, 1);
|
||||
return 0;
|
||||
}
|
||||
INIT_BOARD_EXPORT(rt_hw_wakeup_init);
|
17
board/ports/pm/drv_wakeup.h
Normal file
17
board/ports/pm/drv_wakeup.h
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2018, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2018-08-07 Tanek first implementation
|
||||
*/
|
||||
|
||||
#ifndef __DRV_WAKEUP_H__
|
||||
#define __DRV_WAKEUP_H__
|
||||
|
||||
extern void bsp_register_wakeup(void (*hook)(void));
|
||||
|
||||
#endif /* __DRV_WAKEUP_H__ */
|
||||
|
16
board/ports/rs485/SConscript
Normal file
16
board/ports/rs485/SConscript
Normal file
@ -0,0 +1,16 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
group = []
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = group + DefineGroup('RS485_port', src, depend = ['BSP_USING_RS485'], CPPPATH = CPPPATH)
|
||||
Return('group')
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user