upgrade pico_template to v2.0.3

add pack
This commit is contained in:
Lyon 2023-04-22 17:44:38 +08:00
parent c487912fc5
commit 6454fd8343
331 changed files with 29498 additions and 5100 deletions

2
bsp/pico/.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

71
bsp/pico/.gitignore vendored Normal file
View File

@ -0,0 +1,71 @@
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf
*.dep
project/mdk/template.uvguix.*
project/mdk/Objects
*.scvd
*.iex
project/mdk/JLinkLog.txt
project/mdk/template.uf2
*._ac
*.__i
*@*
*.00??
project/mdk/RTE/PikaScript
RTE_Components.h
Pre_Include_*
project/mdk/RTE/Acceleration/README.md
project/mdk/RTE/Acceleration/img2c.py
project/mdk/RTE/Acceleration/arm_2d.c
project/mdk/RTE/Utilities/core_portme.c

Binary file not shown.

View File

@ -1,78 +0,0 @@
SET PATH=C:\Keil_v5\ARM\ARMCLANG\Bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\CMake\bin;C:\MinGW\bin;C:\Users\lyon\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts;C:\Program Files\PuTTY\;C:\mipsel-none-elf-win\bin;C:\Program Files\dotnet\;C:\Program Files\MATLAB\R2021b\runtime\win64;C:\Program Files\MATLAB\R2021b\bin;C:\Program Files\nodejs\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Go\bin;C:\Users\lyon\.cargo\bin;C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin;C:\Users\lyon\AppData\Local\Microsoft\WindowsApps;C:\texlive\2021\bin\win32;C:\Loongson_IDE32\msys\bin;C:\Loongson_IDE32\Toolchains\mips-mti-elf\2018.11-01\bin;C:\Users\lyon\.dotnet\tools;C:\Users\lyon\AppData\Roaming\npm;C:\Users\lyon\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\lyon\go\bin
SET CPU_TYPE=ARMCM0P_MPU
SET CPU_VENDOR=ARM
SET UV2_TARGET=AC6-flash
SET CPU_CLOCK=0x00B71B00
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\startup_rp2040.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\system_rp2040.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\clocks.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\watchdog.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pll.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\platform.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\xosc.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\irq.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\irq_handler_chain._ac"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\gpio.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\multicore.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\sync.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\critical_section.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\lock_core.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\mutex.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\sem.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\time.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\timeout_helper.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\timer.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\claim.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\queue.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pheap.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\datetime.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\stdlib.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\uart.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\compile_time_choice._ac"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\runtime.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\i2c.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\spi.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\adc.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\bootrom.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\stdio_uart.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\env_wrapper.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\stdio.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\main.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\baseobj.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\dataarg.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\dataargs.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\datalink.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\datalinknode.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\datamemory.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\dataqueue.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\dataqueueobj.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\datastack.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\datastring.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\datastrs.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikaobj.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikaparser.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikaplatform.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikavm.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\tinyobj.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikadebuger_debuger.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastddata_dict.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastddata_list.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastddata_string.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib_memchecker.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib_rangeobj.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib_stringobj.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib_sysobj.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdtask_task.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikamain-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikascript.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib_memchecker-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib_rangeobj-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib_sysobj-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastddata_dict-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastddata_list-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastddata-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\pikastdlib_stringobj-api.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\eventrecorder.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmClang.exe" @".\objects\retarget_io.__i"
"C:\Keil_v5\ARM\ARMCLANG\Bin\ArmLink" --Via ".\Objects\template.lnp"

View File

@ -1,69 +0,0 @@
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc
; command above MUST be in first line (no comment above!)
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
#define FLASH_SIZE 0x00200000
#define SRAM_SIZE (1024*248)
#define STACK_0_SIZE (1024*4)
#define STACK_1_SIZE (1024*1)
#define HEAP_0_SIZE (1024*32)
#define HEAP_1_SIZE (1024*1)
#define RAMSIZE_VALID (SRAM_SIZE - \
STACK_1_SIZE - HEAP_1_SIZE - \
STACK_0_SIZE - HEAP_0_SIZE - 0x100)
LR_STAGE2_BOOT 0x10000000 0x100 {
ER_STAGE2_BOOT +0 0x100 {
compile_time_choice.o (+RO)
}
ER_FILL ImageLimit(ER_STAGE2_BOOT) FILL 0xDEADBEEF 0x100 - ImageLength(ER_STAGE2_BOOT) {
}
}
LR_IROM1 0x10000100 FLASH_SIZE - ImageLength(LR_STAGE2_BOOT) { ; load region size_region
ER_FLASH +0 0x00200000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
* (+RO-DATA)
startup_RP2040.o (+RO)
* (+RO-CODE)
* (+XO)
}
ER_RAM_VECTOR_TABLE 0x20000000 {
* (.ram_vector_table)
}
ARM_LIB_STACK +0 ALIGN 8 EMPTY STACK_0_SIZE {
}
ARM_LIB_STACK_ONE +0 ALIGN 8 EMPTY STACK_1_SIZE {
}
ARM_LIB_HEAP +0 ALIGN 8 EMPTY HEAP_0_SIZE {
}
ARM_LIB_HEAP_ONE +0 ALIGN 8 EMPTY HEAP_1_SIZE {
}
ER_MUTEX_ARRAY +0 {
* (.mutex_array.*)
* (.mutex_array)
}
;ER_PREINIT_ARRAY +0 {
; * (.preinit_array.*)
; * (.preinit_array)
;}
RW_IRAM +0 RAMSIZE_VALID { ; RW data
* (+RW +ZI)
}
}

View File

@ -1,86 +0,0 @@
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc
; command above MUST be in first line (no comment above!)
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
#define FLASH_SIZE 0x00200000
#define SRAM_SIZE (1024*248)
#define STACK_0_SIZE (1024*4)
#define STACK_1_SIZE (1024*1)
#define HEAP_0_SIZE (1024*32)
#define HEAP_1_SIZE (1024*1)
#define RAMSIZE_VALID (SRAM_SIZE - \
STACK_1_SIZE - HEAP_1_SIZE - \
STACK_0_SIZE - HEAP_0_SIZE - 0x100)
;LR_STAGE2_BOOT 0x10000000 0x100 {
; ER_STAGE2_BOOT +0 0x100 {
; compile_time_choice.o (+RO)
; }
; ER_FILL ImageLimit(ER_STAGE2_BOOT) FILL 0xDEADBEEF 0x100 - ImageLength(ER_STAGE2_BOOT) {
; }
;}
LR_IROM1 0x20000000 SRAM_SIZE { ; load region size_region
ER_BINRAY_INFO +0 {
* (:gdef:Reset_Handler) //!< please always make sure that Reset_Handler is placed here.
* (.binary_info_header)
}
;ER_RAM_VECTOR_TABLE +0 ALIGN 256 {
; * (.ram_vector_table)
;}
ER_FLASH +0 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
* (+RO-DATA)
startup_RP2040.o (+RO)
}
ER_MUTEX_ARRAY +0 {
* (.mutex_array.*)
* (.mutex_array)
}
RW_IRAM_CODE +0 {
* (+RO-CODE)
* (+XO)
}
ARM_LIB_STACK +0 ALIGN 8 EMPTY STACK_0_SIZE {
}
ARM_LIB_STACK_ONE +0 ALIGN 8 EMPTY STACK_1_SIZE {
}
ARM_LIB_HEAP +0 ALIGN 8 EMPTY HEAP_0_SIZE {
}
ARM_LIB_HEAP_ONE +0 ALIGN 8 EMPTY HEAP_1_SIZE {
}
;ER_PREINIT_ARRAY +0 {
; * (.preinit_array.*)
; * (.preinit_array)
;}
RW_IRAM +0 { ; RW data
* (+RW +ZI)
}
RW_IRAM_UNINIT +0 UNINIT {
*(.uninitialized_data*)
*(.bss.noinit)
}
}

View File

@ -1,68 +0,0 @@
#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc
; command above MUST be in first line (no comment above!)
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
#define FLASH_SIZE 0x00200000
#define SRAM_SIZE (1024*248)
#define STACK_0_SIZE (1024*4)
#define STACK_1_SIZE (1024*1)
#define HEAP_0_SIZE (1024*32)
#define HEAP_1_SIZE (1024*1)
#define RAMSIZE_VALID (SRAM_SIZE - \
STACK_1_SIZE - HEAP_1_SIZE - \
STACK_0_SIZE - HEAP_0_SIZE - 0x100)
LR_STAGE2_BOOT 0x10000000 0x100 {
ER_STAGE2_BOOT +0 0x100 {
compile_time_choice.o (+RO)
}
ER_FILL ImageLimit(ER_STAGE2_BOOT) FILL 0xDEADBEEF 0x100 - ImageLength(ER_STAGE2_BOOT) {
}
}
LR_IROM1 0x10000100 FLASH_SIZE - ImageLength(LR_STAGE2_BOOT) { ; load region size_region
ER_FLASH +0 0x00200000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
* (+RO-DATA)
startup_RP2040.o (+RO)
}
ER_RAM_VECTOR_TABLE 0x20000000 {
* (.ram_vector_table)
}
ARM_LIB_STACK +0 ALIGN 8 EMPTY STACK_0_SIZE {
}
ARM_LIB_STACK_ONE +0 ALIGN 8 EMPTY STACK_1_SIZE {
}
ARM_LIB_HEAP +0 ALIGN 8 EMPTY HEAP_0_SIZE {
}
ARM_LIB_HEAP_ONE +0 ALIGN 8 EMPTY HEAP_1_SIZE {
}
ER_MUTEX_ARRAY +0 {
* (.mutex_array.*)
* (.mutex_array)
}
;ER_PREINIT_ARRAY +0 {
; * (.preinit_array.*)
; * (.preinit_array)
;}
RW_IRAM +0 RAMSIZE_VALID { ; RW data
* (+RW +ZI)
* (+RO-CODE)
* (+XO)
}
}

View File

@ -1 +0,0 @@
"..\..\tool\elf2uf2.exe" .\Objects\template.axf .\template.uf2

View File

@ -1,10 +0,0 @@
FUNC void reset_pico(void)
{
exec("RESET");
exec("G, Reset_Handler");
}
DEFINE BUTTON "Reset Pico", "reset_pico()"
reset_pico();

View File

@ -1,36 +0,0 @@
FUNC void debug_from_ram(void)
{
//extern unsigned int Image$$ARM_LIB_STACK$$ZI$$Limit;
printf("Entry Point: %08x\r\n", Reset_Handler);
printf("Main Stack Pointer: %08x\r\n", Image$$ARM_LIB_STACK$$ZI$$Limit);
/*
typedef struct {
unsigned int ctrl;
unsigned int load;
unsigned int reason;
unsigned int scratch[8];
unsigned int tick;
} watchdog_hw_t;
#define watchdog_hw ((watchdog_hw_t *const)0x40058000)
*/
_WWORD(0x4005801C ,0xb007c0d3); //! scratch 4
_WWORD(0x40058020 ,-0xb007c0d3 ^ (Reset_Handler | 0x01)); //! scratch 5
_WWORD(0x40058024 ,Image$$ARM_LIB_STACK$$ZI$$Limit); //! scratch 6
_WWORD(0x40058028 ,Reset_Handler | 0x01); //! scratch 7
exec("RESET");
//exec("BS main");
//exec("G, Reset_Handler");
exec("G, main");
}
DEFINE BUTTON "Reset Pico", "debug_from_ram()"
debug_from_ram();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,196 +0,0 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _PICO_PLATFORM_H_
#define _PICO_PLATFORM_H_
#include <sys/cdefs.h>
#include "pico/types.h"
#include "hardware/platform_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/** \file platform.h
* \defgroup pico_platform pico_platform
* Compiler definitions for the selected PICO_PLATFORM
*/
#define __isr
// Section naming macros
#define __after_data(group) __attribute__((section(".after_data." group)))
#define __not_in_flash(group) __attribute__((section(".time_critical." group)))
#define __scratch_x(group) __attribute__((section(".scratch_x." group)))
#define __scratch_y(group) __attribute__((section(".scratch_y." group)))
#define __uninitialized_ram(group) __attribute__((section(".uninitialized_ram." #group))) group
// For use with PICO_COPY_TO_RAM:
#define __in_flash(group) __attribute__((section(".flashdata" group)))
/**
* Decorates a function name, such that the function will execute from RAM (assuming it is not inlined
* into a flash function by the compiler)
*/
#define __not_in_flash_func(func_name) __not_in_flash(__STRING(func_name)) func_name
/**
* Historical synonym for __not_in_flash_func()
*/
#define __time_critical_func(func_name) __not_in_flash_func(func_name)
/**
* Decorates a function name, such that the function will execute from RAM, explicitly marking it as
* noinline to prevent it being inlined into a flash function by the compiler
*/
#define __no_inline_not_in_flash_func(func_name) __noinline __not_in_flash_func(func_name)
#if !defined(__IS_COMPILER_ARM_COMPILER_6__)
#define __packed_aligned __packed __aligned(4)
#if defined(__GNUC__) && __GNUC__ < 7
#define __force_inline inline __always_inline
#else
#define __force_inline __always_inline
#endif
#endif
#ifndef count_of
#define count_of(a) (sizeof(a)/sizeof((a)[0]))
#endif
#ifndef MAX
#define MAX(a, b) ((a)>(b)?(a):(b))
#endif
#ifndef MIN
#define MIN(a, b) ((b)>(a)?(a):(b))
#endif
#ifndef offsetof
#define offsetof(__type, __member) (uintptr_t)(&(((__type *)0)->__member))
#endif
#if !defined(__IS_COMPILER_ARM_COMPILER_6__)
/**
* Execute a breakpoint instruction
*/
static inline void __breakpoint(void) {
__asm__("bkpt #0");
}
#endif
/**
* Ensure that the compiler does not move memory access across this method call
*/
__force_inline static void __compiler_memory_barrier(void) {
__asm__ volatile ("" : : : "memory");
}
// return a 32 bit handle for a raw ptr; DMA chaining for example embeds pointers in 32 bit values
// which of course does not work if we're running the code natively on a 64 bit platforms. Therefore
// we provide this macro which allows that code to provide a 64->32 bit mapping in host mode
#define host_safe_hw_ptr(x) ((uintptr_t)(x))
/**
* Panic (see panic()) with the message "Unsupported".
*/
void __attribute__((noreturn)) panic_unsupported(void);
/**
* Panic with a message. An attempt is made to output the message to all registered STDOUT drivers
* after which this method executes a BKPT instruction.
*
* @param fmt format string (printf-like)
* @param ... printf-like arguments
*/
void __attribute__((noreturn)) panic(const char *fmt, ...);
// PICO_CONFIG: PICO_NO_FPGA_CHECK, Remove the FPGA platform check for small code size reduction, type=bool, default=0, advanced=true, group=pico_runtime
#ifndef PICO_NO_FPGA_CHECK
#define PICO_NO_FPGA_CHECK 0
#endif
#if PICO_NO_FPGA_CHECK
static inline bool running_on_fpga(void) {return false;}
#else
bool running_on_fpga(void);
#endif
/**
* @return the RP2040 chip revision number
*/
uint8_t rp2040_chip_version(void);
/**
* @return the RP2040 rom version number
*/
static inline uint8_t rp2040_rom_version(void) {
return *(uint8_t*)0x13;
}
/**
* Empty function intended to be called by any tight hardware polling loop. using this ubiquitously
* makes it much easier to find tight loops, but also in the future \#ifdef-ed support for lockup
* debugging might be added
*/
static inline void tight_loop_contents(void) {}
/**
* Helper macro for making chain DMA code portable to PICO_PLATFORM=host. The problem here is
* that embedded pointers in the data are only 32 bit, which is a problem if the host
* system is 64 bit. This macro is zero cost on the actual device, but in host mode
* it provides a 64->32 bit mapping
*/
#define native_safe_hw_ptr(x) ((uintptr_t)(x))
/**
* Multiplies a by b using multiply instruction using the ARM mul instruction regardless of values;
* i.e. this is a 1 cycle operation.
*
* \param a the first operand
* \param b the second operand
* \return a * b
*/
__force_inline static int32_t __mul_instruction(int32_t a, int32_t b) {
asm ("mul %0, %1" : "+l" (a) : "l" (b) : );
return a;
}
/**
* Efficiently Multiplies value a by possibly constant value b.
* If b is known to be constant and not zero or a power of 2, then a mul instruction is used rather than gcc's default
* which is often a slow combination of shifts and adds
*
* \param a the first operand
* \param b the second operand
* \return a * b
*/
#define __fast_mul(a, b) __builtin_choose_expr(__builtin_constant_p(b) && !__builtin_constant_p(a), \
(__builtin_popcount(b) >= 2 ? __mul_instruction(a,b) : (a)*(b)), \
(a)*(b))
#if defined(__IS_COMPILER_ARM_COMPILER_6__)
# define WRAPPER_FUNC(__FUNC) $Sub$$##__FUNC
# define REAL_FUNC(__FUNC) $Super$$## __FUNC
#else
# define WRAPPER_FUNC(x) __wrap_ ## x
# define REAL_FUNC(x) __real_ ## x
#endif
#define __check_type_compatible(type_a, type_b) static_assert(__builtin_types_compatible_p(type_a, type_b), __STRING(type_a) " is not compatible with " __STRING(type_b));
/**
* Get the current exception level on this core
* \return the exception number if the CPU is handling an exception, or 0 otherwise
*/
uint __get_current_exception(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,240 @@
/*****************************************************************************
* | File : DEV_Config.c
* | Author :
* | Function : Hardware underlying interface
* | Info :
*----------------
* | This version: V1.0
* | Date : 2021-03-16
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation 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 theex Software, and to permit persons to whom the Software is
# furished 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 OR 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.
******************************************************************************/
#include "DEV_Config.h"
#include <assert.h>
#define SPI_PORT spi1
#define I2C_PORT spi1
/**
* GPIO
**/
int EPD_RST_PIN;
int EPD_DC_PIN;
int EPD_CS_PIN;
int EPD_BL_PIN;
int EPD_CLK_PIN;
int EPD_MOSI_PIN;
int EPD_SCL_PIN;
int EPD_SDA_PIN;
const uint8_t c_chPinMap[] = {
[KEY_HOME] = PIN_KEY_HOME,
[KEY_UP] = PIN_KEY_UP,
[KEY_DOWN] = PIN_KEY_DOWN,
[KEY_LEFT] = PIN_KEY_LEFT,
[KEY_RIGHT] = PIN_KEY_RIGHT,
[KEY_A] = PIN_KEY_A,
[KEY_B] = PIN_KEY_B,
[KEY_X] = PIN_KEY_X,
[KEY_Y] = PIN_KEY_Y,
};
uint slice_num;
/**
* GPIO read and write
**/
void DEV_Digital_Write(UWORD Pin, UBYTE Value)
{
gpio_put(Pin, Value);
}
UBYTE DEV_Digital_Read(UWORD Pin)
{
return gpio_get(Pin);
}
/**
* SPI
**/
void DEV_SPI_WriteByte(uint8_t Value)
{
spi_write_blocking(SPI_PORT, &Value, 1);
}
void DEV_SPI_Write_nByte(uint8_t pData[], uint32_t Len)
{
spi_write_blocking(SPI_PORT, pData, Len);
}
/**
* I2C
**/
void DEV_I2C_Write(uint8_t addr, uint8_t reg, uint8_t Value)
{
uint8_t data[2] = {reg, Value};
i2c_write_blocking(i2c1, addr, data, 2, false);
}
void DEV_I2C_Write_nByte(uint8_t addr, uint8_t *pData, uint32_t Len)
{
i2c_write_blocking(i2c1, addr, pData, Len, false);
}
uint8_t DEV_I2C_ReadByte(uint8_t addr, uint8_t reg)
{
uint8_t buf;
i2c_write_blocking(i2c1,addr,&reg,1,true);
i2c_read_blocking(i2c1,addr,&buf,1,false);
return buf;
}
/**
* GPIO Mode
**/
void DEV_GPIO_Mode(UWORD Pin, UWORD Mode)
{
gpio_init(Pin);
if(Mode == 0 || Mode == GPIO_IN) {
gpio_set_dir(Pin, GPIO_IN);
} else {
gpio_set_dir(Pin, GPIO_OUT);
}
}
/**
* KEY Config
**/
void dev_key_init(uint8_t chPin)
{
assert(chPin < KEY_NUM);
uint32_t wPin = c_chPinMap[chPin];
gpio_init(wPin);
gpio_pull_up(wPin);
gpio_set_dir(wPin, GPIO_IN);
}
bool dev_read_key(uint8_t chPin)
{
assert(chPin < KEY_NUM);
return gpio_get(c_chPinMap[chPin]);
}
/**
* delay x ms
**/
void DEV_Delay_ms(UDOUBLE xms)
{
sleep_ms(xms);
}
void DEV_Delay_us(UDOUBLE xus)
{
sleep_us(xus);
}
void DEV_GPIO_Init(void)
{
DEV_GPIO_Mode(EPD_RST_PIN, 1);
DEV_GPIO_Mode(EPD_DC_PIN, 1);
DEV_GPIO_Mode(EPD_CS_PIN, 1);
DEV_GPIO_Mode(EPD_BL_PIN, 1);
DEV_GPIO_Mode(EPD_CS_PIN, 1);
DEV_GPIO_Mode(EPD_BL_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 1);
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_BL_PIN, 1);
}
/******************************************************************************
function: Module Initialize, the library and initialize the pins, SPI protocol
parameter:
Info:
******************************************************************************/
UBYTE DEV_Module_Init(void)
{
//stdio_init_all();
//GPIO PIN
EPD_RST_PIN = 12;
EPD_DC_PIN = 8;
EPD_BL_PIN = 13;
EPD_CS_PIN = 9;
EPD_CLK_PIN = 10;
EPD_MOSI_PIN = 11;
EPD_SCL_PIN = 7;
EPD_SDA_PIN = 6;
// SPI Config
spi_init(SPI_PORT, 80000 * 1000);
gpio_set_function(EPD_CLK_PIN, GPIO_FUNC_SPI);
gpio_set_function(EPD_MOSI_PIN, GPIO_FUNC_SPI);
// GPIO Config
DEV_GPIO_Init();
// PWM Config
gpio_set_function(EPD_BL_PIN, GPIO_FUNC_PWM);
slice_num = pwm_gpio_to_slice_num(EPD_BL_PIN);
pwm_set_wrap(slice_num, 100);
pwm_set_chan_level(slice_num, PWM_CHAN_B, 1);
pwm_set_clkdiv(slice_num,50);
pwm_set_enabled(slice_num, true);
//I2C Config
i2c_init(i2c1,300*1000);
gpio_set_function(EPD_SDA_PIN,GPIO_FUNC_I2C);
gpio_set_function(EPD_SCL_PIN,GPIO_FUNC_I2C);
gpio_pull_up(EPD_SDA_PIN);
gpio_pull_up(EPD_SCL_PIN);
//printf("DEV_Module_Init OK \r\n");
return 0;
}
void DEV_SET_PWM(uint8_t Value)
{
if(Value<0 || Value >100){
printf("DEV_SET_PWM Error \r\n");
}else {
pwm_set_chan_level(slice_num, PWM_CHAN_B, Value);
}
}
/******************************************************************************
function: Module exits, closes SPI and BCM2835 library
parameter:
Info:
******************************************************************************/
void DEV_Module_Exit(void)
{
}

View File

@ -0,0 +1,111 @@
/*****************************************************************************
* | File : DEV_Config.h
* | Author :
* | Function : Hardware underlying interface
* | Info :
*----------------
* | This version: V1.0
* | Date : 2021-03-16
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation 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 theex Software, and to permit persons to whom the Software is
# furished 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 OR 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.
******************************************************************************/
#ifndef _DEV_CONFIG_H_
#define _DEV_CONFIG_H_
#include "pico/stdlib.h"
#include "hardware/spi.h"
#include "stdio.h"
#include "hardware/i2c.h"
#include "hardware/pwm.h"
/**
* data
**/
#define UBYTE uint8_t
#define UWORD uint16_t
#define UDOUBLE uint32_t
/**
* GPIOI config
**/
extern int EPD_RST_PIN;
extern int EPD_DC_PIN;
extern int EPD_CS_PIN;
extern int EPD_BL_PIN;
extern int EPD_CLK_PIN;
extern int EPD_MOSI_PIN;
extern int EPD_SCL_PIN;
extern int EPD_SDA_PIN;
enum {
PIN_KEY_A = 15,
PIN_KEY_B = 17,
PIN_KEY_X = 19,
PIN_KEY_Y = 21,
PIN_KEY_UP = 2,
PIN_KEY_DOWN = 18,
PIN_KEY_LEFT = 16,
PIN_KEY_RIGHT = 20,
PIN_KEY_HOME = 3,
KEY_HOME = 0,
KEY_UP = 1,
KEY_DOWN,
KEY_LEFT,
KEY_RIGHT,
KEY_A,
KEY_B,
KEY_X,
KEY_Y,
KEY_NUM,
};
/*------------------------------------------------------------------------------------------------------*/
void DEV_Digital_Write(UWORD Pin, UBYTE Value);
UBYTE DEV_Digital_Read(UWORD Pin);
void DEV_GPIO_Mode(UWORD Pin, UWORD Mode);
void dev_key_init(uint8_t chPin);
bool dev_read_key(uint8_t chPin);
void DEV_Digital_Write(UWORD Pin, UBYTE Value);
UBYTE DEV_Digital_Read(UWORD Pin);
void DEV_SPI_WriteByte(UBYTE Value);
void DEV_SPI_Write_nByte(uint8_t *pData, uint32_t Len);
void DEV_Delay_ms(UDOUBLE xms);
void DEV_Delay_us(UDOUBLE xus);
void DEV_I2C_Write(uint8_t addr, uint8_t reg, uint8_t Value);
void DEV_I2C_Write_nByte(uint8_t addr, uint8_t *pData, uint32_t Len);
uint8_t DEV_I2C_ReadByte(uint8_t addr, uint8_t reg);
void DEV_SET_PWM(uint8_t Value);
UBYTE DEV_Module_Init(void);
void DEV_Module_Exit(void);
#endif

View File

@ -0,0 +1,47 @@
/*****************************************************************************
* | File : Debug.h
* | Author :
* | Function : debug with printf
* | Info :
* Image scanning
* Please use progressive scanning to generate images or fonts
*----------------
* | This version: V2.0
* | Date : 2018-10-30
* | Info :
* 1.USE_DEBUG -> DEBUG, If you need to see the debug information,
* clear the execution: make DEBUG=-DDEBUG
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation 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
# furished 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 OR 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.
#
******************************************************************************/
#ifndef __DEBUG_H
#define __DEBUG_H
#include <stdio.h>
#if DEBUG
#define Debug(__info,...) printf("Debug: " __info,##__VA_ARGS__)
#else
#define Debug(__info,...)
#endif
#endif

1384
bsp/pico/bsp/Fonts/font12.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,152 @@
/**
******************************************************************************
* @file Font12.c
* @author MCD Application Team
* @version V1.0.0
* @date 18-February-2014
* @brief This file provides text Font12 for STM32xx-EVAL's LCD driver.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* 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.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "fonts.h"
//
// Font data for Courier New 12pt
//
const CH_CN Font12CN_Table[] =
{
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1D,0xC0,0x1D,0x80,0x3B,0xFF,0x3B,0x07,
0x3F,0x77,0x7E,0x76,0xF8,0x70,0xFB,0xFE,0xFB,0xFE,0x3F,0x77,0x3F,0x77,0x3E,0x73,
0x38,0x70,0x38,0x70,0x3B,0xE0,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x73,0xFF,0x70,0x0F,0xFE,0x1E,
0x7E,0x3C,0x6E,0x38,0xEE,0x30,0xEF,0xFF,0xFC,0x30,0x7C,0x30,0x38,0x30,0x3E,0x30,
0x7E,0x30,0xE0,0x30,0xC1,0xF0,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x0E,0x30,0x0E,0x3F,0xEE,0x30,0xEE,
0xFC,0xFF,0x76,0xCE,0x77,0xFE,0x7B,0xFE,0xFF,0xFE,0xF3,0xDE,0xF3,0xCE,0x37,0xEE,
0x3E,0x6E,0x3C,0x0E,0x30,0x3E,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ݮ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"ݮ"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x70,0xFF,0xFF,0x3E,0x70,0x38,0x00,
0x7F,0xFF,0xE0,0x00,0xFF,0xFC,0x3B,0x8C,0x39,0xCC,0xFF,0xFF,0x73,0x9C,0x71,0xDC,
0x7F,0xFF,0x00,0x1C,0x01,0xF8,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x1F,0xFF,0xF0,0x3E,0x00,0x0E,0x1F,
0xCF,0xFB,0xFF,0xF8,0x3F,0xFF,0x0F,0xFF,0x7F,0xD8,0x7F,0xDC,0x6F,0xCE,0xED,0xFF,
0xFD,0xF7,0xF9,0xC0,0x00,0x00,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: a --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"a"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3E,0x00,0x67,0x00,0x07,0x80,0x0F,0x80,0x7F,0x80,0xE3,0x80,0xE7,0x80,0xE7,0x80,
0x7F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: b --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"b"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x70,0x00,0x70,0x00,0x70,0x00,
0x7F,0x00,0x7B,0x80,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x71,0xC0,0x7B,0x80,
0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: c --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"c"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x3F,0x00,0x73,0x00,0xF0,0x00,0xE0,0x00,0xE0,0x00,0xE0,0x00,0xF0,0x00,0x73,0x00,
0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: A --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"A"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x1F,0x00,0x1F,0x00,
0x1F,0x00,0x3B,0x80,0x3B,0x80,0x71,0x80,0x7F,0xC0,0x71,0xC0,0xE0,0xE0,0xE0,0xE0,
0xE0,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0xFF,0xC0,0x0F,0xFF,0xCF,0x87,
0x6F,0xF6,0x7F,0x7E,0x3C,0x70,0x3C,0x70,0x1C,0x70,0x3E,0xF8,0x3E,0xF8,0x77,0xDC,
0xE3,0x8C,0xC7,0x0F,0x0E,0x07,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ӭ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"ӭ"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE1,0xC0,0x67,0xFF,0x76,0x77,0x3E,0x77,
0x06,0x77,0xF6,0x77,0x76,0x77,0x76,0x77,0x76,0x77,0x77,0xF7,0x7F,0x7E,0x70,0x70,
0x70,0x70,0xF8,0x00,0xCF,0xFF,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ʹ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"ʹ"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x60,0x3F,0xFF,0x38,0x60,
0x7F,0xFF,0x7E,0x67,0xFE,0x67,0xFF,0xFF,0x70,0x67,0x77,0x60,0x73,0xE0,0x71,0xE0,
0x73,0xF8,0x7E,0x1F,0x00,0x00,0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>12; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=16x21 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0x71,0xC7,0x71,0xC7,
0x71,0xC7,0x7F,0xFF,0x71,0xC7,0x71,0xC7,0x71,0xC7,0x7F,0xFF,0x71,0xC7,0x71,0xC7,
0xE1,0xC6,0xC1,0xFE,0x00,0x00,0x00,0x00,0x00,0x00}},
};
cFONT Font12CN = {
Font12CN_Table,
sizeof(Font12CN_Table)/sizeof(CH_CN), /*size of table*/
11, /* ASCII Width */
16, /* Width */
21, /* Height */
};
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

1764
bsp/pico/bsp/Fonts/font16.c Normal file

File diff suppressed because it is too large Load Diff

2142
bsp/pico/bsp/Fonts/font20.c Normal file

File diff suppressed because it is too large Load Diff

2520
bsp/pico/bsp/Fonts/font24.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,524 @@
/**
******************************************************************************
* @file Font12.c
* @author MCD Application Team
* @version V1.0.0
* @date 18-February-2014
* @brief This file provides text Font12 for STM32xx-EVAL's LCD driver.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* 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.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "fonts.h"
//
// Font data for Courier New 12pt
//
const CH_CN Font24CN_Table[] =
{
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,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,0xC1,0xC0,0x00,
0x01,0xE3,0xE0,0x00,0x03,0xE3,0xC0,0x00,0x03,0xC7,0x80,0x00,0x03,0xC7,0xFF,0xFF,
0x07,0x8F,0xFF,0xFF,0x07,0x8F,0x00,0x0F,0x0F,0x1E,0x00,0x1E,0x0F,0x3C,0x1E,0x1E,
0x1F,0x3C,0x1E,0x3E,0x1F,0x18,0x1E,0x3C,0x3F,0x00,0x1E,0x1C,0x7F,0x00,0x1E,0x00,
0x7F,0x07,0x9E,0x70,0xFF,0x07,0x9E,0xF0,0xEF,0x0F,0x9E,0x78,0x6F,0x0F,0x1E,0x78,
0x0F,0x0F,0x1E,0x3C,0x0F,0x1E,0x1E,0x3C,0x0F,0x1E,0x1E,0x1E,0x0F,0x3C,0x1E,0x1E,
0x0F,0x3C,0x1E,0x1F,0x0F,0x7C,0x1E,0x0F,0x0F,0x78,0x1E,0x0E,0x0F,0x00,0x1E,0x00,
0x0F,0x00,0x1E,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x07,0xFC,0x00,0x0F,0x07,0xF8,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
0x0F,0x07,0xFF,0xFE,0x0F,0x07,0xFF,0xFE,0x0F,0x00,0x00,0x3E,0x1E,0x00,0x00,0xFC,
0xFF,0xF8,0x01,0xF0,0xFF,0xF8,0x03,0xE0,0x1E,0x78,0x07,0xC0,0x1E,0x78,0x0F,0x80,
0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00,0x3C,0x78,0x0F,0x00,
0x3C,0x7F,0xFF,0xFF,0x78,0xFF,0xFF,0xFF,0x78,0xF0,0x0F,0x00,0x78,0xF0,0x0F,0x00,
0x3D,0xE0,0x0F,0x00,0x1F,0xE0,0x0F,0x00,0x0F,0xE0,0x0F,0x00,0x07,0xC0,0x0F,0x00,
0x07,0xE0,0x0F,0x00,0x07,0xF0,0x0F,0x00,0x0F,0xF8,0x0F,0x00,0x1E,0x7C,0x0F,0x00,
0x3C,0x38,0x0F,0x00,0x78,0x00,0x0F,0x00,0xF0,0x03,0xFF,0x00,0x60,0x01,0xFE,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ΢ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"΢"},{
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,0x07,0x01,0xE0,0x07,0x87,0x01,0xE0,
0x07,0x07,0x01,0xC0,0x0F,0xF7,0x79,0xC0,0x1E,0xF7,0x7B,0xC0,0x1E,0xF7,0x7B,0x80,
0x3C,0xF7,0x7B,0xFF,0x78,0xF7,0x7B,0xFF,0xF8,0xF7,0x7F,0x9E,0xF7,0xFF,0xFF,0x9E,
0x67,0xFF,0xFF,0x9E,0x07,0x00,0x7F,0x9C,0x0F,0x00,0x0F,0x9C,0x1E,0x00,0x1F,0x9C,
0x1E,0x7F,0xFF,0xBC,0x3E,0x7F,0xF3,0xFC,0x3E,0x00,0x03,0xFC,0x7E,0x00,0x01,0xF8,
0xFE,0x00,0x01,0xF8,0xFE,0x7F,0xE1,0xF8,0xDE,0x7F,0xE1,0xF8,0x1E,0x78,0xE0,0xF0,
0x1E,0x78,0xEE,0xF0,0x1E,0x78,0xFF,0xF0,0x1E,0x78,0xFD,0xF8,0x1E,0x79,0xFB,0xFC,
0x1E,0xF1,0xF7,0xBC,0x1E,0xF0,0xEF,0x9E,0x1F,0xE0,0x0F,0x0F,0x1E,0xC0,0x1E,0x0F,
0x1E,0x00,0x0C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x03,0xC0,0x78,0x00,0x07,0x80,0x78,0x00,0x07,0x80,0x78,0x00,
0x07,0x80,0xF0,0x00,0x0F,0x00,0xF0,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0x1E,0x03,0xC0,0x1F,0x1E,0x03,0xC0,0x1E,0x1F,0xE7,0x8F,0x3E,0x3D,0xE7,0x8F,0x3C,
0x3D,0xEF,0x0F,0x7C,0x3D,0xE7,0x0F,0x78,0x79,0xE0,0x0F,0x00,0x79,0xE0,0x0E,0x00,
0x7F,0xFE,0x0E,0x00,0x7F,0xFE,0x1F,0x00,0x01,0xE0,0x1F,0x00,0x01,0xE0,0x1F,0x00,
0x01,0xE0,0x1F,0x80,0x01,0xE0,0x1F,0x80,0x01,0xE0,0x3F,0x80,0x01,0xFF,0x3F,0xC0,
0x0F,0xFF,0x7B,0xC0,0xFF,0xF0,0x79,0xE0,0xF9,0xE0,0xF1,0xF0,0x01,0xE1,0xF0,0xF0,
0x01,0xE3,0xE0,0xF8,0x01,0xE7,0xC0,0x7C,0x01,0xFF,0x80,0x3F,0x01,0xFF,0x00,0x1F,
0x01,0xEC,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x00,0x00,0x00,0xFF,0x00,
0x7F,0xFC,0xF7,0x80,0x7F,0xFD,0xE3,0xC0,0x01,0xC1,0xE3,0xC0,0x01,0xC3,0xC1,0x80,
0x3D,0xC7,0xFF,0xFF,0x39,0xC7,0xFF,0xFF,0x39,0xCF,0x83,0x80,0x79,0xDF,0x83,0x80,
0x79,0xFF,0x83,0x80,0x79,0xDF,0x83,0x80,0x71,0xC3,0x83,0x80,0x7F,0xFF,0xFF,0xFE,
0x7F,0xFF,0xFF,0xFE,0x03,0xC3,0x83,0x80,0x07,0xC3,0x83,0x80,0x07,0xC3,0x83,0x80,
0x0F,0xC3,0x83,0x80,0x0F,0xC3,0x83,0x80,0x1F,0xC3,0xFF,0xFE,0x1D,0xC3,0xFF,0xFE,
0x3D,0xC3,0x83,0x80,0x79,0xC3,0x83,0x80,0xF1,0xC3,0x83,0x80,0xF1,0xC3,0x83,0x80,
0x61,0xC3,0x83,0x80,0x01,0xC3,0xFF,0xFF,0x03,0xC3,0xFF,0xFF,0x1F,0xC3,0x80,0x00,
0x1F,0x83,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1E,0x03,0xC0,0x3C,0x1E,0xC3,0xC7,0x3C,
0x1F,0xE3,0xC7,0xBC,0x1E,0xF3,0xCF,0x3C,0x1E,0xFB,0xDF,0x3C,0x1E,0x7B,0xDE,0x3C,
0x1E,0x33,0xDC,0x3C,0x1E,0x03,0xC0,0x3C,0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,
0x1E,0x03,0xC0,0x3C,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x3F,0xFF,0xFF,0xFC,
0x3F,0xFF,0xFF,0xFC,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x1C,0x38,0x70,0x70,
0x3E,0x78,0xF8,0xF8,0x3C,0x7C,0x78,0x7C,0x7C,0x3C,0x3C,0x3E,0xF8,0x3E,0x3C,0x1F,
0xF0,0x1C,0x18,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x3C,0x00,
0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00,0x00,0x78,0x3C,0x00,
0x00,0x78,0x3C,0x0C,0x3C,0x78,0x3C,0x1E,0x3C,0x78,0x3C,0x3F,0x3C,0x78,0x3C,0xF8,
0x3C,0x7F,0xFD,0xF0,0x3C,0x7F,0xFF,0xE0,0x3C,0x78,0x3F,0x80,0x3C,0x78,0x3E,0x00,
0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,
0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x00,0x3C,0x78,0x3C,0x0E,0x3C,0x78,0x3C,0x0F,
0x3C,0x78,0x3C,0x0F,0x3C,0x79,0xFC,0x0F,0x3C,0x7F,0xFC,0x0F,0x3F,0xFF,0x3C,0x0F,
0x3F,0xF0,0x3E,0x1E,0xFF,0x00,0x1F,0xFE,0xF0,0x00,0x0F,0xFC,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x03,0xC0,0x00,
0x00,0x03,0xE0,0x00,0x00,0x01,0xE0,0x00,0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE,
0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E,0x78,0x00,0x00,0x1E,
0x7B,0xFF,0xFF,0xDE,0x03,0xFF,0xFF,0xC0,0x00,0x00,0x0F,0xC0,0x00,0x00,0x3F,0x00,
0x00,0x00,0x7E,0x00,0x00,0x01,0xF8,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,
0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,0x00,0x01,0xE0,0x00,
0x00,0x03,0xE0,0x00,0x00,0x03,0xC0,0x00,0x00,0xFF,0xC0,0x00,0x00,0xFF,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,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,0xC0,0x3C,0x00,
0x03,0xC0,0x3C,0x00,0x03,0xC0,0x3C,0x00,0x07,0x80,0x3C,0x00,0x07,0x80,0x3C,0x00,
0x07,0x80,0x3C,0x00,0x0F,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0x1F,0x01,0xFE,0x00,
0x1F,0x01,0xFF,0x00,0x3F,0x01,0xFF,0x00,0x3F,0x03,0xFF,0x00,0x7F,0x03,0xFF,0x80,
0x7F,0x07,0xBF,0x80,0xFF,0x07,0xBF,0xC0,0xEF,0x0F,0x3D,0xC0,0xCF,0x0F,0x3D,0xE0,
0x0F,0x1E,0x3D,0xE0,0x0F,0x1E,0x3C,0xF0,0x0F,0x3C,0x3C,0x78,0x0F,0x7C,0x3C,0x7C,
0x0F,0xF8,0x3C,0x3E,0x0F,0xF7,0xFF,0xDF,0x0F,0xE7,0xFF,0xCF,0x0F,0xC0,0x3C,0x06,
0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00,0x0F,0x00,0x3C,0x00,
0x0F,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
0x00,0x0F,0xE0,0x00,0x00,0x0F,0xF8,0x00,0x00,0x0F,0xFC,0x00,0x00,0x0F,0xBF,0x00,
0x00,0x0F,0x9F,0x80,0x00,0x0F,0x87,0xE0,0x00,0x0F,0x83,0xF0,0x00,0x0F,0x80,0xF8,
0x00,0x0F,0x80,0x7C,0x00,0x0F,0x80,0x38,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,0x00,0x0F,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,
0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,0x7F,0xFC,0x00,0x78,0x7F,0xFC,0x00,0x78,
0x00,0x3C,0x00,0x78,0x00,0x3F,0xFF,0xFF,0x30,0x3F,0xFF,0xFF,0x78,0x3C,0x00,0x78,
0x3C,0x38,0x00,0x78,0x3E,0x78,0x00,0x78,0x1E,0x78,0xC0,0x78,0x0F,0x79,0xE0,0x78,
0x0F,0xF0,0xF0,0x78,0x07,0xF0,0xF8,0x78,0x03,0xF0,0x78,0x78,0x01,0xE0,0x3C,0x78,
0x03,0xF0,0x3E,0x78,0x03,0xF0,0x18,0x78,0x07,0xF8,0x00,0x78,0x07,0xFC,0x00,0x78,
0x0F,0x3E,0x00,0x78,0x1F,0x1E,0x00,0x78,0x3E,0x1F,0x00,0x78,0x7C,0x0E,0x00,0xF8,
0xF8,0x00,0x00,0xF0,0xF0,0x00,0x3F,0xF0,0x60,0x00,0x3F,0xE0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: Ӧ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"Ӧ"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x00,0x00,0x03,0xE0,0x00,0x00,0x01,0xE0,0x00,
0x00,0x01,0xF0,0x00,0x00,0x00,0xF0,0x00,0x1F,0xFF,0xFF,0xFF,0x1F,0xFF,0xFF,0xFF,
0x1E,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x1E,0x01,0xE0,0x78,0x1E,0x01,0xE0,0x78,
0x1E,0xE1,0xE0,0x78,0x1F,0xF1,0xF0,0xF8,0x1E,0xF0,0xF0,0xF0,0x1E,0xF0,0xF0,0xF0,
0x1E,0xF8,0xF0,0xF0,0x1E,0x78,0xF1,0xF0,0x1E,0x78,0xF9,0xE0,0x1E,0x78,0x79,0xE0,
0x1E,0x7C,0x7B,0xE0,0x1E,0x3C,0x7B,0xC0,0x1E,0x3C,0x7B,0xC0,0x1E,0x3C,0x7B,0xC0,
0x3C,0x3E,0x07,0x80,0x3C,0x1C,0x07,0x80,0x3C,0x00,0x07,0x80,0x3C,0x00,0x0F,0x00,
0x78,0x00,0x0F,0x00,0x7B,0xFF,0xFF,0xFF,0xF3,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,
0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
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,0x3C,0x00,0x07,0xC0,0x3E,0x00,
0x07,0x80,0x3C,0x00,0x07,0x80,0x7C,0x00,0x0F,0x00,0x78,0x00,0x7F,0xFE,0x7F,0xFE,
0x7F,0xFE,0xFF,0xFE,0x78,0x1E,0xF0,0x1E,0x78,0x1F,0xE0,0x1E,0x78,0x1F,0xE0,0x1E,
0x78,0x1F,0xC0,0x1E,0x78,0x1F,0xC0,0x1E,0x78,0x1F,0xF0,0x1E,0x78,0x1E,0xF8,0x1E,
0x78,0x1E,0x7C,0x1E,0x7F,0xFE,0x3C,0x1E,0x7F,0xFE,0x1E,0x1E,0x78,0x1E,0x1F,0x1E,
0x78,0x1E,0x0F,0x9E,0x78,0x1E,0x07,0x9E,0x78,0x1E,0x07,0x1E,0x78,0x1E,0x00,0x1E,
0x78,0x1E,0x00,0x1E,0x78,0x1E,0x00,0x3E,0x78,0x1E,0x00,0x3C,0x78,0x1E,0x00,0x3C,
0x7F,0xFE,0x00,0x3C,0x7F,0xFE,0x00,0x7C,0x78,0x1E,0x3F,0xF8,0x78,0x1E,0x3F,0xF0,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,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,0xC0,0x00,0x00,0x03,0xC0,0x00,
0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xFF,0xFF,0x00,0x03,0xFF,0xFF,
0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
0x0F,0xFF,0xFF,0xF8,0x0F,0xFF,0xFF,0xF8,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,
0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,0x0F,0x00,0x00,0x78,
0x0F,0xFF,0xFF,0xF8,0x0F,0xFF,0xFF,0xF8,0x0F,0x00,0x00,0x78,0x00,0x00,0x00,0x00,
0x0C,0x38,0x38,0x30,0x1E,0x7C,0x78,0x78,0x3E,0x3C,0x78,0x78,0x3C,0x3C,0x3C,0x3C,
0x7C,0x3E,0x3C,0x3E,0xF8,0x1E,0x3C,0x1E,0xF0,0x1E,0x1E,0x1F,0x70,0x1E,0x1C,0x0E,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x78,0x00,
0x7F,0xF0,0x78,0x00,0x7F,0xF0,0x78,0x00,0x79,0xFF,0xFF,0xFF,0x79,0xFF,0xFF,0xFF,
0x79,0xE1,0xE0,0x00,0x79,0xE1,0xE0,0x00,0x7B,0xC1,0xEF,0x80,0x7B,0xC3,0xCF,0x80,
0x7B,0xC3,0xCF,0x80,0x7F,0x87,0xCF,0x80,0x7F,0x87,0x8F,0x80,0x7F,0x87,0x8F,0x80,
0x7B,0xCF,0x0F,0x80,0x7B,0xCF,0xFF,0xFE,0x79,0xEF,0xFF,0xFE,0x79,0xE0,0x0F,0x80,
0x78,0xE0,0x0F,0x80,0x78,0xF0,0x0F,0x80,0x78,0xF0,0x0F,0x80,0x78,0xF0,0x0F,0x80,
0x78,0xFF,0xFF,0xFF,0x79,0xFF,0xFF,0xFF,0x7F,0xE0,0x0F,0x80,0x7F,0xC0,0x0F,0x80,
0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80,0x78,0x00,0x0F,0x80,
0x78,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: Ϊ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"Ϊ"},{
0x00,0x00,0x00,0x00,0x00,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,0x80,0x00,
0x0E,0x07,0x80,0x00,0x1F,0x07,0x80,0x00,0x0F,0x87,0x80,0x00,0x07,0xC7,0x80,0x00,
0x01,0xE7,0x80,0x00,0x00,0xC7,0x80,0x00,0x00,0x07,0x80,0x00,0x7F,0xFF,0xFF,0xFC,
0x7F,0xFF,0xFF,0xFC,0x00,0x07,0x80,0x3C,0x00,0x0F,0x80,0x3C,0x00,0x0F,0x00,0x3C,
0x00,0x0F,0x00,0x3C,0x00,0x0F,0x60,0x3C,0x00,0x1F,0xF0,0x3C,0x00,0x1E,0x78,0x3C,
0x00,0x3E,0x3C,0x3C,0x00,0x3C,0x3E,0x3C,0x00,0x7C,0x1F,0x3C,0x00,0x78,0x0F,0x3C,
0x00,0xF8,0x06,0x3C,0x01,0xF0,0x00,0x3C,0x03,0xE0,0x00,0x7C,0x07,0xC0,0x00,0x7C,
0x0F,0x80,0x00,0x78,0x1F,0x00,0x00,0xF8,0x3E,0x00,0xFF,0xF0,0x7C,0x00,0xFF,0xE0,
0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x38,
0x0F,0x00,0x00,0x38,0x0F,0x00,0x00,0x38,0x0F,0x3F,0xF8,0x38,0x0F,0x3F,0xF8,0x38,
0x0F,0x00,0x78,0x38,0xFF,0xE0,0x7F,0xFF,0xFF,0xE0,0x7F,0xFF,0x0F,0x00,0x70,0x38,
0x0F,0x18,0xF0,0x38,0x1F,0x3C,0xF0,0x38,0x1F,0x1C,0xFE,0x38,0x1F,0xDE,0xFE,0x38,
0x3F,0xEF,0xEF,0x38,0x3F,0xFF,0xEF,0x38,0x3F,0xF7,0xE7,0xB8,0x7F,0x67,0xC7,0xB8,
0x7F,0x03,0xC3,0xB8,0xFF,0x07,0xE0,0x38,0xEF,0x07,0xE0,0x38,0xEF,0x0F,0xF0,0x38,
0xCF,0x1F,0xF0,0x38,0x0F,0x1E,0x78,0x38,0x0F,0x3C,0x7C,0x38,0x0F,0x78,0x3C,0x38,
0x0F,0xF8,0x38,0x38,0x0F,0x60,0x00,0x78,0x0F,0x00,0x0F,0xF8,0x0F,0x00,0x07,0xF0,
0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ݮ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"ݮ"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x1E,0x00,0x00,0x3C,0x1E,0x00,
0x00,0x3C,0x1E,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x3C,0x1E,0x00,
0x07,0xBC,0x1E,0x00,0x07,0x80,0x00,0x00,0x0F,0xFF,0xFF,0xFC,0x0F,0xFF,0xFF,0xFC,
0x1E,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xF0,
0xF7,0xFF,0xFF,0xF0,0x37,0x83,0x80,0xF0,0x07,0x87,0xC0,0xF0,0x07,0x83,0xF0,0xF0,
0x07,0x00,0xE0,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x00,0xE0,
0x0F,0x0F,0x81,0xE0,0x0E,0x03,0xE1,0xE0,0x1E,0x01,0xC1,0xE0,0x1F,0xFF,0xFF,0xFE,
0x1F,0xFF,0xFF,0xFE,0x00,0x00,0x01,0xE0,0x00,0x00,0x03,0xC0,0x00,0x00,0xFF,0xC0,
0x00,0x00,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x3E,
0x7C,0x00,0x3F,0xFE,0x3F,0x3F,0xFF,0xF0,0x1F,0xBF,0xE0,0x00,0x07,0xBC,0x00,0x00,
0x03,0x3C,0x00,0x00,0x00,0x3C,0x00,0x3C,0x00,0x3C,0x0F,0xFE,0x70,0x3D,0xFF,0xF8,
0xF8,0x3D,0xFF,0x00,0x7C,0x3D,0xE7,0x80,0x3F,0x3D,0xE7,0x80,0x1F,0x3D,0xE7,0x8E,
0x0E,0x3D,0xE7,0x9F,0x00,0x3D,0xE7,0xFE,0x00,0x39,0xE7,0xF8,0x00,0x39,0xE3,0xF0,
0x1C,0x39,0xE3,0xC0,0x1E,0x79,0xE3,0xC0,0x1E,0x79,0xE1,0xE0,0x1E,0x79,0xE1,0xE0,
0x3C,0x79,0xE0,0xF0,0x3C,0x79,0xE0,0xF8,0x3C,0xF1,0xE0,0x7C,0x3C,0xF1,0xE3,0x7C,
0x7D,0xF1,0xEF,0x3F,0x79,0xE1,0xFE,0x1F,0x7B,0xE1,0xF8,0x0E,0x7B,0xC3,0xE0,0x00,
0x79,0x81,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: A --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{
"A"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x7C,0x00,0x00,0x00,0xFC,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0xFE,0x00,0x00,
0x01,0xFF,0x00,0x00,0x01,0xFF,0x00,0x00,0x01,0xEF,0x00,0x00,0x03,0xEF,0x80,0x00,
0x03,0xCF,0x80,0x00,0x07,0xC7,0x80,0x00,0x07,0xC7,0xC0,0x00,0x07,0x87,0xC0,0x00,
0x0F,0x83,0xE0,0x00,0x0F,0x83,0xE0,0x00,0x0F,0x01,0xE0,0x00,0x1F,0xFF,0xF0,0x00,
0x1F,0xFF,0xF0,0x00,0x3F,0xFF,0xF8,0x00,0x3E,0x00,0xF8,0x00,0x3C,0x00,0xF8,0x00,
0x7C,0x00,0x7C,0x00,0x7C,0x00,0x7C,0x00,0x78,0x00,0x3C,0x00,0xF8,0x00,0x3E,0x00,
0xF8,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: a --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"a"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,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,0xF8,0x00,0x00,
0x1F,0xFE,0x00,0x00,0x3F,0xFE,0x00,0x00,0x3E,0x3F,0x00,0x00,0x38,0x1F,0x00,0x00,
0x00,0x0F,0x00,0x00,0x00,0x0F,0x00,0x00,0x03,0xFF,0x00,0x00,0x1F,0xFF,0x00,0x00,
0x3F,0x8F,0x00,0x00,0x7C,0x0F,0x00,0x00,0x7C,0x0F,0x00,0x00,0x78,0x1F,0x00,0x00,
0x7C,0x1F,0x00,0x00,0x7E,0x7F,0x00,0x00,0x7F,0xFF,0x00,0x00,0x3F,0xFF,0x00,0x00,
0x0F,0xCF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: b --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"b"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,
0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,
0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x3C,0xFE,0x00,0x00,
0x3D,0xFF,0x80,0x00,0x3F,0xFF,0xC0,0x00,0x3F,0x8F,0xC0,0x00,0x3F,0x07,0xE0,0x00,
0x3E,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00,0x3C,0x01,0xE0,0x00,0x3C,0x01,0xE0,0x00,
0x3C,0x01,0xE0,0x00,0x3C,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00,0x3E,0x03,0xE0,0x00,
0x3F,0x07,0xC0,0x00,0x3F,0x8F,0xC0,0x00,0x3F,0xFF,0x80,0x00,0x3F,0xFF,0x00,0x00,
0x3C,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: c --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"c"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,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,0xFC,0x00,0x00,
0x07,0xFE,0x00,0x00,0x1F,0xFE,0x00,0x00,0x3F,0x86,0x00,0x00,0x3E,0x00,0x00,0x00,
0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x78,0x00,0x00,0x00,
0x78,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,0x7C,0x00,0x00,0x00,
0x3E,0x00,0x00,0x00,0x3F,0x86,0x00,0x00,0x1F,0xFE,0x00,0x00,0x0F,0xFE,0x00,0x00,
0x03,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ΢ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"΢"},{
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,0x07,0x01,0xE0,0x07,0x87,0x01,0xE0,
0x07,0x07,0x01,0xC0,0x0F,0xF7,0x79,0xC0,0x1E,0xF7,0x7B,0xC0,0x1E,0xF7,0x7B,0x80,
0x3C,0xF7,0x7B,0xFF,0x78,0xF7,0x7B,0xFF,0xF8,0xF7,0x7F,0x9E,0xF7,0xFF,0xFF,0x9E,
0x67,0xFF,0xFF,0x9E,0x07,0x00,0x7F,0x9C,0x0F,0x00,0x0F,0x9C,0x1E,0x00,0x1F,0x9C,
0x1E,0x7F,0xFF,0xBC,0x3E,0x7F,0xF3,0xFC,0x3E,0x00,0x03,0xFC,0x7E,0x00,0x01,0xF8,
0xFE,0x00,0x01,0xF8,0xFE,0x7F,0xE1,0xF8,0xDE,0x7F,0xE1,0xF8,0x1E,0x78,0xE0,0xF0,
0x1E,0x78,0xEE,0xF0,0x1E,0x78,0xFF,0xF0,0x1E,0x78,0xFD,0xF8,0x1E,0x79,0xFB,0xFC,
0x1E,0xF1,0xF7,0xBC,0x1E,0xF0,0xEF,0x9E,0x1F,0xE0,0x0F,0x0F,0x1E,0xC0,0x1E,0x0F,
0x1E,0x00,0x0C,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ѩ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"ѩ"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE,0x78,0x03,0xC0,0x1E,0x78,0x03,0xC0,0x1E,
0x7F,0xFF,0xFF,0xFE,0x7F,0xFF,0xFF,0xFE,0x00,0x03,0xC0,0x00,0x00,0x03,0xC0,0x00,
0x07,0xFF,0xFF,0xE0,0x07,0xFF,0xFF,0xE0,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,
0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,
0x1F,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x78,
0x00,0x00,0x00,0x78,0x3F,0xFF,0xFF,0xF8,0x3F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x78,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,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,0x80,0x00,0x00,0x07,0x80,0x00,
0x00,0x07,0x80,0x00,0x00,0x07,0x80,0x00,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8,
0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,
0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8,
0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,
0x78,0x07,0x80,0xF8,0x78,0x07,0x80,0xF8,0x7F,0xFF,0xFF,0xF8,0x7F,0xFF,0xFF,0xF8,
0x78,0x07,0x80,0x0E,0x78,0x07,0x80,0x0F,0x00,0x07,0x80,0x0F,0x00,0x07,0x80,0x0F,
0x00,0x07,0x80,0x1F,0x00,0x07,0x80,0x1E,0x00,0x03,0xFF,0xFE,0x00,0x01,0xFF,0xFC,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,0xFF,0xF8,0x1F,0xFF,0xFF,0xF8,0x00,0x00,0x01,0xF8,0x00,0x00,0x07,0xE0,
0x00,0x00,0x0F,0xC0,0x00,0x00,0x1F,0x80,0x00,0x00,0x3E,0x00,0x00,0x00,0xFC,0x00,
0x00,0x01,0xF8,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,
0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,
0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,0x00,0x03,0xE0,0x00,
0x00,0x03,0xE0,0x00,0x00,0x03,0xC0,0x00,0x01,0xFF,0xC0,0x00,0x00,0xFF,0x80,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x01,0xF0,0x00,
0x00,0x01,0xE0,0x00,0x7F,0xF1,0xE0,0x00,0xFF,0xF9,0xE0,0x00,0xFF,0xFB,0xFF,0xFF,
0x7F,0xFB,0xFF,0xFF,0x00,0x7B,0xFF,0xFF,0x00,0x7F,0x8C,0x1E,0x78,0x77,0x9E,0x3E,
0x78,0xF7,0x9E,0x3C,0x3C,0xFF,0x1E,0x7C,0x3E,0xFF,0x1E,0x78,0x1E,0xF6,0x1E,0x00,
0x0F,0xE0,0x1E,0x00,0x0F,0xE0,0x1E,0x00,0x07,0xE0,0x1F,0x00,0x03,0xE0,0x3F,0x00,
0x03,0xE0,0x3F,0x00,0x03,0xE0,0x3F,0x80,0x07,0xF0,0x7F,0x80,0x0F,0xF8,0x7F,0xC0,
0x0F,0x78,0xFB,0xC0,0x1F,0x7C,0xF3,0xE0,0x3E,0x3D,0xF1,0xF0,0x7C,0x3B,0xE0,0xF8,
0xF8,0x07,0xC0,0xFC,0xF8,0x1F,0x80,0x7E,0xF0,0x3F,0x00,0x3F,0x60,0x7E,0x00,0x1E,
0x00,0x38,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ӭ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"ӭ"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x38,0x03,0xF0,0x00,
0x7C,0x3F,0xF0,0x00,0x3E,0x3F,0xFF,0xFE,0x1E,0x3E,0x1F,0xFE,0x1F,0x3C,0x1F,0xFE,
0x0F,0xBC,0x1E,0x1E,0x07,0x3C,0x1E,0x1E,0x00,0x3C,0x1E,0x1E,0x00,0x3C,0x1E,0x1E,
0x00,0x3C,0x1E,0x1E,0xFF,0x3C,0x1E,0x1E,0xFF,0x3C,0x1E,0x1E,0xFF,0x3C,0x1E,0x1E,
0x0F,0x3C,0x1E,0x1E,0x0F,0x3C,0x1E,0x1E,0x0F,0x3C,0x1E,0x1E,0x0F,0x3C,0x7E,0x1E,
0x0F,0x3D,0xFE,0x1E,0x0F,0x3F,0xFE,0x1E,0x0F,0x3F,0xDF,0xFC,0x0F,0x7F,0x1F,0xFC,
0x0F,0x3E,0x1F,0xF8,0x0F,0x38,0x1E,0x00,0x1F,0x00,0x1E,0x00,0x3F,0x00,0x1E,0x00,
0x7F,0x80,0x1E,0x00,0xFF,0xF0,0x00,0x0F,0xF3,0xFF,0xFF,0xFF,0xE0,0xFF,0xFF,0xFF,
0x60,0x0F,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: ʹ --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"ʹ"},{
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,0x3C,0x00,0x03,0xC0,0x3C,0x00,
0x03,0xC0,0x3C,0x00,0x07,0x80,0x3C,0x00,0x07,0xFF,0xFF,0xFE,0x07,0xFF,0xFF,0xFF,
0x0F,0xFF,0xFF,0xFF,0x0F,0x00,0x3C,0x00,0x1E,0x00,0x3C,0x00,0x1E,0x00,0x3C,0x00,
0x1E,0x3F,0xFF,0xFC,0x3E,0x3F,0xFF,0xFC,0x3E,0x3C,0x3C,0x1C,0x7E,0x3C,0x3C,0x1C,
0xFE,0x3C,0x3C,0x1C,0xFE,0x3C,0x3C,0x1C,0xFE,0x3F,0xFF,0xFC,0xFE,0x3F,0xFF,0xFC,
0x1E,0x3F,0xFF,0xFC,0x1E,0x04,0x3C,0x1C,0x1E,0x1E,0x38,0x00,0x1E,0x1F,0x78,0x00,
0x1E,0x0F,0x78,0x00,0x1E,0x07,0xF8,0x00,0x1E,0x07,0xF0,0x00,0x1E,0x03,0xF8,0x00,
0x1E,0x07,0xFE,0x00,0x1E,0x1F,0xFF,0xE0,0x1E,0x7F,0x1F,0xFF,0x1F,0xFE,0x07,0xFF,
0x1E,0xF8,0x00,0x7E,0x0E,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
/*-- <20><><EFBFBD><EFBFBD>: <20><> --*/
/*-- ΢<><CEA2><EFBFBD>ź<EFBFBD>24; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>x<EFBFBD><78>=32x41 --*/
{{"<EFBFBD><EFBFBD>"},{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,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,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1E,0x01,0xE0,0x3C,
0x1E,0x01,0xE0,0x3C,0x1E,0x01,0xE0,0x3C,0x1E,0x01,0xE0,0x3C,0x1E,0x01,0xE0,0x3C,
0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1E,0x01,0xE0,0x3C,
0x1E,0x01,0xE0,0x3C,0x1E,0x01,0xE0,0x3C,0x1E,0x01,0xE0,0x3C,0x1E,0x01,0xE0,0x3C,
0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1F,0xFF,0xFF,0xFC,0x1E,0x01,0xE0,0x3C,
0x1E,0x01,0xE0,0x3C,0x1E,0x01,0xE0,0x3C,0x3E,0x01,0xE0,0x3C,0x3C,0x01,0xE0,0x3C,
0x3C,0x01,0xE0,0x3C,0x7C,0x01,0xE0,0x3C,0x78,0x01,0xEF,0xFC,0xF8,0x01,0xEF,0xFC,
0x70,0x01,0xEF,0xF8,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00}},
};
cFONT Font24CN = {
Font24CN_Table,
sizeof(Font24CN_Table)/sizeof(CH_CN), /*size of table*/
24, /* ASCII Width */
32, /* Width */
41, /* Height */
};
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

1004
bsp/pico/bsp/Fonts/font8.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,97 @@
/**
******************************************************************************
* @file fonts.h
* @author MCD Application Team
* @version V1.0.0
* @date 18-February-2014
* @brief Header for fonts.c file
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* 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.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __FONTS_H
#define __FONTS_H
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>΢<EFBFBD><CEA2><EFBFBD>ź<EFBFBD>24 (32x41) */
#define MAX_HEIGHT_FONT 41
#define MAX_WIDTH_FONT 32
#define OFFSET_BITMAP
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
//ASCII
typedef struct _tFont
{
const uint8_t *table;
uint16_t Width;
uint16_t Height;
} sFONT;
//GB2312
typedef struct // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>ݽṹ
{
const char index[2]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
const char matrix[MAX_HEIGHT_FONT*MAX_WIDTH_FONT/8+2]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}CH_CN;
typedef struct
{
const CH_CN *table;
uint16_t size;
uint16_t ASCII_Width;
uint16_t Width;
uint16_t Height;
}cFONT;
extern sFONT Font24;
extern sFONT Font20;
extern sFONT Font16;
extern sFONT Font12;
extern sFONT Font8;
extern cFONT Font12CN;
extern cFONT Font24CN;
#ifdef __cplusplus
}
#endif
#endif /* __FONTS_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -0,0 +1,71 @@
/*
* Copyright (c) 2019 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*-----------------------------------------------------------------------------
* File GLCD_Config.h
* Brief Graphic LCD interface configuration file for V2M-MPS3 evaluation board
* Version 1.0.0
*----------------------------------------------------------------------------*/
#ifndef __GLCD_CONFIG_H
#define __GLCD_CONFIG_H
/*---------------------- Graphic LCD orientation configuration ---------------*/
/*---------------------- Graphic LCD physical definitions --------------------*/
#define GLCD_WIDTH 240 /* Screen Width (in pixels) */
#define GLCD_HEIGHT 240 /* Screen Height (in pixels) */
/*---------------------- Graphic LCD color definitions -----------------------*/
/* Color coding (16-bit):
15..11 = R4..0 (Red)
10..5 = G5..0 (Green)
4..0 = B4..0 (Blue)
*/
#if defined(__USE_RGB32__)
# define __RGB(__R, __G, __B) ((((uint32_t)(__R) & 0xFF) << 16) | \
(((uint32_t)(__G) & 0xFF) << 8) | \
(((uint32_t)(__B) & 0xFF) << 0) | \
(uint32_t)0xFF << 24)
#else
# define __RGB(__R, __G, __B) ((((uint16_t)(__R) & 0xFF) >> 3 << 11) | \
(((uint16_t)(__G) & 0xFF) >> 2 << 5) | \
(((uint16_t)(__B) & 0xFF) >> 3 << 0) )
#endif
/* GLCD RGB color definitions */
#define GLCD_COLOR_BLACK __RGB( 0, 0, 0 )
#define GLCD_COLOR_NAVY __RGB( 0, 0, 128 )
#define GLCD_COLOR_DARK_GREEN __RGB( 0, 128, 0 )
#define GLCD_COLOR_DARK_CYAN __RGB( 0, 128, 128 )
#define GLCD_COLOR_MAROON __RGB( 128, 0, 0 )
#define GLCD_COLOR_PURPLE __RGB( 128, 0, 128 )
#define GLCD_COLOR_OLIVE __RGB( 128, 128, 0 )
#define GLCD_COLOR_LIGHT_GREY __RGB( 192, 192, 192 )
#define GLCD_COLOR_DARK_GREY __RGB( 128, 128, 128 )
#define GLCD_COLOR_BLUE __RGB( 0, 0, 255 )
#define GLCD_COLOR_GREEN __RGB( 0, 255, 0 )
#define GLCD_COLOR_CYAN __RGB( 0, 255, 255 )
#define GLCD_COLOR_RED __RGB( 255, 0, 0 )
#define GLCD_COLOR_MAGENTA __RGB( 255, 0, 255 )
#define GLCD_COLOR_YELLOW __RGB( 255, 255, 0 )
#define GLCD_COLOR_WHITE __RGB( 255, 255, 255 )
#endif /* __GLCD_CONFIG_H */

View File

@ -0,0 +1,804 @@
#include "GUI_Paint.h"
#include "DEV_Config.h"
#include "Debug.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h> //memset()
#include <math.h>
PAINT Paint;
/******************************************************************************
function: Create Image
parameter:
image : Pointer to the image cache
width : The width of the picture
Height : The height of the picture
Color : Whether the picture is inverted
******************************************************************************/
void Paint_NewImage(UBYTE *image, UWORD Width, UWORD Height, UWORD Rotate, UWORD Color)
{
Paint.Image = NULL;
Paint.Image = image;
Paint.WidthMemory = Width;
Paint.HeightMemory = Height;
Paint.Color = Color;
Paint.Scale = 2;
Paint.WidthByte = (Width % 8 == 0)? (Width / 8 ): (Width / 8 + 1);
Paint.HeightByte = Height;
// printf("WidthByte = %d, HeightByte = %d\r\n", Paint.WidthByte, Paint.HeightByte);
// printf(" EPD_WIDTH / 8 = %d\r\n", 122 / 8);
Paint.Rotate = Rotate;
Paint.Mirror = MIRROR_NONE;
if(Rotate == ROTATE_0 || Rotate == ROTATE_180) {
Paint.Width = Width;
Paint.Height = Height;
} else {
Paint.Width = Height;
Paint.Height = Width;
}
}
/******************************************************************************
function: Select Image
parameter:
image : Pointer to the image cache
******************************************************************************/
void Paint_SelectImage(UBYTE *image)
{
Paint.Image = image;
}
/******************************************************************************
function: Select Image Rotate
parameter:
Rotate : 0,90,180,270
******************************************************************************/
void Paint_SetRotate(UWORD Rotate)
{
if(Rotate == ROTATE_0 || Rotate == ROTATE_90 || Rotate == ROTATE_180 || Rotate == ROTATE_270) {
Debug("Set image Rotate %d\r\n", Rotate);
Paint.Rotate = Rotate;
} else {
Debug("rotate = 0, 90, 180, 270\r\n");
}
}
void Paint_SetScale(UBYTE scale)
{
if(scale == 2){
Paint.Scale = scale;
Paint.WidthByte = (Paint.WidthMemory % 8 == 0)? (Paint.WidthMemory / 8 ): (Paint.WidthMemory / 8 + 1);
}else if(scale == 4){
Paint.Scale = scale;
Paint.WidthByte = (Paint.WidthMemory % 4 == 0)? (Paint.WidthMemory / 4 ): (Paint.WidthMemory / 4 + 1);
}else if(scale ==16) {
Paint.Scale = scale;
Paint.WidthByte = (Paint.WidthMemory%2==0) ? (Paint.WidthMemory/2) : (Paint.WidthMemory/2+1);
}else if(scale ==65) {
Paint.Scale = scale;
Paint.WidthByte = Paint.WidthMemory*2;
}else{
Debug("Set Scale Input parameter error\r\n");
Debug("Scale Only support: 2 4 16 65\r\n");
}
}
/******************************************************************************
function: Select Image mirror
parameter:
mirror :Not mirror,Horizontal mirror,Vertical mirror,Origin mirror
******************************************************************************/
void Paint_SetMirroring(UBYTE mirror)
{
if(mirror == MIRROR_NONE || mirror == MIRROR_HORIZONTAL ||
mirror == MIRROR_VERTICAL || mirror == MIRROR_ORIGIN) {
Debug("mirror image x:%s, y:%s\r\n",(mirror & 0x01)? "mirror":"none", ((mirror >> 1) & 0x01)? "mirror":"none");
Paint.Mirror = mirror;
} else {
Debug("mirror should be MIRROR_NONE, MIRROR_HORIZONTAL, \
MIRROR_VERTICAL or MIRROR_ORIGIN\r\n");
}
}
/******************************************************************************
function: Draw Pixels
parameter:
Xpoint : At point X
Ypoint : At point Y
Color : Painted colors
******************************************************************************/
void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color)
{
if(Xpoint > Paint.Width || Ypoint > Paint.Height){
Debug("Exceeding display boundaries\r\n");
return;
}
UWORD X, Y;
switch(Paint.Rotate) {
case 0:
X = Xpoint;
Y = Ypoint;
break;
case 90:
X = Paint.WidthMemory - Ypoint - 1;
Y = Xpoint;
break;
case 180:
X = Paint.WidthMemory - Xpoint - 1;
Y = Paint.HeightMemory - Ypoint - 1;
break;
case 270:
X = Ypoint;
Y = Paint.HeightMemory - Xpoint - 1;
break;
default:
return;
}
switch(Paint.Mirror) {
case MIRROR_NONE:
break;
case MIRROR_HORIZONTAL:
X = Paint.WidthMemory - X - 1;
break;
case MIRROR_VERTICAL:
Y = Paint.HeightMemory - Y - 1;
break;
case MIRROR_ORIGIN:
X = Paint.WidthMemory - X - 1;
Y = Paint.HeightMemory - Y - 1;
break;
default:
return;
}
if(X > Paint.WidthMemory || Y > Paint.HeightMemory){
Debug("Exceeding display boundaries\r\n");
return;
}
if(Paint.Scale == 2){
UDOUBLE Addr = X / 8 + Y * Paint.WidthByte;
UBYTE Rdata = Paint.Image[Addr];
if(Color&0xff == BLACK)
Paint.Image[Addr] = Rdata & ~(0x80 >> (X % 8));
else
Paint.Image[Addr] = Rdata | (0x80 >> (X % 8));
}else if(Paint.Scale == 4){
UDOUBLE Addr = X / 4 + Y * Paint.WidthByte;
Color = Color % 4;//Guaranteed color scale is 4 --- 0~3
UBYTE Rdata = Paint.Image[Addr];
Rdata = Rdata & (~(0xC0 >> ((X % 4)*2)));
Paint.Image[Addr] = Rdata | ((Color << 6) >> ((X % 4)*2));
}else if(Paint.Scale == 16) {
UDOUBLE Addr = X / 2 + Y * Paint.WidthByte;
UBYTE Rdata = Paint.Image[Addr];
Color = Color % 16;
Rdata = Rdata & (~(0xf0 >> ((X % 2)*4)));
Paint.Image[Addr] = Rdata | ((Color << 4) >> ((X % 2)*4));
}else if(Paint.Scale == 65) {
UDOUBLE Addr = X*2 + Y*Paint.WidthByte;
Paint.Image[Addr] = 0xff & (Color>>8);
Paint.Image[Addr+1] = 0xff & Color;
}
}
/******************************************************************************
function: Clear the color of the picture
parameter:
Color : Painted colors
******************************************************************************/
void Paint_Clear(UWORD Color)
{
if(Paint.Scale == 2 || Paint.Scale == 4) {
for (UWORD Y = 0; Y < Paint.HeightByte; Y++) {
for (UWORD X = 0; X < Paint.WidthByte; X++ ) {//8 pixel = 1 byte
UDOUBLE Addr = X + Y*Paint.WidthByte;
Paint.Image[Addr] = Color;
}
}
}else if(Paint.Scale == 16) {
for (UWORD Y = 0; Y < Paint.HeightByte; Y++) {
for (UWORD X = 0; X < Paint.WidthByte; X++ ) {//8 pixel = 1 byte
UDOUBLE Addr = X + Y*Paint.WidthByte;
Color = Color & 0x0f;
Paint.Image[Addr] = (Color<<4) | Color;
}
}
}else if(Paint.Scale == 65) {
for (UWORD Y = 0; Y < Paint.HeightByte; Y++) {
for (UWORD X = 0; X < Paint.WidthByte; X++ ) {//8 pixel = 1 byte
UDOUBLE Addr = X*2 + Y*Paint.WidthByte;
Paint.Image[Addr] = 0xff & (Color>>8);
Paint.Image[Addr+1] = 0xff & Color;
}
}
}
}
/******************************************************************************
function: Clear the color of a window
parameter:
Xstart : x starting point
Ystart : Y starting point
Xend : x end point
Yend : y end point
Color : Painted colors
******************************************************************************/
void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color)
{
UWORD X, Y;
for (Y = Ystart; Y < Yend; Y++) {
for (X = Xstart; X < Xend; X++) {//8 pixel = 1 byte
Paint_SetPixel(X, Y, Color);
}
}
}
/******************************************************************************
function: Draw Point(Xpoint, Ypoint) Fill the color
parameter:
Xpoint : The Xpoint coordinate of the point
Ypoint : The Ypoint coordinate of the point
Color : Painted color
Dot_Pixel : point size
Dot_Style : point Style
******************************************************************************/
void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color,
DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_Style)
{
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
Debug("Paint_DrawPoint Input exceeds the normal display range\r\n");
printf("Xpoint = %d , Paint.Width = %d \r\n ",Xpoint,Paint.Width);
printf("Ypoint = %d , Paint.Height = %d \r\n ",Ypoint,Paint.Height);
return;
}
int16_t XDir_Num , YDir_Num;
if (Dot_Style == DOT_FILL_AROUND) {
for (XDir_Num = 0; XDir_Num < 2 * Dot_Pixel - 1; XDir_Num++) {
for (YDir_Num = 0; YDir_Num < 2 * Dot_Pixel - 1; YDir_Num++) {
if(Xpoint + XDir_Num - Dot_Pixel < 0 || Ypoint + YDir_Num - Dot_Pixel < 0)
break;
// printf("x = %d, y = %d\r\n", Xpoint + XDir_Num - Dot_Pixel, Ypoint + YDir_Num - Dot_Pixel);
Paint_SetPixel(Xpoint + XDir_Num - Dot_Pixel, Ypoint + YDir_Num - Dot_Pixel, Color);
}
}
} else {
for (XDir_Num = 0; XDir_Num < Dot_Pixel; XDir_Num++) {
for (YDir_Num = 0; YDir_Num < Dot_Pixel; YDir_Num++) {
Paint_SetPixel(Xpoint + XDir_Num - 1, Ypoint + YDir_Num - 1, Color);
}
}
}
}
/******************************************************************************
function: Draw a line of arbitrary slope
parameter:
Xstart Starting Xpoint point coordinates
Ystart Starting Xpoint point coordinates
Xend End point Xpoint coordinate
Yend End point Ypoint coordinate
Color The color of the line segment
Line_width : Line width
Line_Style: Solid and dotted lines
******************************************************************************/
void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend,
UWORD Color, DOT_PIXEL Line_width, LINE_STYLE Line_Style)
{
if (Xstart > Paint.Width || Ystart > Paint.Height ||
Xend > Paint.Width || Yend > Paint.Height) {
Debug("Paint_DrawLine Input exceeds the normal display range\r\n");
return;
}
UWORD Xpoint = Xstart;
UWORD Ypoint = Ystart;
int dx = (int)Xend - (int)Xstart >= 0 ? Xend - Xstart : Xstart - Xend;
int dy = (int)Yend - (int)Ystart <= 0 ? Yend - Ystart : Ystart - Yend;
// Increment direction, 1 is positive, -1 is counter;
int XAddway = Xstart < Xend ? 1 : -1;
int YAddway = Ystart < Yend ? 1 : -1;
//Cumulative error
int Esp = dx + dy;
char Dotted_Len = 0;
for (;;) {
Dotted_Len++;
//Painted dotted line, 2 point is really virtual
if (Line_Style == LINE_STYLE_DOTTED && Dotted_Len % 3 == 0) {
//Debug("LINE_DOTTED\r\n");
if(Color)
Paint_DrawPoint(Xpoint, Ypoint, BLACK, Line_width, DOT_STYLE_DFT);
else
Paint_DrawPoint(Xpoint, Ypoint, WHITE, Line_width, DOT_STYLE_DFT);
Dotted_Len = 0;
} else {
Paint_DrawPoint(Xpoint, Ypoint, Color, Line_width, DOT_STYLE_DFT);
}
if (2 * Esp >= dy) {
if (Xpoint == Xend)
break;
Esp += dy;
Xpoint += XAddway;
}
if (2 * Esp <= dx) {
if (Ypoint == Yend)
break;
Esp += dx;
Ypoint += YAddway;
}
}
}
/******************************************************************************
function: Draw a rectangle
parameter:
Xstart Rectangular Starting Xpoint point coordinates
Ystart Rectangular Starting Xpoint point coordinates
Xend Rectangular End point Xpoint coordinate
Yend Rectangular End point Ypoint coordinate
Color The color of the Rectangular segment
Line_width: Line width
Draw_Fill : Whether to fill the inside of the rectangle
******************************************************************************/
void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend,
UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
{
if (Xstart > Paint.Width || Ystart > Paint.Height ||
Xend > Paint.Width || Yend > Paint.Height) {
Debug("Input exceeds the normal display range\r\n");
return;
}
if (Draw_Fill) {
UWORD Ypoint;
for(Ypoint = Ystart; Ypoint < Yend; Ypoint++) {
Paint_DrawLine(Xstart, Ypoint, Xend, Ypoint, Color , Line_width, LINE_STYLE_SOLID);
}
} else {
Paint_DrawLine(Xstart, Ystart, Xend, Ystart, Color, Line_width, LINE_STYLE_SOLID);
Paint_DrawLine(Xstart, Ystart, Xstart, Yend, Color, Line_width, LINE_STYLE_SOLID);
Paint_DrawLine(Xend, Yend, Xend, Ystart, Color, Line_width, LINE_STYLE_SOLID);
Paint_DrawLine(Xend, Yend, Xstart, Yend, Color, Line_width, LINE_STYLE_SOLID);
}
}
/******************************************************************************
function: Use the 8-point method to draw a circle of the
specified size at the specified position->
parameter:
X_Center Center X coordinate
Y_Center Center Y coordinate
Radius circle Radius
Color The color of the circle segment
Line_width: Line width
Draw_Fill : Whether to fill the inside of the Circle
******************************************************************************/
void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius,
UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill)
{
if (X_Center > Paint.Width || Y_Center >= Paint.Height) {
Debug("Paint_DrawCircle Input exceeds the normal display range\r\n");
return;
}
//Draw a circle from(0, R) as a starting point
int16_t XCurrent, YCurrent;
XCurrent = 0;
YCurrent = Radius;
//Cumulative error,judge the next point of the logo
int16_t Esp = 3 - (Radius << 1 );
int16_t sCountY;
if (Draw_Fill == DRAW_FILL_FULL) {
while (XCurrent <= YCurrent ) { //Realistic circles
for (sCountY = XCurrent; sCountY <= YCurrent; sCountY ++ ) {
Paint_DrawPoint(X_Center + XCurrent, Y_Center + sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//1
Paint_DrawPoint(X_Center - XCurrent, Y_Center + sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//2
Paint_DrawPoint(X_Center - sCountY, Y_Center + XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//3
Paint_DrawPoint(X_Center - sCountY, Y_Center - XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//4
Paint_DrawPoint(X_Center - XCurrent, Y_Center - sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//5
Paint_DrawPoint(X_Center + XCurrent, Y_Center - sCountY, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//6
Paint_DrawPoint(X_Center + sCountY, Y_Center - XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);//7
Paint_DrawPoint(X_Center + sCountY, Y_Center + XCurrent, Color, DOT_PIXEL_DFT, DOT_STYLE_DFT);
}
if (Esp < 0 )
Esp += 4 * XCurrent + 6;
else {
Esp += 10 + 4 * (XCurrent - YCurrent );
YCurrent --;
}
XCurrent ++;
}
} else { //Draw a hollow circle
while (XCurrent <= YCurrent ) {
Paint_DrawPoint(X_Center + XCurrent, Y_Center + YCurrent, Color, Line_width, DOT_STYLE_DFT);//1
Paint_DrawPoint(X_Center - XCurrent, Y_Center + YCurrent, Color, Line_width, DOT_STYLE_DFT);//2
Paint_DrawPoint(X_Center - YCurrent, Y_Center + XCurrent, Color, Line_width, DOT_STYLE_DFT);//3
Paint_DrawPoint(X_Center - YCurrent, Y_Center - XCurrent, Color, Line_width, DOT_STYLE_DFT);//4
Paint_DrawPoint(X_Center - XCurrent, Y_Center - YCurrent, Color, Line_width, DOT_STYLE_DFT);//5
Paint_DrawPoint(X_Center + XCurrent, Y_Center - YCurrent, Color, Line_width, DOT_STYLE_DFT);//6
Paint_DrawPoint(X_Center + YCurrent, Y_Center - XCurrent, Color, Line_width, DOT_STYLE_DFT);//7
Paint_DrawPoint(X_Center + YCurrent, Y_Center + XCurrent, Color, Line_width, DOT_STYLE_DFT);//0
if (Esp < 0 )
Esp += 4 * XCurrent + 6;
else {
Esp += 10 + 4 * (XCurrent - YCurrent );
YCurrent --;
}
XCurrent ++;
}
}
}
/******************************************************************************
function: Show English characters
parameter:
Xpoint X coordinate
Ypoint Y coordinate
Acsii_Char To display the English characters
Font A structure pointer that displays a character size
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawChar(UWORD Xpoint, UWORD Ypoint, const char Acsii_Char,
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
{
UWORD Page, Column;
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
Debug("Paint_DrawChar Input exceeds the normal display range\r\n");
return;
}
uint32_t Char_Offset = (Acsii_Char - ' ') * Font->Height * (Font->Width / 8 + (Font->Width % 8 ? 1 : 0));
const unsigned char *ptr = &Font->table[Char_Offset];
for (Page = 0; Page < Font->Height; Page ++ ) {
for (Column = 0; Column < Font->Width; Column ++ ) {
//To determine whether the font background color and screen background color is consistent
if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan
if (*ptr & (0x80 >> (Column % 8)))
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Foreground);
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
} else {
if (*ptr & (0x80 >> (Column % 8))) {
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Foreground);
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
} else {
Paint_SetPixel(Xpoint + Column, Ypoint + Page, Color_Background);
// Paint_DrawPoint(Xpoint + Column, Ypoint + Page, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT);
}
}
//One pixel is 8 bits
if (Column % 8 == 7)
ptr++;
}// Write a line
if (Font->Width % 8 != 0)
ptr++;
}// Write all
}
/******************************************************************************
function: Display the string
parameter:
Xstart X coordinate
Ystart Y coordinate
pString The first address of the English string to be displayed
Font A structure pointer that displays a character size
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString,
sFONT* Font, UWORD Color_Foreground, UWORD Color_Background)
{
UWORD Xpoint = Xstart;
UWORD Ypoint = Ystart;
if (Xstart > Paint.Width || Ystart > Paint.Height) {
Debug("Paint_DrawString_EN Input exceeds the normal display range\r\n");
return;
}
while (* pString != '\0') {
//if X direction filled , reposition to(Xstart,Ypoint),Ypoint is Y direction plus the Height of the character
if ((Xpoint + Font->Width ) > Paint.Width ) {
Xpoint = Xstart;
Ypoint += Font->Height;
}
// If the Y direction is full, reposition to(Xstart, Ystart)
if ((Ypoint + Font->Height ) > Paint.Height ) {
Xpoint = Xstart;
Ypoint = Ystart;
}
Paint_DrawChar(Xpoint, Ypoint, * pString, Font, Color_Background, Color_Foreground);
//The next character of the address
pString ++;
//The next word of the abscissa increases the font of the broadband
Xpoint += Font->Width;
}
}
/******************************************************************************
function: Display the string
parameter:
Xstart X coordinate
Ystart Y coordinate
pString The first address of the Chinese string and English
string to be displayed
Font A structure pointer that displays a character size
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font,
UWORD Color_Foreground, UWORD Color_Background)
{
const char* p_text = pString;
int x = Xstart, y = Ystart;
int i, j,Num;
/* Send the string character by character on EPD */
while (*p_text != 0) {
if(*p_text <= 0x7F) { //ASCII < 126
for(Num = 0; Num < font->size; Num++) {
if(*p_text== font->table[Num].index[0]) {
const char* ptr = &font->table[Num].matrix[0];
for (j = 0; j < font->Height; j++) {
for (i = 0; i < font->Width; i++) {
if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan
if (*ptr & (0x80 >> (i % 8))) {
Paint_SetPixel(x + i, y + j, Color_Foreground);
// Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
}
} else {
if (*ptr & (0x80 >> (i % 8))) {
Paint_SetPixel(x + i, y + j, Color_Foreground);
// Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
} else {
Paint_SetPixel(x + i, y + j, Color_Background);
// Paint_DrawPoint(x + i, y + j, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT);
}
}
if (i % 8 == 7) {
ptr++;
}
}
if (font->Width % 8 != 0) {
ptr++;
}
}
break;
}
}
/* Point on the next character */
p_text += 1;
/* Decrement the column position by 16 */
x += font->ASCII_Width;
} else { //Chinese
for(Num = 0; Num < font->size; Num++) {
if((*p_text== font->table[Num].index[0]) && (*(p_text+1) == font->table[Num].index[1])) {
const char* ptr = &font->table[Num].matrix[0];
for (j = 0; j < font->Height; j++) {
for (i = 0; i < font->Width; i++) {
if (FONT_BACKGROUND == Color_Background) { //this process is to speed up the scan
if (*ptr & (0x80 >> (i % 8))) {
Paint_SetPixel(x + i, y + j, Color_Foreground);
// Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
}
} else {
if (*ptr & (0x80 >> (i % 8))) {
Paint_SetPixel(x + i, y + j, Color_Foreground);
// Paint_DrawPoint(x + i, y + j, Color_Foreground, DOT_PIXEL_DFT, DOT_STYLE_DFT);
} else {
Paint_SetPixel(x + i, y + j, Color_Background);
// Paint_DrawPoint(x + i, y + j, Color_Background, DOT_PIXEL_DFT, DOT_STYLE_DFT);
}
}
if (i % 8 == 7) {
ptr++;
}
}
if (font->Width % 8 != 0) {
ptr++;
}
}
break;
}
}
/* Point on the next character */
p_text += 2;
/* Decrement the column position by 16 */
x += font->Width;
}
}
}
/******************************************************************************
function: Display nummber
parameter:
Xstart X coordinate
Ystart : Y coordinate
Nummber : The number displayed
Font A structure pointer that displays a character size
Digit : Fractional width
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
#define ARRAY_LEN 255
void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, double Nummber,
sFONT* Font, UWORD Digit,UWORD Color_Foreground, UWORD Color_Background)
{
int16_t Num_Bit = 0, Str_Bit = 0;
uint8_t Str_Array[ARRAY_LEN] = {0}, Num_Array[ARRAY_LEN] = {0};
uint8_t *pStr = Str_Array;
int temp = Nummber;
float decimals;
uint8_t i;
if (Xpoint > Paint.Width || Ypoint > Paint.Height) {
Debug("Paint_DisNum Input exceeds the normal display range\r\n");
return;
}
if(Digit > 0) {
decimals = Nummber - temp;
for(i=Digit; i > 0; i--) {
decimals*=10;
}
temp = decimals;
//Converts a number to a string
for(i=Digit; i>0; i--) {
Num_Array[Num_Bit] = temp % 10 + '0';
Num_Bit++;
temp /= 10;
}
Num_Array[Num_Bit] = '.';
Num_Bit++;
}
temp = Nummber;
//Converts a number to a string
while (temp) {
Num_Array[Num_Bit] = temp % 10 + '0';
Num_Bit++;
temp /= 10;
}
//The string is inverted
while (Num_Bit > 0) {
Str_Array[Str_Bit] = Num_Array[Num_Bit - 1];
Str_Bit ++;
Num_Bit --;
}
//show
Paint_DrawString_EN(Xpoint, Ypoint, (const char*)pStr, Font, Color_Background, Color_Foreground);
}
/******************************************************************************
function: Display time
parameter:
Xstart X coordinate
Ystart : Y coordinate
pTime : Time-related structures
Font A structure pointer that displays a character size
Color_Foreground : Select the foreground color
Color_Background : Select the background color
******************************************************************************/
void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font,
UWORD Color_Foreground, UWORD Color_Background)
{
uint8_t value[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
UWORD Dx = Font->Width;
//Write data into the cache
Paint_DrawChar(Xstart , Ystart, value[pTime->Hour / 10], Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx , Ystart, value[pTime->Hour % 10], Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx + Dx / 4 + Dx / 2 , Ystart, ':' , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 2 + Dx / 2 , Ystart, value[pTime->Min / 10] , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 3 + Dx / 2 , Ystart, value[pTime->Min % 10] , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 4 + Dx / 2 - Dx / 4, Ystart, ':' , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 5 , Ystart, value[pTime->Sec / 10] , Font, Color_Background, Color_Foreground);
Paint_DrawChar(Xstart + Dx * 6 , Ystart, value[pTime->Sec % 10] , Font, Color_Background, Color_Foreground);
}
void Paint_DrawImage(const unsigned char *image, UWORD xStart, UWORD yStart, UWORD W_Image, UWORD H_Image)
{
int i,j;
for(j = 0; j < H_Image; j++){
for(i = 0; i < W_Image; i++){
if(xStart+i < Paint.WidthMemory && yStart+j < Paint.HeightMemory)//Exceeded part does not display
Paint_SetPixel(xStart + i, yStart + j, (*(image + j*W_Image*2 + i*2+1))<<8 | (*(image + j*W_Image*2 + i*2)));
//Using arrays is a property of sequential storage, accessing the original array by algorithm
//j*W_Image*2 Y offset
//i*2 X offset
}
}
}
void Paint_DrawImage1(const unsigned char *image, UWORD xStart, UWORD yStart, UWORD W_Image, UWORD H_Image)
{
int i,j;
for(j = 0; j < H_Image; j++){
for(i = 0; i < W_Image; i++){
if(xStart+i < Paint.HeightMemory && yStart+j < Paint.WidthMemory)//Exceeded part does not display
Paint_SetPixel(xStart + i, yStart + j, (*(image + j*W_Image*2 + i*2+1))<<8 | (*(image + j*W_Image*2 + i*2)));
//Using arrays is a property of sequential storage, accessing the original array by algorithm
//j*W_Image*2 Y offset
//i*2 X offset
}
}
}
/******************************************************************************
function: Display monochrome bitmap
parameter:
image_buffer A picture data converted to a bitmap
info:
Use a computer to convert the image into a corresponding array,
and then embed the array directly into Imagedata.cpp as a .c file.
******************************************************************************/
void Paint_DrawBitMap(const unsigned char* image_buffer)
{
UWORD x, y;
UDOUBLE Addr = 0;
for (y = 0; y < Paint.HeightByte; y++) {
for (x = 0; x < Paint.WidthByte; x++) {//8 pixel = 1 byte
Addr = x + y * Paint.WidthByte;
Paint.Image[Addr] = (unsigned char)image_buffer[Addr];
}
}
}
void Paint_DrawBitMap_Block(const unsigned char* image_buffer, UBYTE Region)
{
UWORD x, y;
UDOUBLE Addr = 0;
for (y = 0; y < Paint.HeightByte; y++) {
for (x = 0; x < Paint.WidthByte; x++) {//8 pixel = 1 byte
Addr = x + y * Paint.WidthByte ;
Paint.Image[Addr] = \
(unsigned char)image_buffer[Addr+ (Paint.HeightByte)*Paint.WidthByte*(Region - 1)];
}
}
}
void Paint_BmpWindows(unsigned char x,unsigned char y,const unsigned char *pBmp,
unsigned char chWidth,unsigned char chHeight)
{
uint16_t i, j, byteWidth = (chWidth + 7)/8;
for(j = 0; j < chHeight; j ++){
for(i = 0; i < chWidth; i ++ ) {
if(*(pBmp + j * byteWidth + i / 8) & (128 >> (i & 7))) {
Paint_SetPixel(x+i, y+j, 0xffff);
}
}
}
}

View File

@ -0,0 +1,158 @@
#ifndef __GUI_PAINT_H
#define __GUI_PAINT_H
#include "DEV_Config.h"
#include "../Fonts/fonts.h"
/**
* Image attributes
**/
typedef struct {
UBYTE *Image;
UWORD Width;
UWORD Height;
UWORD WidthMemory;
UWORD HeightMemory;
UWORD Color;
UWORD Rotate;
UWORD Mirror;
UWORD WidthByte;
UWORD HeightByte;
UWORD Scale;
} PAINT;
extern PAINT Paint;
/**
* Display rotate
**/
#define ROTATE_0 0
#define ROTATE_90 90
#define ROTATE_180 180
#define ROTATE_270 270
/**
* Display Flip
**/
typedef enum {
MIRROR_NONE = 0x00,
MIRROR_HORIZONTAL = 0x01,
MIRROR_VERTICAL = 0x02,
MIRROR_ORIGIN = 0x03,
} MIRROR_IMAGE;
#define MIRROR_IMAGE_DFT MIRROR_NONE
/**
* image 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 IMAGE_BACKGROUND WHITE
#define FONT_FOREGROUND BLACK
#define FONT_BACKGROUND WHITE
/**
* The size of the point
**/
typedef enum {
DOT_PIXEL_1X1 = 1, // 1 x 1
DOT_PIXEL_2X2 , // 2 X 2
DOT_PIXEL_3X3 , // 3 X 3
DOT_PIXEL_4X4 , // 4 X 4
DOT_PIXEL_5X5 , // 5 X 5
DOT_PIXEL_6X6 , // 6 X 6
DOT_PIXEL_7X7 , // 7 X 7
DOT_PIXEL_8X8 , // 8 X 8
} DOT_PIXEL;
#define DOT_PIXEL_DFT DOT_PIXEL_1X1 //Default dot pilex
/**
* Point size fill style
**/
typedef enum {
DOT_FILL_AROUND = 1, // dot pixel 1 x 1
DOT_FILL_RIGHTUP , // dot pixel 2 X 2
} DOT_STYLE;
#define DOT_STYLE_DFT DOT_FILL_AROUND //Default dot pilex
/**
* Line style, solid or dashed
**/
typedef enum {
LINE_STYLE_SOLID = 0,
LINE_STYLE_DOTTED,
} LINE_STYLE;
/**
* Whether the graphic is filled
**/
typedef enum {
DRAW_FILL_EMPTY = 0,
DRAW_FILL_FULL,
} DRAW_FILL;
/**
* Custom structure of a time attribute
**/
typedef struct {
UWORD Year; //0000
UBYTE Month; //1 - 12
UBYTE Day; //1 - 30
UBYTE Hour; //0 - 23
UBYTE Min; //0 - 59
UBYTE Sec; //0 - 59
} PAINT_TIME;
extern PAINT_TIME sPaint_time;
//init and Clear
void Paint_NewImage(UBYTE *image, UWORD Width, UWORD Height, UWORD Rotate, UWORD Color);
void Paint_SelectImage(UBYTE *image);
void Paint_SetRotate(UWORD Rotate);
void Paint_SetMirroring(UBYTE mirror);
void Paint_SetPixel(UWORD Xpoint, UWORD Ypoint, UWORD Color);
void Paint_SetScale(UBYTE scale);
void Paint_Clear(UWORD Color);
void Paint_ClearWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color);
//Drawing
void Paint_DrawPoint(UWORD Xpoint, UWORD Ypoint, UWORD Color, DOT_PIXEL Dot_Pixel, DOT_STYLE Dot_FillWay);
void Paint_DrawLine(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width, LINE_STYLE Line_Style);
void Paint_DrawRectangle(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill);
void Paint_DrawCircle(UWORD X_Center, UWORD Y_Center, UWORD Radius, UWORD Color, DOT_PIXEL Line_width, DRAW_FILL Draw_Fill);
//Display string
void Paint_DrawChar(UWORD Xstart, UWORD Ystart, const char Acsii_Char, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawString_EN(UWORD Xstart, UWORD Ystart, const char * pString, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawString_CN(UWORD Xstart, UWORD Ystart, const char * pString, cFONT* font, UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawNum(UWORD Xpoint, UWORD Ypoint, double Nummber, sFONT* Font, UWORD Digit,UWORD Color_Foreground, UWORD Color_Background);
void Paint_DrawTime(UWORD Xstart, UWORD Ystart, PAINT_TIME *pTime, sFONT* Font, UWORD Color_Foreground, UWORD Color_Background);
//pic
void Paint_DrawBitMap(const unsigned char* image_buffer);
void Paint_DrawBitMap_Block(const unsigned char* image_buffer, UBYTE Region);
void Paint_DrawImage(const unsigned char *image, UWORD xStart, UWORD yStart, UWORD W_Image, UWORD H_Image) ;
void Paint_DrawImage1(const unsigned char *image, UWORD xStart, UWORD yStart, UWORD W_Image, UWORD H_Image);
void Paint_BmpWindows(unsigned char x,unsigned char y,const unsigned char *pBmp,\
unsigned char chWidth,unsigned char chHeight);
#endif

View File

@ -0,0 +1,302 @@
/*****************************************************************************
* | File : LCD_0in96.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2021-03-11
* | Info : Basic version
*
******************************************************************************/
#include "LCD_0in96.h"
#include "DEV_Config.h"
#include <stdlib.h> //itoa()
#include <stdio.h>
LCD_0IN96_ATTRIBUTES LCD_0IN96;
/******************************************************************************
function : Hardware reset
parameter:
******************************************************************************/
static void LCD_0IN96_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(200);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(200);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(200);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void LCD_0IN96_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
//DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_0IN96_SendData_8Bit(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_0IN96_SendData_16Bit(UWORD Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte((Data >> 8) & 0xFF);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Initialize the lcd register
parameter:
******************************************************************************/
static void LCD_0IN96_InitReg(void)
{
LCD_0IN96_SendCommand(0x11);//Sleep exit
DEV_Delay_ms (120);
LCD_0IN96_SendCommand(0x21);
LCD_0IN96_SendCommand(0x21);
LCD_0IN96_SendCommand(0xB1);
LCD_0IN96_SendData_8Bit(0x05);
LCD_0IN96_SendData_8Bit(0x3A);
LCD_0IN96_SendData_8Bit(0x3A);
LCD_0IN96_SendCommand(0xB2);
LCD_0IN96_SendData_8Bit(0x05);
LCD_0IN96_SendData_8Bit(0x3A);
LCD_0IN96_SendData_8Bit(0x3A);
LCD_0IN96_SendCommand(0xB3);
LCD_0IN96_SendData_8Bit(0x05);
LCD_0IN96_SendData_8Bit(0x3A);
LCD_0IN96_SendData_8Bit(0x3A);
LCD_0IN96_SendData_8Bit(0x05);
LCD_0IN96_SendData_8Bit(0x3A);
LCD_0IN96_SendData_8Bit(0x3A);
LCD_0IN96_SendCommand(0xB4);
LCD_0IN96_SendData_8Bit(0x03);
LCD_0IN96_SendCommand(0xC0);
LCD_0IN96_SendData_8Bit(0x62);
LCD_0IN96_SendData_8Bit(0x02);
LCD_0IN96_SendData_8Bit(0x04);
LCD_0IN96_SendCommand(0xC1);
LCD_0IN96_SendData_8Bit(0xC0);
LCD_0IN96_SendCommand(0xC2);
LCD_0IN96_SendData_8Bit(0x0D);
LCD_0IN96_SendData_8Bit(0x00);
LCD_0IN96_SendCommand(0xC3);
LCD_0IN96_SendData_8Bit(0x8D);
LCD_0IN96_SendData_8Bit(0x6A);
LCD_0IN96_SendCommand(0xC4);
LCD_0IN96_SendData_8Bit(0x8D);
LCD_0IN96_SendData_8Bit(0xEE);
LCD_0IN96_SendCommand(0xC5); /*VCOM*/
LCD_0IN96_SendData_8Bit(0x0E);
LCD_0IN96_SendCommand(0xE0);
LCD_0IN96_SendData_8Bit(0x10);
LCD_0IN96_SendData_8Bit(0x0E);
LCD_0IN96_SendData_8Bit(0x02);
LCD_0IN96_SendData_8Bit(0x03);
LCD_0IN96_SendData_8Bit(0x0E);
LCD_0IN96_SendData_8Bit(0x07);
LCD_0IN96_SendData_8Bit(0x02);
LCD_0IN96_SendData_8Bit(0x07);
LCD_0IN96_SendData_8Bit(0x0A);
LCD_0IN96_SendData_8Bit(0x12);
LCD_0IN96_SendData_8Bit(0x27);
LCD_0IN96_SendData_8Bit(0x37);
LCD_0IN96_SendData_8Bit(0x00);
LCD_0IN96_SendData_8Bit(0x0D);
LCD_0IN96_SendData_8Bit(0x0E);
LCD_0IN96_SendData_8Bit(0x10);
LCD_0IN96_SendCommand(0xE1);
LCD_0IN96_SendData_8Bit(0x10);
LCD_0IN96_SendData_8Bit(0x0E);
LCD_0IN96_SendData_8Bit(0x03);
LCD_0IN96_SendData_8Bit(0x03);
LCD_0IN96_SendData_8Bit(0x0F);
LCD_0IN96_SendData_8Bit(0x06);
LCD_0IN96_SendData_8Bit(0x02);
LCD_0IN96_SendData_8Bit(0x08);
LCD_0IN96_SendData_8Bit(0x0A);
LCD_0IN96_SendData_8Bit(0x13);
LCD_0IN96_SendData_8Bit(0x26);
LCD_0IN96_SendData_8Bit(0x36);
LCD_0IN96_SendData_8Bit(0x00);
LCD_0IN96_SendData_8Bit(0x0D);
LCD_0IN96_SendData_8Bit(0x0E);
LCD_0IN96_SendData_8Bit(0x10);
LCD_0IN96_SendCommand(0x3A);
LCD_0IN96_SendData_8Bit(0x05);
LCD_0IN96_SendCommand(0x36);
LCD_0IN96_SendData_8Bit(0xA8);
LCD_0IN96_SendCommand(0x29);
}
/********************************************************************************
function : Initialize the lcd
parameter:
********************************************************************************/
void LCD_0IN96_Init(UBYTE Scan_dir)
{
DEV_SET_PWM(90);
LCD_0IN96_Reset();
LCD_0IN96.HEIGHT = LCD_0IN96_HEIGHT;
LCD_0IN96.WIDTH = LCD_0IN96_WIDTH;
//Set the initialization register
LCD_0IN96_InitReg();
}
/********************************************************************************
function: Sets the start position and size of the display area
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
********************************************************************************/
void LCD_0IN96_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
Xstart = Xstart + 1;
Xend = Xend + 1;
Ystart = Ystart + 26;
Yend = Yend+26;
LCD_0IN96_SendCommand(0x2a);
LCD_0IN96_SendData_8Bit(Xstart >> 8);
LCD_0IN96_SendData_8Bit(Xstart);
LCD_0IN96_SendData_8Bit(Xend >> 8);
LCD_0IN96_SendData_8Bit(Xend );
LCD_0IN96_SendCommand(0x2b);
LCD_0IN96_SendData_8Bit(Ystart >> 8);
LCD_0IN96_SendData_8Bit(Ystart);
LCD_0IN96_SendData_8Bit(Yend >> 8);
LCD_0IN96_SendData_8Bit(Yend);
LCD_0IN96_SendCommand(0x2C);
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void LCD_0IN96_Clear(UWORD Color)
{
UWORD j,i;
UWORD Image[LCD_0IN96.WIDTH*LCD_0IN96.HEIGHT];
Color = ((Color<<8)&0xff00)|(Color>>8);
for (j = 0; j < LCD_0IN96.HEIGHT*LCD_0IN96.WIDTH; j++) {
Image[j] = Color;
}
LCD_0IN96_SetWindows(0, 0, LCD_0IN96.WIDTH-1, LCD_0IN96.HEIGHT-1);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
// for(j = 0; j < LCD_0IN96.WIDTH*LCD_0IN96.HEIGHT; j++){
// LCD_0IN96_SendData_16Bit(Image[j]);
for(j = 0; j < LCD_0IN96.HEIGHT; j++){
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_0IN96.WIDTH], LCD_0IN96.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
******************************************************************************/
void LCD_0IN96_Display(UWORD *Image)
{
UWORD j;
LCD_0IN96_SetWindows(0, 0, LCD_0IN96.WIDTH-1, LCD_0IN96.HEIGHT-1);
DEV_Digital_Write(EPD_DC_PIN, 1);
// DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = 0; j < LCD_0IN96.HEIGHT; j++) {
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_0IN96.WIDTH], LCD_0IN96.WIDTH*2);
// for(j = 0; j < LCD_0IN96.WIDTH*LCD_0IN96.HEIGHT; j++){
// LCD_0IN96_SendData_16Bit(Image[j]);
}
// DEV_Digital_Write(EPD_CS_PIN, 1);
//LCD_0IN96_SendCommand(0x29);
}
void LCD_0IN96_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image)
{
// display
UDOUBLE Addr = 0;
UWORD j;
LCD_0IN96_SetWindows(Xstart, Ystart, Xend , Yend);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = Ystart; j < Yend - 1; j++) {
Addr = Xstart + j * LCD_0IN96.WIDTH ;
DEV_SPI_Write_nByte((uint8_t *)&Image[Addr], (Xend-Xstart)*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
void LCD_0IN96_DisplayPoint(UWORD X, UWORD Y, UWORD Color)
{
LCD_0IN96_SetWindows(X,Y,X,Y);
LCD_0IN96_SendData_16Bit(Color);
}
void Handler_0IN96_LCD(int signo)
{
//System Exit
printf("\r\nHandler:Program stop\r\n");
DEV_Module_Exit();
exit(0);
}

View File

@ -0,0 +1,52 @@
/*****************************************************************************
* | File : LCD_0in96.h
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2021-03-11
* | Info : Basic version
*
******************************************************************************/
#ifndef __LCD_0IN96_H
#define __LCD_0IN96_H
#include "DEV_Config.h"
#include <stdint.h>
#include <stdlib.h> //itoa()
#include <stdio.h>
#define LCD_0IN96_HEIGHT 80
#define LCD_0IN96_WIDTH 160
#define HORIZONTAL 0
#define VERTICAL 1
#define LCD_0IN96_SetBacklight(Value) ;
typedef struct{
UWORD WIDTH;
UWORD HEIGHT;
UBYTE SCAN_DIR;
}LCD_0IN96_ATTRIBUTES;
extern LCD_0IN96_ATTRIBUTES LCD_0IN96;
/********************************************************************************
function:
Macro definition variable name
********************************************************************************/
void LCD_0IN96_Init(UBYTE Scan_dir);
void LCD_0IN96_Clear(UWORD Color);
void LCD_0IN96_Display(UWORD *Image);
void LCD_0IN96_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image);
void LCD_0IN96_DisplayPoint(UWORD X, UWORD Y, UWORD Color);
void Handler_0IN96_LCD(int signo);
#endif

View File

@ -0,0 +1,284 @@
#include "LCD_1in14.h"
#include "DEV_Config.h"
#include <stdlib.h> //itoa()
#include <stdio.h>
LCD_1IN14_ATTRIBUTES LCD_1IN14;
/******************************************************************************
function : Hardware reset
parameter:
******************************************************************************/
static void LCD_1IN14_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void LCD_1IN14_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN14_SendData_8Bit(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN14_SendData_16Bit(UWORD Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte((Data >> 8) & 0xFF);
DEV_SPI_WriteByte(Data & 0xFF);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Initialize the lcd register
parameter:
******************************************************************************/
static void LCD_1IN14_InitReg(void)
{
LCD_1IN14_SendCommand(0x3A);
LCD_1IN14_SendData_8Bit(0x05);
LCD_1IN14_SendCommand(0xB2);
LCD_1IN14_SendData_8Bit(0x0C);
LCD_1IN14_SendData_8Bit(0x0C);
LCD_1IN14_SendData_8Bit(0x00);
LCD_1IN14_SendData_8Bit(0x33);
LCD_1IN14_SendData_8Bit(0x33);
LCD_1IN14_SendCommand(0xB7); //Gate Control
LCD_1IN14_SendData_8Bit(0x35);
LCD_1IN14_SendCommand(0xBB); //VCOM Setting
LCD_1IN14_SendData_8Bit(0x19);
LCD_1IN14_SendCommand(0xC0); //LCM Control
LCD_1IN14_SendData_8Bit(0x2C);
LCD_1IN14_SendCommand(0xC2); //VDV and VRH Command Enable
LCD_1IN14_SendData_8Bit(0x01);
LCD_1IN14_SendCommand(0xC3); //VRH Set
LCD_1IN14_SendData_8Bit(0x12);
LCD_1IN14_SendCommand(0xC4); //VDV Set
LCD_1IN14_SendData_8Bit(0x20);
LCD_1IN14_SendCommand(0xC6); //Frame Rate Control in Normal Mode
LCD_1IN14_SendData_8Bit(0x0F);
LCD_1IN14_SendCommand(0xD0); // Power Control 1
LCD_1IN14_SendData_8Bit(0xA4);
LCD_1IN14_SendData_8Bit(0xA1);
LCD_1IN14_SendCommand(0xE0); //Positive Voltage Gamma Control
LCD_1IN14_SendData_8Bit(0xD0);
LCD_1IN14_SendData_8Bit(0x04);
LCD_1IN14_SendData_8Bit(0x0D);
LCD_1IN14_SendData_8Bit(0x11);
LCD_1IN14_SendData_8Bit(0x13);
LCD_1IN14_SendData_8Bit(0x2B);
LCD_1IN14_SendData_8Bit(0x3F);
LCD_1IN14_SendData_8Bit(0x54);
LCD_1IN14_SendData_8Bit(0x4C);
LCD_1IN14_SendData_8Bit(0x18);
LCD_1IN14_SendData_8Bit(0x0D);
LCD_1IN14_SendData_8Bit(0x0B);
LCD_1IN14_SendData_8Bit(0x1F);
LCD_1IN14_SendData_8Bit(0x23);
LCD_1IN14_SendCommand(0xE1); //Negative Voltage Gamma Control
LCD_1IN14_SendData_8Bit(0xD0);
LCD_1IN14_SendData_8Bit(0x04);
LCD_1IN14_SendData_8Bit(0x0C);
LCD_1IN14_SendData_8Bit(0x11);
LCD_1IN14_SendData_8Bit(0x13);
LCD_1IN14_SendData_8Bit(0x2C);
LCD_1IN14_SendData_8Bit(0x3F);
LCD_1IN14_SendData_8Bit(0x44);
LCD_1IN14_SendData_8Bit(0x51);
LCD_1IN14_SendData_8Bit(0x2F);
LCD_1IN14_SendData_8Bit(0x1F);
LCD_1IN14_SendData_8Bit(0x1F);
LCD_1IN14_SendData_8Bit(0x20);
LCD_1IN14_SendData_8Bit(0x23);
LCD_1IN14_SendCommand(0x21); //Display Inversion On
LCD_1IN14_SendCommand(0x11); //Sleep Out
LCD_1IN14_SendCommand(0x29); //Display On
}
/********************************************************************************
function: Set the resolution and scanning method of the screen
parameter:
Scan_dir: Scan direction
********************************************************************************/
static void LCD_1IN14_SetAttributes(UBYTE Scan_dir)
{
//Get the screen scan direction
LCD_1IN14.SCAN_DIR = Scan_dir;
UBYTE MemoryAccessReg = 0x00;
//Get GRAM and LCD width and height
if(Scan_dir == HORIZONTAL) {
LCD_1IN14.HEIGHT = LCD_1IN14_WIDTH;
LCD_1IN14.WIDTH = LCD_1IN14_HEIGHT;
MemoryAccessReg = 0X70;
} else {
LCD_1IN14.HEIGHT = LCD_1IN14_HEIGHT;
LCD_1IN14.WIDTH = LCD_1IN14_WIDTH;
MemoryAccessReg = 0X00;
}
// Set the read / write scan direction of the frame memory
LCD_1IN14_SendCommand(0x36); //MX, MY, RGB mode
LCD_1IN14_SendData_8Bit(MemoryAccessReg); //0x08 set RGB
}
/********************************************************************************
function : Initialize the lcd
parameter:
********************************************************************************/
void LCD_1IN14_Init(UBYTE Scan_dir)
{
DEV_SET_PWM(90);
//Hardware reset
LCD_1IN14_Reset();
//Set the resolution and scanning method of the screen
LCD_1IN14_SetAttributes(Scan_dir);
//Set the initialization register
LCD_1IN14_InitReg();
}
/********************************************************************************
function: Sets the start position and size of the display area
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
********************************************************************************/
void LCD_1IN14_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
UBYTE x,y;
if(LCD_1IN14.SCAN_DIR == HORIZONTAL){x=40;y=53;}
else{ x=52; y=40; }
//set the X coordinates
LCD_1IN14_SendCommand(0x2A);
LCD_1IN14_SendData_16Bit(Xstart +x);
LCD_1IN14_SendData_16Bit(Xend-1 +x);
//set the Y coordinates
LCD_1IN14_SendCommand(0x2B);
LCD_1IN14_SendData_16Bit(Ystart +y);
LCD_1IN14_SendData_16Bit(Yend-1 +y);
LCD_1IN14_SendCommand(0X2C);
// printf("%d %d\r\n",x,y);
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void LCD_1IN14_Clear(UWORD Color)
{
UWORD j,i;
UWORD Image[LCD_1IN14.WIDTH*LCD_1IN14.HEIGHT];
Color = ((Color<<8)&0xff00)|(Color>>8);
for (j = 0; j < LCD_1IN14.HEIGHT*LCD_1IN14.WIDTH; j++) {
Image[j] = Color;
}
LCD_1IN14_SetWindows(0, 0, LCD_1IN14.WIDTH, LCD_1IN14.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
// printf("HEIGHT %d, WIDTH %d\r\n",LCD_1IN14.HEIGHT,LCD_1IN14.WIDTH);
for(j = 0; j < LCD_1IN14.HEIGHT; j++){
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN14.WIDTH], LCD_1IN14.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
******************************************************************************/
void LCD_1IN14_Display(UWORD *Image)
{
UWORD j;
LCD_1IN14_SetWindows(0, 0, LCD_1IN14.WIDTH, LCD_1IN14.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = 0; j < LCD_1IN14.HEIGHT; j++) {
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN14.WIDTH], LCD_1IN14.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
LCD_1IN14_SendCommand(0x29);
}
void LCD_1IN14_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image)
{
// display
UDOUBLE Addr = 0;
UWORD j;
LCD_1IN14_SetWindows(Xstart, Ystart, Xend , Yend);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = Ystart; j < Yend - 1; j++) {
Addr = Xstart + j * LCD_1IN14.WIDTH ;
DEV_SPI_Write_nByte((uint8_t *)&Image[Addr], (Xend-Xstart)*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
void LCD_1IN14_DisplayPoint(UWORD X, UWORD Y, UWORD Color)
{
LCD_1IN14_SetWindows(X,Y,X,Y);
LCD_1IN14_SendData_16Bit(Color);
}
void Handler_1IN14_LCD(int signo)
{
//System Exit
printf("\r\nHandler:Program stop\r\n");
DEV_Module_Exit();
exit(0);
}

View File

@ -0,0 +1,39 @@
#ifndef __LCD_1IN14_H
#define __LCD_1IN14_H
#include "DEV_Config.h"
#include <stdint.h>
#include <stdlib.h> //itoa()
#include <stdio.h>
#define LCD_1IN14_HEIGHT 240
#define LCD_1IN14_WIDTH 135
#define HORIZONTAL 0
#define VERTICAL 1
#define LCD_1IN14_SetBacklight(Value) ;
typedef struct{
UWORD WIDTH;
UWORD HEIGHT;
UBYTE SCAN_DIR;
}LCD_1IN14_ATTRIBUTES;
extern LCD_1IN14_ATTRIBUTES LCD_1IN14;
/********************************************************************************
function:
Macro definition variable name
********************************************************************************/
void LCD_1IN14_Init(UBYTE Scan_dir);
void LCD_1IN14_Clear(UWORD Color);
void LCD_1IN14_Display(UWORD *Image);
void LCD_1IN14_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image);
void LCD_1IN14_DisplayPoint(UWORD X, UWORD Y, UWORD Color);
void Handler_1IN14_LCD(int signo);
#endif

View File

@ -0,0 +1,328 @@
/*****************************************************************************
* | File : LCD_1IN14_V2.C
* | Function : test Demo
* | Info :
*----------------
* | This version: V1.0
* | Date : 2021-03-16
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation 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
# furished 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 OR 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.
#
******************************************************************************/
#include "LCD_1in14_V2.h"
#include "DEV_Config.h"
#include <stdlib.h> //itoa()
#include <stdio.h>
LCD_1IN14_V2_ATTRIBUTES LCD_1IN14_V2;
/******************************************************************************
function : Hardware reset
parameter:
******************************************************************************/
static void LCD_1IN14_V2_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void LCD_1IN14_V2_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN14_V2_SendData_8Bit(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN14_V2_SendData_16Bit(UWORD Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte((Data >> 8) & 0xFF);
DEV_SPI_WriteByte(Data & 0xFF);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Initialize the lcd register
parameter:
******************************************************************************/
static void LCD_1IN14_V2_InitReg(void)
{
LCD_1IN14_V2_SendCommand(0x3A);
LCD_1IN14_V2_SendData_8Bit(0x05);
LCD_1IN14_V2_SendCommand(0xB2);
LCD_1IN14_V2_SendData_8Bit(0x0C);
LCD_1IN14_V2_SendData_8Bit(0x0C);
LCD_1IN14_V2_SendData_8Bit(0x00);
LCD_1IN14_V2_SendData_8Bit(0x33);
LCD_1IN14_V2_SendData_8Bit(0x33);
LCD_1IN14_V2_SendCommand(0xB7); //Gate Control
LCD_1IN14_V2_SendData_8Bit(0x35);
LCD_1IN14_V2_SendCommand(0xBB); //VCOM Setting
LCD_1IN14_V2_SendData_8Bit(0x19);
LCD_1IN14_V2_SendCommand(0xC0); //LCM Control
LCD_1IN14_V2_SendData_8Bit(0x2C);
LCD_1IN14_V2_SendCommand(0xC2); //VDV and VRH Command Enable
LCD_1IN14_V2_SendData_8Bit(0x01);
LCD_1IN14_V2_SendCommand(0xC3); //VRH Set
LCD_1IN14_V2_SendData_8Bit(0x12);
LCD_1IN14_V2_SendCommand(0xC4); //VDV Set
LCD_1IN14_V2_SendData_8Bit(0x20);
LCD_1IN14_V2_SendCommand(0xC6); //Frame Rate Control in Normal Mode
LCD_1IN14_V2_SendData_8Bit(0x0F);
LCD_1IN14_V2_SendCommand(0xD0); // Power Control 1
LCD_1IN14_V2_SendData_8Bit(0xA4);
LCD_1IN14_V2_SendData_8Bit(0xA1);
LCD_1IN14_V2_SendCommand(0xE0); //Positive Voltage Gamma Control
LCD_1IN14_V2_SendData_8Bit(0xD0);
LCD_1IN14_V2_SendData_8Bit(0x04);
LCD_1IN14_V2_SendData_8Bit(0x0D);
LCD_1IN14_V2_SendData_8Bit(0x11);
LCD_1IN14_V2_SendData_8Bit(0x13);
LCD_1IN14_V2_SendData_8Bit(0x2B);
LCD_1IN14_V2_SendData_8Bit(0x3F);
LCD_1IN14_V2_SendData_8Bit(0x54);
LCD_1IN14_V2_SendData_8Bit(0x4C);
LCD_1IN14_V2_SendData_8Bit(0x18);
LCD_1IN14_V2_SendData_8Bit(0x0D);
LCD_1IN14_V2_SendData_8Bit(0x0B);
LCD_1IN14_V2_SendData_8Bit(0x1F);
LCD_1IN14_V2_SendData_8Bit(0x23);
LCD_1IN14_V2_SendCommand(0xE1); //Negative Voltage Gamma Control
LCD_1IN14_V2_SendData_8Bit(0xD0);
LCD_1IN14_V2_SendData_8Bit(0x04);
LCD_1IN14_V2_SendData_8Bit(0x0C);
LCD_1IN14_V2_SendData_8Bit(0x11);
LCD_1IN14_V2_SendData_8Bit(0x13);
LCD_1IN14_V2_SendData_8Bit(0x2C);
LCD_1IN14_V2_SendData_8Bit(0x3F);
LCD_1IN14_V2_SendData_8Bit(0x44);
LCD_1IN14_V2_SendData_8Bit(0x51);
LCD_1IN14_V2_SendData_8Bit(0x2F);
LCD_1IN14_V2_SendData_8Bit(0x1F);
LCD_1IN14_V2_SendData_8Bit(0x1F);
LCD_1IN14_V2_SendData_8Bit(0x20);
LCD_1IN14_V2_SendData_8Bit(0x23);
LCD_1IN14_V2_SendCommand(0x21); //Display Inversion On
LCD_1IN14_V2_SendCommand(0x11); //Sleep Out
LCD_1IN14_V2_SendCommand(0x29); //Display On
}
/********************************************************************************
function: Set the resolution and scanning method of the screen
parameter:
Scan_dir: Scan direction
********************************************************************************/
static void LCD_1IN14_V2_SetAttributes(UBYTE Scan_dir)
{
//Get the screen scan direction
LCD_1IN14_V2.SCAN_DIR = Scan_dir;
UBYTE MemoryAccessReg = 0x00;
//Get GRAM and LCD width and height
if(Scan_dir == HORIZONTAL) {
LCD_1IN14_V2.HEIGHT = LCD_1IN14_V2_WIDTH;
LCD_1IN14_V2.WIDTH = LCD_1IN14_V2_HEIGHT;
MemoryAccessReg = 0X70;
} else {
LCD_1IN14_V2.HEIGHT = LCD_1IN14_V2_HEIGHT;
LCD_1IN14_V2.WIDTH = LCD_1IN14_V2_WIDTH;
MemoryAccessReg = 0X00;
}
// Set the read / write scan direction of the frame memory
LCD_1IN14_V2_SendCommand(0x36); //MX, MY, RGB mode
LCD_1IN14_V2_SendData_8Bit(MemoryAccessReg); //0x08 set RGB
}
/********************************************************************************
function : Initialize the lcd
parameter:
********************************************************************************/
void LCD_1IN14_V2_Init(UBYTE Scan_dir)
{
DEV_SET_PWM(90);
//Hardware reset
LCD_1IN14_V2_Reset();
//Set the resolution and scanning method of the screen
LCD_1IN14_V2_SetAttributes(Scan_dir);
//Set the initialization register
LCD_1IN14_V2_InitReg();
}
/********************************************************************************
function: Sets the start position and size of the display area
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
********************************************************************************/
void LCD_1IN14_V2_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
UBYTE x,y;
if(LCD_1IN14_V2.SCAN_DIR == HORIZONTAL){x=40;y=53;}
else{ x=52; y=40; }
//set the X coordinates
LCD_1IN14_V2_SendCommand(0x2A);
LCD_1IN14_V2_SendData_16Bit(Xstart +x);
LCD_1IN14_V2_SendData_16Bit(Xend-1 +x);
//set the Y coordinates
LCD_1IN14_V2_SendCommand(0x2B);
LCD_1IN14_V2_SendData_16Bit(Ystart +y);
LCD_1IN14_V2_SendData_16Bit(Yend-1 +y);
LCD_1IN14_V2_SendCommand(0X2C);
// printf("%d %d\r\n",x,y);
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void LCD_1IN14_V2_Clear(UWORD Color)
{
UWORD j,i;
UWORD Image[LCD_1IN14_V2.WIDTH*LCD_1IN14_V2.HEIGHT];
Color = ((Color<<8)&0xff00)|(Color>>8);
for (j = 0; j < LCD_1IN14_V2.HEIGHT*LCD_1IN14_V2.WIDTH; j++) {
Image[j] = Color;
}
LCD_1IN14_V2_SetWindows(0, 0, LCD_1IN14_V2.WIDTH, LCD_1IN14_V2.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
// printf("HEIGHT %d, WIDTH %d\r\n",LCD_1IN14_V2.HEIGHT,LCD_1IN14_V2.WIDTH);
for(j = 0; j < LCD_1IN14_V2.HEIGHT; j++){
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN14_V2.WIDTH], LCD_1IN14_V2.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
******************************************************************************/
void LCD_1IN14_V2_Display(UWORD *Image)
{
UWORD j;
LCD_1IN14_V2_SetWindows(0, 0, LCD_1IN14_V2.WIDTH, LCD_1IN14_V2.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = 0; j < LCD_1IN14_V2.HEIGHT; j++) {
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN14_V2.WIDTH], LCD_1IN14_V2.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
LCD_1IN14_V2_SendCommand(0x29);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
Image : Written content
******************************************************************************/
void LCD_1IN14_V2_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image)
{
// display
UDOUBLE Addr = 0;
UWORD j;
LCD_1IN14_V2_SetWindows(Xstart, Ystart, Xend , Yend);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = Ystart; j < Yend - 1; j++) {
Addr = Xstart + j * LCD_1IN14_V2.WIDTH ;
DEV_SPI_Write_nByte((uint8_t *)&Image[Addr], (Xend-Xstart)*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Change the color of a point
parameter:
X : X coordinates
Y : Y coordinates
Color : Color
******************************************************************************/
void LCD_1IN14_V2_DisplayPoint(UWORD X, UWORD Y, UWORD Color)
{
LCD_1IN14_V2_SetWindows(X,Y,X,Y);
LCD_1IN14_V2_SendData_16Bit(Color);
}
void Handler_1IN14_V2_LCD(int signo)
{
//System Exit
printf("\r\nHandler:Program stop\r\n");
DEV_Module_Exit();
exit(0);
}

View File

@ -0,0 +1,68 @@
/*****************************************************************************
* | File : LCD_1IN14_V2.h
* | Function : test Demo
* | Info :
*----------------
* | This version: V1.0
* | Date : 2021-03-16
* | Info :
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation 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
# furished 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 OR 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.
#
******************************************************************************/
#ifndef __LCD_1IN14_V2_H
#define __LCD_1IN14_V2_H
#include "DEV_Config.h"
#include <stdint.h>
#include <stdlib.h> //itoa()
#include <stdio.h>
#define LCD_1IN14_V2_HEIGHT 240
#define LCD_1IN14_V2_WIDTH 135
#define HORIZONTAL 0
#define VERTICAL 1
#define LCD_1IN14_V2_SetBacklight(Value) ;
typedef struct{
UWORD WIDTH;
UWORD HEIGHT;
UBYTE SCAN_DIR;
}LCD_1IN14_V2_ATTRIBUTES;
extern LCD_1IN14_V2_ATTRIBUTES LCD_1IN14_V2;
/********************************************************************************
function:
Macro definition variable name
********************************************************************************/
void LCD_1IN14_V2_Init(UBYTE Scan_dir);
void LCD_1IN14_V2_Clear(UWORD Color);
void LCD_1IN14_V2_Display(UWORD *Image);
void LCD_1IN14_V2_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image);
void LCD_1IN14_V2_DisplayPoint(UWORD X, UWORD Y, UWORD Color);
void Handler_1IN14_V2_LCD(int signo);
#endif

318
bsp/pico/bsp/LCD/LCD_1in3.c Normal file
View File

@ -0,0 +1,318 @@
/*****************************************************************************
* | File : LCD_1in14.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2020-05-20
* | Info : Basic version
*
******************************************************************************/
#include "LCD_1in3.h"
#include "DEV_Config.h"
#include <stdlib.h> //itoa()
#include <stdio.h>
LCD_1IN3_ATTRIBUTES LCD_1IN3;
/******************************************************************************
function : Hardware reset
parameter:
******************************************************************************/
static void LCD_1IN3_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void LCD_1IN3_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN3_SendData_8Bit(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN3_SendData_16Bit(UWORD Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data & 0xFF);
DEV_SPI_WriteByte((Data >> 8) & 0xFF);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Initialize the lcd register
parameter:
******************************************************************************/
static void LCD_1IN3_InitReg(void)
{
LCD_1IN3_SendCommand(0x3A);
LCD_1IN3_SendData_8Bit(0x05);
LCD_1IN3_SendCommand(0xB2);
LCD_1IN3_SendData_8Bit(0x0C);
LCD_1IN3_SendData_8Bit(0x0C);
LCD_1IN3_SendData_8Bit(0x00);
LCD_1IN3_SendData_8Bit(0x33);
LCD_1IN3_SendData_8Bit(0x33);
LCD_1IN3_SendCommand(0xB7); //Gate Control
LCD_1IN3_SendData_8Bit(0x35);
LCD_1IN3_SendCommand(0xBB); //VCOM Setting
LCD_1IN3_SendData_8Bit(0x19);
LCD_1IN3_SendCommand(0xC0); //LCM Control
LCD_1IN3_SendData_8Bit(0x2C);
LCD_1IN3_SendCommand(0xC2); //VDV and VRH Command Enable
LCD_1IN3_SendData_8Bit(0x01);
LCD_1IN3_SendCommand(0xC3); //VRH Set
LCD_1IN3_SendData_8Bit(0x12);
LCD_1IN3_SendCommand(0xC4); //VDV Set
LCD_1IN3_SendData_8Bit(0x20);
LCD_1IN3_SendCommand(0xC6); //Frame Rate Control in Normal Mode
LCD_1IN3_SendData_8Bit(0x0F);
LCD_1IN3_SendCommand(0xB0);
LCD_1IN3_SendData_8Bit(0x00);
LCD_1IN3_SendData_8Bit(0xC8);
LCD_1IN3_SendCommand(0xD0); // Power Control 1
LCD_1IN3_SendData_8Bit(0xA4);
LCD_1IN3_SendData_8Bit(0xA1);
LCD_1IN3_SendCommand(0xE0); //Positive Voltage Gamma Control
LCD_1IN3_SendData_8Bit(0xD0);
LCD_1IN3_SendData_8Bit(0x04);
LCD_1IN3_SendData_8Bit(0x0D);
LCD_1IN3_SendData_8Bit(0x11);
LCD_1IN3_SendData_8Bit(0x13);
LCD_1IN3_SendData_8Bit(0x2B);
LCD_1IN3_SendData_8Bit(0x3F);
LCD_1IN3_SendData_8Bit(0x54);
LCD_1IN3_SendData_8Bit(0x4C);
LCD_1IN3_SendData_8Bit(0x18);
LCD_1IN3_SendData_8Bit(0x0D);
LCD_1IN3_SendData_8Bit(0x0B);
LCD_1IN3_SendData_8Bit(0x1F);
LCD_1IN3_SendData_8Bit(0x23);
LCD_1IN3_SendCommand(0xE1); //Negative Voltage Gamma Control
LCD_1IN3_SendData_8Bit(0xD0);
LCD_1IN3_SendData_8Bit(0x04);
LCD_1IN3_SendData_8Bit(0x0C);
LCD_1IN3_SendData_8Bit(0x11);
LCD_1IN3_SendData_8Bit(0x13);
LCD_1IN3_SendData_8Bit(0x2C);
LCD_1IN3_SendData_8Bit(0x3F);
LCD_1IN3_SendData_8Bit(0x44);
LCD_1IN3_SendData_8Bit(0x51);
LCD_1IN3_SendData_8Bit(0x2F);
LCD_1IN3_SendData_8Bit(0x1F);
LCD_1IN3_SendData_8Bit(0x1F);
LCD_1IN3_SendData_8Bit(0x20);
LCD_1IN3_SendData_8Bit(0x23);
LCD_1IN3_SendCommand(0x21); //Display Inversion On
LCD_1IN3_SendCommand(0x11); //Sleep Out
LCD_1IN3_SendCommand(0x29); //Display On
}
/********************************************************************************
function: Set the resolution and scanning method of the screen
parameter:
Scan_dir: Scan direction
********************************************************************************/
static void LCD_1IN3_SetAttributes(UBYTE Scan_dir)
{
//Get the screen scan direction
LCD_1IN3.SCAN_DIR = Scan_dir;
UBYTE MemoryAccessReg = 0x00;
//Get GRAM and LCD width and height
if(Scan_dir == HORIZONTAL) {
LCD_1IN3.HEIGHT = LCD_1IN3_WIDTH;
LCD_1IN3.WIDTH = LCD_1IN3_HEIGHT;
MemoryAccessReg = 0X70;
} else {
LCD_1IN3.HEIGHT = LCD_1IN3_HEIGHT;
LCD_1IN3.WIDTH = LCD_1IN3_WIDTH;
MemoryAccessReg = 0X00;
}
// Set the read / write scan direction of the frame memory
LCD_1IN3_SendCommand(0x36); //MX, MY, RGB mode
LCD_1IN3_SendData_8Bit(MemoryAccessReg); //0x08 set RGB
}
/********************************************************************************
function : Initialize the lcd
parameter:
********************************************************************************/
void LCD_1IN3_Init(UBYTE Scan_dir)
{
DEV_SET_PWM(90);
//Hardware reset
LCD_1IN3_Reset();
//Set the resolution and scanning method of the screen
LCD_1IN3_SetAttributes(Scan_dir);
//Set the initialization register
LCD_1IN3_InitReg();
}
/********************************************************************************
function: Sets the start position and size of the display area
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
********************************************************************************/
void LCD_1IN3_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
//set the X coordinates
LCD_1IN3_SendCommand(0x2A);
LCD_1IN3_SendData_8Bit(0x00);
LCD_1IN3_SendData_8Bit(Xstart);
LCD_1IN3_SendData_8Bit(0x00);
LCD_1IN3_SendData_8Bit(Xend-1);
//set the Y coordinates
LCD_1IN3_SendCommand(0x2B);
LCD_1IN3_SendData_8Bit(0x00);
LCD_1IN3_SendData_8Bit(Ystart);
LCD_1IN3_SendData_8Bit(0x00);
LCD_1IN3_SendData_8Bit(Yend-1);
LCD_1IN3_SendCommand(0X2C);
// printf("%d %d\r\n",x,y);
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void LCD_1IN3_Clear(UWORD Color)
{
UWORD j,i;
static UWORD Image[LCD_1IN3_WIDTH];
//Color = ((Color<<8)&0xff00)|(Color>>8);
for (j = 0; j < LCD_1IN3_WIDTH; j++) {
Image[j] = Color;
}
LCD_1IN3_SetWindows(0, 0, LCD_1IN3.WIDTH, LCD_1IN3.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for(j = 0; j < LCD_1IN3.HEIGHT; j++){
DEV_SPI_Write_nByte((uint8_t *)Image, LCD_1IN3.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
******************************************************************************/
void LCD_1IN3_Display(UWORD *Image)
{
UWORD j;
LCD_1IN3_SetWindows(0, 0, LCD_1IN3.WIDTH, LCD_1IN3.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = 0; j < LCD_1IN3.HEIGHT; j++) {
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN3.WIDTH], LCD_1IN3.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
LCD_1IN3_SendCommand(0x29);
}
void GLCD_DrawBitmap( int_fast16_t x, int_fast16_t y,
int_fast16_t width, int_fast16_t height,
uint16_t *frame_ptr)
{
UWORD j;
LCD_1IN3_SetWindows(x, y, x+width, y+height);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_Write_nByte((uint8_t *)frame_ptr, height*width*2);
DEV_Digital_Write(EPD_CS_PIN, 1);
LCD_1IN3_SendCommand(0x29);
}
void Disp0_DrawBitmap( int16_t x,
int16_t y,
int16_t width,
int16_t height,
const uint8_t *bitmap)
{
GLCD_DrawBitmap(x, y, width, height, (uint16_t *)bitmap);
}
void LCD_1IN3_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image)
{
// display
UDOUBLE Addr = 0;
UWORD j;
LCD_1IN3_SetWindows(Xstart, Ystart, Xend , Yend);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = Ystart; j < Yend - 1; j++) {
Addr = Xstart + j * LCD_1IN3.WIDTH ;
DEV_SPI_Write_nByte((uint8_t *)&Image[Addr], (Xend-Xstart)*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
void LCD_1IN3_DisplayPoint(UWORD X, UWORD Y, UWORD Color)
{
LCD_1IN3_SetWindows(X,Y,X,Y);
LCD_1IN3_SendData_16Bit(Color);
}

View File

@ -0,0 +1,56 @@
/*****************************************************************************
* | File : LCD_1in54.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2020-05-20
* | Info : Basic version
*
******************************************************************************/
#ifndef __LCD_1IN3_H
#define __LCD_1IN3_H
#include "DEV_Config.h"
#include <stdint.h>
#include <stdlib.h> //itoa()
#include <stdio.h>
#define LCD_1IN3_HEIGHT 240
#define LCD_1IN3_WIDTH 240
#define HORIZONTAL 0
#define VERTICAL 1
#define LCD_1IN3_SetBacklight(Value) ;
typedef struct{
UWORD WIDTH;
UWORD HEIGHT;
UBYTE SCAN_DIR;
}LCD_1IN3_ATTRIBUTES;
extern LCD_1IN3_ATTRIBUTES LCD_1IN3;
/********************************************************************************
function:
Macro definition variable name
********************************************************************************/
void LCD_1IN3_Init(UBYTE Scan_dir);
void LCD_1IN3_Clear(UWORD Color);
void LCD_1IN3_Display(UWORD *Image);
void LCD_1IN3_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image);
void LCD_1IN3_DisplayPoint(UWORD X, UWORD Y, UWORD Color);
extern
void GLCD_DrawBitmap( int_fast16_t x, int_fast16_t y,
int_fast16_t width, int_fast16_t height,
uint16_t *frame_ptr);
#endif

View File

@ -0,0 +1,322 @@
/*****************************************************************************
* | File : LCD_1in44.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2020-05-20
* | Info : Basic version
*
******************************************************************************/
#include "LCD_1in44.h"
#include "DEV_Config.h"
#include <stdlib.h> //itoa()
#include <stdio.h>
LCD_1IN44_ATTRIBUTES LCD_1IN44;
/******************************************************************************
function : Hardware reset
parameter:
******************************************************************************/
static void LCD_1IN44_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void LCD_1IN44_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
// DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN44_SendData_8Bit(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN44_SendData_16Bit(UWORD Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte((Data >> 8) & 0xFF);
DEV_SPI_WriteByte(Data & 0xFF);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Initialize the lcd register
parameter:
******************************************************************************/
static void LCD_1IN44_InitReg(void)
{
LCD_1IN44_SendCommand(0x3A);
LCD_1IN44_SendData_8Bit(0x05);
//ST7735R Frame Rate
LCD_1IN44_SendCommand(0xB1);
LCD_1IN44_SendData_8Bit(0x01);
LCD_1IN44_SendData_8Bit(0x2C);
LCD_1IN44_SendData_8Bit(0x2D);
LCD_1IN44_SendCommand(0xB2);
LCD_1IN44_SendData_8Bit(0x01);
LCD_1IN44_SendData_8Bit(0x2C);
LCD_1IN44_SendData_8Bit(0x2D);
LCD_1IN44_SendCommand(0xB3);
LCD_1IN44_SendData_8Bit(0x01);
LCD_1IN44_SendData_8Bit(0x2C);
LCD_1IN44_SendData_8Bit(0x2D);
LCD_1IN44_SendData_8Bit(0x01);
LCD_1IN44_SendData_8Bit(0x2C);
LCD_1IN44_SendData_8Bit(0x2D);
LCD_1IN44_SendCommand(0xB4); //Column inversion
LCD_1IN44_SendData_8Bit(0x07);
//ST7735R Power Sequence
LCD_1IN44_SendCommand(0xC0);
LCD_1IN44_SendData_8Bit(0xA2);
LCD_1IN44_SendData_8Bit(0x02);
LCD_1IN44_SendData_8Bit(0x84);
LCD_1IN44_SendCommand(0xC1);
LCD_1IN44_SendData_8Bit(0xC5);
LCD_1IN44_SendCommand(0xC2);
LCD_1IN44_SendData_8Bit(0x0A);
LCD_1IN44_SendData_8Bit(0x00);
LCD_1IN44_SendCommand(0xC3);
LCD_1IN44_SendData_8Bit(0x8A);
LCD_1IN44_SendData_8Bit(0x2A);
LCD_1IN44_SendCommand(0xC4);
LCD_1IN44_SendData_8Bit(0x8A);
LCD_1IN44_SendData_8Bit(0xEE);
LCD_1IN44_SendCommand(0xC5); //VCOM
LCD_1IN44_SendData_8Bit(0x0E);
//ST7735R Gamma Sequence
LCD_1IN44_SendCommand(0xe0);
LCD_1IN44_SendData_8Bit(0x0f);
LCD_1IN44_SendData_8Bit(0x1a);
LCD_1IN44_SendData_8Bit(0x0f);
LCD_1IN44_SendData_8Bit(0x18);
LCD_1IN44_SendData_8Bit(0x2f);
LCD_1IN44_SendData_8Bit(0x28);
LCD_1IN44_SendData_8Bit(0x20);
LCD_1IN44_SendData_8Bit(0x22);
LCD_1IN44_SendData_8Bit(0x1f);
LCD_1IN44_SendData_8Bit(0x1b);
LCD_1IN44_SendData_8Bit(0x23);
LCD_1IN44_SendData_8Bit(0x37);
LCD_1IN44_SendData_8Bit(0x00);
LCD_1IN44_SendData_8Bit(0x07);
LCD_1IN44_SendData_8Bit(0x02);
LCD_1IN44_SendData_8Bit(0x10);
LCD_1IN44_SendCommand(0xe1);
LCD_1IN44_SendData_8Bit(0x0f);
LCD_1IN44_SendData_8Bit(0x1b);
LCD_1IN44_SendData_8Bit(0x0f);
LCD_1IN44_SendData_8Bit(0x17);
LCD_1IN44_SendData_8Bit(0x33);
LCD_1IN44_SendData_8Bit(0x2c);
LCD_1IN44_SendData_8Bit(0x29);
LCD_1IN44_SendData_8Bit(0x2e);
LCD_1IN44_SendData_8Bit(0x30);
LCD_1IN44_SendData_8Bit(0x30);
LCD_1IN44_SendData_8Bit(0x39);
LCD_1IN44_SendData_8Bit(0x3f);
LCD_1IN44_SendData_8Bit(0x00);
LCD_1IN44_SendData_8Bit(0x07);
LCD_1IN44_SendData_8Bit(0x03);
LCD_1IN44_SendData_8Bit(0x10);
LCD_1IN44_SendCommand(0x21);// reverse
LCD_1IN44_SendCommand(0x11);
DEV_Delay_ms(120);
//Turn on the LCD display
LCD_1IN44_SendCommand(0x29);
}
/********************************************************************************
function: Set the resolution and scanning method of the screen
parameter:
Scan_dir: Scan direction
********************************************************************************/
static void LCD_1IN44_SetAttributes(UBYTE Scan_dir)
{
//Get the screen scan direction
LCD_1IN44.SCAN_DIR = Scan_dir;
UBYTE MemoryAccessReg = 0x00;
//Get GRAM and LCD width and height
if(Scan_dir == HORIZONTAL) {
LCD_1IN44.HEIGHT = LCD_1IN44_WIDTH;
LCD_1IN44.WIDTH = LCD_1IN44_HEIGHT;
MemoryAccessReg = 0X70;
} else {
LCD_1IN44.HEIGHT = LCD_1IN44_HEIGHT;
LCD_1IN44.WIDTH = LCD_1IN44_WIDTH;
MemoryAccessReg = 0X00;
}
// Set the read / write scan direction of the frame memory
LCD_1IN44_SendCommand(0x36); //MX, MY, RGB mode
LCD_1IN44_SendData_8Bit(MemoryAccessReg); //0x08 set RGB
}
/********************************************************************************
function : Initialize the lcd
parameter:
********************************************************************************/
void LCD_1IN44_Init(UBYTE Scan_dir)
{
DEV_SET_PWM(90);
//Hardware reset
LCD_1IN44_Reset();
//Set the resolution and scanning method of the screen
LCD_1IN44_SetAttributes(Scan_dir);
//Set the initialization register
LCD_1IN44_InitReg();
}
/********************************************************************************
function: Sets the start position and size of the display area
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
********************************************************************************/
void LCD_1IN44_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
UBYTE x,y;
if(LCD_1IN44.SCAN_DIR == HORIZONTAL){x=1;y=2;}
else{ x=2; y=1; }
//set the X coordinates
LCD_1IN44_SendCommand(0x2A);
LCD_1IN44_SendData_16Bit(Xstart +x);
LCD_1IN44_SendData_16Bit(Xend-1 +x);
//set the Y coordinates
LCD_1IN44_SendCommand(0x2B);
LCD_1IN44_SendData_16Bit(Ystart +y);
LCD_1IN44_SendData_16Bit(Yend-1 +y);
LCD_1IN44_SendCommand(0X2C);
// printf("%d %d\r\n",x,y);
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void LCD_1IN44_Clear(UWORD Color)
{
UWORD j,i;
UWORD Image[LCD_1IN44.WIDTH*LCD_1IN44.HEIGHT];
Color = ((Color<<8)&0xff00)|(Color>>8);
for (j = 0; j < LCD_1IN44.HEIGHT*LCD_1IN44.WIDTH; j++) {
Image[j] = Color;
}
LCD_1IN44_SetWindows(0, 0, LCD_1IN44.WIDTH, LCD_1IN44.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
// printf("HEIGHT %d, WIDTH %d\r\n",LCD_1IN44.HEIGHT,LCD_1IN44.WIDTH);
for(j = 0; j < LCD_1IN44.HEIGHT; j++){
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN44.WIDTH], LCD_1IN44.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
******************************************************************************/
void LCD_1IN44_Display(UWORD *Image)
{
UWORD j;
LCD_1IN44_SetWindows(0, 0, LCD_1IN44.WIDTH, LCD_1IN44.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = 0; j < LCD_1IN44.HEIGHT; j++) {
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN44.WIDTH], LCD_1IN44.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
LCD_1IN44_SendCommand(0x29);
}
void LCD_1IN44_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image)
{
// display
UDOUBLE Addr = 0;
UWORD j;
LCD_1IN44_SetWindows(Xstart, Ystart, Xend , Yend);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = Ystart; j < Yend - 1; j++) {
Addr = Xstart + j * LCD_1IN44.WIDTH ;
DEV_SPI_Write_nByte((uint8_t *)&Image[Addr], (Xend-Xstart)*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
void LCD_1IN44_DisplayPoint(UWORD X, UWORD Y, UWORD Color)
{
LCD_1IN44_SetWindows(X,Y,X,Y);
LCD_1IN44_SendData_16Bit(Color);
}
void Handler_1IN44_LCD(int signo)
{
//System Exit
printf("\r\nHandler:Program stop\r\n");
DEV_Module_Exit();
exit(0);
}

View File

@ -0,0 +1,51 @@
/*****************************************************************************
* | File : LCD_1in54.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2020-05-20
* | Info : Basic version
*
******************************************************************************/
#ifndef __LCD_1IN44_H
#define __LCD_1IN44_H
#include "DEV_Config.h"
#include <stdint.h>
#include <stdlib.h> //itoa()
#include <stdio.h>
#define LCD_1IN44_HEIGHT 128
#define LCD_1IN44_WIDTH 128
#define HORIZONTAL 0
#define VERTICAL 1
#define LCD_1IN44_SetBacklight(Value) ;
typedef struct{
UWORD WIDTH;
UWORD HEIGHT;
UBYTE SCAN_DIR;
}LCD_1IN44_ATTRIBUTES;
extern LCD_1IN44_ATTRIBUTES LCD_1IN44;
/********************************************************************************
function:
Macro definition variable name
********************************************************************************/
void LCD_1IN44_Init(UBYTE Scan_dir);
void LCD_1IN44_Clear(UWORD Color);
void LCD_1IN44_Display(UWORD *Image);
void LCD_1IN44_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image);
void LCD_1IN44_DisplayPoint(UWORD X, UWORD Y, UWORD Color);
void Handler_1IN44_LCD(int signo);
#endif

View File

@ -0,0 +1,276 @@
#include "LCD_1in54.h"
#include "DEV_Config.h"
#include <stdlib.h> //itoa()
#include <stdio.h>
LCD_1IN54_ATTRIBUTES LCD_1IN54;
/******************************************************************************
function : Hardware reset
parameter:
******************************************************************************/
static void LCD_1IN54_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void LCD_1IN54_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN54_SendData_8Bit(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN54_SendData_16Bit(UWORD Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte((Data >> 8) & 0xFF);
DEV_SPI_WriteByte(Data & 0xFF);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Initialize the lcd register
parameter:
******************************************************************************/
static void LCD_1IN54_InitReg(void)
{
LCD_1IN54_SendCommand(0x3A);
LCD_1IN54_SendData_8Bit(0x05);
LCD_1IN54_SendCommand(0xB2);
LCD_1IN54_SendData_8Bit(0x0C);
LCD_1IN54_SendData_8Bit(0x0C);
LCD_1IN54_SendData_8Bit(0x00);
LCD_1IN54_SendData_8Bit(0x33);
LCD_1IN54_SendData_8Bit(0x33);
LCD_1IN54_SendCommand(0xB7); //Gate Control
LCD_1IN54_SendData_8Bit(0x35);
LCD_1IN54_SendCommand(0xBB); //VCOM Setting
LCD_1IN54_SendData_8Bit(0x19);
LCD_1IN54_SendCommand(0xC0); //LCM Control
LCD_1IN54_SendData_8Bit(0x2C);
LCD_1IN54_SendCommand(0xC2); //VDV and VRH Command Enable
LCD_1IN54_SendData_8Bit(0x01);
LCD_1IN54_SendCommand(0xC3); //VRH Set
LCD_1IN54_SendData_8Bit(0x12);
LCD_1IN54_SendCommand(0xC4); //VDV Set
LCD_1IN54_SendData_8Bit(0x20);
LCD_1IN54_SendCommand(0xC6); //Frame Rate Control in Normal Mode
LCD_1IN54_SendData_8Bit(0x0F);
LCD_1IN54_SendCommand(0xD0); // Power Control 1
LCD_1IN54_SendData_8Bit(0xA4);
LCD_1IN54_SendData_8Bit(0xA1);
LCD_1IN54_SendCommand(0xE0); //Positive Voltage Gamma Control
LCD_1IN54_SendData_8Bit(0xD0);
LCD_1IN54_SendData_8Bit(0x04);
LCD_1IN54_SendData_8Bit(0x0D);
LCD_1IN54_SendData_8Bit(0x11);
LCD_1IN54_SendData_8Bit(0x13);
LCD_1IN54_SendData_8Bit(0x2B);
LCD_1IN54_SendData_8Bit(0x3F);
LCD_1IN54_SendData_8Bit(0x54);
LCD_1IN54_SendData_8Bit(0x4C);
LCD_1IN54_SendData_8Bit(0x18);
LCD_1IN54_SendData_8Bit(0x0D);
LCD_1IN54_SendData_8Bit(0x0B);
LCD_1IN54_SendData_8Bit(0x1F);
LCD_1IN54_SendData_8Bit(0x23);
LCD_1IN54_SendCommand(0xE1); //Negative Voltage Gamma Control
LCD_1IN54_SendData_8Bit(0xD0);
LCD_1IN54_SendData_8Bit(0x04);
LCD_1IN54_SendData_8Bit(0x0C);
LCD_1IN54_SendData_8Bit(0x11);
LCD_1IN54_SendData_8Bit(0x13);
LCD_1IN54_SendData_8Bit(0x2C);
LCD_1IN54_SendData_8Bit(0x3F);
LCD_1IN54_SendData_8Bit(0x44);
LCD_1IN54_SendData_8Bit(0x51);
LCD_1IN54_SendData_8Bit(0x2F);
LCD_1IN54_SendData_8Bit(0x1F);
LCD_1IN54_SendData_8Bit(0x1F);
LCD_1IN54_SendData_8Bit(0x20);
LCD_1IN54_SendData_8Bit(0x23);
LCD_1IN54_SendCommand(0x21); //Display Inversion On
LCD_1IN54_SendCommand(0x11); //Sleep Out
LCD_1IN54_SendCommand(0x29); //Display On
}
/********************************************************************************
function: Set the resolution and scanning method of the screen
parameter:
Scan_dir: Scan direction
********************************************************************************/
static void LCD_1IN54_SetAttributes(UBYTE Scan_dir)
{
//Get the screen scan direction
LCD_1IN54.SCAN_DIR = Scan_dir;
UBYTE MemoryAccessReg = 0x00;
//Get GRAM and LCD width and height
if(Scan_dir == HORIZONTAL) {
LCD_1IN54.HEIGHT = LCD_1IN54_HEIGHT;
LCD_1IN54.WIDTH = LCD_1IN54_WIDTH;
MemoryAccessReg = 0X70;
} else {
LCD_1IN54.HEIGHT = LCD_1IN54_WIDTH;
LCD_1IN54.WIDTH = LCD_1IN54_HEIGHT;
MemoryAccessReg = 0X00;
}
// Set the read / write scan direction of the frame memory
LCD_1IN54_SendCommand(0x36); //MX, MY, RGB mode
LCD_1IN54_SendData_8Bit(MemoryAccessReg); //0x08 set RGB
}
/********************************************************************************
function : Initialize the lcd
parameter:
********************************************************************************/
void LCD_1IN54_Init(UBYTE Scan_dir)
{
//Turn on the backlight
// LCD_1IN54_BL_1;
//Hardware reset
LCD_1IN54_Reset();
//Set the resolution and scanning method of the screen
LCD_1IN54_SetAttributes(Scan_dir);
//Set the initialization register
LCD_1IN54_InitReg();
}
/********************************************************************************
function: Sets the start position and size of the display area
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
********************************************************************************/
void LCD_1IN54_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
//set the X coordinates
LCD_1IN54_SendCommand(0x2A);
LCD_1IN54_SendData_8Bit((Xstart >> 8) & 0xFF);
LCD_1IN54_SendData_8Bit(Xstart & 0xFF);
LCD_1IN54_SendData_8Bit(((Xend - 1) >> 8) & 0xFF);
LCD_1IN54_SendData_8Bit((Xend - 1) & 0xFF);
//set the Y coordinates
LCD_1IN54_SendCommand(0x2B);
LCD_1IN54_SendData_8Bit((Ystart >> 8) & 0xFF);
LCD_1IN54_SendData_8Bit(Ystart & 0xFF);
LCD_1IN54_SendData_8Bit(((Yend - 1) >> 8) & 0xFF);
LCD_1IN54_SendData_8Bit((Yend - 1) & 0xFF);
LCD_1IN54_SendCommand(0X2C);
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void LCD_1IN54_Clear(UWORD Color)
{
UWORD j;
UWORD Image[LCD_1IN54_WIDTH*LCD_1IN54_HEIGHT];
Color = ((Color<<8)&0xff00)|(Color>>8);
for (j = 0; j < LCD_1IN54_HEIGHT*LCD_1IN54_WIDTH; j++) {
Image[j] = Color;
}
LCD_1IN54_SetWindows(0, 0, LCD_1IN54_WIDTH, LCD_1IN54_HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for(j = 0; j < LCD_1IN54_HEIGHT; j++){
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN54_WIDTH], LCD_1IN54_WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
******************************************************************************/
void LCD_1IN54_Display(UWORD *Image)
{
UWORD j;
LCD_1IN54_SetWindows(0, 0, LCD_1IN54_WIDTH, LCD_1IN54_HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = 0; j < LCD_1IN54_HEIGHT; j++) {
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN54_WIDTH], LCD_1IN54_WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
void LCD_1IN54_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image)
{
// display
UDOUBLE Addr = 0;
UWORD j;
LCD_1IN54_SetWindows(Xstart, Ystart, Xend , Yend);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = Ystart; j < Yend - 1; j++) {
Addr = Xstart + j * LCD_1IN54_WIDTH ;
DEV_SPI_Write_nByte((uint8_t *)&Image[Addr], (Xend-Xstart)*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
void LCD_1IN54_DisplayPoint(UWORD X, UWORD Y, UWORD Color)
{
LCD_1IN54_SetWindows(X,Y,X,Y);
LCD_1IN54_SendData_16Bit(Color);
}

View File

@ -0,0 +1,34 @@
#ifndef __LCD_1IN54_H
#define __LCD_1IN54_H
#include "DEV_Config.h"
#define LCD_1IN54_HEIGHT 240
#define LCD_1IN54_WIDTH 240
#define LCD_1IN54_WIDTH_Byte 240
#define HORIZONTAL 0
#define VERTICAL 1
typedef struct{
UWORD WIDTH;
UWORD HEIGHT;
UBYTE SCAN_DIR;
}LCD_1IN54_ATTRIBUTES;
extern LCD_1IN54_ATTRIBUTES LCD_1IN54;
/********************************************************************************
function:
Macro definition variable name
********************************************************************************/
void LCD_1IN54_Init(UBYTE Scan_dir);
void LCD_1IN54_Clear(UWORD Color);
void LCD_1IN54_Display(UWORD *Image);
void LCD_1IN54_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image);
void LCD_1IN54_DisplayPoint(UWORD X, UWORD Y, UWORD Color);
void Handler_1IN54_LCD(int signo);
#endif

326
bsp/pico/bsp/LCD/LCD_1in8.c Normal file
View File

@ -0,0 +1,326 @@
/*****************************************************************************
* | File : LCD_1in8.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2020-05-20
* | Info : Basic version
*
******************************************************************************/
#include "LCD_1in8.h"
#include "DEV_Config.h"
#include <stdlib.h> //itoa()
#include <stdio.h>
LCD_1IN8_ATTRIBUTES LCD_1IN8;
/******************************************************************************
function : Hardware reset
parameter:
******************************************************************************/
static void LCD_1IN8_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void LCD_1IN8_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN8_SendData_8Bit(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_1IN8_SendData_16Bit(UWORD Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte((Data >> 8) & 0xFF);
DEV_SPI_WriteByte(Data & 0xFF);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Initialize the lcd register
parameter:
******************************************************************************/
static void LCD_1IN8_InitReg(void)
{
LCD_1IN8_SendCommand(0x3A);
LCD_1IN8_SendData_8Bit(0x05);
//ST7735R Frame Rate
LCD_1IN8_SendCommand(0xB1);
LCD_1IN8_SendData_8Bit(0x01);
LCD_1IN8_SendData_8Bit(0x2C);
LCD_1IN8_SendData_8Bit(0x2D);
LCD_1IN8_SendCommand(0xB2);
LCD_1IN8_SendData_8Bit(0x01);
LCD_1IN8_SendData_8Bit(0x2C);
LCD_1IN8_SendData_8Bit(0x2D);
LCD_1IN8_SendCommand(0xB3);
LCD_1IN8_SendData_8Bit(0x01);
LCD_1IN8_SendData_8Bit(0x2C);
LCD_1IN8_SendData_8Bit(0x2D);
LCD_1IN8_SendData_8Bit(0x01);
LCD_1IN8_SendData_8Bit(0x2C);
LCD_1IN8_SendData_8Bit(0x2D);
LCD_1IN8_SendCommand(0xB4); //Column inversion
LCD_1IN8_SendData_8Bit(0x07);
//ST7735R Power Sequence
LCD_1IN8_SendCommand(0xC0);
LCD_1IN8_SendData_8Bit(0xA2);
LCD_1IN8_SendData_8Bit(0x02);
LCD_1IN8_SendData_8Bit(0x84);
LCD_1IN8_SendCommand(0xC1);
LCD_1IN8_SendData_8Bit(0xC5);
LCD_1IN8_SendCommand(0xC2);
LCD_1IN8_SendData_8Bit(0x0A);
LCD_1IN8_SendData_8Bit(0x00);
LCD_1IN8_SendCommand(0xC3);
LCD_1IN8_SendData_8Bit(0x8A);
LCD_1IN8_SendData_8Bit(0x2A);
LCD_1IN8_SendCommand(0xC4);
LCD_1IN8_SendData_8Bit(0x8A);
LCD_1IN8_SendData_8Bit(0xEE);
LCD_1IN8_SendCommand(0xC5); //VCOM
LCD_1IN8_SendData_8Bit(0x0E);
//ST7735R Gamma Sequence
LCD_1IN8_SendCommand(0xe0);
LCD_1IN8_SendData_8Bit(0x0f);
LCD_1IN8_SendData_8Bit(0x1a);
LCD_1IN8_SendData_8Bit(0x0f);
LCD_1IN8_SendData_8Bit(0x18);
LCD_1IN8_SendData_8Bit(0x2f);
LCD_1IN8_SendData_8Bit(0x28);
LCD_1IN8_SendData_8Bit(0x20);
LCD_1IN8_SendData_8Bit(0x22);
LCD_1IN8_SendData_8Bit(0x1f);
LCD_1IN8_SendData_8Bit(0x1b);
LCD_1IN8_SendData_8Bit(0x23);
LCD_1IN8_SendData_8Bit(0x37);
LCD_1IN8_SendData_8Bit(0x00);
LCD_1IN8_SendData_8Bit(0x07);
LCD_1IN8_SendData_8Bit(0x02);
LCD_1IN8_SendData_8Bit(0x10);
LCD_1IN8_SendCommand(0xe1);
LCD_1IN8_SendData_8Bit(0x0f);
LCD_1IN8_SendData_8Bit(0x1b);
LCD_1IN8_SendData_8Bit(0x0f);
LCD_1IN8_SendData_8Bit(0x17);
LCD_1IN8_SendData_8Bit(0x33);
LCD_1IN8_SendData_8Bit(0x2c);
LCD_1IN8_SendData_8Bit(0x29);
LCD_1IN8_SendData_8Bit(0x2e);
LCD_1IN8_SendData_8Bit(0x30);
LCD_1IN8_SendData_8Bit(0x30);
LCD_1IN8_SendData_8Bit(0x39);
LCD_1IN8_SendData_8Bit(0x3f);
LCD_1IN8_SendData_8Bit(0x00);
LCD_1IN8_SendData_8Bit(0x07);
LCD_1IN8_SendData_8Bit(0x03);
LCD_1IN8_SendData_8Bit(0x10);
LCD_1IN8_SendCommand(0xF0); //Enable test command
LCD_1IN8_SendData_8Bit(0x01);
LCD_1IN8_SendCommand(0xF6); //Disable ram power save mode
LCD_1IN8_SendData_8Bit(0x00);
//sleep out
LCD_1IN8_SendCommand(0x11);
DEV_Delay_ms(120);
//Turn on the LCD display
LCD_1IN8_SendCommand(0x29);
DEV_Delay_ms(120);
}
/********************************************************************************
function: Set the resolution and scanning method of the screen
parameter:
Scan_dir: Scan direction
********************************************************************************/
static void LCD_1IN8_SetAttributes(UBYTE Scan_dir)
{
//Get the screen scan direction
LCD_1IN8.SCAN_DIR = Scan_dir;
UBYTE MemoryAccessReg = 0x00;
//Get GRAM and LCD width and height
if(Scan_dir == HORIZONTAL) {
LCD_1IN8.HEIGHT = LCD_1IN8_WIDTH;
LCD_1IN8.WIDTH = LCD_1IN8_HEIGHT;
MemoryAccessReg = 0X70;
} else {
LCD_1IN8.HEIGHT = LCD_1IN8_HEIGHT;
LCD_1IN8.WIDTH = LCD_1IN8_WIDTH;
MemoryAccessReg = 0X00;
}
// Set the read / write scan direction of the frame memory
LCD_1IN8_SendCommand(0x36); //MX, MY, RGB mode
LCD_1IN8_SendData_8Bit(MemoryAccessReg); //0x08 set RGB
}
/********************************************************************************
function : Initialize the lcd
parameter:
********************************************************************************/
void LCD_1IN8_Init(UBYTE Scan_dir)
{
DEV_SET_PWM(90);
//Hardware reset
LCD_1IN8_Reset();
//Set the resolution and scanning method of the screen
LCD_1IN8_SetAttributes(Scan_dir);
//Set the initialization register
LCD_1IN8_InitReg();
}
/********************************************************************************
function: Sets the start position and size of the display area
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
********************************************************************************/
void LCD_1IN8_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
//set the X coordinates
LCD_1IN8_SendCommand(0x2A);
LCD_1IN8_SendData_8Bit(0x00);
LCD_1IN8_SendData_8Bit(Xstart+1);
LCD_1IN8_SendData_8Bit(0x00);
LCD_1IN8_SendData_8Bit(Xend);
//set the Y coordinates
LCD_1IN8_SendCommand(0x2B);
LCD_1IN8_SendData_8Bit(0x00);
LCD_1IN8_SendData_8Bit(Ystart+1);
LCD_1IN8_SendData_8Bit(0x00);
LCD_1IN8_SendData_8Bit(Yend);
LCD_1IN8_SendCommand(0X2C);
// printf("%d %d\r\n",x,y);
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void LCD_1IN8_Clear(UWORD Color)
{
UWORD j,i;
UWORD Image[LCD_1IN8.WIDTH*LCD_1IN8.HEIGHT];
Color = ((Color<<8)&0xff00)|(Color>>8);
for (j = 0; j < LCD_1IN8.HEIGHT*LCD_1IN8.WIDTH; j++) {
Image[j] = Color;
}
LCD_1IN8_SetWindows(0, 0, LCD_1IN8.WIDTH, LCD_1IN8.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
// printf("HEIGHT %d, WIDTH %d\r\n",LCD_1IN8.HEIGHT,LCD_1IN8.WIDTH);
for(j = 0; j < LCD_1IN8.HEIGHT; j++){
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN8.WIDTH], LCD_1IN8.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
******************************************************************************/
void LCD_1IN8_Display(UWORD *Image)
{
UWORD j;
LCD_1IN8_SetWindows(0, 0, LCD_1IN8.WIDTH, LCD_1IN8.HEIGHT);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = 0; j < LCD_1IN8.HEIGHT; j++) {
DEV_SPI_Write_nByte((uint8_t *)&Image[j*LCD_1IN8.WIDTH], LCD_1IN8.WIDTH*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
LCD_1IN8_SendCommand(0x29);
}
void LCD_1IN8_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image)
{
// display
UDOUBLE Addr = 0;
UWORD j;
LCD_1IN8_SetWindows(Xstart, Ystart, Xend , Yend);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = Ystart; j < Yend - 1; j++) {
Addr = Xstart + j * LCD_1IN8.WIDTH ;
DEV_SPI_Write_nByte((uint8_t *)&Image[Addr], (Xend-Xstart)*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
void LCD_1IN8_DisplayPoint(UWORD X, UWORD Y, UWORD Color)
{
LCD_1IN8_SetWindows(X,Y,X,Y);
LCD_1IN8_SendData_16Bit(Color);
}
void Handler_1IN8_LCD(int signo)
{
//System Exit
printf("\r\nHandler:Program stop\r\n");
DEV_Module_Exit();
exit(0);
}

View File

@ -0,0 +1,52 @@
/*****************************************************************************
* | File : LCD_1in54.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2020-05-20
* | Info : Basic version
*
******************************************************************************/
#ifndef __LCD_1IN8_H
#define __LCD_1IN8_H
#include "DEV_Config.h"
#include <stdint.h>
#include <stdlib.h> //itoa()
#include <stdio.h>
#define LCD_1IN8_HEIGHT 160
#define LCD_1IN8_WIDTH 130
#define HORIZONTAL 0
#define VERTICAL 1
#define LCD_1IN8_SetBacklight(Value) ;
typedef struct{
UWORD WIDTH;
UWORD HEIGHT;
UBYTE SCAN_DIR;
}LCD_1IN8_ATTRIBUTES;
extern LCD_1IN8_ATTRIBUTES LCD_1IN8;
/********************************************************************************
function:
Macro definition variable name
********************************************************************************/
void LCD_1IN8_Init(UBYTE Scan_dir);
void LCD_1IN8_Clear(UWORD Color);
void LCD_1IN8_Display(UWORD *Image);
void LCD_1IN8_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image);
void LCD_1IN8_DisplayPoint(UWORD X, UWORD Y, UWORD Color);
void Handler_1IN8_LCD(int signo);
#endif

311
bsp/pico/bsp/LCD/LCD_2in.c Normal file
View File

@ -0,0 +1,311 @@
/*****************************************************************************
* | File : LCD_1in14.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2020-05-20
* | Info : Basic version
*
******************************************************************************/
#include "LCD_2in.h"
#include "DEV_Config.h"
#include <stdlib.h> //itoa()
#include <stdio.h>
LCD_2IN_ATTRIBUTES LCD_2IN;
/******************************************************************************
function : Hardware reset
parameter:
******************************************************************************/
static void LCD_2IN_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(100);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(100);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void LCD_2IN_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_2IN_SendData_8Bit(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void LCD_2IN_SendData_16Bit(UWORD Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte((Data >> 8) & 0xFF);
DEV_SPI_WriteByte(Data & 0xFF);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Initialize the lcd register
parameter:
******************************************************************************/
static void LCD_2IN_InitReg(void)
{
LCD_2IN_SendCommand(0x36);
LCD_2IN_SendData_8Bit(0x00);
LCD_2IN_SendCommand(0x3A);
LCD_2IN_SendData_8Bit(0x05);
LCD_2IN_SendCommand(0x21);
LCD_2IN_SendCommand(0x2A);
LCD_2IN_SendData_8Bit(0x00);
LCD_2IN_SendData_8Bit(0x00);
LCD_2IN_SendData_8Bit(0x01);
LCD_2IN_SendData_8Bit(0x3F);
LCD_2IN_SendCommand(0x2B);
LCD_2IN_SendData_8Bit(0x00);
LCD_2IN_SendData_8Bit(0x00);
LCD_2IN_SendData_8Bit(0x00);
LCD_2IN_SendData_8Bit(0xEF);
LCD_2IN_SendCommand(0xB2);
LCD_2IN_SendData_8Bit(0x0C);
LCD_2IN_SendData_8Bit(0x0C);
LCD_2IN_SendData_8Bit(0x00);
LCD_2IN_SendData_8Bit(0x33);
LCD_2IN_SendData_8Bit(0x33);
LCD_2IN_SendCommand(0xB7);
LCD_2IN_SendData_8Bit(0x35);
LCD_2IN_SendCommand(0xBB);
LCD_2IN_SendData_8Bit(0x1F);
LCD_2IN_SendCommand(0xC0);
LCD_2IN_SendData_8Bit(0x2C);
LCD_2IN_SendCommand(0xC2);
LCD_2IN_SendData_8Bit(0x01);
LCD_2IN_SendCommand(0xC3);
LCD_2IN_SendData_8Bit(0x12);
LCD_2IN_SendCommand(0xC4);
LCD_2IN_SendData_8Bit(0x20);
LCD_2IN_SendCommand(0xC6);
LCD_2IN_SendData_8Bit(0x0F);
LCD_2IN_SendCommand(0xD0);
LCD_2IN_SendData_8Bit(0xA4);
LCD_2IN_SendData_8Bit(0xA1);
LCD_2IN_SendCommand(0xE0);
LCD_2IN_SendData_8Bit(0xD0);
LCD_2IN_SendData_8Bit(0x08);
LCD_2IN_SendData_8Bit(0x11);
LCD_2IN_SendData_8Bit(0x08);
LCD_2IN_SendData_8Bit(0x0C);
LCD_2IN_SendData_8Bit(0x15);
LCD_2IN_SendData_8Bit(0x39);
LCD_2IN_SendData_8Bit(0x33);
LCD_2IN_SendData_8Bit(0x50);
LCD_2IN_SendData_8Bit(0x36);
LCD_2IN_SendData_8Bit(0x13);
LCD_2IN_SendData_8Bit(0x14);
LCD_2IN_SendData_8Bit(0x29);
LCD_2IN_SendData_8Bit(0x2D);
LCD_2IN_SendCommand(0xE1);
LCD_2IN_SendData_8Bit(0xD0);
LCD_2IN_SendData_8Bit(0x08);
LCD_2IN_SendData_8Bit(0x10);
LCD_2IN_SendData_8Bit(0x08);
LCD_2IN_SendData_8Bit(0x06);
LCD_2IN_SendData_8Bit(0x06);
LCD_2IN_SendData_8Bit(0x39);
LCD_2IN_SendData_8Bit(0x44);
LCD_2IN_SendData_8Bit(0x51);
LCD_2IN_SendData_8Bit(0x0B);
LCD_2IN_SendData_8Bit(0x16);
LCD_2IN_SendData_8Bit(0x14);
LCD_2IN_SendData_8Bit(0x2F);
LCD_2IN_SendData_8Bit(0x31);
LCD_2IN_SendCommand(0x21);
LCD_2IN_SendCommand(0x11);
LCD_2IN_SendCommand(0x29);
}
/********************************************************************************
function: Set the resolution and scanning method of the screen
parameter:
Scan_dir: Scan direction
********************************************************************************/
static void LCD_2IN_SetAttributes(UBYTE Scan_dir)
{
//Get the screen scan direction
LCD_2IN.SCAN_DIR = Scan_dir;
UBYTE MemoryAccessReg = 0x00;
//Get GRAM and LCD width and height
if(Scan_dir == HORIZONTAL) {
LCD_2IN.HEIGHT = LCD_2IN_WIDTH;
LCD_2IN.WIDTH = LCD_2IN_HEIGHT;
MemoryAccessReg = 0X70;
} else {
LCD_2IN.HEIGHT = LCD_2IN_HEIGHT;
LCD_2IN.WIDTH = LCD_2IN_WIDTH;
MemoryAccessReg = 0X00;
}
// Set the read / write scan direction of the frame memory
LCD_2IN_SendCommand(0x36); //MX, MY, RGB mode
LCD_2IN_SendData_8Bit(MemoryAccessReg); //0x08 set RGB
}
/********************************************************************************
function : Initialize the lcd
parameter:
********************************************************************************/
void LCD_2IN_Init(UBYTE Scan_dir)
{
DEV_SET_PWM(90);
//Hardware reset
LCD_2IN_Reset();
//Set the resolution and scanning method of the screen
LCD_2IN_SetAttributes(Scan_dir);
//Set the initialization register
LCD_2IN_InitReg();
}
/********************************************************************************
function: Sets the start position and size of the display area
parameter:
Xstart : X direction Start coordinates
Ystart : Y direction Start coordinates
Xend : X direction end coordinates
Yend : Y direction end coordinates
********************************************************************************/
void LCD_2IN_SetWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend)
{
//set the X coordinates
LCD_2IN_SendCommand(0x2A);
LCD_2IN_SendData_8Bit(Xstart >>8);
LCD_2IN_SendData_8Bit(Xstart & 0xff);
LCD_2IN_SendData_8Bit((Xend - 1) >> 8);
LCD_2IN_SendData_8Bit((Xend-1) & 0xFF);
//set the Y coordinates
LCD_2IN_SendCommand(0x2B);
LCD_2IN_SendData_8Bit(Ystart >>8);
LCD_2IN_SendData_8Bit(Ystart & 0xff);
LCD_2IN_SendData_8Bit((Yend - 1) >> 8);
LCD_2IN_SendData_8Bit((Yend - 1) & 0xff);
LCD_2IN_SendCommand(0X2C);
// printf("%d %d\r\n",x,y);
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void LCD_2IN_Clear(UWORD Color)
{
UWORD i;
UWORD image[LCD_2IN_HEIGHT];
for(i=0;i<LCD_2IN_HEIGHT;i++){
image[i] = Color>>8 | (Color&0xff)<<8;
}
UBYTE *p = (UBYTE *)(image);
LCD_2IN_SetWindows(0, 0, LCD_2IN_HEIGHT,LCD_2IN_WIDTH);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for(i = 0; i < LCD_2IN_WIDTH; i++){
DEV_SPI_Write_nByte(p,LCD_2IN_HEIGHT*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Sends the image buffer in RAM to displays
parameter:
******************************************************************************/
void LCD_2IN_Display(UBYTE *Image)
{
UWORD j;
LCD_2IN_SetWindows(0, 0,LCD_2IN.WIDTH,LCD_2IN.HEIGHT );
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = 0; j < LCD_2IN.WIDTH; j++) {
DEV_SPI_Write_nByte((UBYTE *)Image+LCD_2IN.HEIGHT*2*j,LCD_2IN.HEIGHT*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
LCD_2IN_SendCommand(0x29);
}
void LCD_2IN_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image)
{
// display
UDOUBLE Addr = 0;
UWORD j;
LCD_2IN_SetWindows(Xstart, Ystart, Xend , Yend);
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
for (j = Ystart; j < Yend - 1; j++) {
Addr = Xstart + j * LCD_2IN.WIDTH ;
DEV_SPI_Write_nByte((uint8_t *)&Image[Addr], (Xend-Xstart)*2);
}
DEV_Digital_Write(EPD_CS_PIN, 1);
}
void LCD_2IN_DisplayPoint(UWORD X, UWORD Y, UWORD Color)
{
LCD_2IN_SetWindows(X,Y,X,Y);
LCD_2IN_SendData_16Bit(Color);
}
void Handler_2IN_LCD(int signo)
{
//System Exit
printf("\r\nHandler:Program stop\r\n");
DEV_Module_Exit();
exit(0);
}

View File

@ -0,0 +1,52 @@
/*****************************************************************************
* | File : LCD_1in54.c
* | Author : Waveshare team
* | Function : Hardware underlying interface
* | Info :
* Used to shield the underlying layers of each master
* and enhance portability
*----------------
* | This version: V1.0
* | Date : 2020-05-20
* | Info : Basic version
*
******************************************************************************/
#ifndef __LCD_2IN_H
#define __LCD_2IN_H
#include "DEV_Config.h"
#include <stdint.h>
#include <stdlib.h> //itoa()
#include <stdio.h>
#define LCD_2IN_HEIGHT 240
#define LCD_2IN_WIDTH 320
#define HORIZONTAL 0
#define VERTICAL 1
#define LCD_2IN_SetBacklight(Value) ;
typedef struct{
UWORD WIDTH;
UWORD HEIGHT;
UBYTE SCAN_DIR;
}LCD_2IN_ATTRIBUTES;
extern LCD_2IN_ATTRIBUTES LCD_2IN;
/********************************************************************************
function:
Macro definition variable name
********************************************************************************/
void LCD_2IN_Init(UBYTE Scan_dir);
void LCD_2IN_Clear(UWORD Color);
void LCD_2IN_Display(UBYTE *Image);
void LCD_2IN_DisplayWindows(UWORD Xstart, UWORD Ystart, UWORD Xend, UWORD Yend, UWORD *Image);
void LCD_2IN_DisplayPoint(UWORD X, UWORD Y, UWORD Color);
void Handler_2IN_LCD(int signo);
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -17,24 +17,45 @@
/*============================ INCLUDES ======================================*/
#include "pico/stdlib.h"
#include "perf_counter.h"
#include "pikaScript.h"
#include "PikaParser.h"
#include "PikaVM.h"
#include "dataStrs.h"
#if defined(__PICO_USE_LCD_1IN3__) && __PICO_USE_LCD_1IN3__
#include "DEV_Config.h"
#include "LCD_1In3.h"
#include "GLCD_Config.h"
#endif
#include <stdio.h>
#include "RTE_Components.h"
#if defined(RTE_Compiler_EventRecorder) && defined(USE_EVR_FOR_STDOUR)
#if defined(RTE_Compiler_EventRecorder) && defined(RTE_Compiler_IO_STDOUT_EVR)
# include <EventRecorder.h>
#endif
#if defined(RTE_Script_PikaScript) || defined(USING_PIKAPYTHON)
# include "pikaScript.h"
#endif
#if defined(__RTE_ACCELERATION_ARM_2D__) || defined(RTE_Acceleration_Arm_2D)
# include "arm_2d.h"
# include "arm_2d_helper.h"
# include "arm_2d_disp_adapters.h"
# include "arm_2d_scenes.h"
#endif
#if defined(__RTE_ACCELERATION_ARM_2D_EXTRA_BENCHMARK_WATCH_PANEL__) \
|| defined(__RTE_ACCELERATION_ARM_2D_EXTRA_BENCHMARK_GENERIC__)
# include "arm_2d_benchmark.h"
#endif
/*============================ MACROS ========================================*/
#define TOP (0x1FFF)
/*============================ MACROFIED FUNCTIONS ===========================*/
#define ABS(__N) ((__N) < 0 ? -(__N) : (__N))
#define _BV(__N) ((uint32_t)1<<(__N))
#ifndef ABS
# define ABS(__N) ((__N) < 0 ? -(__N) : (__N))
#endif
#ifndef _BV
# define _BV(__N) ((uint32_t)1<<(__N))
#endif
/*============================ TYPES =========================================*/
@ -94,46 +115,77 @@ static void system_init(void)
*/
init_cycle_counter(false);
#if defined(RTE_Compiler_EventRecorder) && defined(USE_EVR_FOR_STDOUR)
#if defined(RTE_Compiler_EventRecorder) && defined(RTE_Compiler_IO_STDOUT_EVR)
EventRecorderInitialize(0, 1);
#endif
stdio_init_all();
gpio_init(PICO_DEFAULT_LED_PIN);
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
#if defined(__PICO_USE_LCD_1IN3__) && __PICO_USE_LCD_1IN3__
DEV_Delay_ms(100);
if(DEV_Module_Init()!=0){
//assert(0);
}
DEV_SET_PWM(50);
/* LCD Init */
LCD_1IN3_Init(HORIZONTAL);
LCD_1IN3_Clear(GLCD_COLOR_BLUE);
for (int n = 0; n < KEY_NUM; n++) {
dev_key_init(n);
}
#endif
}
static void prime_number_100_c(void) {
volatile int num = 0;
/* run */
for (volatile int i = 2; i < 100; i++) {
volatile int is_prime = 1;
for (volatile int j = 2; j < i; j++) {
if (i % j == 0) {
is_prime = 0;
break;
}
}
if (is_prime) {
num = num + i;
}
}
if ( num != 1060){
printf("[error] in benchmark prime_number_100_c \r\n");
}
int stdin_getchar(void);
char pika_platform_getchar(void) {
return stdin_getchar();
}
int main(void)
{
system_init();
printf("Hello Pico-Template\r\n");
uint32_t n = 0;
/* run unit test */
obj_deinit(pikaScriptInit());
__cycleof__("printf") {
printf("Hello Pico-Template\r\n");
}
#if defined(RTE_Script_PikaScript) || defined(USING_PIKAPYTHON)
pikaScriptInit();
#endif
#if defined( __PERF_COUNTER_COREMARK__ ) && __PERF_COUNTER_COREMARK__
printf("\r\nRun Coremark 1.0...\r\n");
coremark_main();
#endif
#if defined(__RTE_ACCELERATION_ARM_2D_EXTRA_BENCHMARK_WATCH_PANEL__) \
|| defined(__RTE_ACCELERATION_ARM_2D_EXTRA_BENCHMARK_GENERIC__)
arm_2d_run_benchmark();
#endif
#if defined(__RTE_ACCELERATION_ARM_2D__) || defined(RTE_Acceleration_Arm_2D)
arm_2d_init();
disp_adapter0_init();
//arm_2d_scene_player_switch_to_next_scene(&DISP0_ADAPTER);
#endif
while (true) {
breath_led();
#if defined(__RTE_ACCELERATION_ARM_2D__) || defined(RTE_Acceleration_Arm_2D)
disp_adapter0_task();
#endif
//gpio_put(PICO_DEFAULT_LED_PIN, 1);
//sleep_ms(500);
//gpio_put(PICO_DEFAULT_LED_PIN, 0);

View File

@ -1,4 +0,0 @@
_Instructions: (please delete)_
- _please do not submit against `master`, use `develop` instead_
- _please make sure there is an associated issue for your PR, and reference it via "Fixes #num" in the description_
- _please enter a detailed description_

View File

@ -1,49 +0,0 @@
name: CMake
on: [push, pull_request]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
if: github.repository_owner == 'raspberrypi'
runs-on: [self-hosted, Linux, X64]
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- name: Checkout repo
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Get core count
id: core_count
run : cat /proc/cpuinfo | grep processor | wc -l
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE --parallel ${{steps.core_count.outputs.output}}

View File

@ -1,3 +0,0 @@
[submodule "tinyusb"]
path = lib/tinyusb
url = https://github.com/hathach/tinyusb.git

View File

@ -22,6 +22,9 @@ See [Getting Started with the Raspberry Pi Pico](https://rptl.io/pico-get-starte
hardware, IDE/environment and for how to build and debug software for the Raspberry Pi Pico
and other RP2040-based devices.
See [Connecting to the Internet with Raspberry Pi Pico W](https://rptl.io/picow-connect) to learn more about writing
applications for your Raspberry Pi Pico W that connect to the internet.
See [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk) to learn more about programming using the
SDK, to explore more advanced features, and for complete PDF-based API documentation.
@ -31,6 +34,12 @@ See [Online Raspberry Pi Pico SDK API docs](https://rptl.io/pico-doxygen) for HT
See [pico-examples](https://github.com/raspberrypi/pico-examples) for example code you can build.
# Getting the latest SDK code
The [master](https://github.com/raspberrypi/pico-sdk/tree/master/) branch of `pico-sdk` on GitHub contains the
_latest stable release_ of the SDK. If you need or want to test upcoming features, you can try the
[develop](https://github.com/raspberrypi/pico-sdk/tree/develop/) branch instead.
# Quick-start your own project
These instructions are extremely terse, and Linux-based only. For detailed steps,
@ -110,6 +119,24 @@ instructions for other platforms, and just in general, we recommend you see [Ras
```
* Or by cloning the SDK locally, but without copying `pico_sdk_import.cmake`:
1. `git clone` this Raspberry Pi Pico SDK repository
2. Setup a `CMakeLists.txt` like:
```cmake
cmake_minimum_required(VERSION 3.13)
# initialize the SDK directly
include(/path/to/pico-sdk/pico_sdk_init.cmake)
project(my_project)
# initialize the Raspberry Pi Pico SDK
pico_sdk_init()
# rest of your project
```
1. Write your code (see [pico-examples](https://github.com/raspberrypi/pico-examples) or the [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk) documentation for more information)
About the simplest you can do is a single source file (e.g. hello_world.c)
@ -141,14 +168,23 @@ instructions for other platforms, and just in general, we recommend you see [Ras
Note this example uses the default UART for _stdout_;
if you want to use the default USB see the [hello-usb](https://github.com/raspberrypi/pico-examples/tree/master/hello_world/usb) example.
1. Setup a CMake build directory.
For example, if not using an IDE:
```
$ mkdir build
$ cd build
$ cmake ..
```
```
When building for a board other than the Raspberry Pi Pico, you should pass `-DPICO_BOARD=board_name` to the `cmake` command above, e.g. `cmake -DPICO_BOARD=pico_w ..`
to configure the SDK and build options accordingly for that particular board.
Doing so sets up various compiler defines (e.g. default pin numbers for UART and other hardware) and in certain
cases also enables the use of additional libraries (e.g. wireless support when building for `PICO_BOARD=pico_w`) which cannot
be built without a board which provides the requisite functionality.
For a list of boards defined in the SDK itself, look in [this directory](src/boards/include/boards) which has a
header for each named board.
1. Make your target from the build directory you created.
```sh

View File

@ -13,7 +13,7 @@ endif ()
set(PICO_PLATFORM ${PICO_PLATFORM} CACHE STRING "PICO Build platform (e.g. rp2040, host)")
# PICO_CMAKE_CONFIG: PICO_CMAKE_RELOAD_PLATFORM_FILE, custom CMake file to use to set up the platform environment, default=none, group=build
# PICO_CMAKE_CONFIG: PICO_CMAKE_PRELOAD_PLATFORM_FILE, custom CMake file to use to set up the platform environment, default=none, group=build
set(PICO_CMAKE_PRELOAD_PLATFORM_FILE "" CACHE INTERNAL "")
set(PICO_CMAKE_PRELOAD_PLATFORM_DIR "${CMAKE_CURRENT_LIST_DIR}/preload/platforms" CACHE INTERNAL "")

View File

@ -27,10 +27,6 @@ set(CMAKE_INCLUDE_FLAG_ASM "-I")
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
# Disable compiler checks.
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)
# Add target system root to cmake find path.
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
@ -43,11 +39,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
include_directories(/usr/include/newlib)
# todo move to platform/Generix-xxx
set(ARM_CLANG_COMMON_FLAGS " --target=arm-none-eabi -mcpu=cortex-m0plus -mthumb")
set(CMAKE_C_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
set(CMAKE_CXX_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
set(CMAKE_ASM_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG_INIT "${ARM_CLANG_COMMON_FLAGS} -Og")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "${ARM_CLANG_COMMON_FLAGS} -Og")
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
set(ARM_TOOLCHAIN_COMMON_FLAGS " --target=arm-none-eabi -mcpu=cortex-m0plus -mthumb")
include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake)

View File

@ -27,10 +27,6 @@ set(CMAKE_INCLUDE_FLAG_ASM "-I")
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
# Disable compiler checks.
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)
# Add target system root to cmake find path.
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
@ -41,12 +37,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# todo move to platform/Generix-xxx
set(ARM_CLANG_COMMON_FLAGS " --cpu=Cortex-M0plus")
string(APPEND CMAKE_C_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
string(APPEND CMAKE_CXX_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
string(APPEND CMAKE_ASM_FLAGS_INIT "${ARM_CLANG_COMMON_FLAGS}")
string(APPEND CMAKE_C_FLAGS_DEBUG_INIT "${ARM_CLANG_COMMON_FLAGS} -Og")
string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT "${ARM_CLANG_COMMON_FLAGS} -Og")
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
set(ARM_TOOLCHAIN_COMMON_FLAGS " --cpu=Cortex-M0plus")
include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake)

View File

@ -35,10 +35,6 @@ set(CMAKE_INCLUDE_FLAG_ASM "-I")
set(CMAKE_OBJCOPY ${PICO_OBJCOPY} CACHE FILEPATH "")
set(CMAKE_OBJDUMP ${PICO_OBJDUMP} CACHE FILEPATH "")
# Disable compiler checks.
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)
# Add target system root to cmake find path.
get_filename_component(PICO_COMPILER_DIR "${PICO_COMPILER_CC}" DIRECTORY)
get_filename_component(CMAKE_FIND_ROOT_PATH "${PICO_COMPILER_DIR}" DIRECTORY)
@ -51,17 +47,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
option(PICO_DEOPTIMIZED_DEBUG "Build debug builds with -O0" 0)
# todo move to platform/Generix-xxx
# on ARM -mcpu should not be mixed with -march
set(ARM_GCC_COMMON_FLAGS " -mcpu=cortex-m0plus -mthumb")
foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_FLAGS_INIT "${ARM_GCC_COMMON_FLAGS}")
if (PICO_DEOPTIMIZED_DEBUG)
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0")
else()
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-Og")
endif()
set(CMAKE_${LANG}_LINK_FLAGS "-Wl,--build-id=none")
endforeach()
set(ARM_TOOLCHAIN_COMMON_FLAGS " -mcpu=cortex-m0plus -mthumb")
include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake)

View File

@ -0,0 +1,19 @@
get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
foreach(LANG IN ITEMS C CXX ASM)
set(CMAKE_${LANG}_FLAGS_INIT "${ARM_TOOLCHAIN_COMMON_FLAGS}")
if (PICO_DEOPTIMIZED_DEBUG)
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0")
else()
set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-Og")
endif()
set(CMAKE_${LANG}_LINK_FLAGS "-Wl,--build-id=none")
# try_compile is where the feature testing is done, and at that point,
# pico_standard_link is not ready to be linked in to provide essential
# functions like _exit. So pass -nostdlib so it doesn't link in an exit()
# function at all.
if(IS_IN_TRY_COMPILE)
set(CMAKE_${LANG}_LINK_FLAGS "${CMAKE_${LANG}_LINK_FLAGS} -nostdlib")
endif()
endforeach()

View File

@ -60,4 +60,5 @@ PREDEFINED = __not_in_flash_func(x) \
__time_critical_func(x) \
__not_in_flash(x)= \
__no_inline_not_in_flash(x)= \
__attribute__(x)=
__attribute__(x)= \
DOXYGEN_GENERATION=

View File

@ -7,12 +7,13 @@
<tab type="user" url="@ref examples_page" visible="yes" title="Examples" intro="Links to SDK examples"/>
<tab type="usergroup" url="@ref weblinks_page" visible="yes" title="Additional Documentation" intro="Links to datasheets and documentation">
<tab type="user" url="https://rptl.io/pico-datasheet" visible="yes" title="Raspberry Pi Pico Datasheet" intro=""/>
<tab type="user" url="https://rptl.io/picow-datasheet" visible="yes" title="Raspberry Pi Pico W Datasheet" intro=""/>
<tab type="user" url="https://rptl.io/rp2040-datasheet" visible="yes" title="RP2040 Datasheet" intro=""/>
<tab type="user" url="https://rptl.io/rp2040-design" visible="yes" title="Hardware design with RP2040" intro=""/>
<tab type="user" url="https://rptl.io/pico-c-sdk" visible="yes" title="Raspberry Pi Pico C/C++ SDK" intro=""/>
<tab type="user" url="https://rptl.io/pico-micropython" visible="yes" title="Raspberry Pi Pico Python SDK" intro=""/>
<tab type="user" url="https://rptl.io/pico-get-started" visible="yes" title="Getting started with Raspberry Pi Pico" intro=""/>
<tab type="user" url="https://rptl.io/pico-faq" visible="yes" title="Raspberry Pi Pico FAQ" intro=""/>
<tab type="user" url="https://rptl.io/picow-connect" visible="yes" title="Connecting to the Internet with Raspberry Pi Pico W" intro=""/>
</tab>
<tab type="usergroup" url="@ref weblinks_page" visible="yes" title="Web" intro="useful weblinks">
<tab type="user" url="https://www.raspberrypi.com/" visible="yes" title="Raspberry Pi Site" intro=""/>

View File

@ -54,7 +54,7 @@
<div class="navigation-footer">
<img src="logo-mobile.svg" alt="Raspberry Pi">
<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi (Trading) Ltd</a>
<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
</div>
<!-- <div class="search">
<form>

View File

@ -41,7 +41,10 @@
* This group of libraries provide higher level functionality that isn't hardware related or provides a richer
* set of functionality above the basic hardware interfaces
* @{
* \defgroup pico_async_context pico_async_context
* \defgroup pico_multicore pico_multicore
* \defgroup pico_i2c_slave pico_i2c_slave
* \defgroup pico_rand pico_rand
* \defgroup pico_stdlib pico_stdlib
* \defgroup pico_sync pico_sync
* \defgroup pico_time pico_time
@ -56,6 +59,15 @@
* \defgroup tinyusb_host tinyusb_host
* @}
*
* \defgroup networking Networking Libraries
* Functions for implementing networking
* @{
* \defgroup pico_btstack pico_btstack
* \defgroup pico_lwip pico_lwip
* \defgroup pico_cyw43_driver pico_cyw43_driver
* \defgroup pico_cyw43_arch pico_cyw43_arch
* @}
*
* \defgroup runtime Runtime Infrastructure
* Libraries that are used to provide efficient implementation of certain
* language level and C library functions, as well as CMake INTERFACE libraries

View File

@ -1,17 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="570" height="720">
<path d="m 158.375,1.65625 c -3.6193,0.1123192 -7.51715,1.4493266 -11.9375,4.9375 C 135.61054,2.4174496 125.11041,0.9665612 115.71875,9.46875 101.22489,7.5879922 96.508461,11.469494 92.9375,16 89.754953,15.934135 69.118652,12.72793 59.65625,26.84375 35.874602,24.030329 28.359472,40.831625 36.875,56.5 c -4.856911,7.518955 -9.889503,14.947226 1.46875,29.28125 -4.018006,7.983514 -1.527431,16.64403 7.9375,27.125 -2.497857,11.2226 2.412077,19.14086 11.21875,25.3125 -1.64709,15.35756 14.083505,24.28743 18.78125,27.46875 1.803677,8.94868 5.56291,17.3927 23.53125,22.0625 2.96323,13.3361 13.76206,15.63906 24.21875,18.4375 -34.561929,20.08954 -64.20067,46.52266 -64,111.375 l -5.0625,9.03125 C 15.337882,350.69604 -20.316547,428.16001 35.4375,491.125 c 3.641871,19.70838 9.749589,33.86396 15.1875,49.53125 8.133834,63.13058 61.21763,92.69161 75.21875,96.1875 20.51653,15.62812 42.36818,30.45672 71.9375,40.84375 27.87515,28.74946 58.07388,39.7064 88.4375,39.6875 0.44515,-2.8e-4 0.89853,0.005 1.34375,0 30.36363,0.0189 60.56235,-10.93804 88.4375,-39.6875 29.56932,-10.38703 51.42097,-25.21563 71.9375,-40.84375 14.00112,-3.49589 67.08492,-33.05692 75.21875,-96.1875 5.43791,-15.66729 11.54562,-29.82287 15.1875,-49.53125 55.75404,-62.96499 20.09961,-140.42896 -19.53125,-164.53125 L 513.75,317.5625 c 0.20067,-64.85234 -29.43807,-91.28546 -64,-111.375 10.45669,-2.79844 21.25552,-5.1014 24.21875,-18.4375 17.96834,-4.6698 21.72758,-13.11382 23.53125,-22.0625 4.69775,-3.18132 20.42834,-12.11119 18.78125,-27.46875 8.80668,-6.17164 13.71661,-14.0899 11.21875,-25.3125 9.46494,-10.48097 11.9555,-19.141487 7.9375,-27.125 C 546.79575,71.447226 541.76316,64.018955 536.90625,56.5 545.42178,40.831625 537.90665,24.030329 514.125,26.84375 504.6626,12.72793 484.0263,15.934135 480.84375,16 477.27279,11.469494 472.55636,7.587992 458.0625,9.46875 448.67084,0.96656132 438.17071,2.41745 427.34375,6.59375 414.48455,-3.5536631 405.97149,4.580454 396.25,7.65625 380.67615,2.568472 377.11698,9.5371578 369.46875,12.375 352.4935,8.7869238 347.33315,16.598532 339.1875,24.84375 l -9.46875,-0.1875 c -25.61054,15.093115 -38.33378,45.825501 -42.84375,61.625 -4.51206,-15.801979 -17.20647,-46.534542 -42.8125,-61.625 l -9.46875,0.1875 C 226.4481,16.598532 221.28775,8.7869235 204.3125,12.375 196.66427,9.5371583 193.1051,2.5684729 177.53125,7.65625 c -6.37973,-2.0184911 -12.24667,-6.2144276 -19.15625,-6 z" style="fill:#000000" />
<path d="m 107.39184,68.055583 c 67.94767,35.031357 107.44689,63.368967 129.08717,87.504467 -11.08235,44.41759 -68.89638,46.44464 -90.03559,45.19858 4.32842,-2.01474 7.93988,-4.42778 9.22051,-8.13574 -5.30449,-3.76981 -24.11289,-0.39719 -37.24363,-7.77416 5.04407,-1.04499 7.40348,-2.06302 9.76289,-5.78542 -12.40571,-3.9567 -25.76862,-7.36642 -33.627746,-13.92116 4.241253,0.0524 8.201156,0.9488 13.740366,-2.89271 -11.111694,-5.98819 -22.969108,-10.73351 -32.18139,-19.88738 5.745213,-0.14063 11.939452,-0.0568 13.740371,-2.16953 -10.17044,-6.30068 -18.751242,-13.30787 -25.853592,-20.97215 8.039979,0.97052 11.435284,0.13478 13.378782,-1.26556 -7.687795,-7.87419 -17.417559,-14.52319 -22.056911,-24.22644 5.969606,2.057484 11.431249,2.84506 15.36752,-0.180795 -2.612365,-5.893453 -13.805413,-9.369618 -20.248967,-23.141676 6.284359,0.609377 12.949606,1.371108 14.282753,0 C 61.802068,58.517346 56.796919,51.835885 51.887978,44.913906 65.338021,44.714177 85.715734,44.966253 84.792549,43.82914 l -8.31654,-8.497335 c 13.137617,-3.537241 26.580651,0.568164 36.339661,3.615887 4.38186,-3.457681 -0.0776,-7.82998 -5.42383,-12.294015 11.16496,1.490646 21.25382,4.057389 30.37345,7.593362 4.87238,-4.399329 -3.16389,-8.798658 -7.05098,-13.197987 17.24936,3.272568 24.55716,7.87068 31.81981,12.47481 5.26935,-5.050799 0.30166,-9.343299 -3.2543,-13.740371 13.00566,4.817048 19.70478,11.035551 26.75756,17.175463 2.39119,-3.227053 6.07494,-5.592408 1.62715,-13.378781 9.23416,5.322725 16.18926,11.59506 21.33374,18.621817 5.71336,-3.637941 3.40387,-8.613023 3.43509,-13.197987 9.59665,7.806516 15.68687,16.11395 23.14168,24.226443 1.50169,-1.093437 2.81661,-4.80171 3.97747,-10.666867 22.89539,22.211815 55.24591,78.158241 8.31654,100.340861 C 207.95028,109.95728 160.25292,86.016909 107.39184,68.055583 z" style="fill:#75a928" />
<path d="M 467.92487,68.055583 C 399.9772,103.08694 360.47798,131.42455 338.8377,155.56005 c 11.08235,44.41759 68.89638,46.44464 90.03559,45.19858 -4.32842,-2.01474 -7.93988,-4.42778 -9.22051,-8.13574 5.30449,-3.76981 24.11289,-0.39719 37.24363,-7.77416 -5.04407,-1.04499 -7.40348,-2.06302 -9.76289,-5.78542 12.40571,-3.9567 25.76862,-7.36642 33.62775,-13.92116 -4.24126,0.0524 -8.20116,0.9488 -13.74037,-2.89271 11.11169,-5.98819 22.96911,-10.73351 32.18139,-19.88738 -5.74521,-0.14063 -11.93945,-0.0568 -13.74037,-2.16953 10.17044,-6.30068 18.75124,-13.30787 25.85359,-20.97215 -8.03998,0.97052 -11.43528,0.13478 -13.37878,-1.26556 7.68779,-7.87419 17.41756,-14.52319 22.05691,-24.22644 -5.96961,2.057484 -11.43125,2.84506 -15.36752,-0.180795 2.61237,-5.893453 13.80541,-9.369618 20.24897,-23.141676 -6.28436,0.609377 -12.94961,1.371108 -14.28276,0 2.92231,-11.888563 7.92746,-18.570024 12.8364,-25.492003 -13.45004,-0.199729 -33.82775,0.05235 -32.90457,-1.084766 l 8.31654,-8.497335 c -13.13762,-3.537241 -26.58065,0.568164 -36.33966,3.615887 -4.38186,-3.457681 0.0776,-7.82998 5.42383,-12.294015 -11.16496,1.490646 -21.25382,4.057389 -30.37345,7.593362 -4.87238,-4.399329 3.16389,-8.798658 7.05098,-13.197987 -17.24936,3.272568 -24.55716,7.87068 -31.81981,12.47481 -5.26935,-5.050799 -0.30166,-9.343299 3.2543,-13.740371 -13.00566,4.817048 -19.70478,11.035551 -26.75756,17.175463 -2.39119,-3.227053 -6.07494,-5.592408 -1.62715,-13.378781 -9.23416,5.322725 -16.18926,11.59506 -21.33374,18.621817 -5.71336,-3.637941 -3.40387,-8.613023 -3.43509,-13.197987 -9.59665,7.806516 -15.68687,16.11395 -23.14168,24.226443 -1.50169,-1.093437 -2.81661,-4.80171 -3.97747,-10.666867 -22.89539,22.211815 -55.24591,78.158241 -8.31654,100.340861 39.91877,-32.94716 87.61613,-56.887531 140.47721,-74.848857 z" style="fill:#75a928" />
<path d="m 365.2046,521.84937 a 71.956154,66.532318 0 1 1 -143.91231,0 71.956154,66.532318 0 1 1 143.91231,0 z" transform="matrix(1.131107,0,0,1.1280497,-43.139135,-68.310983)" style="fill:#bc1142" />
<path d="m 262.84091,276.64774 a 61.875,28.125 0 1 1 -123.75,0 61.875,28.125 0 1 1 123.75,0 z" transform="matrix(0.76741684,-1.1613112,2.171115,1.4224368,-560.88858,217.68859)" style="fill:#bc1142" />
<path d="m 262.84091,276.64774 a 61.875,28.125 0 1 1 -123.75,0 61.875,28.125 0 1 1 123.75,0 z" transform="matrix(-0.76741684,-1.1613112,-2.171115,1.4224368,1134.8288,213.68859)" style="fill:#bc1142" />
<path d="M 72.910253,342.0878 C 109.32447,332.33088 85.201845,492.72431 55.576871,479.56357 22.990103,453.35089 12.493801,376.58814 72.910253,342.0878 z" style="fill:#bc1142" />
<path d="m 493.67828,340.0878 c -36.41422,-9.75692 -12.2916,150.63651 17.33338,137.47577 32.58677,-26.21268 43.08307,-102.97543 -17.33338,-137.47577 z" style="fill:#bc1142" />
<path d="m 369.97158,220.6534 c 62.83486,-10.61013 115.11594,26.72229 113.01138,94.85796 -2.06693,26.12112 -136.15872,-90.96907 -113.01138,-94.85796 z" style="fill:#bc1142" />
<path d="M 196.35975,218.6534 C 133.52489,208.04327 81.24381,245.37569 83.34837,313.51136 85.4153,339.63248 219.50709,222.54229 196.35975,218.6534 z" style="fill:#bc1142" />
<path d="m 286.61932,202.75568 c -37.50259,-0.97548 -73.49548,27.83418 -73.58158,44.54443 -0.10462,20.30426 29.6512,41.09266 73.83726,41.62035 45.12305,0.32321 73.91561,-16.64049 74.0611,-37.59409 0.16484,-23.73996 -41.03879,-48.93744 -74.31678,-48.57069 z" style="fill:#bc1142" />
<path d="m 288.90937,619.11675 c 32.69744,-1.42711 76.57083,10.53196 76.6568,26.39598 0.5427,15.4052 -39.78969,50.21055 -78.82634,49.53765 -40.42729,1.74391 -80.06908,-33.11559 -79.54951,-45.19859 -0.60506,-17.71593 49.226,-31.54796 81.71905,-30.73504 z" style="fill:#bc1142" />
<path d="m 168.13874,525.10369 c 23.2791,28.04573 33.89066,77.31899 14.46355,91.84353 -18.37917,11.08784 -63.01228,6.52162 -94.736237,-39.05157 -21.395052,-38.24168 -18.637584,-77.15663 -3.615887,-88.58924 22.464424,-13.68429 57.173424,4.79902 83.888574,35.79728 z" style="fill:#bc1142" />
<path d="m 405.0209,516.21177 c -25.18682,29.50165 -39.21227,83.30951 -20.83785,100.6428 17.56828,13.46361 64.7292,11.58162 99.56566,-36.75574 25.29599,-32.46471 16.82013,-86.68225 2.37077,-101.07511 -21.46408,-16.60213 -52.27691,4.64489 -81.09858,37.18805 z" style="fill:#bc1142" />
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="50mm" height="50mm" viewBox="0 0 141.73228 141.73228">
<defs>
<style>
.cls-1 {
fill: #46af4b;
}
.cls-2 {
fill: #cd2355;
}
</style>
</defs>
<g>
<path d="M120.397,80.45865c-.56815-5.90742-3.22385-11.16309-6.995-13.93267a17.27379,17.27379,0,0,0-3.24656-6.31353,19.36966,19.36966,0,0,0-6.892-13.02018,7.27722,7.27722,0,0,0,1.59572-1.944c4.57759-2.04455,7.80508-6.33776,8.1794-9.53072a12.5259,12.5259,0,0,0,3.95675-8.20484,7.846,7.846,0,0,0-.69989-3.69357,7.01847,7.01847,0,0,0,1.82922-7.2442c-1.36677-3.95887-6.15514-6.52856-12.58679-6.80113A10.13626,10.13626,0,0,0,98.52937,7.374a16.203,16.203,0,0,0-3.78352.46578,8.61261,8.61261,0,0,0-3.719-.75319,14.555,14.555,0,0,0-7.0952,1.934,6.5202,6.5202,0,0,0-.85646-.05542c-3.193-.0003-6.38471,2.19991-8.00284,3.51125a24.2642,24.2642,0,0,0-4.2063,4.38226,24.27017,24.27017,0,0,0-4.206-4.38195c-1.61814-1.31135-4.80988-3.51126-8.00254-3.51156a6.525,6.525,0,0,0-.85677.05542,14.55806,14.55806,0,0,0-7.09489-1.934,8.614,8.614,0,0,0-3.71931.75319A16.201,16.201,0,0,0,43.203,7.374a10.13676,10.13676,0,0,0-7.00858,2.39979c-6.432.27257-11.22033,2.84226-12.5871,6.80143a7.018,7.018,0,0,0,1.82922,7.2439A7.84794,7.84794,0,0,0,24.737,27.513a12.52529,12.52529,0,0,0,3.95675,8.20454c.37432,3.19326,3.60181,7.48617,8.1794,9.53072a7.27538,7.27538,0,0,0,1.59542,1.944,19.37028,19.37028,0,0,0-6.89168,13.02018A17.27118,17.27118,0,0,0,28.33031,66.526c-3.77111,2.76958-6.42681,8.02525-6.99495,13.93236-.56482,5.87168,1.046,11.35328,4.32471,14.82547a20.99222,20.99222,0,0,0,3.56516,8.18667,21.30368,21.30368,0,0,0,5.378,12.42629,22.01533,22.01533,0,0,0,11.859,7.04734,28.71359,28.71359,0,0,0,9.48469,5.87137A20.881,20.881,0,0,0,70.866,134.64567a20.8833,20.8833,0,0,0,14.91936-5.83019,28.72034,28.72034,0,0,0,9.48469-5.87137,22.01559,22.01559,0,0,0,11.85873-7.04734,21.3036,21.3036,0,0,0,5.378-12.426,20.98659,20.98659,0,0,0,3.56517-8.187C119.35068,91.81162,120.96155,86.33,120.397,80.45865Z"/>
<path class="cls-1" d="M82.88834,15.64565a.50715.50715,0,0,1,.64431.53875c-.16085,1.517.75688,1.32594.97375,1.05634,2.38917-2.97065,4.91974-3.64653,7.18552-3.447a.5073.5073,0,0,1,.347.81808c-.90026,1.33535.06917,1.58923.42806,1.34935,3.67706-2.299,7.18462-2.30316,8.53087-1.33751a.50652.50652,0,0,1,.03017.78741c-1.36075,1.15928-.599,1.73636-.11843,1.56042,3.73308-1.31743,8.88679-.15193,10.68462,1.36809a.511.511,0,0,1,.01278.77323,10.12618,10.12618,0,0,0-3.89825,6.80014c-.10141.89409,1.38228.706,2.00839.54492a.50694.50694,0,0,1,.63161.47341c.05646,2.14911-1.97606,4.51144-5.00017,6.53158-.405.27055-.34746.91972.57694.94363a.50088.50088,0,0,1,.43014.75445c-1.0784,2.00172-2.545,3.88636-7.54009,5.18055a.51181.51181,0,0,0-.07052.96565.48972.48972,0,0,1,.15941.86532c-4.97342,4.27273-17.58014,2.58829-19.18036-4.603a.50477.50477,0,0,1,.09069-.4114A47.92158,47.92158,0,0,1,100.721,21.25148a.3975.3975,0,0,0-.19687-.76539,34.186,34.186,0,0,0-22.704,13.68742.512.512,0,0,1-.65061.14752C69.08866,30.14885,75.72444,17.82948,82.88834,15.64565Z"/>
<path class="cls-1" d="M35.37668,35.161a.50084.50084,0,0,1,.43005-.75445c.92449-.02391.982-.67308.57694-.94363-3.02411-2.02014-5.05663-4.38247-5.00007-6.53158a.5069.5069,0,0,1,.6316-.47341c.626.16108,2.10971.34917,2.0083-.54492a10.126,10.126,0,0,0-3.89816-6.80014.51094.51094,0,0,1,.0127-.77323c1.79782-1.52,6.95154-2.68552,10.6847-1.36809.48048.17594,1.24223-.40114-.11843-1.56042a.50652.50652,0,0,1,.03008-.78741c1.34634-.96565,4.85381-.96146,8.53087,1.33751.3589.23988,1.32833-.014.42815-1.34935a.5073.5073,0,0,1,.34692-.81808c2.26588-.19954,4.79644.47634,7.18561,3.447.21678.2696,1.13461.46062.97375-1.05634a.50711.50711,0,0,1,.64422-.53875c7.164,2.18383,13.79977,14.5032,5.71877,18.67538a.512.512,0,0,1-.65061-.14752A34.18579,34.18579,0,0,0,41.20821,20.48609a.3975.3975,0,0,0-.19688.76539,47.92145,47.92145,0,0,1,20.90622,15.9066.50472.50472,0,0,1,.0906.4114c-1.60022,7.19128-14.20694,8.87572-19.18035,4.603a.48975.48975,0,0,1,.15941-.86532.51183.51183,0,0,0-.07043-.96565C37.92166,39.04731,36.455,37.16267,35.37668,35.161Z"/>
<path class="cls-2" d="M102.70391,57.14512c2.07215,5.51262.45788,8.1631-4.45781,5.35681a35.23186,35.23186,0,0,1-10.324-8.6538c-3.70264-4.39923-1.29618-6.3588,4.53643-5.30214A15.74307,15.74307,0,0,1,102.70391,57.14512Z"/>
<path class="cls-2" d="M80.656,50.9434c7.02971,5.84278-1.02445,9.97893-9.78984,9.97893s-16.81947-4.13615-9.78976-9.97893a15.62992,15.62992,0,0,1,19.5796,0Z"/>
<path class="cls-2" d="M39.02843,57.14512A15.74294,15.74294,0,0,1,49.27372,48.546c5.83261-1.05666,8.23916.90291,4.53644,5.30214a35.232,35.232,0,0,1-10.324,8.6538C38.57056,65.30822,36.95628,62.65774,39.02843,57.14512Z"/>
<path class="cls-2" d="M28.86006,87.77634a15.73764,15.73764,0,0,1,1.16828-13.39206c2.59721-4.419,5.21118-4.2431,6.24869-.49944a23.47909,23.47909,0,0,1-1.35309,15.47529C33.00057,93.18313,30.595,91.89119,28.86006,87.77634Z"/>
<path class="cls-2" d="M47.58848,116.39963A15.64491,15.64491,0,0,1,35.82,102.43657C36.79507,79.749,69.49268,120.26554,47.58848,116.39963Z"/>
<path class="cls-2" d="M48.254,88.14263c-5.48323-3.16572-6.9343-10.91794-3.24093-17.31507s11.13243-9.01664,16.61566-5.85087c5.48323,3.16572,6.9343,10.918,3.24094,17.31507S53.73709,91.3084,48.254,88.14263Z"/>
<path class="cls-2" d="M80.0159,125.05829a15.6584,15.6584,0,0,1-18.29955,0c-5.43318-3.75194.03278-8.06894,9.14978-8.06894S85.44917,121.30635,80.0159,125.05829Z"/>
<ellipse class="cls-2" cx="70.86613" cy="100.39562" rx="12.72753" ry="10.90937"/>
<path class="cls-2" d="M76.86255,82.29176c-3.69336-6.39709-2.24229-14.14935,3.24094-17.31507,5.48323-3.16577,12.9223-.54622,16.61567,5.85087s2.24229,14.14935-3.24094,17.31507C87.99516,91.3084,80.55592,88.68885,76.86255,82.29176Z"/>
<path class="cls-2" d="M94.14377,116.39963c-21.9042,3.86591,10.79341-36.65066,11.7686-13.96306A15.64488,15.64488,0,0,1,94.14377,116.39963Z"/>
<path class="cls-2" d="M112.87229,87.77634c-1.73505,4.11485-4.14061,5.40679-6.064,1.58379a23.47913,23.47913,0,0,1-1.353-15.47529c1.03742-3.74366,3.65139-3.9196,6.2486.49944A15.73769,15.73769,0,0,1,112.87229,87.77634Z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -1,30 +1,28 @@
# Raspberry Pi Pico SDK
The Raspberry Pi Pico SDK (Software Development Kit), henceforth SDK, provides the headers, libraries and build system necessary to write programs for the RP2040 based devices such as the Raspberry Pi Pico in C, C++ or assembly language. The SDK is designed to provide an API and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
The Raspberry Pi Pico SDK (Software Development Kit), henceforth SDK, provides the headers, libraries and build system necessary to write programs for RP2040-based devices such as the Raspberry Pi Pico in C, C++ or assembly language. The SDK is designed to provide an API (Application Programming Interface) and programming environment that is familiar both to non-embedded C developers and embedded C developers alike.
A single program runs on the device at a time with a conventional main() method. Standard C/C++ libraries are supported along with APIs for accessing the RP2040s hardware, including DMA, IRQs, and the wide variety fixed function peripherals and PIO (Programmable IO).
A single program runs on the device at a time with a conventional `main()` method. Standard C/C++ libraries are supported along with APIs for accessing the RP2040s hardware, including DMA, IRQs, and the wide variety of fixed-function peripherals and PIO (Programmable IO).
Additionally the SDK provides higher level libraries for dealing with timers, USB, synchronization and multi-core programming, along with additional high level functionality built using PIO such as audio. The SDK can be used to build anything from simple applications, full fledged runtime environments such as MicroPython, to low level software such as the RP2040s on chip bootrom itself.
Additionally the SDK provides higher-level libraries for dealing with timers, USB, synchronization and multi-core programming, along with additional high-level functionality built using PIO, such as audio. The SDK can be used to build anything from simple applications, or full-fledged runtime environments such as MicroPython, to low-level software such as the RP2040s on-chip bootrom itself.
This documentation is generated from the SDK source tree using Doxygen. It provides basic information on the APIs used for each library, but does not provide usage information. Please refer to the Databooks for usage and more technical information.
## SDK Design
The RP2040 is a powerful chip, however it is an embedded environment, so both RAM, and program space are at premium. Additionally the trade offs between performance and other factors (e.g. edge case error handling, runtime vs compile time configuration) are necessarily much more visible to the developer than they might be on other higher level platforms.
The RP2040 is a powerful chip, however it is an embedded environment, so both RAM and program space are at premium. Additionally the trade-offs between performance and other factors (e.g. edge-case error handling, runtime vs compile-time configuration) are necessarily much more visible to the developer than they might be on other higher-level platforms.
The intention within the SDK has been for features to just work out of the box, with sensible defaults, but also to give the developer as much control and power as possible (if they want it) to fine tune every aspect of the application they are building and the libraries used.
The intention within the SDK has been for features to just work out of the box, with sensible defaults, but also to give the developer as much control and power as possible (if they want it) to fine-tune every aspect of the application they are building and the libraries used.
## The Build System
The SDK uses CMake to manage the build. CMake is widely supported by IDEs (Integrated Development Environments), and allows a simple specification of the build (via CMakeLists.txt files), from which CMake can generate a build system (for use by `make`, `ninja` or other build tools) customized for the platform and by any configuration variables the developer chooses for a list of configuration variables).
The SDK uses CMake to manage the build. CMake is widely supported by IDEs (Integrated Development Environments), and allows a simple specification of the build (via `CMakeLists.txt` files), from which CMake can generate a build system (for use by `make`, `ninja` or other build tools) customized for the platform and by any configuration variables the developer chooses.
Apart from being a widely used build system for C/C++ development, CMake is fundamental to the way the SDK is structured, and how applications are configured and built.
Apart from being a widely-used build system for C/C++ development, CMake is fundamental to the way the SDK is structured, and how applications are configured and built.
The SDK builds an executable which is bare metal, i.e. it includes the entirety of the code needed to run on the device (other than floating point and other optimized code contained in the bootrom within the RP2040).
The SDK builds an executable which is bare-metal, i.e. it includes the entirety of the code needed to run on the device (other than floating-point and other optimized code contained in the bootrom within the RP2040).
## Examples
This SDK documentation contains a number of example code fragments. An index of these examples can be found [here](@ref examples_page). These examples, and any other source code included in this documentation, is Copyright &copy; 2020 Raspberry Pi (Trading) Ltd. and licensed under the [3-Clause BSD](https://opensource.org/licenses/BSD-3-Clause) license.

View File

@ -4,11 +4,12 @@ The full documentation for the RP2040 and Raspberry Pi Pico board can be found a
- [RP2040 Datasheet](https://rptl.io/rp2040-datasheet)
- [Raspberry Pi Pico Datasheet](https://rptl.io/pico-datasheet)
- [Hardware design with the RP2040](https://rptl.io/rp2040-design)
- [Raspberry Pi Pico W Datasheet](https://rptl.io/picow-datasheet)
- [Hardware design with RP2040](https://rptl.io/rp2040-design)
- [Raspberry Pi Pico C/C++ SDK](https://rptl.io/pico-c-sdk)
- [Raspberry Pi Pico Python SDK](https://rptl.io/pico-micropython)
- [Getting started with Raspberry Pi Pico](https://rptl.io/pico-get-started)
- [Raspberry Pi Pico FAQ](https://rptl.io/pico-faq)
- [Connecting to the Internet with Raspberry Pi Pico W](https://rptl.io/picow-connect)
### Weblinks

View File

@ -29,11 +29,22 @@ if (NOT PICO_SDK_PATH)
if (PICO_SDK_FETCH_FROM_GIT_PATH)
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
endif ()
FetchContent_Declare(
pico_sdk
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
GIT_TAG master
)
# GIT_SUBMODULES_RECURSE was added in 3.17
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0")
FetchContent_Declare(
pico_sdk
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
GIT_TAG master
GIT_SUBMODULES_RECURSE FALSE
)
else ()
FetchContent_Declare(
pico_sdk
GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk
GIT_TAG master
)
endif ()
if (NOT pico_sdk)
message("Downloading Raspberry Pi Pico SDK")
FetchContent_Populate(pico_sdk)

View File

@ -53,7 +53,6 @@ if (NOT TARGET _pico_sdk_pre_init_marker)
message(WARNING "pico_sdk_init() should be called after the project is created (and languages added)")
endif()
add_subdirectory(${PICO_SDK_PATH} pico-sdk)
pico_is_top_level_project(ISTOP)
endmacro()
macro(add_sub_list_dirs var)

View File

@ -1,18 +1,18 @@
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, group=pico_base
set(PICO_SDK_VERSION_MAJOR 1)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
set(PICO_SDK_VERSION_MINOR 3)
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, group=pico_base
set(PICO_SDK_VERSION_MINOR 5)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, group=pico_base
set(PICO_SDK_VERSION_REVISION 0)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, optional SDK pre-release version identifier, type=string, group=pico_base
#set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
# PICO_CONFIG: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_STRING, SDK version, type=string, group=pico_base
set(PICO_SDK_VERSION_STRING "${PICO_SDK_VERSION_MAJOR}.${PICO_SDK_VERSION_MINOR}.${PICO_SDK_VERSION_REVISION}")
if (PICO_SDK_VERSION_PRE_RELEASE_ID)

View File

@ -0,0 +1,88 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_ADAFRUIT_KB2040_H
#define _BOARDS_ADAFRUIT_KB2040_H
// For board detection
#define ADAFRUIT_KB2040
// On some samples, the xosc can take longer to stabilize than is usual
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif
//------------- UART -------------//
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
//------------- LED -------------//
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 17
#endif
//------------- I2C -------------//
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 12
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 13
#endif
//------------- SPI -------------//
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 20
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
//------------- FLASH -------------//
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -0,0 +1,187 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_ADAFRUIT_MACROPAD_RP2040_H
#define _BOARDS_ADAFRUIT_MACROPAD_RP2040_H
// For board detection
#define ADAFRUIT_MACROPAD_RP2040
// On some samples, the xosc can take longer to stabilize than is usual
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif
// --- BOARD SPECIFIC ---
#ifndef ADAFRUIT_MACROPAD_KEY1_PIN
#define ADAFRUIT_MACROPAD_KEY1_PIN 1
#endif
#ifndef ADAFRUIT_MACROPAD_KEY2_PIN
#define ADAFRUIT_MACROPAD_KEY2_PIN 2
#endif
#ifndef ADAFRUIT_MACROPAD_KEY3_PIN
#define ADAFRUIT_MACROPAD_KEY3_PIN 3
#endif
#ifndef ADAFRUIT_MACROPAD_KEY4_PIN
#define ADAFRUIT_MACROPAD_KEY4_PIN 4
#endif
#ifndef ADAFRUIT_MACROPAD_KEY5_PIN
#define ADAFRUIT_MACROPAD_KEY5_PIN 5
#endif
#ifndef ADAFRUIT_MACROPAD_KEY6_PIN
#define ADAFRUIT_MACROPAD_KEY6_PIN 6
#endif
#ifndef ADAFRUIT_MACROPAD_KEY7_PIN
#define ADAFRUIT_MACROPAD_KEY7_PIN 7
#endif
#ifndef ADAFRUIT_MACROPAD_KEY8_PIN
#define ADAFRUIT_MACROPAD_KEY8_PIN 8
#endif
#ifndef ADAFRUIT_MACROPAD_KEY9_PIN
#define ADAFRUIT_MACROPAD_KEY9_PIN 9
#endif
#ifndef ADAFRUIT_MACROPAD_KEY10_PIN
#define ADAFRUIT_MACROPAD_KEY10_PIN 10
#endif
#ifndef ADAFRUIT_MACROPAD_KEY11_PIN
#define ADAFRUIT_MACROPAD_KEY11_PIN 11
#endif
#ifndef ADAFRUIT_MACROPAD_KEY12_PIN
#define ADAFRUIT_MACROPAD_KEY12_PIN 12
#endif
#ifndef ADAFRUIT_MACROPAD_LED_PIN
#define ADAFRUIT_MACROPAD_LED_PIN 13
#endif
#ifndef ADAFRUIT_MACROPAD_SPEAKER_ENABLE_PIN
#define ADAFRUIT_MACROPAD_SPEAKER_ENABLE_PIN 14
#endif
#ifndef ADAFRUIT_MACROPAD_SPEAKER_PIN
#define ADAFRUIT_MACROPAD_SPEAKER_PIN 16
#endif
#ifndef ADAFRUIT_MACROPAD_BUTTON_PIN
#define ADAFRUIT_MACROPAD_BUTTON_PIN 0
#endif
#ifndef ADAFRUIT_MACROPAD_ROTA_PIN
#define ADAFRUIT_MACROPAD_ROTA_PIN 17
#endif
#ifndef ADAFRUIT_MACROPAD_ROTB_PIN
#define ADAFRUIT_MACROPAD_ROTB_PIN 18
#endif
#ifndef ADAFRUIT_MACROPAD_NEOPIXEL_PIN
#define ADAFRUIT_MACROPAD_NEOPIXEL_PIN 19
#endif
#ifndef ADAFRUIT_MACROPAD_DISPLAY_OLED_CS_PIN
#define ADAFRUIT_MACROPAD_DISPLAY_OLED_CS_PIN 22
#endif
#ifndef ADAFRUIT_MACROPAD_DISPLAY_OLED_RESET_PIN
#define ADAFRUIT_MACROPAD_DISPLAY_OLED_RESET_PIN 23
#endif
#ifndef ADAFRUIT_MACROPAD_DISPLAY_OLED_DC_PIN
#define ADAFRUIT_MACROPAD_DISPLAY_OLED_DC_PIN 24
#endif
#ifndef ADAFRUIT_MACROPAD_DISPLAY_SCK_PIN
#define ADAFRUIT_MACROPAD_DISPLAY_SCK_PIN 26
#endif
#ifndef ADAFRUIT_MACROPAD_DISPLAY_MOSI_PIN
#define ADAFRUIT_MACROPAD_DISPLAY_MOSI_PIN 27
#endif
#ifndef ADAFRUIT_MACROPAD_DISPLAY_MISO_PIN
#define ADAFRUIT_MACROPAD_DISPLAY_MISO_PIN 28
#endif
// no PICO_DEFAULT_UART
//------------- LED -------------//
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN ADAFRUIT_MACROPAD_LED_PIN
#endif
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN ADAFRUIT_MACROPAD_NEOPIXEL_PIN
#endif
//------------- I2C -------------//
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 20
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 21
#endif
//------------- SPI -------------//
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 27
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 28
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 26
#endif
//------------- FLASH -------------//
// Use slower generic flash access
#define PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 4
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
#define PICO_FLOAT_SUPPORT_ROM_V1 0
#endif
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
#endif
#endif

View File

@ -0,0 +1,60 @@
/*
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
//
//------------------------------------------------------------------------------------------
// Board definition for the DatanoiseTV RP2040 DSP Board
//
// This header may be included by other board headers as "boards/datanoisetv_rp2040_dsp.h"
#ifndef _BOARDS_DATANOISETV_RP2040_DSP_H
#define _BOARDS_DATANOISETV_RP2040_DSP_H
// For board detection
#define DATANOISETV_RP2040_DSP
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 24
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 25
#endif
// -- FLASH --
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
#endif
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
// --- I2S ---
#ifndef PICO_AUDIO_I2S_DATA_PIN
#define PICO_AUDIO_I2S_DATA_PIN 16
#endif
#ifndef PICO_AUDIO_I2S_CLOCK_PIN_BASE
#define PICO_AUDIO_I2S_CLOCK_PIN_BASE 17
#endif
#include "boards/pico.h"
#endif

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2021 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_EETREE_GAMEKIT_RP2040_H
#define _BOARDS_EETREE_GAMEKIT_RP2040_H
// For board detection
#define EETREE_GAMEKIT_RP2040
// --- UART ---
// no PICO_DEFAULT_UART
// no PICO_DEFAULT_UART_TX_PIN
// no PICO_DEFAULT_UART_RX_PIN
// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 4
#endif
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 10
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 11
#endif
// --- SPI ---
// no PICO_DEFAULT_SPI
// no PICO_DEFAULT_SPI_SCK_PIN
// no PICO_DEFAULT_SPI_TX_PIN
// no PICO_DEFAULT_SPI_RX_PIN
// no PICO_DEFAULT_SPI_CSN_PIN
// --- LCD ---
#ifndef EETREE_RP2040_LCD_SPI
#define EETREE_RP2040_LCD_SPI 0
#endif
#ifndef EETREE_RP2040_LCD_DC_PIN
#define EETREE_RP2040_LCD_DC_PIN 1
#endif
#ifndef EETREE_RP2040_LCD_SCLK_PIN
#define EETREE_RP2040_LCD_SCLK_PIN 2
#endif
#ifndef EETREE_RP2040_LCD_TX_PIN
#define EETREE_RP2040_LCD_TX_PIN 3
#endif
#ifndef EETREE_RP2040_LCD_RST_PIN
#define EETREE_RP2040_LCD_RST_PIN 0
#endif
// no EETREE_RP2040_LCD_CS_PIN
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif // _BOARDS_EETREE_GAMEKIT_RP2040_H

View File

@ -9,11 +9,11 @@
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_PYBSTICK26_RP2040_H
#define _BOARDS_PYBSTICK26_RP2040_H
#ifndef _BOARDS_GARATRONIC_PYBSTICK26_RP2040_H
#define _BOARDS_GARATRONIC_PYBSTICK26_RP2040_H
// For board detection
#define PYBSTICK26_RP2040
#define GARATRONIC_PYBSTICK26_RP2040
// --- UART ---
#ifndef PICO_DEFAULT_UART
@ -82,4 +82,4 @@
#endif
#endif
// of #define _BOARDS_PYBSTICK26_RP2040_H
// of #define _BOARDS_GARATRONIC_PYBSTICK26_RP2040_H

View File

@ -0,0 +1,110 @@
/*
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
//
//------------------------------------------------------------------------------------------
// Board definition for the nullbits Bit-C PRO
//
// This header may be included by other board headers as "boards/nullbits_bit_c_pro.h"
#ifndef _BOARDS_NULLBITS_BIT_C_PRO_H
#define _BOARDS_NULLBITS_BIT_C_PRO_H
// For board detection
#define NULLBITS_BIT_C_PRO
// On some samples, the xosc can take longer to stabilize than is usual
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif
// --- BOARD SPECIFIC ---
#define BIT_C_PRO_LED_R_PIN 16
#define BIT_C_PRO_LED_G_PIN 17
#define BIT_C_PRO_LED_B_PIN 18
//------------- UART -------------//
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// --- LED ---
// Set the default LED to the Bit-C PRO's B led
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN BIT_C_PRO_LED_B_PIN
#endif
#ifndef PICO_DEFAULT_LED_PIN_INVERTED
#define PICO_DEFAULT_LED_PIN_INVERTED 1
#endif
// no PICO_DEFAULT_WS2812_PIN
//------------- I2C -------------//
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 2
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 3
#endif
//------------- SPI -------------//
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 23
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 20
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 22
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 21
#endif
//------------- FLASH -------------//
// Best performance/compatibility with selected flash
#define PICO_BOOT_STAGE2_CHOOSE_W25X10CL 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
// Bit-C PRO has 4MB SPI flash
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
#endif
// All boards have B1+ RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -0,0 +1,102 @@
/*
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
// This header may be included by other board headers as "boards/pico.h"
#ifndef _BOARDS_PICO_W_H
#define _BOARDS_PICO_W_H
// For board detection
#define RASPBERRYPI_PICO_W
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN - LED is on Wireless chip
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// note the SMSP mode pin is on WL_GPIO1
// #define PICO_SMPS_MODE_PIN
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#ifndef PICO_RP2040_B1_SUPPORTED
#define PICO_RP2040_B1_SUPPORTED 0
#endif
#ifndef CYW43_PIN_WL_HOST_WAKE
#define CYW43_PIN_WL_HOST_WAKE 24
#endif
#ifndef CYW43_PIN_WL_REG_ON
#define CYW43_PIN_WL_REG_ON 23
#endif
#ifndef CYW43_WL_GPIO_COUNT
#define CYW43_WL_GPIO_COUNT 3
#endif
#ifndef CYW43_WL_GPIO_LED_PIN
#define CYW43_WL_GPIO_LED_PIN 0
#endif
#endif

View File

@ -0,0 +1,116 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_PIMORONI_BADGER2040_H
#define _BOARDS_PIMORONI_BADGER2040_H
// For board detection
#define PIMORONI_BADGER2040
// --- BOARD SPECIFIC ---
#define BADGER2040_UART 0
#define BADGER2040_TX_PIN 0
#define BADGER2040_RX_PIN 1
#define BADGER2040_I2C 0
#define BADGER2040_INT_PIN 3
#define BADGER2040_SDA_PIN 4
#define BADGER2040_SCL_PIN 5
#define BADGER2040_3V3_EN_PIN 10
#define BADGER2040_SW_DOWN_PIN 11
#define BADGER2040_SW_A_PIN 12
#define BADGER2040_SW_B_PIN 13
#define BADGER2040_SW_C_PIN 14
#define BADGER2040_SW_UP_PIN 15
#define BADGER2040_INKY_SPI 0
#define BADGER2040_INKY_MISO_PIN 16
#define BADGER2040_INKY_CSN_PIN 17
#define BADGER2040_INKY_SCK_PIN 18
#define BADGER2040_INKY_MOSI_PIN 19
#define BADGER2040_INKY_DC_PIN 20
#define BADGER2040_INKY_RESET_PIN 21
#define BADGER2040_INKY_BUSY_PIN 26
#define BADGER2040_USER_SW_PIN 23
#define BADGER2040_USER_LED_PIN 25
#define BADGER2040_VBUS_DETECT_PIN 24
#define BADGER2040_VREF_POWER_PIN 27
#define BADGER2040_1V2_REF_PIN 28
#define BADGER2040_BAT_SENSE_PIN 29
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART BADGER2040_UART
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN BADGER2040_TX_PIN
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN BADGER2040_RX_PIN
#endif
// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN BADGER2040_USER_LED_PIN
#endif
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C BADGER2040_I2C
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN BADGER2040_SDA_PIN
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN BADGER2040_SCL_PIN
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI BADGER2040_INKY_SPI
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN BADGER2040_INKY_SCK_PIN
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN BADGER2040_INKY_MOSI_PIN
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN BADGER2040_INKY_MISO_PIN
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN BADGER2040_INKY_CSN_PIN
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -16,117 +16,42 @@
#define PIMORONI_INTERSTATE75
// --- BOARD SPECIFIC ---
#ifndef INTERSTATE75_R0_PIN
#define INTERSTATE75_R0_PIN 0
#endif
#ifndef INTERSTATE75_G0_PIN
#define INTERSTATE75_G0_PIN 1
#endif
#ifndef INTERSTATE75_B0_PIN
#define INTERSTATE75_B0_PIN 2
#endif
#ifndef INTERSTATE75_R1_PIN
#define INTERSTATE75_R1_PIN 3
#endif
#ifndef INTERSTATE75_G1_PIN
#define INTERSTATE75_G1_PIN 4
#endif
#ifndef INTERSTATE75_B1_PIN
#define INTERSTATE75_B1_PIN 5
#endif
#ifndef INTERSTATE75_ROW_A_PIN
#define INTERSTATE75_ROW_A_PIN 6
#endif
#ifndef INTERSTATE75_ROW_B_PIN
#define INTERSTATE75_ROW_B_PIN 7
#endif
#ifndef INTERSTATE75_ROW_C_PIN
#define INTERSTATE75_ROW_C_PIN 8
#endif
#ifndef INTERSTATE75_ROW_D_PIN
#define INTERSTATE75_ROW_D_PIN 9
#endif
#ifndef INTERSTATE75_ROW_E_PIN
#define INTERSTATE75_ROW_E_PIN 10
#endif
#ifndef INTERSTATE75_CLK_PIN
#define INTERSTATE75_CLK_PIN 11
#endif
#ifndef INTERSTATE75_LAT_PIN
#define INTERSTATE75_LAT_PIN 12
#endif
#ifndef INTERSTATE75_OE_PIN
#define INTERSTATE75_OE_PIN 13
#endif
#ifndef INTERSTATE75_SW_A_PIN
#define INTERSTATE75_SW_A_PIN 14
#endif
#ifndef INTERSTATE75_LED_R_PIN
#define INTERSTATE75_LED_R_PIN 16
#endif
#ifndef INTERSTATE75_LED_G_PIN
#define INTERSTATE75_LED_G_PIN 17
#endif
#ifndef INTERSTATE75_LED_B_PIN
#define INTERSTATE75_LED_B_PIN 18
#endif
#ifndef INTERSTATE75_I2C
#define INTERSTATE75_I2C 0
#endif
#ifndef INTERSTATE75_INT_PIN
#define INTERSTATE75_INT_PIN 19
#endif
#ifndef INTERSTATE75_SDA_PIN
#define INTERSTATE75_SDA_PIN 20
#endif
#ifndef INTERSTATE75_SCL_PIN
#define INTERSTATE75_SCL_PIN 21
#endif
#ifndef INTERSTATE75_USER_SW_PIN
#define INTERSTATE75_USER_SW_PIN 23
#endif
#ifndef INTERSTATE75_A0_PIN
#define INTERSTATE75_A0_PIN 26
#endif
#ifndef INTERSTATE75_A1_PIN
#define INTERSTATE75_A1_PIN 27
#endif
#ifndef INTERSTATE75_A2_PIN
#define INTERSTATE75_A2_PIN 28
#endif
#ifndef INTERSTATE75_NUM_ADC_PINS
#define INTERSTATE75_NUM_ADC_PINS 3
#endif
#ifndef INTERSTATE75_CURRENT_SENSE_PIN
#define INTERSTATE75_CURRENT_SENSE_PIN 29
#endif
// --- UART ---
// no PICO_DEFAULT_UART

View File

@ -16,89 +16,30 @@
#define PIMORONI_KEYBOW2040
// --- BOARD SPECIFIC ---
#ifndef KEYBOW2040_I2C_SDA_PIN
#define KEYBOW2040_I2C_SDA_PIN 4
#endif
#ifndef KEYBOW2040_I2C_SCL_PIN
#define KEYBOW2040_I2C_SCL_PIN 5
#endif
#ifndef KEYBOW2040_I2C_INT_PIN
#define KEYBOW2040_I2C_INT_PIN 3
#endif
#ifndef KEYBOW2040_USER_SW_PIN
#define KEYBOW2040_USER_SW_PIN 23
#endif
#ifndef KEYBOW2040_SW0_PIN
#define KEYBOW2040_SW0_PIN 21
#endif
#ifndef KEYBOW2040_SW1_PIN
#define KEYBOW2040_SW1_PIN 20
#endif
#ifndef KEYBOW2040_SW2_PIN
#define KEYBOW2040_SW2_PIN 19
#endif
#ifndef KEYBOW2040_SW3_PIN
#define KEYBOW2040_SW3_PIN 18
#endif
#ifndef KEYBOW2040_SW4_PIN
#define KEYBOW2040_SW4_PIN 17
#endif
#ifndef KEYBOW2040_SW5_PIN
#define KEYBOW2040_SW5_PIN 16
#endif
#ifndef KEYBOW2040_SW6_PIN
#define KEYBOW2040_SW6_PIN 15
#endif
#ifndef KEYBOW2040_SW7_PIN
#define KEYBOW2040_SW7_PIN 14
#endif
#ifndef KEYBOW2040_SW8_PIN
#define KEYBOW2040_SW8_PIN 13
#endif
#ifndef KEYBOW2040_SW9_PIN
#define KEYBOW2040_SW9_PIN 12
#endif
#ifndef KEYBOW2040_SW10_PIN
#define KEYBOW2040_SW10_PIN 11
#endif
#ifndef KEYBOW2040_SW11_PIN
#define KEYBOW2040_SW11_PIN 10
#endif
#ifndef KEYBOW2040_SW12_PIN
#define KEYBOW2040_SW12_PIN 9
#endif
#ifndef KEYBOW2040_SW13_PIN
#define KEYBOW2040_SW13_PIN 8
#endif
#ifndef KEYBOW2040_SW14_PIN
#define KEYBOW2040_SW14_PIN 7
#endif
#ifndef KEYBOW2040_SW15_PIN
#define KEYBOW2040_SW15_PIN 6
#endif
#ifndef KEYBOW2040_NUM_SWITCHES_PINS
#define KEYBOW2040_NUM_SWITCHES_PINS 16
#endif
// --- UART ---
#ifndef PICO_DEFAULT_UART

View File

@ -0,0 +1,138 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_PIMORONI_MOTOR2040_H
#define _BOARDS_PIMORONI_MOTOR2040_H
// For board detection
#define PIMORONI_MOTOR2040
#ifndef MOTOR2040_USE_DISTANCE_SENSOR
// default to 0, if not explicitly set
#define MOTOR2040_USE_DISTANCE_SENSOR 0
#endif
// --- BOARD SPECIFIC ---
#define MOTOR2040_MOTOR_A_P_PIN 4
#define MOTOR2040_MOTOR_A_N_PIN 5
#define MOTOR2040_MOTOR_B_P_PIN 6
#define MOTOR2040_MOTOR_B_N_PIN 7
#define MOTOR2040_MOTOR_C_P_PIN 8
#define MOTOR2040_MOTOR_C_N_PIN 9
#define MOTOR2040_MOTOR_D_P_PIN 10
#define MOTOR2040_MOTOR_D_N_PIN 11
#define MOTOR2040_NUM_MOTORS 4
#define MOTOR2040_ENCODER_A_A_PIN 0
#define MOTOR2040_ENCODER_A_B_PIN 1
#define MOTOR2040_ENCODER_B_A_PIN 2
#define MOTOR2040_ENCODER_B_B_PIN 3
#define MOTOR2040_ENCODER_C_A_PIN 12
#define MOTOR2040_ENCODER_C_B_PIN 13
#define MOTOR2040_ENCODER_D_A_PIN 14
#define MOTOR2040_ENCODER_D_B_PIN 15
#define MOTOR2040_NUM_ENCODERS 4
#if MOTOR2040_USE_DISTANCE_SENSOR
#define MOTOR2040_TRIG_PIN 16
#define MOTOR2040_ECHO_PIN 17
#else
#define MOTOR2040_UART 0
#define MOTOR2040_TX_PIN 16
#define MOTOR2040_RX_PIN 17
#endif
#define MOTOR2040_LED_DATA_PIN 18
#define MOTOR2040_NUM_LEDS 1
#define MOTOR2040_I2C 0
#define MOTOR2040_INT_PIN 19
#define MOTOR2040_SDA_PIN 20
#define MOTOR2040_SCL_PIN 21
#define MOTOR2040_USER_SW_PIN 23
#define MOTOR2040_A0_PIN 26
#define MOTOR2040_A1_PIN 27
#define MOTOR2040_A2_PIN 28
#define MOTOR2040_NUM_ADC_PINS 3
#define MOTOR2040_SHARED_ADC_PIN 29
#define MOTOR2040_ADC_ADDR_0_PIN 22
#define MOTOR2040_ADC_ADDR_1_PIN 24
#define MOTOR2040_ADC_ADDR_2_PIN 25
#define MOTOR2040_CURRENT_SENSE_A_ADDR 0b000
#define MOTOR2040_CURRENT_SENSE_B_ADDR 0b001
#define MOTOR2040_CURRENT_SENSE_C_ADDR 0b010
#define MOTOR2040_CURRENT_SENSE_D_ADDR 0b011
#define MOTOR2040_VOLTAGE_SENSE_ADDR 0b100
#define MOTOR2040_FAULT_SENSE_ADDR 0b101
#define MOTOR2040_SENSOR_1_ADDR 0b110
#define MOTOR2040_SENSOR_2_ADDR 0b111
#define MOTOR2040_NUM_SENSORS 2
// --- UART ---
#if MOTOR2040_USE_DISTANCE_SENSOR
// no PICO_DEFAULT_UART
#else
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART MOTOR2040_UART
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN MOTOR2040_TX_PIN
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN MOTOR2040_RX_PIN
#endif
#endif
// --- LED ---
// no PICO_DEFAULT_LED_PIN
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN MOTOR2040_LED_DATA_PIN
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C MOTOR2040_I2C
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN MOTOR2040_SDA_PIN
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN MOTOR2040_SCL_PIN
#endif
// --- SPI ---
// no PICO_DEFAULT_SPI
// no PICO_DEFAULT_SPI_SCK_PIN
// no PICO_DEFAULT_SPI_TX_PIN
// no PICO_DEFAULT_SPI_RX_PIN
// no PICO_DEFAULT_SPI_CSN_PIN
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -16,17 +16,9 @@
#define PIMORONI_PICOLIPO_16MB
// --- BOARD SPECIFIC ---
#ifndef PICOLIPO_USER_SW_PIN
#define PICOLIPO_USER_SW_PIN 23
#endif
#ifndef PICOLIPO_VBUS_DETECT_PIN
#define PICOLIPO_VBUS_DETECT_PIN 24
#endif
#ifndef PICOLIPO_BAT_SENSE_PIN
#define PICOLIPO_BAT_SENSE_PIN 29
#endif
// --- UART ---
#ifndef PICO_DEFAULT_UART

View File

@ -16,17 +16,9 @@
#define PIMORONI_PICOLIPO_4MB
// --- BOARD SPECIFIC ---
#ifndef PICOLIPO_USER_SW_PIN
#define PICOLIPO_USER_SW_PIN 23
#endif
#ifndef PICOLIPO_VBUS_DETECT_PIN
#define PICOLIPO_VBUS_DETECT_PIN 24
#endif
#ifndef PICOLIPO_BAT_SENSE_PIN
#define PICOLIPO_BAT_SENSE_PIN 29
#endif
// --- UART ---
#ifndef PICO_DEFAULT_UART

View File

@ -16,97 +16,35 @@
#define PIMORONI_PICOSYSTEM
// --- BOARD SPECIFIC ---
#ifndef PICOSYSTEM_VBUS_DETECT_PIN
#define PICOSYSTEM_VBUS_DETECT_PIN 2
#endif
#ifndef PICOSYSTEM_LCD_SPI
#define PICOSYSTEM_LCD_SPI 0
#endif
#ifndef PICOSYSTEM_LCD_RESET_PIN
#define PICOSYSTEM_LCD_RESET_PIN 4
#endif
#ifndef PICOSYSTEM_LCD_CSN_PIN
#define PICOSYSTEM_LCD_CSN_PIN 5
#endif
#ifndef PICOSYSTEM_LCD_SCLK_PIN
#define PICOSYSTEM_LCD_SCLK_PIN 6
#endif
#ifndef PICOSYSTEM_LCD_MOSI_PIN
#define PICOSYSTEM_LCD_MOSI_PIN 7
#endif
#ifndef PICOSYSTEM_LCD_VSYNC_PIN
#define PICOSYSTEM_LCD_VSYNC_PIN 8
#endif
#ifndef PICOSYSTEM_LCD_DC_PIN
#define PICOSYSTEM_LCD_DC_PIN 9
#endif
#ifndef PICOSYSTEM_AUDIO_PIN
#define PICOSYSTEM_AUDIO_PIN 11
#endif
#ifndef PICOSYSTEM_BACKLIGHT_PIN
#define PICOSYSTEM_BACKLIGHT_PIN 12
#endif
#ifndef PICOSYSTEM_LED_G_PIN
#define PICOSYSTEM_LED_G_PIN 13
#endif
#ifndef PICOSYSTEM_LED_R_PIN
#define PICOSYSTEM_LED_R_PIN 14
#endif
#ifndef PICOSYSTEM_LED_B_PIN
#define PICOSYSTEM_LED_B_PIN 15
#endif
#ifndef PICOSYSTEM_SW_Y_PIN
#define PICOSYSTEM_SW_Y_PIN 16
#endif
#ifndef PICOSYSTEM_SW_X_PIN
#define PICOSYSTEM_SW_X_PIN 17
#endif
#ifndef PICOSYSTEM_SW_A_PIN
#define PICOSYSTEM_SW_A_PIN 18
#endif
#ifndef PICOSYSTEM_SW_B_PIN
#define PICOSYSTEM_SW_B_PIN 19
#endif
#ifndef PICOSYSTEM_SW_DOWN_PIN
#define PICOSYSTEM_SW_DOWN_PIN 20
#endif
#ifndef PICOSYSTEM_SW_RIGHT_PIN
#define PICOSYSTEM_SW_RIGHT_PIN 21
#endif
#ifndef PICOSYSTEM_SW_LEFT_PIN
#define PICOSYSTEM_SW_LEFT_PIN 22
#endif
#ifndef PICOSYSTEM_SW_UP_PIN
#define PICOSYSTEM_SW_UP_PIN 23
#endif
#ifndef PICOSYSTEM_CHARGE_STAT_PIN
#define PICOSYSTEM_CHARGE_STAT_PIN 24
#endif
#ifndef PICOSYSTEM_BAT_SENSE_PIN
#define PICOSYSTEM_BAT_SENSE_PIN 26
#endif
// --- UART ---
#ifndef PICO_DEFAULT_UART

View File

@ -16,73 +16,29 @@
#define PIMORONI_PLASMA2040
// --- BOARD SPECIFIC ---
#ifndef PLASMA2040_SW_A_PIN
#define PLASMA2040_SW_A_PIN 12
#endif
#ifndef PLASMA2040_SW_B_PIN
#define PLASMA2040_SW_B_PIN 13
#endif
#ifndef PLASMA2040_CLK_PIN
#define PLASMA2040_CLK_PIN 14
#endif
#ifndef PLASMA2040_DATA_PIN
#define PLASMA2040_DATA_PIN 15
#endif
#ifndef PLASMA2040_LED_R_PIN
#define PLASMA2040_LED_R_PIN 16
#endif
#ifndef PLASMA2040_LED_G_PIN
#define PLASMA2040_LED_G_PIN 17
#endif
#ifndef PLASMA2040_LED_B_PIN
#define PLASMA2040_LED_B_PIN 18
#endif
#ifndef PLASMA2040_I2C
#define PLASMA2040_I2C 0
#endif
#ifndef PLASMA2040_INT_PIN
#define PLASMA2040_INT_PIN 19
#endif
#ifndef PLASMA2040_SDA_PIN
#define PLASMA2040_SDA_PIN 20
#endif
#ifndef PLASMA2040_SCL_PIN
#define PLASMA2040_SCL_PIN 21
#endif
#ifndef PLASMA2040_USER_SW_PIN
#define PLASMA2040_USER_SW_PIN 23
#endif
#ifndef PLASMA2040_A0_PIN
#define PLASMA2040_A0_PIN 26
#endif
#ifndef PLASMA2040_A1_PIN
#define PLASMA2040_A1_PIN 27
#endif
#ifndef PLASMA2040_A2_PIN
#define PLASMA2040_A2_PIN 28
#endif
#ifndef PLASMA2040_NUM_ADC_PINS
#define PLASMA2040_NUM_ADC_PINS 3
#endif
#ifndef PLASMA2040_CURRENT_SENSE_PIN
#define PLASMA2040_CURRENT_SENSE_PIN 29
#endif
// --- UART ---
// no PICO_DEFAULT_UART

View File

@ -0,0 +1,114 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_PIMORONI_SERVO2040_H
#define _BOARDS_PIMORONI_SERVO2040_H
// For board detection
#define PIMORONI_SERVO2040
// --- BOARD SPECIFIC ---
#define SERVO2040_SERVO_1_PIN 0
#define SERVO2040_SERVO_2_PIN 1
#define SERVO2040_SERVO_3_PIN 2
#define SERVO2040_SERVO_4_PIN 3
#define SERVO2040_SERVO_5_PIN 4
#define SERVO2040_SERVO_6_PIN 5
#define SERVO2040_SERVO_7_PIN 6
#define SERVO2040_SERVO_8_PIN 7
#define SERVO2040_SERVO_9_PIN 8
#define SERVO2040_SERVO_10_PIN 9
#define SERVO2040_SERVO_11_PIN 10
#define SERVO2040_SERVO_12_PIN 11
#define SERVO2040_SERVO_13_PIN 12
#define SERVO2040_SERVO_14_PIN 13
#define SERVO2040_SERVO_15_PIN 14
#define SERVO2040_SERVO_16_PIN 15
#define SERVO2040_SERVO_17_PIN 16
#define SERVO2040_SERVO_18_PIN 17
#define SERVO2040_NUM_SERVOS 18
#define SERVO2040_LED_DATA_PIN 18
#define SERVO2040_NUM_LEDS 6
#define SERVO2040_I2C 0
#define SERVO2040_INT_PIN 19
#define SERVO2040_SDA_PIN 20
#define SERVO2040_SCL_PIN 21
#define SERVO2040_USER_SW_PIN 23
#define SERVO2040_A0_PIN 26
#define SERVO2040_A1_PIN 27
#define SERVO2040_A2_PIN 28
#define SERVO2040_NUM_ADC_PINS 3
#define SERVO2040_SHARED_ADC_PIN 29
#define SERVO2040_ADC_ADDR_0_PIN 22
#define SERVO2040_ADC_ADDR_1_PIN 24
#define SERVO2040_ADC_ADDR_2_PIN 25
#define SERVO2040_SENSOR_1_ADDR 0b000
#define SERVO2040_SENSOR_2_ADDR 0b001
#define SERVO2040_SENSOR_3_ADDR 0b010
#define SERVO2040_SENSOR_4_ADDR 0b011
#define SERVO2040_SENSOR_5_ADDR 0b100
#define SERVO2040_SENSOR_6_ADDR 0b101
#define SERVO2040_VOLTAGE_SENSE_ADDR 0b110
#define SERVO2040_CURRENT_SENSE_ADDR 0b111
#define SERVO2040_NUM_SENSORS 6
// --- UART ---
// no PICO_DEFAULT_UART
// no PICO_DEFAULT_UART_TX_PIN
// no PICO_DEFAULT_UART_RX_PIN
// --- LED ---
// no PICO_DEFAULT_LED_PIN
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN SERVO2040_LED_DATA_PIN
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C SERVO2040_I2C
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN SERVO2040_SDA_PIN
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN SERVO2040_SCL_PIN
#endif
// --- SPI ---
// no PICO_DEFAULT_SPI
// no PICO_DEFAULT_SPI_SCK_PIN
// no PICO_DEFAULT_SPI_TX_PIN
// no PICO_DEFAULT_SPI_RX_PIN
// no PICO_DEFAULT_SPI_CSN_PIN
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -14,47 +14,22 @@
// For board detection
#define PIMORONI_TINY2040
#define PIMORONI_TINY2040_8MB
// --- BOARD SPECIFIC ---
#ifndef TINY2040_LED_R_PIN
#define TINY2040_LED_R_PIN 18
#endif
#ifndef TINY2040_LED_G_PIN
#define TINY2040_LED_G_PIN 19
#endif
#ifndef TINY2040_LED_B_PIN
#define TINY2040_LED_B_PIN 20
#endif
#ifndef TINY2040_USER_SW_PIN
#define TINY2040_USER_SW_PIN 23
#endif
#ifndef TINY2040_A0_PIN
#define TINY2040_A0_PIN 26
#endif
#ifndef TINY2040_A1_PIN
#define TINY2040_A1_PIN 27
#endif
#ifndef TINY2040_A2_PIN
#define TINY2040_A2_PIN 28
#endif
#ifndef TINY2040_A3_PIN
#define TINY2040_A3_PIN 29
#endif
#ifndef TINY2040_NUM_IO_PINS
#define TINY2040_NUM_IO_PINS 8
#endif
#ifndef TINY2040_NUM_ADC_PINS
#define TINY2040_NUM_ADC_PINS 4
#endif
// --- UART ---
#ifndef PICO_DEFAULT_UART

View File

@ -0,0 +1,102 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_PIMORONI_TINY2040_2MB_H
#define _BOARDS_PIMORONI_TINY2040_2MB_H
// For board detection
#define PIMORONI_TINY2040
#define PIMORONI_TINY2040_2MB
// --- BOARD SPECIFIC ---
#define TINY2040_LED_R_PIN 18
#define TINY2040_LED_G_PIN 19
#define TINY2040_LED_B_PIN 20
#define TINY2040_USER_SW_PIN 23
#define TINY2040_A0_PIN 26
#define TINY2040_A1_PIN 27
#define TINY2040_A2_PIN 28
#define TINY2040_A3_PIN 29
#define TINY2040_NUM_IO_PINS 8
#define TINY2040_NUM_ADC_PINS 4
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// --- LED ---
// Included so basic examples will work, and set it to the green LED
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN TINY2040_LED_G_PIN
#endif
// no PICO_DEFAULT_WS2812_PIN
#ifndef PICO_DEFAULT_LED_PIN_INVERTED
#define PICO_DEFAULT_LED_PIN_INVERTED 1
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 2
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 3
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 6
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 7
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 4
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 5
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -0,0 +1,100 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_SEEED_XIAO_RP2040_H
#define _BOARDS_SEEED_XIAO_RP2040_H
// For board detection
#define SEEED_XIAO_RP2040
// On some samples, the xosc can take longer to stabilize than is usual
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif
//------------- UART -------------//
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
//------------- LED -------------//
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 25
#endif
#ifndef PICO_DEFAULT_LED_PIN_INVERTED
#define PICO_DEFAULT_LED_PIN_INVERTED 1
#endif
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 12
#endif
#ifndef PICO_DEFAULT_WS2812_POWER_PIN
#define PICO_DEFAULT_WS2812_POWER_PIN 11
#endif
//------------- I2C -------------//
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 6
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 7
#endif
//------------- SPI -------------//
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 3
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 4
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 2
#endif
//------------- FLASH -------------//
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -0,0 +1,83 @@
/*
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
//
//------------------------------------------------------------------------------------------
// Board definition for the Solder Party RP2040 Stamp
//
// This header may be included by other board headers as "boards/solderparty_rp2040_stamp.h"
#ifndef _BOARDS_SOLDERPARTY_RP2040_STAMP_H
#define _BOARDS_SOLDERPARTY_RP2040_STAMP_H
// For board detection
#define SOLDERPARTY_RP2040_STAMP
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// --- Neopixel ---
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 21
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif
// All production boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -0,0 +1,29 @@
/*
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
//
//------------------------------------------------------------------------------------------
// Board definition for the Solder Party RP2040 Stamp Carrier
//
// This header may be included by other board headers as "boards/solderparty_rp2040_stamp_carrier.h"
#ifndef _BOARDS_SOLDERPARTY_RP2040_STAMP_CARRIER_H
#define _BOARDS_SOLDERPARTY_RP2040_STAMP_CARRIER_H
// For board detection
#define SOLDERPARTY_RP2040_STAMP_CARRIER
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 20
#endif
#include "solderparty_rp2040_stamp.h"
#endif

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
//
//------------------------------------------------------------------------------------------
// Board definition for the Solder Party RP2040 Stamp Round Carrier
//
// This header may be included by other board headers as "boards/solderparty_rp2040_stamp_round_carrier.h"
#ifndef _BOARDS_SOLDERPARTY_RP2040_STAMP_ROUND_CARRIER_H
#define _BOARDS_SOLDERPARTY_RP2040_STAMP_ROUND_CARRIER_H
// For board detection
#define SOLDERPARTY_RP2040_STAMP_ROUND_CARRIER
// --- User LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 25
#endif
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 16
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 17
#endif
// --- Neopixel Ring ---
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 24
#endif
// --- On-Stamp Neopixel ---
#ifndef SOLDERPARTY_RP2040_STAMP_WS2812_PIN
#define SOLDERPARTY_RP2040_STAMP_WS2812_PIN 21
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 0
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 1
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 10
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 11
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 8
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 9
#endif
#include "solderparty_rp2040_stamp.h"
#endif

View File

@ -53,12 +53,25 @@
#define PICO_DEFAULT_UART_RX_PIN 21
#endif
#ifndef PICO_SCANVIDEO_COLOR_PIN_BASE
#define PICO_SCANVIDEO_COLOR_PIN_BASE VGABOARD_VGA_COLOR_PIN_BASE
#define PICO_SCANVIDEO_SYNC_PIN_BASE VGABOARD_VGA_SYNC_PIN_BASE
#endif
#ifndef PICO_SCANVIDEO_SYNC_PIN_BASE
#define PICO_SCANVIDEO_SYNC_PIN_BASE VGABOARD_VGA_SYNC_PIN_BASE
#endif
#ifndef PICO_SD_CLK_PIN
#define PICO_SD_CLK_PIN VGABOARD_SD_CLK_PIN
#endif
#ifndef PICO_SD_CMD_PIN
#define PICO_SD_CMD_PIN VGABOARD_SD_CMD_PIN
#endif
#ifndef PICO_SD_DAT0_PIN
#define PICO_SD_DAT0_PIN VGABOARD_SD_DAT0_PIN
#endif
// 1 or 4
#ifndef PICO_SD_DAT_PIN_COUNT
@ -66,13 +79,24 @@
#endif
// 1 or -1
#ifndef PICO_SD_DAT_PIN_INCREMENT
#define PICO_SD_DAT_PIN_INCREMENT 1
#endif
#ifndef PICO_AUDIO_I2S_DATA_PIN
#define PICO_AUDIO_I2S_DATA_PIN VGABOARD_I2S_DIN_PIN
#endif
#ifndef PICO_AUDIO_I2S_CLOCK_PIN_BASE
#define PICO_AUDIO_I2S_CLOCK_PIN_BASE VGABOARD_I2S_BCK_PIN
#endif
#ifndef PICO_AUDIO_PWM_L_PIN
#define PICO_AUDIO_PWM_L_PIN VGABOARD_PWM_L_PIN
#endif
#ifndef PICO_AUDIO_PWM_R_PIN
#define PICO_AUDIO_PWM_R_PIN VGABOARD_PWM_R_PIN
#endif
#define PICO_VGA_BOARD

View File

@ -31,13 +31,13 @@
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#define PICO_DEFAULT_I2C_SDA_PIN 6
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#define PICO_DEFAULT_I2C_SCL_PIN 7
#endif
// --- SPI ---

View File

@ -0,0 +1,104 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_WAVESHARE_RP2040_LCD_1_28_H
#define _BOARDS_WAVESHARE_RP2040_LCD_1_28_H
// For board detection
#define WAVESHARE_RP2040_LCD_1_28
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// no PICO_DEFAULT_WS2812_PIN
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 6
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 7
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
// --- LCD ---
#ifndef WAVESHARE_RP2040_LCD_SPI
#define WAVESHARE_RP2040_LCD_SPI 1
#endif
#ifndef WAVESHARE_RP2040_LCD_DC_PIN
#define WAVESHARE_RP2040_LCD_DC_PIN 8
#endif
#ifndef WAVESHARE_RP2040_LCD_CS_PIN
#define WAVESHARE_RP2040_LCD_CS_PIN 9
#endif
#ifndef WAVESHARE_RP2040_LCD_SCLK_PIN
#define WAVESHARE_RP2040_LCD_SCLK_PIN 10
#endif
#ifndef WAVESHARE_RP2040_LCD_TX_PIN
#define WAVESHARE_RP2040_LCD_TX_PIN 11
#endif
#ifndef WAVESHARE_RP2040_LCD_RST_PIN
#define WAVESHARE_RP2040_LCD_RST_PIN 12
#endif
#ifndef WAVESHARE_RP2040_LCD_BL_PIN
#define WAVESHARE_RP2040_LCD_BL_PIN 25
#endif
// --- ADC ---
#ifndef WAVESHARE_RP2040_BAT_ADC_PIN
#define WAVESHARE_RP2040_BAT_ADC_PIN 29
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_WAVESHARE_RP2040_ONE_H
#define _BOARDS_WAVESHARE_RP2040_ONE_H
// For board detection
#define WAVESHARE_RP2040_ONE
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// --- WS2812 ---
#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 16
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 1
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 6
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 7
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 1
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 10
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 11
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 12
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 13
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
#endif
// All boards have B1 RP2040
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -0,0 +1,103 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------
#ifndef _BOARDS_WIZNET_W5100S_EVB_PICO_H
#define _BOARDS_WIZNET_W5100S_EVB_PICO_H
// For board detection
#define WIZNET_W5100S_EVB_PICO
// --- BOARD SPECIFIC ---
#ifndef W5100S_EVB_PICO_INTN_PIN
#define W5100S_EVB_PICO_INTN_PIN 21
#endif
#ifndef W5100S_EVB_PICO_RSTN_PIN
#define W5100S_EVB_PICO_RSTN_PIN 20
#endif
#ifndef W5100S_EVB_PICO_A0_PIN
#define W5100S_EVB_PICO_A0_PIN 26
#endif
#ifndef W5100S_EVB_PICO_A1_PIN
#define W5100S_EVB_PICO_A1_PIN 27
#endif
#ifndef W5100S_EVB_PICO_A2_PIN
#define W5100S_EVB_PICO_A2_PIN 28
#endif
// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 25
#endif
// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif
// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif
// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif
// --- FLASH ---
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif
#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
#endif
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
#define PICO_SMPS_MODE_PIN 23
#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif
#endif

View File

@ -0,0 +1,3 @@
set(PICO_CYW43_SUPPORTED "1")
pico_register_common_scope_var(PICO_CYW43_SUPPORTED)
include(${CMAKE_CURRENT_LIST_DIR}/generic_board.cmake)

View File

@ -13,8 +13,8 @@ endmacro()
# PICO_CMAKE_CONFIG: PICO_CONFIG_HEADER_FILES, List of extra header files to include from pico/config.h for all platforms, type=list, default="", group=pico_base
add_header_content_from_var(PICO_CONFIG_HEADER_FILES)
# PICO_CMAKE_CONFIG: PICO_CONFIG_RP2040_HEADER_FILES, List of extra header files to include from pico/config.h for rp2040 platform, type=list, default="", group=pico_base
# PICO_CMAKE_CONFIG: PICO_CONFIG_HOST_HEADER_FILES, List of extra header files to include from pico/config.h for host platform, type=list, default="", group=pico_base
# PICO_CMAKE_CONFIG: PICO_RP2040_CONFIG_HEADER_FILES, List of extra header files to include from pico/config.h for rp2040 platform, type=list, default="", group=pico_base
# PICO_CMAKE_CONFIG: PICO_HOST_CONFIG_HEADER_FILES, List of extra header files to include from pico/config.h for host platform, type=list, default="", group=pico_base
add_header_content_from_var(PICO_${PICO_PLATFORM_UPPER}_CONFIG_HEADER_FILES)
file(GENERATE
@ -26,4 +26,4 @@ configure_file( ${CMAKE_CURRENT_LIST_DIR}/include/pico/version.h.in ${CMAKE_BINA
foreach(DIR IN LISTS PICO_INCLUDE_DIRS)
target_include_directories(pico_base_headers INTERFACE ${DIR})
endforeach()
endforeach()

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