This commit is contained in:
commit
357abd6cb0
|
@ -32,6 +32,7 @@ extern int Ps5308Pm1_0Init(void);
|
|||
extern int Ps5308Pm2_5Init(void);
|
||||
extern int Ps5308Pm10Init(void);
|
||||
extern int Zg09Co2Init(void);
|
||||
extern int G8sCo2Init(void);
|
||||
extern int As830Ch4Init(void);
|
||||
extern int Tb600bIaq10IaqInit(void);
|
||||
extern int Tb600bTvoc10TvocInit(void);
|
||||
|
@ -106,6 +107,10 @@ static struct InitDesc sensor_desc[] =
|
|||
{ "zg09_co2", Zg09Co2Init },
|
||||
#endif
|
||||
|
||||
#ifdef SENSOR_G8S
|
||||
{ "g8s_co2", G8sCo2Init },
|
||||
#endif
|
||||
|
||||
#ifdef SENSOR_QS_FX
|
||||
{ "qs_fx_wind_direction", QsFxWindDirectionInit },
|
||||
#endif
|
||||
|
|
|
@ -22,6 +22,11 @@ ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
|
|||
ifeq ($(CONFIG_APPLICATION_SENSOR_CO2_ZG09), y)
|
||||
CSRCS += co2_zg09.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_APPLICATION_SENSOR_CO2_G8S), y)
|
||||
CSRCS += co2_g8s.c
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308), y)
|
||||
CSRCS += pm1_0_ps5308.c
|
||||
|
|
|
@ -17,8 +17,10 @@
|
|||
* @author AIIT XUOS Lab
|
||||
* @date 2021.12.23
|
||||
*/
|
||||
|
||||
#include <user_api.h>
|
||||
//
|
||||
#ifdef ADD_XIZI_FETURES
|
||||
# include <user_api.h>
|
||||
#endif
|
||||
#include <sensor.h>
|
||||
|
||||
/**
|
||||
|
|
|
@ -64,6 +64,7 @@ config SENSOR_ZG09
|
|||
endif
|
||||
endif
|
||||
|
||||
|
||||
config SENSOR_G8S
|
||||
bool "Using g8-s"
|
||||
default n
|
||||
|
@ -99,7 +100,11 @@ config SENSOR_G8S
|
|||
endif
|
||||
|
||||
if ADD_NUTTX_FETURES
|
||||
|
||||
config SENSOR_DEVICE_G8S_DEV
|
||||
string "CO2 device name"
|
||||
default "/dev/ttyS3"
|
||||
---help---
|
||||
If USART1 is selected, then fill in /dev/ttyS1 here.
|
||||
endif
|
||||
|
||||
if ADD_RTTHREAD_FETURES
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
############################################################################
|
||||
# APP_Framework/Framework/sensor/co2/g8s/Make.defs
|
||||
############################################################################
|
||||
ifneq ($(CONFIG_SENSOR_G8S),)
|
||||
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/sensor/co2/g8s
|
||||
endif
|
|
@ -1,3 +1,13 @@
|
|||
SRC_FILES := g8s.c
|
||||
include $(KERNEL_ROOT)/.config
|
||||
|
||||
ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
|
||||
include $(APPDIR)/Make.defs
|
||||
CSRCS += g8s.c
|
||||
include $(APPDIR)/Application.mk
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
|
||||
SRC_FILES := g8s.c
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
endif
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
|
|
|
@ -37,6 +37,7 @@ static struct SensorProductInfo info =
|
|||
* @param sdev - sensor device pointer
|
||||
* @return success: 1 , failure: other
|
||||
*/
|
||||
#ifdef ADD_NUTTX_FETURES
|
||||
static int SensorDeviceOpen(struct SensorDevice *sdev)
|
||||
{
|
||||
int result = 0;
|
||||
|
@ -46,7 +47,20 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
|
|||
printf("open %s error\n", SENSOR_DEVICE_G8S_DEV);
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
static int SensorDeviceOpen(struct SensorDevice *sdev)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
sdev->fd = PrivOpen(SENSOR_DEVICE_G8S_DEV, O_RDWR);
|
||||
if (sdev->fd < 0) {
|
||||
printf("open %s error\n", SENSOR_DEVICE_G8S_DEV);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
struct SerialDataCfg cfg;
|
||||
cfg.serial_baud_rate = BAUD_RATE_9600;
|
||||
cfg.serial_data_bits = DATA_BITS_8;
|
||||
|
@ -67,7 +81,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
/**
|
||||
* @description: Read sensor device
|
||||
* @param sdev - sensor device pointer
|
||||
|
@ -76,10 +90,9 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
|
|||
*/
|
||||
static int SensorDeviceRead(struct SensorDevice *sdev, size_t len)
|
||||
{
|
||||
uint8_t tmp = 0;
|
||||
|
||||
PrivWrite(sdev->fd, g8s_read_instruction, sizeof(g8s_read_instruction));
|
||||
|
||||
PrivTaskDelay(500);
|
||||
if (PrivRead(sdev->fd, sdev->buffer, len) < 0)
|
||||
return -1;
|
||||
|
||||
|
@ -140,16 +153,26 @@ static int32_t QuantityRead(struct SensorQuantity *quant)
|
|||
result_ascii[i] = quant->sdev->buffer[i];
|
||||
}
|
||||
|
||||
if (8 == ascii_length) {
|
||||
for (i = 0; i < ascii_length; i ++) {
|
||||
result_hex[i] = result_ascii[i] - 0x30;
|
||||
result += result_hex[i] * pow(10, ascii_length - 1 - i);
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
if (ascii_length == 0){
|
||||
|
||||
printf("This reading is wrong\n");
|
||||
|
||||
result = SENSOR_QUANTITY_VALUE_ERROR;
|
||||
|
||||
return result;
|
||||
|
||||
}else{
|
||||
|
||||
for (i = 0; i < ascii_length; i ++) {
|
||||
|
||||
result_hex[i] = result_ascii[i] - 0x30;
|
||||
|
||||
result += result_hex[i] * pow(10, ascii_length - 1 - i);
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
if (quant->sdev->status == SENSOR_DEVICE_ACTIVE) {
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_DISABLE_LOSMART is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ADD_NUTTX_FETURES=y
|
||||
CONFIG_ARCH="risc-v"
|
||||
CONFIG_ARCH_BOARD="xidatong-riscv64"
|
||||
CONFIG_ARCH_BOARD_XIDATONG_RISCV64=y
|
||||
CONFIG_ARCH_CHIP="k210"
|
||||
CONFIG_ARCH_CHIP_K210=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_RISCV=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_BINFMT_DISABLE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=46000
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_EXAMPLES_HELLO=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=2048
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_INIT_STACKSIZE=3072
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LIBC_PERROR_STDOUT=y
|
||||
CONFIG_LIBC_STRERROR=y
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_DISABLE_IFUPDOWN=y
|
||||
CONFIG_NSH_DISABLE_MKDIR=y
|
||||
CONFIG_NSH_DISABLE_RM=y
|
||||
CONFIG_NSH_DISABLE_RMDIR=y
|
||||
CONFIG_NSH_DISABLE_UMOUNT=y
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_NSH_STRERROR=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=2097152
|
||||
CONFIG_RAM_START=0x80400000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_READLINE_CMD_HISTORY=y
|
||||
CONFIG_READLINE_CMD_HISTORY_LEN=100
|
||||
CONFIG_READLINE_CMD_HISTORY_LINELEN=120
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_STACK_COLORATION=y
|
||||
CONFIG_START_DAY=28
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2019
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TASK_NAME_SIZE=20
|
||||
CONFIG_TESTING_GETPRIME=y
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
CONFIG_READLINE_TABCOMPLETION=y
|
||||
CONFIG_SCHED_HPWORK=y
|
||||
CONFIG_DEV_GPIO=y
|
||||
CONFIG_BOARDCTL_RESET=y
|
||||
CONFIG_K210_HAVE_LCD=y
|
||||
CONFIG_K210_LCD=y
|
||||
CONFIG_K210_LCD_BACKLIGHT=y
|
||||
CONFIG_LCD=y
|
||||
CONFIG_LCD_LT768=y
|
|
@ -34,6 +34,10 @@ ifeq ($(CONFIG_ARCH_LEDS),y)
|
|||
CSRCS += k210_leds.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_K210_LCD),y)
|
||||
CSRCS += k210_lcd.c lcd_demo.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEV_GPIO),y)
|
||||
CSRCS += k210_gpio.c
|
||||
endif
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <nuttx/fs/fs.h>
|
||||
|
||||
#include "k210.h"
|
||||
#include "k210_clockconfig.h"
|
||||
#include "xidatong-riscv64.h"
|
||||
|
||||
#ifdef CONFIG_BSP_USING_CH438
|
||||
|
@ -75,5 +76,14 @@ int k210_bringup(void)
|
|||
board_ch438_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_K210_LCD
|
||||
k210_sysctl_init();
|
||||
ret = board_lcd_initialize();
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_NOTICE, "board lcd initialize %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,219 @@
|
|||
/*
|
||||
* Copyright (c) 2022 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file k210_lcd.c
|
||||
* @brief LCD relative driver
|
||||
* @version 1.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2022.7.21
|
||||
*/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include "k210_fpioa.h"
|
||||
#include "k210_gpiohs.h"
|
||||
#include "nuttx/arch.h"
|
||||
#include "nuttx/lcd/lt768.h"
|
||||
#include "nuttx/lcd/lt768_lib.h"
|
||||
#include "nuttx/lcd/k210_lcd.h"
|
||||
#ifdef CONFIG_LCD_LCDDRV_SPIIF
|
||||
#include "nuttx/lcd/lcddrv_spiif.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void test_delay(void)
|
||||
{
|
||||
volatile uint32_t i = 0;
|
||||
for (i = 0; i < 200; ++i)
|
||||
{
|
||||
__asm("NOP"); /* delay */
|
||||
}
|
||||
}
|
||||
|
||||
void lcd_pin_init(void)
|
||||
{
|
||||
k210_fpioa_config(BSP_LCD_NRST, HS_GPIO(FPIOA_LCD_NRST) | K210_IOFLAG_GPIOHS);
|
||||
k210_fpioa_config(BSP_LCD_SCLK, HS_GPIO(FPIOA_LCD_SCLK) | K210_IOFLAG_GPIOHS);
|
||||
k210_fpioa_config(BSP_LCD_MOSI, HS_GPIO(FPIOA_LCD_MOSI) | K210_IOFLAG_GPIOHS);
|
||||
k210_fpioa_config(BSP_LCD_MISO, HS_GPIO(FPIOA_LCD_MISO) | K210_IOFLAG_GPIOHS);
|
||||
k210_fpioa_config(BSP_LCD_NCS, HS_GPIO(FPIOA_LCD_NCS) | K210_IOFLAG_GPIOHS);
|
||||
|
||||
k210_gpiohs_set_direction(FPIOA_LCD_MISO, GPIO_DM_INPUT);
|
||||
k210_gpiohs_set_direction(FPIOA_LCD_NRST, GPIO_DM_OUTPUT);
|
||||
k210_gpiohs_set_direction(FPIOA_LCD_SCLK, GPIO_DM_OUTPUT);
|
||||
k210_gpiohs_set_direction(FPIOA_LCD_MOSI, GPIO_DM_OUTPUT);
|
||||
k210_gpiohs_set_direction(FPIOA_LCD_NCS, GPIO_DM_OUTPUT);
|
||||
|
||||
lcd_set_pin(FPIOA_LCD_SCLK, GPIO_PV_HIGH);
|
||||
lcd_set_pin(FPIOA_LCD_NCS, GPIO_PV_HIGH);
|
||||
lcd_set_pin(FPIOA_LCD_NRST, GPIO_PV_HIGH);
|
||||
}
|
||||
|
||||
void lcd_backlight_init(bool enable)
|
||||
{
|
||||
k210_fpioa_config(BSP_LCD_BL_PIN, HS_GPIO(FPIOA_LCD_BL) | K210_IOFLAG_GPIOHS);
|
||||
k210_gpiohs_set_direction(FPIOA_LCD_BL, GPIO_DM_OUTPUT);
|
||||
k210_gpiohs_set_value(FPIOA_LCD_BL, enable);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LCD_LCDDRV_SPIIF
|
||||
int spiif_backlight(FAR struct lcddrv_lcd_s *lcd, int level)
|
||||
{
|
||||
lcd_backlight_init(true);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t lcd_transfer_byte(uint8_t dat)
|
||||
{
|
||||
uint8_t i, rx_data = 0;
|
||||
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
CLK_H;
|
||||
|
||||
// MOSI during falling edge
|
||||
if((dat << i) & 0x80)
|
||||
{
|
||||
MOSI_H;
|
||||
}
|
||||
else
|
||||
{
|
||||
MOSI_L;
|
||||
}
|
||||
|
||||
CLK_L;
|
||||
|
||||
// MISO during rising edge
|
||||
rx_data <<= 1;
|
||||
if(lcd_get_pin(FPIOA_LCD_MISO))
|
||||
rx_data ++;
|
||||
}
|
||||
CLK_H;
|
||||
return rx_data;
|
||||
}
|
||||
|
||||
void LCD_CmdWrite(uint8_t cmd)
|
||||
{
|
||||
NCS_L;
|
||||
lcd_transfer_byte(0x00);
|
||||
lcd_transfer_byte(cmd);
|
||||
NCS_H;
|
||||
}
|
||||
|
||||
void LCD_DataWrite(uint8_t data)
|
||||
{
|
||||
NCS_L;
|
||||
lcd_transfer_byte(0x80);
|
||||
lcd_transfer_byte(data);
|
||||
NCS_H;
|
||||
}
|
||||
|
||||
void LCD_DataWrite_Pixel(uint8_t data)
|
||||
{
|
||||
NCS_L;
|
||||
lcd_transfer_byte(0x80);
|
||||
lcd_transfer_byte(data);
|
||||
NCS_H;
|
||||
NCS_L;
|
||||
lcd_transfer_byte(0x80);
|
||||
lcd_transfer_byte(data >> 8);
|
||||
NCS_H;
|
||||
}
|
||||
|
||||
uint8_t LCD_StatusRead(void)
|
||||
{
|
||||
uint8_t temp = 0;
|
||||
NCS_L;
|
||||
lcd_transfer_byte(0x40);
|
||||
temp = lcd_transfer_byte(0xff);
|
||||
NCS_H;
|
||||
return temp;
|
||||
}
|
||||
|
||||
uint8_t LCD_DataRead(void)
|
||||
{
|
||||
uint8_t temp = 0;
|
||||
NCS_L;
|
||||
lcd_transfer_byte(0xc0);
|
||||
temp = lcd_transfer_byte(0xff);
|
||||
NCS_H;
|
||||
return temp;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void lcd_drv_init(void)
|
||||
{
|
||||
uint8_t PwmControl = 100;
|
||||
|
||||
lcd_pin_init();
|
||||
lt768_init();
|
||||
Select_SFI_Dual_Mode0();
|
||||
|
||||
// PWM1 enable backlight
|
||||
LT768_PWM1_Init(1, 0, 200, 100, PwmControl);
|
||||
|
||||
// enable RGB output
|
||||
Display_ON();
|
||||
|
||||
Main_Image_Start_Address(LCD_START_ADDR);
|
||||
Main_Image_Width(LCD_XSIZE_TFT);
|
||||
Main_Window_Start_XY(0, 0);
|
||||
Canvas_Image_Start_address(LCD_START_ADDR);
|
||||
Canvas_image_width(LCD_XSIZE_TFT);
|
||||
Active_Window_XY(0, 0);
|
||||
Active_Window_WH(LCD_XSIZE_TFT, LCD_YSIZE_TFT);
|
||||
up_mdelay(10);
|
||||
Canvas_Image_Start_address(LCD_START_ADDR);
|
||||
|
||||
//fill blue background
|
||||
LT768_DrawSquare_Fill(0, 0, LCD_XSIZE_TFT, LCD_YSIZE_TFT, Blue);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: k210_lcd_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the LCD. Setup backlight (initially off)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_lcd_initialize(void)
|
||||
{
|
||||
/* Configure the LCD backlight (and turn the backlight off) */
|
||||
lcd_backlight_init(true);
|
||||
lcd_drv_init();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: k210_backlight
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_K210_LCD_BACKLIGHT is defined, then the board-specific
|
||||
* logic must provide this interface to turn the backlight on and off.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_K210_LCD_BACKLIGHT
|
||||
void k210_backlight(bool blon)
|
||||
{
|
||||
lcd_backlight_init(blon);
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,64 @@
|
|||
/****************************************************************************
|
||||
* lcd_demo.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file lcd_demo.c
|
||||
* @brief
|
||||
* @version 1.0.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2022-07-21
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include "nuttx/arch.h"
|
||||
#include "nuttx/lcd/lt768.h"
|
||||
#include "nuttx/lcd/lt768_lib.h"
|
||||
#include "nuttx/lcd/k210_lcd.h"
|
||||
|
||||
void LcdDemo(void)
|
||||
{
|
||||
// int x1 = 0, y1 = 0, x2 = LCD_XSIZE_TFT, y2 = LCD_YSIZE_TFT;
|
||||
int x1 = 100, y1 = 100, x2 = 200, y2 = 200;
|
||||
|
||||
Main_Image_Start_Address(LCD_START_ADDR);
|
||||
Main_Image_Width(LCD_XSIZE_TFT);
|
||||
Main_Window_Start_XY(0, 0);
|
||||
Canvas_Image_Start_address(LCD_START_ADDR);
|
||||
Canvas_image_width(LCD_XSIZE_TFT);
|
||||
Active_Window_XY(0, 0);
|
||||
Active_Window_WH(LCD_XSIZE_TFT, LCD_YSIZE_TFT);
|
||||
up_mdelay(10);
|
||||
Canvas_Image_Start_address(LCD_START_ADDR);
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
syslog(LOG_NOTICE, "Disp_demo %d\n", i);
|
||||
LT768_DrawSquare_Fill(x1, y1, x2, y2, Red);
|
||||
up_mdelay(2000);
|
||||
LT768_DrawSquare_Fill(x1, y1, x2, y2, Green);
|
||||
up_mdelay(2000);
|
||||
LT768_DrawSquare_Fill(x1, y1, x2, y2, Blue);
|
||||
up_mdelay(2000);
|
||||
}
|
||||
}
|
||||
|
|
@ -571,6 +571,10 @@ config NSH_DISABLE_CO2ZG09
|
|||
bool "Disable the sensor zg09."
|
||||
default n
|
||||
|
||||
config NSH_DISABLE_CO2G8S
|
||||
bool "Disable the sensor g8-s."
|
||||
default n
|
||||
|
||||
config NSH_DISABLE_PM1_0PS5308
|
||||
bool "Disable the pm1.0 function of the sensor ps5308."
|
||||
default n
|
||||
|
|
|
@ -1454,6 +1454,10 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
|
|||
int cmd_Ch438(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_K210_LCD) && !defined(CONFIG_NSH_DISABLE_LCD)
|
||||
int cmd_Lcd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS) && !defined(CONFIG_NSH_DISABLE_HCHO_TB600B_WQ_HCHO1OS)
|
||||
int cmd_Hcho1os(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
@ -1474,6 +1478,10 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
|
|||
int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
|
||||
int cmd_Co2G8S(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
|
||||
int cmd_Pm10Ps5308(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
|
|
@ -49,6 +49,19 @@ int cmd_Ch438(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_lcd
|
||||
****************************************************************************/
|
||||
#if defined(CONFIG_K210_LCD) && !defined(CONFIG_NSH_DISABLE_LCD)
|
||||
extern void LcdDemo(void);
|
||||
int cmd_Lcd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
nsh_output(vtbl, "Hello, LCD!\n");
|
||||
LcdDemo();
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_Hcho1os
|
||||
****************************************************************************/
|
||||
|
@ -125,6 +138,21 @@ int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_Co2g8s
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
|
||||
extern void Co2G8s(void);
|
||||
int cmd_Co2G8S(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
nsh_output(vtbl, "Hello, world!\n");
|
||||
FrameworkInit();
|
||||
Co2G8s();
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_Pm10Ps5308
|
||||
****************************************************************************/
|
||||
|
|
|
@ -600,6 +600,10 @@ static const struct cmdmap_s g_cmdmap[] =
|
|||
{ "ch438", cmd_Ch438, 1, 1, "[ch438 demo cmd.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_K210_LCD) && !defined(CONFIG_NSH_DISABLE_LCD)
|
||||
{ "lcd", cmd_Lcd, 1, 1, "[LCD demo cmd.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS) && !defined(CONFIG_NSH_DISABLE_HCHO_TB600B_WQ_HCHO1OS)
|
||||
{ "hcho1os", cmd_Hcho1os, 1, 1, "[get the concentration of formaldehyde with sensor tb600b_wq_hcho1os.]" },
|
||||
#endif
|
||||
|
@ -620,6 +624,10 @@ static const struct cmdmap_s g_cmdmap[] =
|
|||
{ "zg09", cmd_Co2Zg09, 1, 1, "[get the concentration of co2 with sensor ZG09.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
|
||||
{ "g8s", cmd_Co2G8S, 1, 1, "[get the concentration of co2 with sensor G8S.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
|
||||
{ "pm1.0", cmd_Pm10Ps5308, 1, 1, "[get pm1.0 with sensor Ps5308.]" },
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
comment "K210 Configuration Options"
|
||||
|
||||
menu "K210 Peripheral Support"
|
||||
|
||||
# These "hidden" settings determine whether a peripheral option is available
|
||||
# for the selected MCU
|
||||
|
||||
config K210_HAVE_UART0
|
||||
bool
|
||||
default y
|
||||
select UART0_SERIALDRIVER
|
||||
select ARCH_HAVE_SERIAL_TERMIOS
|
||||
|
||||
# These are the peripheral selections proper
|
||||
|
||||
config K210_UART0
|
||||
bool "UART0"
|
||||
default y
|
||||
select ARCH_HAVE_UART0
|
||||
select ARCH_HAVE_SERIAL_TERMIOS
|
||||
select K210_UART
|
||||
|
||||
config K210_HAVE_LCD
|
||||
bool
|
||||
default n
|
||||
|
||||
config K210_LCD
|
||||
bool "LCD"
|
||||
default n
|
||||
select K210_HAVE_LCD
|
||||
|
||||
config K210_LCD_BACKLIGHT
|
||||
bool "LCD BACKLIGHT"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
|
||||
menu "K210 Others"
|
||||
|
||||
config K210_WITH_QEMU
|
||||
bool "qemu support"
|
||||
default n
|
||||
|
||||
endmenu
|
|
@ -57,6 +57,7 @@ CHIP_CSRCS = k210_allocateheap.c k210_clockconfig.c
|
|||
CHIP_CSRCS += k210_irq.c k210_irq_dispatch.c k210_systemreset.c
|
||||
CHIP_CSRCS += k210_lowputc.c k210_serial.c k210_fpioa.c
|
||||
CHIP_CSRCS += k210_start.c k210_timerisr.c k210_gpiohs.c k210_gpio.c
|
||||
CHIP_CSRCS += k210_sysctl.c
|
||||
|
||||
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||
CMN_CSRCS += riscv_task_start.c riscv_pthread_start.c
|
||||
|
|
1329
Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/encoding.h
Executable file
1329
Ubiquitous/Nuttx_Fusion_XiUOS/app_match_nuttx/nuttx/arch/risc-v/src/k210/encoding.h
Executable file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,153 @@
|
|||
/****************************************************************************
|
||||
* arch/risc-v/src/k210/k210_clockconfig.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "riscv_internal.h"
|
||||
#include "k210_clockconfig.h"
|
||||
#include "k210_sysctl.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define OSC_FREQ 26000000UL
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t g_cpu_clock = 390000000;//416000000;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: k210_get_cpuclk
|
||||
****************************************************************************/
|
||||
|
||||
uint32_t k210_get_cpuclk(void)
|
||||
{
|
||||
return g_cpu_clock;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: k210_get_pll0clk
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_K210_WITH_QEMU
|
||||
uint32_t k210_get_pll0clk(void)
|
||||
{
|
||||
uint32_t pll0;
|
||||
uint32_t nr;
|
||||
uint32_t nf;
|
||||
uint32_t od;
|
||||
|
||||
pll0 = getreg32(K210_SYSCTL_PLL0);
|
||||
nr = PLL_CLK_R(pll0) + 1;
|
||||
nf = PLL_CLK_F(pll0) + 1;
|
||||
od = PLL_CLK_OD(pll0) + 1;
|
||||
|
||||
return OSC_FREQ / nr * nf / od;
|
||||
}
|
||||
|
||||
uint32_t k210_get_pll1clk(void)
|
||||
{
|
||||
uint32_t pll1;
|
||||
uint32_t nr;
|
||||
uint32_t nf;
|
||||
uint32_t od;
|
||||
|
||||
pll1 = getreg32(K210_SYSCTL_PLL1);
|
||||
nr = PLL_CLK_R(pll1) + 1;
|
||||
nf = PLL_CLK_F(pll1) + 1;
|
||||
od = PLL_CLK_OD(pll1) + 1;
|
||||
|
||||
return OSC_FREQ / nr * nf / od;
|
||||
}
|
||||
|
||||
uint32_t k210_get_pll2clk(void)
|
||||
{
|
||||
uint32_t pll2;
|
||||
uint32_t nr;
|
||||
uint32_t nf;
|
||||
uint32_t od;
|
||||
|
||||
pll2 = getreg32(K210_SYSCTL_PLL2);
|
||||
nr = PLL_CLK_R(pll2) + 1;
|
||||
nf = PLL_CLK_F(pll2) + 1;
|
||||
od = PLL_CLK_OD(pll2) + 1;
|
||||
|
||||
return OSC_FREQ / nr * nf / od;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: k210_clockconfig
|
||||
****************************************************************************/
|
||||
|
||||
void k210_clockconfig(void)
|
||||
{
|
||||
#ifndef CONFIG_K210_WITH_QEMU
|
||||
uint32_t clksel0;
|
||||
|
||||
/* Obtain clock selector for ACLK */
|
||||
clksel0 = getreg32(K210_SYSCTL_CLKSEL0);
|
||||
|
||||
if (1 == CLKSEL0_ACLK_SEL(clksel0))
|
||||
{
|
||||
/* PLL0 selected */
|
||||
g_cpu_clock = k210_get_pll0clk() / 2;
|
||||
|
||||
syslog(LOG_NOTICE, "g_cpu clock = %d sel %#x\r\n", g_cpu_clock, clksel0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* OSC selected */
|
||||
|
||||
g_cpu_clock = OSC_FREQ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void k210_sysctl_init(void)
|
||||
{
|
||||
// sysctl_pll_set_freq(SYSCTL_PLL0, 800000000UL);
|
||||
// sysctl_pll_set_freq(SYSCTL_PLL1, 400000000UL);
|
||||
// sysctl_pll_set_freq(SYSCTL_PLL2, 45158400UL);
|
||||
sysctl_clock_set_threshold(SYSCTL_THRESHOLD_APB1, 2);
|
||||
|
||||
// sysctl_set_power_mode(SYSCTL_POWER_BANK0, SYSCTL_POWER_V18);
|
||||
// sysctl_set_power_mode(SYSCTL_POWER_BANK1, SYSCTL_POWER_V18);
|
||||
// sysctl_set_power_mode(SYSCTL_POWER_BANK2, SYSCTL_POWER_V18);
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
/****************************************************************************
|
||||
* arch/risc-v/src/k210/k210_clockconfig.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_RISCV_SRC_K210_K210_CLOCKCONFIG_H
|
||||
#define __ARCH_RISCV_SRC_K210_K210_CLOCKCONFIG_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include "k210_memorymap.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
EXTERN uint32_t k210_get_cpuclk(void);
|
||||
EXTERN uint32_t k210_get_pll0clk(void);
|
||||
EXTERN void k210_clockconfig(void);
|
||||
EXTERN void k210_sysctl_init(void);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#undef EXTERN
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_RISCV_SRC_K210_K210_CLOCKCONFIG_H */
|
|
@ -38,6 +38,8 @@
|
|||
#include <stdbool.h>
|
||||
#include "k210_gpio_common.h"
|
||||
|
||||
#define HS_GPIO(n) (K210_IO_FUNC_GPIOHS0 + n)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
/****************************************************************************
|
||||
* arch/risc-v/src/k210/k210_memorymap.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_RISCV_SRC_K210_K210_MEMORYMAP_H
|
||||
#define __ARCH_RISCV_SRC_K210_K210_MEMORYMAP_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include "riscv_internal.h"
|
||||
#include "hardware/k210_memorymap.h"
|
||||
#include "hardware/k210_uart.h"
|
||||
#include "hardware/k210_clint.h"
|
||||
#include "hardware/k210_plic.h"
|
||||
//#include "hardware/k210_sysctl.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Idle thread stack starts from _ebss */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#define K210_IDLESTACK_BASE (uintptr_t)&_ebss
|
||||
#else
|
||||
#define K210_IDLESTACK_BASE _ebss
|
||||
#endif
|
||||
|
||||
#define K210_IDLESTACK0_BASE (K210_IDLESTACK_BASE)
|
||||
#define K210_IDLESTACK0_TOP (K210_IDLESTACK0_BASE + CONFIG_IDLETHREAD_STACKSIZE)
|
||||
|
||||
#endif /* __ARCH_RISCV_SRC_K210_K210_MEMORYMAP_H */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,183 @@
|
|||
############################################################################
|
||||
# drivers/lcd/Make.defs
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership. The
|
||||
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance with the
|
||||
# License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
ifeq ($(CONFIG_LCD),y)
|
||||
|
||||
# Support for the generic LCD framebuffer front-end
|
||||
|
||||
ifeq ($(CONFIG_LCD_FRAMEBUFFER),y)
|
||||
CSRCS += lcd_framebuffer.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_DEV),y)
|
||||
CSRCS += lcd_dev.c
|
||||
endif
|
||||
|
||||
# Include support for Graphics LCD drivers
|
||||
|
||||
ifeq ($(CONFIG_LCD_FT80X),y)
|
||||
CSRCS += ft80x.c
|
||||
ifeq ($(CONFIG_LCD_FT80X_SPI),y)
|
||||
CSRCS += ft80x_spi.c
|
||||
else ifeq ($(CONFIG_LCD_FT80X_I2C),y)
|
||||
CSRCS += ft80x_i2c.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_LPM013M091A),y)
|
||||
CSRCS += lpm013m091a.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_P14201),y)
|
||||
CSRCS += p14201.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_UG2864AMBAG01),y)
|
||||
CSRCS += ug-2864ambag01.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_UG9664HSWAG01),y)
|
||||
CSRCS += ug-9664hswag01.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_SSD1306),y)
|
||||
CSRCS += ssd1306_base.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_SSD1306_SPI),y)
|
||||
CSRCS += ssd1306_spi.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_SSD1306_I2C),y)
|
||||
CSRCS += ssd1306_i2c.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_SSD1289),y)
|
||||
CSRCS += ssd1289.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_SSD1351),y)
|
||||
CSRCS += ssd1351.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_MIO283QT2),y)
|
||||
CSRCS += mio283qt2.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_MAX7219),y)
|
||||
CSRCS += max7219.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_MIO283QT9A),y)
|
||||
CSRCS += mio283qt9a.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_PCD8544),y)
|
||||
CSRCS += pcd8544.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ST7565),y)
|
||||
CSRCS += st7565.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ST7567),y)
|
||||
CSRCS += st7567.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_SHARP_MEMLCD),y)
|
||||
CSRCS += memlcd.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ILI9225),y)
|
||||
CSRCS += ili9225.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ILI9340),y)
|
||||
CSRCS += ili9340.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ILI9341),y)
|
||||
CSRCS += ili9341.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_LT768),y)
|
||||
CSRCS += lt768.c lt768_lib.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_LCDDRV_SPIIF),y)
|
||||
CSRCS += lcddrv_spiif.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_RA8875),y)
|
||||
CSRCS += ra8875.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ST7735),y)
|
||||
CSRCS += st7735.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ST7789),y)
|
||||
CSRCS += st7789.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_GC9A01),y)
|
||||
CSRCS += gc9a01.c
|
||||
endif
|
||||
|
||||
endif # CONFIG_LCD
|
||||
|
||||
ifeq ($(CONFIG_SLCD),y)
|
||||
|
||||
# Include support for Alphanumeric/Segment LCD drivers
|
||||
|
||||
ifeq ($(CONFIG_LCD_BACKPACK),y)
|
||||
CSRCS += pcf8574_lcd_backpack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ST7032),y)
|
||||
CSRCS += st7032.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_HT16K33),y)
|
||||
CSRCS += ht16k33_14seg.c
|
||||
endif
|
||||
endif # CONFIG_SLCD
|
||||
|
||||
# Other LCD-related devices
|
||||
|
||||
ifeq ($(CONFIG_LCD_TDA19988),y)
|
||||
CSRCS += tda19988.c
|
||||
endif
|
||||
|
||||
# Include LCD driver build support (the nested if-then-else implements an OR)
|
||||
|
||||
ifeq ($(CONFIG_LCD),y)
|
||||
DEPPATH += --dep-path lcd
|
||||
VPATH += :lcd
|
||||
CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)lcd}
|
||||
else ifeq ($(CONFIG_SLCD),y)
|
||||
DEPPATH += --dep-path lcd
|
||||
VPATH += :lcd
|
||||
CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)lcd}
|
||||
else ifeq ($(CONFIG_LCD_OTHER),y)
|
||||
DEPPATH += --dep-path lcd
|
||||
VPATH += :lcd
|
||||
CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)lcd}
|
||||
endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,91 @@
|
|||
/****************************************************************************
|
||||
* k210_lcd.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @file k210_lcd.h
|
||||
* @brief
|
||||
* @version 1.0.0
|
||||
* @author AIIT XUOS Lab
|
||||
* @date 2022-07-21
|
||||
*/
|
||||
|
||||
#ifndef __K210_LCD_H_
|
||||
#define __K210_LCD_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <debug.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "nuttx/lcd/lt768.h"
|
||||
#include "nuttx/lcd/lt768_lib.h"
|
||||
|
||||
//PIN.define
|
||||
#define BSP_LCD_NRST 37
|
||||
#define BSP_LCD_SCLK 38
|
||||
#define BSP_LCD_MOSI 39
|
||||
#define BSP_LCD_MISO 40
|
||||
#define BSP_LCD_NCS 41
|
||||
#define BSP_LCD_BL_PIN 47
|
||||
|
||||
//FPIOA.define
|
||||
#define FPIOA_LCD_NRST 0
|
||||
#define FPIOA_LCD_BL 9
|
||||
#define FPIOA_LCD_SCLK 28
|
||||
#define FPIOA_LCD_MOSI 29
|
||||
#define FPIOA_LCD_MISO 23 //can't use GPIOHS30
|
||||
#define FPIOA_LCD_NCS 31
|
||||
|
||||
#define GPIO_PV_HIGH 1 // true
|
||||
#define GPIO_PV_LOW 0 // false
|
||||
|
||||
#define LCD_START_ADDR 0
|
||||
#define STM32_FSMC_8 0
|
||||
|
||||
#define lcd_set_pin k210_gpiohs_set_value
|
||||
#define lcd_get_pin k210_gpiohs_get_value
|
||||
|
||||
void test_delay(void);
|
||||
|
||||
#define lcd_delay() up_udelay(20)
|
||||
|
||||
#define NCS_H lcd_set_pin(FPIOA_LCD_NCS, GPIO_PV_HIGH); lcd_delay()
|
||||
#define NCS_L lcd_set_pin(FPIOA_LCD_NCS, GPIO_PV_LOW); lcd_delay()
|
||||
|
||||
#define CLK_H lcd_set_pin(FPIOA_LCD_SCLK, GPIO_PV_HIGH); lcd_delay()
|
||||
#define CLK_L lcd_set_pin(FPIOA_LCD_SCLK, GPIO_PV_LOW); lcd_delay()
|
||||
|
||||
#define MOSI_H lcd_set_pin(FPIOA_LCD_MOSI, GPIO_PV_HIGH)
|
||||
#define MOSI_L lcd_set_pin(FPIOA_LCD_MOSI, GPIO_PV_LOW)
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
void lcd_backlight_init(bool enable);
|
||||
void lcd_drv_init(void);
|
||||
|
||||
void LCD_CmdWrite(uint8_t cmd);
|
||||
void LCD_DataWrite(uint8_t data);
|
||||
uint8_t LCD_DataRead(void);
|
||||
uint8_t LCD_StatusRead(void);
|
||||
void LCD_DataWrite_Pixel(uint8_t data);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
|
@ -0,0 +1,685 @@
|
|||
/******************** COPYRIGHT ********************
|
||||
* File Name : LT768.h
|
||||
* Author : Levetop Electronics
|
||||
* Version : V1.0
|
||||
* Date : 2017-8-25
|
||||
* Description : ²Ù×÷LT768µÄ¼Ä´æÆ÷º¯Êý
|
||||
****************************************************/
|
||||
|
||||
#ifndef _LT768_h
|
||||
#define _LT768_h
|
||||
|
||||
#define cSetb0 0x01
|
||||
#define cSetb1 0x02
|
||||
#define cSetb2 0x04
|
||||
#define cSetb3 0x08
|
||||
#define cSetb4 0x10
|
||||
#define cSetb5 0x20
|
||||
#define cSetb6 0x40
|
||||
#define cSetb7 0x80
|
||||
|
||||
#define cClrb0 0xfe
|
||||
#define cClrb1 0xfd
|
||||
#define cClrb2 0xfb
|
||||
#define cClrb3 0xf7
|
||||
#define cClrb4 0xef
|
||||
#define cClrb5 0xdf
|
||||
#define cClrb6 0xbf
|
||||
#define cClrb7 0x7f
|
||||
|
||||
|
||||
void LCD_RegisterWrite(unsigned char Cmd,unsigned char Data);
|
||||
unsigned char LCD_RegisterRead(unsigned char Cmd);
|
||||
|
||||
//**Staus**//
|
||||
void Check_Mem_WR_FIFO_not_Full(void);
|
||||
void Check_Mem_WR_FIFO_Empty(void);
|
||||
void Check_Mem_RD_FIFO_not_Full(void);
|
||||
void Check_Mem_RD_FIFO_not_Empty(void);
|
||||
void Check_2D_Busy(void);
|
||||
void Check_SDRAM_Ready(void);
|
||||
unsigned char Power_Saving_Status(void);
|
||||
void Check_Power_is_Normal(void);
|
||||
void Check_Power_is_Saving(void);
|
||||
void Check_NO_Interrupt(void);
|
||||
void Check_Interrupt_Occur(void);
|
||||
|
||||
void Check_Busy_Draw(void);
|
||||
void Check_Busy_SFI_DMA(void);
|
||||
|
||||
//**[00h]**//
|
||||
void LT768_SW_Reset(void);
|
||||
//**[01h]**//
|
||||
void Enable_PLL(void);
|
||||
void LT768_Sleep(void);
|
||||
void LT768_WakeUp(void);
|
||||
void TFT_24bit(void);
|
||||
void TFT_18bit(void);
|
||||
void TFT_16bit(void);
|
||||
void TFT_LVDS(void);
|
||||
void Key_Scan_Enable(void);
|
||||
void Key_Scan_Disable(void);
|
||||
void LT768_I2CM_Enable(void);
|
||||
void LT768_I2CM_Disable(void);
|
||||
void Enable_SFlash_SPI(void);
|
||||
void Disable_SFlash_SPI(void);
|
||||
void Host_Bus_8bit(void);
|
||||
void Host_Bus_16bit(void);
|
||||
//**[02h]**//
|
||||
|
||||
void RGB_8b_8bpp(void);
|
||||
void RGB_8b_16bpp(void);
|
||||
void RGB_8b_24bpp(void);
|
||||
|
||||
void RGB_16b_8bpp(void);
|
||||
void RGB_16b_16bpp(void);
|
||||
void RGB_16b_24bpp_mode1(void);
|
||||
void RGB_16b_24bpp_mode2(void);
|
||||
|
||||
void MemRead_Left_Right_Top_Down(void);
|
||||
void MemRead_Right_Left_Top_Down(void);
|
||||
void MemRead_Top_Down_Left_Right(void);
|
||||
void MemRead_Down_Top_Left_Right(void);
|
||||
|
||||
void MemWrite_Left_Right_Top_Down(void);
|
||||
void MemWrite_Right_Left_Top_Down(void);
|
||||
void MemWrite_Top_Down_Left_Right(void);
|
||||
void MemWrite_Down_Top_Left_Right(void);
|
||||
//**[03h]**//
|
||||
void Interrupt_Active_Low(void);
|
||||
void Interrupt_Active_High(void);
|
||||
void ExtInterrupt_Debounce(void);
|
||||
void ExtInterrupt_Nodebounce(void);
|
||||
void ExtInterrupt_Input_Low_Level_Trigger(void);
|
||||
void ExtInterrupt_Input_High_Level_Trigger(void);
|
||||
void ExtInterrupt_Input_Falling_Edge_Trigger(void);
|
||||
void ExtInterrupt_Input_Rising_Edge_Trigger(void);
|
||||
void LVDS_Format1(void);
|
||||
void LVDS_Format2(void);
|
||||
void Graphic_Mode(void);
|
||||
void Text_Mode(void);
|
||||
void Memory_Select_SDRAM(void);
|
||||
void Memory_Select_Graphic_Cursor_RAM(void);
|
||||
void Memory_Select_Color_Palette_RAM(void);
|
||||
//**[05h]**//
|
||||
//**[06h]**//
|
||||
//**[07h]**//
|
||||
//**[09h]**//
|
||||
//**[0Ah]**//
|
||||
//**[0Bh]**//
|
||||
void Enable_Resume_Interrupt(void);
|
||||
void Disable_Resume_Interrupt(void);
|
||||
void Enable_ExtInterrupt_Input(void);
|
||||
void Disable_ExtInterrupt_Input(void);
|
||||
void Enable_I2CM_Interrupt(void);
|
||||
void Disable_I2CM_Interrupt(void);
|
||||
void Enable_Vsync_Interrupt(void);
|
||||
void Disable_Vsync_Interrupt(void);
|
||||
void Enable_KeyScan_Interrupt(void);
|
||||
void Disable_KeyScan_Interrupt(void);
|
||||
void Enable_DMA_Draw_BTE_Interrupt(void);
|
||||
void Disable_DMA_Draw_BTE_Interrupt(void);
|
||||
void Enable_PWM1_Interrupt(void);
|
||||
void Disable_PWM1_Interrupt(void);
|
||||
void Enable_PWM0_Interrupt(void);
|
||||
void Disable_PWM0_Interrupt(void);
|
||||
//**[0Ch]**//
|
||||
unsigned char Read_Interrupt_status(void);
|
||||
void Clear_Resume_Interrupt_Flag(void);
|
||||
void Clear_ExtInterrupt_Input_Flag(void);
|
||||
void Clear_I2CM_Interrupt_Flag(void);
|
||||
void Clear_Vsync_Interrupt_Flag(void);
|
||||
void Clear_KeyScan_Interrupt_Flag(void);
|
||||
void Clear_DMA_Draw_BTE_Interrupt_Flag(void);
|
||||
void Clear_PWM1_Interrupt_Flag(void);
|
||||
void Clear_PWM0_Interrupt_Flag(void);
|
||||
//**[0Dh]**//
|
||||
void Mask_Resume_Interrupt_Flag(void);
|
||||
void Mask_ExtInterrupt_Input_Flag(void);
|
||||
void Mask_I2CM_Interrupt_Flag(void);
|
||||
void Mask_Vsync_Interrupt_Flag(void);
|
||||
void Mask_KeyScan_Interrupt_Flag(void);
|
||||
void Mask_DMA_Draw_BTE_Interrupt_Flag(void);
|
||||
void Mask_PWM1_Interrupt_Flag(void);
|
||||
void Mask_PWM0_Interrupt_Flag(void);
|
||||
//
|
||||
void Enable_Resume_Interrupt_Flag(void);
|
||||
void Enable_ExtInterrupt_Input_Flag(void);
|
||||
void Enable_I2CM_Interrupt_Flag(void);
|
||||
void Enable_Vsync_Interrupt_Flag(void);
|
||||
void Enable_KeyScan_Interrupt_Flag(void);
|
||||
void Enable_DMA_Draw_BTE_Interrupt_Flag(void);
|
||||
void Enable_PWM1_Interrupt_Flag(void);
|
||||
void Enable_PWM0_Interrupt_Flag(void);
|
||||
//**[0Eh]**//
|
||||
void Enable_GPIOF_PullUp(void);
|
||||
void Enable_GPIOE_PullUp(void);
|
||||
void Enable_GPIOD_PullUp(void);
|
||||
void Enable_GPIOC_PullUp(void);
|
||||
void Enable_XDB15_8_PullUp(void);
|
||||
void Enable_XDB7_0_PullUp(void);
|
||||
void Disable_GPIOF_PullUp(void);
|
||||
void Disable_GPIOE_PullUp(void);
|
||||
void Disable_GPIOD_PullUp(void);
|
||||
void Disable_GPIOC_PullUp(void);
|
||||
void Disable_XDB15_8_PullUp(void);
|
||||
void Disable_XDB7_0_PullUp(void);
|
||||
|
||||
//**[0Fh]**//
|
||||
void XPDAT18_Set_GPIO_D7(void);
|
||||
void XPDAT18_Set_KOUT4(void);
|
||||
void XPDAT17_Set_GPIO_D5(void);
|
||||
void XPDAT17_Set_KOUT2(void);
|
||||
void XPDAT16_Set_GPIO_D4(void);
|
||||
void XPDAT16_Set_KOUT1(void);
|
||||
void XPDAT9_Set_GPIO_D3(void);
|
||||
void XPDAT9_Set_KOUT3(void);
|
||||
void XPDAT8_Set_GPIO_D2(void);
|
||||
void XPDAT8_Set_KIN3(void);
|
||||
void XPDAT2_Set_GPIO_D6(void);
|
||||
void XPDAT2_Set_KIN4(void);
|
||||
void XPDAT1_Set_GPIO_D1(void);
|
||||
void XPDAT1_Set_KIN2(void);
|
||||
void XPDAT0_Set_GPIO_D0(void);
|
||||
void XPDAT0_Set_KIN1(void);
|
||||
|
||||
//**[10h]**//
|
||||
void Enable_PIP1(void);
|
||||
void Disable_PIP1(void);
|
||||
void Enable_PIP2(void);
|
||||
void Disable_PIP2(void);
|
||||
void Select_PIP1_Parameter(void);
|
||||
void Select_PIP2_Parameter(void);
|
||||
void Select_Main_Window_8bpp(void);
|
||||
void Select_Main_Window_16bpp(void);
|
||||
void Select_Main_Window_24bpp(void);
|
||||
//**[11h]**//
|
||||
void Select_PIP1_Window_8bpp(void);
|
||||
void Select_PIP1_Window_16bpp(void);
|
||||
void Select_PIP1_Window_24bpp(void);
|
||||
void Select_PIP2_Window_8bpp(void);
|
||||
void Select_PIP2_Window_16bpp(void);
|
||||
void Select_PIP2_Window_24bpp(void);
|
||||
//**[12h]**//
|
||||
void PCLK_Rising(void);
|
||||
void PCLK_Falling(void);
|
||||
void Display_ON(void);
|
||||
void Display_OFF(void);
|
||||
void Color_Bar_ON(void);
|
||||
void Color_Bar_OFF(void);
|
||||
void HSCAN_L_to_R(void);
|
||||
void HSCAN_R_to_L(void);
|
||||
void VSCAN_T_to_B(void);
|
||||
void VSCAN_B_to_T(void);
|
||||
void PDATA_Set_RGB(void);
|
||||
void PDATA_Set_RBG(void);
|
||||
void PDATA_Set_GRB(void);
|
||||
void PDATA_Set_GBR(void);
|
||||
void PDATA_Set_BRG(void);
|
||||
void PDATA_Set_BGR(void);
|
||||
void PDATA_IDLE_STATE(void);
|
||||
|
||||
//**[13h]**//
|
||||
void HSYNC_Low_Active(void);
|
||||
void HSYNC_High_Active(void);
|
||||
void VSYNC_Low_Active(void);
|
||||
void VSYNC_High_Active(void);
|
||||
void DE_Low_Active(void);
|
||||
void DE_High_Active(void);
|
||||
void Idle_DE_Low(void);
|
||||
void Idle_DE_High(void);
|
||||
void Idle_PCLK_Low(void);
|
||||
void Idle_PCLK_High(void);
|
||||
void Idle_PDAT_Low(void);
|
||||
void Idle_PDAT_High(void);
|
||||
void Idle_HSYNC_Low(void);
|
||||
void Idle_HSYNC_High(void);
|
||||
void Idle_VSYNC_Low(void);
|
||||
void Idle_VSYNC_High(void);
|
||||
//**[14h][15h][1Ah][1Bh]**//
|
||||
void LCD_HorizontalWidth_VerticalHeight(unsigned short WX,unsigned short HY);
|
||||
//**[16h][17h]**//
|
||||
void LCD_Horizontal_Non_Display(unsigned short WX);
|
||||
//**[18h]**//
|
||||
void LCD_HSYNC_Start_Position(unsigned short WX);
|
||||
//**[19h]**//
|
||||
void LCD_HSYNC_Pulse_Width(unsigned short WX);
|
||||
//**[1Ch][1Dh]**//
|
||||
void LCD_Vertical_Non_Display(unsigned short HY);
|
||||
//**[1Eh]**//
|
||||
void LCD_VSYNC_Start_Position(unsigned short HY);
|
||||
//**[1Fh]**//
|
||||
void LCD_VSYNC_Pulse_Width(unsigned short HY);
|
||||
//**[20h][21h][22h][23h]**//
|
||||
void Main_Image_Start_Address(unsigned long Addr);
|
||||
//**[24h][25h]**//
|
||||
void Main_Image_Width(unsigned short WX);
|
||||
//**[26h][27h][28h][29h]**//
|
||||
void Main_Window_Start_XY(unsigned short WX,unsigned short HY);
|
||||
//**[2Ah][2Bh][2Ch][2Dh]**//
|
||||
void PIP_Display_Start_XY(unsigned short WX,unsigned short HY);
|
||||
//**[2Eh][2Fh][30h][31h]**//
|
||||
void PIP_Image_Start_Address(unsigned long Addr);
|
||||
//**[32h][33h]**//
|
||||
void PIP_Image_Width(unsigned short WX);
|
||||
//**[34h][35h][36h][37h]**//
|
||||
void PIP_Window_Image_Start_XY(unsigned short WX,unsigned short HY);
|
||||
//**[38h][39h][3Ah][3Bh]**//
|
||||
void PIP_Window_Width_Height(unsigned short WX,unsigned short HY);
|
||||
//**[3C]**//
|
||||
void Enable_Graphic_Cursor(void);
|
||||
void Disable_Graphic_Cursor(void);
|
||||
void Select_Graphic_Cursor_1(void);
|
||||
void Select_Graphic_Cursor_2(void);
|
||||
void Select_Graphic_Cursor_3(void);
|
||||
void Select_Graphic_Cursor_4(void);
|
||||
void Enable_Text_Cursor(void);
|
||||
void Disable_Text_Cursor(void);
|
||||
void Enable_Text_Cursor_Blinking(void);
|
||||
void Disable_Text_Cursor_Blinking(void);
|
||||
//**[3D]**//
|
||||
void Blinking_Time_Frames(unsigned char temp);
|
||||
//**[3E][3Fh]**//
|
||||
void Text_Cursor_H_V(unsigned short WX,unsigned short HY);
|
||||
//**[40h][41h][42h][43h]**//
|
||||
void Graphic_Cursor_XY(unsigned short WX,unsigned short HY);
|
||||
//**[44]**//
|
||||
void Set_Graphic_Cursor_Color_1(unsigned char temp);
|
||||
//**[45]**//
|
||||
void Set_Graphic_Cursor_Color_2(unsigned char temp);
|
||||
//**[50h][51h][52h][53h]**//
|
||||
void Canvas_Image_Start_address(unsigned long Addr);
|
||||
//**[54h][55h]**//
|
||||
void Canvas_image_width(unsigned short WX);
|
||||
//**[56h][57h][58h][59h]**//
|
||||
void Active_Window_XY(unsigned short WX,unsigned short HY);
|
||||
//**[5Ah][5Bh][5Ch][5Dh]**//
|
||||
void Active_Window_WH(unsigned short WX,unsigned short HY);
|
||||
//**[5E]**//
|
||||
void Select_Write_Data_Position(void);
|
||||
void Select_Read_Data_Position(void);
|
||||
void Memory_XY_Mode(void);
|
||||
void Memory_Linear_Mode(void);
|
||||
void Memory_8bpp_Mode(void);
|
||||
void Memory_16bpp_Mode(void);
|
||||
void Memory_24bpp_Mode(void);
|
||||
//**[5Fh][60h][61h][62h]**//
|
||||
void Goto_Pixel_XY(unsigned short WX,unsigned short HY);
|
||||
void Goto_Linear_Addr(unsigned long Addr);
|
||||
//**[63h][64h][65h][66h]**//
|
||||
void Goto_Text_XY(unsigned short WX,unsigned short HY);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : Draw ] ****////
|
||||
//**[67h]**//
|
||||
void Start_Line(void);
|
||||
void Start_Triangle(void);
|
||||
void Start_Triangle_Fill(void);
|
||||
//**[68h]~[73h]**//
|
||||
void Line_Start_XY(unsigned short WX,unsigned short HY);
|
||||
void Line_End_XY(unsigned short WX,unsigned short HY);
|
||||
void Triangle_Point1_XY(unsigned short WX,unsigned short HY);
|
||||
void Triangle_Point2_XY(unsigned short WX,unsigned short HY);
|
||||
void Triangle_Point3_XY (unsigned short WX,unsigned short HY);
|
||||
void Square_Start_XY(unsigned short WX,unsigned short HY);
|
||||
void Square_End_XY(unsigned short WX,unsigned short HY);
|
||||
//**[76h]**//
|
||||
void Start_Circle_or_Ellipse(void);
|
||||
void Start_Circle_or_Ellipse_Fill(void);
|
||||
void Start_Left_Down_Curve(void);
|
||||
void Start_Left_Up_Curve(void);
|
||||
void Start_Right_Up_Curve(void);
|
||||
void Start_Right_Down_Curve(void);
|
||||
void Start_Left_Down_Curve_Fill(void);
|
||||
void Start_Left_Up_Curve_Fill(void);
|
||||
void Start_Right_Up_Curve_Fill(void);
|
||||
void Start_Right_Down_Curve_Fill(void);
|
||||
void Start_Square(void);
|
||||
void Start_Square_Fill(void);
|
||||
void Start_Circle_Square(void);
|
||||
void Start_Circle_Square_Fill(void);
|
||||
//**[77h]~[7Eh]**//
|
||||
void Circle_Center_XY(unsigned short WX,unsigned short HY);
|
||||
void Ellipse_Center_XY(unsigned short WX,unsigned short HY);
|
||||
void Circle_Radius_R(unsigned short WX);
|
||||
void Ellipse_Radius_RxRy(unsigned short WX,unsigned short HY);
|
||||
void Circle_Square_Radius_RxRy(unsigned short WX,unsigned short HY);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : PWM ] ****////
|
||||
//**[84h]**//
|
||||
void Set_PWM_Prescaler_1_to_256(unsigned short WX);
|
||||
//**[85h]**//
|
||||
void Select_PWM1_Clock_Divided_By_1(void);
|
||||
void Select_PWM1_Clock_Divided_By_2(void);
|
||||
void Select_PWM1_Clock_Divided_By_4(void);
|
||||
void Select_PWM1_Clock_Divided_By_8(void);
|
||||
void Select_PWM0_Clock_Divided_By_1(void);
|
||||
void Select_PWM0_Clock_Divided_By_2(void);
|
||||
void Select_PWM0_Clock_Divided_By_4(void);
|
||||
void Select_PWM0_Clock_Divided_By_8(void);
|
||||
//[85h].[bit3][bit2]
|
||||
void Select_PWM1_is_ErrorFlag(void);
|
||||
void Select_PWM1(void);
|
||||
void Select_PWM1_is_Osc_Clock(void);
|
||||
//[85h].[bit1][bit0]
|
||||
void Select_PWM0_is_GPIO_C7(void);
|
||||
void Select_PWM0(void);
|
||||
void Select_PWM0_is_Core_Clock(void);
|
||||
//**[86h]**//
|
||||
//[86h]PWM1
|
||||
void Enable_PWM1_Inverter(void);
|
||||
void Disable_PWM1_Inverter(void);
|
||||
void Auto_Reload_PWM1(void);
|
||||
void One_Shot_PWM1(void);
|
||||
void Start_PWM1(void);
|
||||
void Stop_PWM1(void);
|
||||
//[86h]PWM0
|
||||
void Enable_PWM0_Dead_Zone(void);
|
||||
void Disable_PWM0_Dead_Zone(void);
|
||||
void Enable_PWM0_Inverter(void);
|
||||
void Disable_PWM0_Inverter(void);
|
||||
void Auto_Reload_PWM0(void);
|
||||
void One_Shot_PWM0(void);
|
||||
void Start_PWM0(void);
|
||||
void Stop_PWM0(void);
|
||||
//**[87h]**//
|
||||
void Set_Timer0_Dead_Zone_Length(unsigned char temp);
|
||||
//**[88h][89h]**//
|
||||
void Set_Timer0_Compare_Buffer(unsigned short WX);
|
||||
//**[8Ah][8Bh]**//
|
||||
void Set_Timer0_Count_Buffer(unsigned short WX);
|
||||
//**[8Ch][8Dh]**//
|
||||
void Set_Timer1_Compare_Buffer(unsigned short WX);
|
||||
//**[8Eh][8Fh]**//
|
||||
void Set_Timer1_Count_Buffer(unsigned short WX);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : BTE ] ****////
|
||||
//**[90h]**//
|
||||
|
||||
//[90h]=========================================================================
|
||||
void BTE_Enable(void);
|
||||
void BTE_Disable(void);
|
||||
|
||||
void Check_BTE_Busy(void);
|
||||
|
||||
void Pattern_Format_8X8(void);
|
||||
void Pattern_Format_16X16(void);
|
||||
|
||||
//[91h]=========================================================================
|
||||
void BTE_ROP_Code(unsigned char setx);
|
||||
void BTE_Operation_Code(unsigned char setx);
|
||||
|
||||
//[92h]=========================================================================
|
||||
void BTE_S0_Color_8bpp(void);
|
||||
void BTE_S0_Color_16bpp(void);
|
||||
void BTE_S0_Color_24bpp(void);
|
||||
|
||||
void BTE_S1_Color_8bpp(void);
|
||||
void BTE_S1_Color_16bpp(void);
|
||||
void BTE_S1_Color_24bpp(void);
|
||||
void BTE_S1_Color_Constant(void);
|
||||
void BTE_S1_Color_8bit_Alpha(void);
|
||||
void BTE_S1_Color_16bit_Alpha(void);
|
||||
|
||||
void BTE_Destination_Color_8bpp(void);
|
||||
void BTE_Destination_Color_16bpp(void);
|
||||
void BTE_Destination_Color_24bpp(void);
|
||||
|
||||
//[93h][94h][95h][96h]=========================================================================
|
||||
void BTE_S0_Memory_Start_Address(unsigned long Addr);
|
||||
|
||||
//[97h][98h]=========================================================================
|
||||
void BTE_S0_Image_Width(unsigned short WX);
|
||||
|
||||
//[99h][9Ah][9Bh][9Ch]=========================================================================
|
||||
void BTE_S0_Window_Start_XY(unsigned short WX,unsigned short HY);
|
||||
|
||||
//[9Dh][9Eh][9Fh][A0h]=========================================================================
|
||||
void BTE_S1_Memory_Start_Address(unsigned long Addr);
|
||||
void S1_Constant_color_256(unsigned char temp);
|
||||
void S1_Constant_color_65k(unsigned short temp);
|
||||
void S1_Constant_color_16M(unsigned long temp);
|
||||
|
||||
//[A1h][A2h]=========================================================================
|
||||
void BTE_S1_Image_Width(unsigned short WX);
|
||||
|
||||
//[A3h][A4h][A5h][A6h]=========================================================================
|
||||
void BTE_S1_Window_Start_XY(unsigned short WX,unsigned short HY);
|
||||
|
||||
//[A7h][A8h][A9h][AAh]=========================================================================
|
||||
void BTE_Destination_Memory_Start_Address(unsigned long Addr);
|
||||
|
||||
//[ABh][ACh]=========================================================================
|
||||
void BTE_Destination_Image_Width(unsigned short WX);
|
||||
|
||||
//[ADh][AEh][AFh][B0h]=========================================================================
|
||||
void BTE_Destination_Window_Start_XY(unsigned short WX,unsigned short HY);
|
||||
|
||||
//[B1h][B2h][B3h][B4h]=========================================================================
|
||||
void BTE_Window_Size(unsigned short WX, unsigned short WY);
|
||||
|
||||
//[B5h]=========================================================================
|
||||
void BTE_Alpha_Blending_Effect(unsigned char temp);
|
||||
|
||||
|
||||
//**[B5h]**//
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : Serial Flash ] ****////
|
||||
|
||||
|
||||
//REG[B6h] Serial flash DMA Controller REG (DMA_CTRL)
|
||||
void Start_SFI_DMA(void);
|
||||
void Check_Busy_SFI_DMA(void);
|
||||
|
||||
//REG[B7h] Serial Flash/ROM Controller Register (SFL_CTRL)
|
||||
void Select_SFI_0(void);
|
||||
void Select_SFI_1(void);
|
||||
void Select_SFI_Font_Mode(void);
|
||||
void Select_SFI_DMA_Mode(void);
|
||||
void Select_SFI_24bit_Address(void);
|
||||
void Select_SFI_32bit_Address(void);
|
||||
void Select_SFI_Waveform_Mode_0(void);
|
||||
void Select_SFI_Waveform_Mode_3(void);
|
||||
void Select_SFI_0_DummyRead(void);
|
||||
void Select_SFI_8_DummyRead(void);
|
||||
void Select_SFI_16_DummyRead(void);
|
||||
void Select_SFI_24_DummyRead(void);
|
||||
void Select_SFI_Single_Mode(void);
|
||||
void Select_SFI_Dual_Mode0(void);
|
||||
void Select_SFI_Dual_Mode1(void);
|
||||
|
||||
//REG[B8h] SPI master Tx /Rx FIFO Data Register (SPIDR)
|
||||
unsigned char SPI_Master_FIFO_Data_Put(unsigned char Data);
|
||||
unsigned char SPI_Master_FIFO_Data_Get(void);
|
||||
|
||||
//REG[B9h] SPI master Control Register (SPIMCR2)
|
||||
void Mask_SPI_Master_Interrupt_Flag(void);
|
||||
void Select_nSS_drive_on_xnsfcs0(void);
|
||||
void Select_nSS_drive_on_xnsfcs1(void);
|
||||
void nSS_Inactive(void);
|
||||
void nSS_Active(void);
|
||||
void OVFIRQEN_Enable(void);
|
||||
void EMTIRQEN_Enable(void);
|
||||
void Reset_CPOL(void);
|
||||
void Set_CPOL(void);
|
||||
void Reset_CPHA(void);
|
||||
void Set_CPHA(void);
|
||||
|
||||
//REG[BAh] SPI master Status Register (SPIMSR)
|
||||
unsigned char Tx_FIFO_Empty_Flag(void);
|
||||
unsigned char Tx_FIFO_Full_Flag(void);
|
||||
unsigned char Rx_FIFO_Empty_Flag(void);
|
||||
unsigned char Rx_FIFO_full_flag(void);
|
||||
unsigned char OVFI_Flag(void);
|
||||
void Clear_OVFI_Flag(void);
|
||||
unsigned char EMTI_Flag(void);
|
||||
void Clear_EMTI_Flag(void);
|
||||
|
||||
//REG[BB] SPI Clock period (SPIDIV)
|
||||
void SPI_Clock_Period(unsigned char temp);
|
||||
|
||||
|
||||
//**[BCh][BDh][BEh][BFh]**//
|
||||
void SFI_DMA_Source_Start_Address(unsigned long Addr);
|
||||
//**[C0h][C1h][C2h][C3h]**//
|
||||
void SFI_DMA_Destination_Start_Address(unsigned long Addr);
|
||||
void SFI_DMA_Destination_Upper_Left_Corner(unsigned short WX,unsigned short HY);
|
||||
//**[C4h][C5h]**//
|
||||
void SFI_DMA_Destination_Width(unsigned short WX);
|
||||
//**[C6h][C7h][C8h][C9h]**//
|
||||
void SFI_DMA_Transfer_Number(unsigned long Addr);
|
||||
void SFI_DMA_Transfer_Width_Height(unsigned short WX,unsigned short HY);
|
||||
//**[CAh][CBh]**//
|
||||
void SFI_DMA_Source_Width(unsigned short WX);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : Font ] ****////
|
||||
//**[CCh]**//
|
||||
|
||||
void Font_Select_UserDefine_Mode(void);
|
||||
void CGROM_Select_Internal_CGROM(void);
|
||||
void CGROM_Select_Genitop_FontROM(void);
|
||||
void Font_Select_8x16_16x16(void);
|
||||
void Font_Select_12x24_24x24(void);
|
||||
void Font_Select_16x32_32x32(void);
|
||||
void Internal_CGROM_Select_ISOIEC8859_1(void);
|
||||
void Internal_CGROM_Select_ISOIEC8859_2(void);
|
||||
void Internal_CGROM_Select_ISOIEC8859_3(void);
|
||||
void Internal_CGROM_Select_ISOIEC8859_4(void);
|
||||
//**[CDh]**//
|
||||
void Enable_Font_Alignment(void);
|
||||
void Disable_Font_Alignment(void);
|
||||
void Font_Background_select_Transparency(void);
|
||||
void Font_Background_select_Color(void);
|
||||
void Font_0_degree(void);
|
||||
void Font_90_degree(void);
|
||||
void Font_Width_X1(void);
|
||||
void Font_Width_X2(void);
|
||||
void Font_Width_X3(void);
|
||||
void Font_Width_X4(void);
|
||||
void Font_Height_X1(void);
|
||||
void Font_Height_X2(void);
|
||||
void Font_Height_X3(void);
|
||||
void Font_Height_X4(void);
|
||||
//**[CEh]**//
|
||||
void GTFont_Select_GT21L16TW_GT21H16T1W(void);
|
||||
void GTFont_Select_GT23L16U2W(void);
|
||||
void GTFont_Select_GT23L24T3Y_GT23H24T3Y(void);
|
||||
void GTFont_Select_GT23L24M1Z(void);
|
||||
void GTFont_Select_GT23L32S4W_GT23H32S4W(void);
|
||||
void GTFont_Select_GT20L24F6Y(void);
|
||||
void GTFont_Select_GT21L24S1W(void);
|
||||
void GTFont_Select_GT22L16A1Y(void);
|
||||
//**[CFh]**//
|
||||
void Set_GTFont_Decoder(unsigned char temp);
|
||||
//**[D0h]**//
|
||||
void Font_Line_Distance(unsigned char temp);
|
||||
//**[D1h]**//
|
||||
void Set_Font_to_Font_Width(unsigned char temp);
|
||||
//**[D2h]~[D4h]**//
|
||||
void Foreground_RGB(unsigned char RED,unsigned char GREEN,unsigned char BLUE);
|
||||
void Foreground_color_256(unsigned char temp);
|
||||
void Foreground_color_65k(unsigned short temp);
|
||||
void Foreground_color_16M(unsigned long temp);
|
||||
//**[D5h]~[D7h]**//
|
||||
void Background_RGB(unsigned char RED,unsigned char GREEN,unsigned char BLUE);
|
||||
void Background_color_256(unsigned char temp);
|
||||
void Background_color_65k(unsigned short temp);
|
||||
void Background_color_16M(unsigned long temp);
|
||||
//**[DBh]~[DEh]**//
|
||||
void CGRAM_Start_address(unsigned long Addr);
|
||||
//**[DFh]**//
|
||||
void Power_Normal_Mode(void);
|
||||
void Power_Saving_Standby_Mode(void);
|
||||
void Power_Saving_Suspend_Mode(void);
|
||||
void Power_Saving_Sleep_Mode(void);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : SDRAM ] ****////
|
||||
//**[E0h]~[E4h]**//
|
||||
// LT768_Select_SDRAM();
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : I2C ] ****////
|
||||
//**[E5h]~[EAh]**//
|
||||
void LT768_I2CM_Clock_Prescale(unsigned short WX);
|
||||
//**[E7h]**//
|
||||
void LT768_I2CM_Transmit_Data(unsigned char temp);
|
||||
//**[E8h]**//
|
||||
unsigned char LT768_I2CM_Receiver_Data(void);
|
||||
//**[E9h]**//
|
||||
|
||||
void LT768_I2CM_Read_With_Ack(void);
|
||||
void LT768_I2CM_Read_With_Nack(void);
|
||||
void LT768_I2CM_Write_With_Start(void);
|
||||
void LT768_I2CM_Write(void);
|
||||
void LT768_I2CM_Stop(void);
|
||||
|
||||
|
||||
//**[EAh]**//
|
||||
unsigned char LT768_I2CM_Check_Slave_ACK(void);
|
||||
unsigned char LT768_I2CM_Bus_Busy(void);
|
||||
unsigned char LT768_I2CM_transmit_Progress(void);
|
||||
unsigned char LT768_I2CM_Arbitration(void);
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : GPIO ] ****////
|
||||
//[F0h][F1h]
|
||||
void Set_GPIO_A_In_Out(unsigned char temp);
|
||||
void Write_GPIO_A_7_0(unsigned char temp);
|
||||
unsigned char Read_GPIO_A_7_0(void);
|
||||
//[F2h]
|
||||
void Write_GPIO_B_7_4(unsigned char temp);
|
||||
unsigned char Read_GPIO_B_7_0(void);
|
||||
//[F3h][F4h]
|
||||
void Set_GPIO_C_In_Out(unsigned char temp);
|
||||
void Write_GPIO_C_7_0(unsigned char temp);
|
||||
unsigned char Read_GPIO_C_7_0(void);
|
||||
//[F5h][F6h]
|
||||
void Set_GPIO_D_In_Out(unsigned char temp);
|
||||
void Write_GPIO_D_7_0(unsigned char temp);
|
||||
unsigned char Read_GPIO_D_7_0(void);
|
||||
//[F7h][F8h]
|
||||
void Set_GPIO_E_In_Out(unsigned char temp);
|
||||
void Write_GPIO_E_7_0(unsigned char temp);
|
||||
unsigned char Read_GPIO_E_7_0(void);
|
||||
//[F9h][FAh]
|
||||
void Set_GPIO_F_In_Out(unsigned char temp);
|
||||
void Write_GPIO_F_7_0(unsigned char temp);
|
||||
unsigned char Read_GPIO_F_7_0(void);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////**** [ Function : Key ] ****////
|
||||
//**[FBh]~[FFh]**//
|
||||
//[FBh]
|
||||
void Long_Key_enable(void);
|
||||
void Key_Scan_Freg(unsigned char temp); //set bit2~0
|
||||
|
||||
//[FCh]
|
||||
void Key_Scan_Wakeup_Function_Enable(void);
|
||||
void Long_Key_Timing_Adjustment(unsigned char setx);//set bit5~3
|
||||
unsigned char Numbers_of_Key_Hit(void);
|
||||
|
||||
//[FDh][FEh][FFh]
|
||||
unsigned char Read_Key_Strobe_Data_0(void);
|
||||
unsigned char Read_Key_Strobe_Data_1(void);
|
||||
unsigned char Read_Key_Strobe_Data_2(void);
|
||||
|
||||
void Show_String(char *str);
|
||||
void Show_picture(unsigned long numbers,const unsigned short *data);
|
||||
|
||||
void PWM0_ON(void); //¿ªPWM0
|
||||
|
||||
void lt768_hw_reset(void);
|
||||
void System_Check_Temp(void);
|
||||
void Enable_SPI_Flash_DMA(unsigned char val);
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,306 @@
|
|||
/********************* COPYRIGHT **********************
|
||||
* File Name : lt768_lib.h
|
||||
* Author : Levetop Electronics
|
||||
* Version : V1.3
|
||||
* Date : 2019-5-14
|
||||
* Description : LT768x所有功能函数
|
||||
********************************************************/
|
||||
|
||||
#ifndef _LT768_Lib_H
|
||||
#define _LT768_Lib_H
|
||||
#include "lt768.h"
|
||||
|
||||
//外部晶振
|
||||
#define XI_4M 0
|
||||
#define XI_8M 1
|
||||
#define XI_10M 0
|
||||
#define XI_12M 0
|
||||
|
||||
//分辨率
|
||||
#define LCD_XSIZE_TFT 480
|
||||
#define LCD_YSIZE_TFT 272
|
||||
|
||||
//参数
|
||||
#define LCD_VBPD 20
|
||||
#define LCD_VFPD 12
|
||||
#define LCD_VSPW 3
|
||||
#define LCD_HBPD 140
|
||||
#define LCD_HFPD 160
|
||||
#define LCD_HSPW 20
|
||||
|
||||
#define color256_black 0x00
|
||||
#define color256_white 0xff
|
||||
#define color256_red 0xe0
|
||||
#define color256_green 0x1c
|
||||
#define color256_blue 0x03
|
||||
#define color256_yellow color256_red|color256_green
|
||||
#define color256_cyan color256_green|color256_blue
|
||||
#define color256_purple color256_red|color256_blue
|
||||
|
||||
#define color65k_black 0x0000
|
||||
#define color65k_white 0xffff
|
||||
#define color65k_red 0xf800
|
||||
#define color65k_green 0x07e0
|
||||
#define color65k_blue 0x001f
|
||||
#define color65k_yellow color65k_red|color65k_green
|
||||
#define color65k_cyan color65k_green|color65k_blue
|
||||
#define color65k_purple color65k_red|color65k_blue
|
||||
|
||||
#define color65k_grayscale1 2113
|
||||
#define color65k_grayscale2 2113*2
|
||||
#define color65k_grayscale3 2113*3
|
||||
#define color65k_grayscale4 2113*4
|
||||
#define color65k_grayscale5 2113*5
|
||||
#define color65k_grayscale6 2113*6
|
||||
#define color65k_grayscale7 2113*7
|
||||
#define color65k_grayscale8 2113*8
|
||||
#define color65k_grayscale9 2113*9
|
||||
#define color65k_grayscale10 2113*10
|
||||
#define color65k_grayscale11 2113*11
|
||||
#define color65k_grayscale12 2113*12
|
||||
#define color65k_grayscale13 2113*13
|
||||
#define color65k_grayscale14 2113*14
|
||||
#define color65k_grayscale15 2113*15
|
||||
#define color65k_grayscale16 2113*16
|
||||
#define color65k_grayscale17 2113*17
|
||||
#define color65k_grayscale18 2113*18
|
||||
#define color65k_grayscale19 2113*19
|
||||
#define color65k_grayscale20 2113*20
|
||||
#define color65k_grayscale21 2113*21
|
||||
#define color65k_grayscale22 2113*22
|
||||
#define color65k_grayscale23 2113*23
|
||||
#define color65k_grayscale24 2113*24
|
||||
#define color65k_grayscale25 2113*25
|
||||
#define color65k_grayscale26 2113*26
|
||||
#define color65k_grayscale27 2113*27
|
||||
#define color65k_grayscale28 2113*28
|
||||
#define color65k_grayscale29 2113*29
|
||||
#define color65k_grayscale30 2113*30
|
||||
|
||||
#define color16M_black 0x00000000
|
||||
#define color16M_white 0x00ffffff
|
||||
#define color16M_red 0x00ff0000
|
||||
#define color16M_green 0x0000ff00
|
||||
#define color16M_blue 0x000000ff
|
||||
#define color16M_yellow color16M_red|color16M_green
|
||||
#define color16M_cyan color16M_green|color16M_blue
|
||||
#define color16M_purple color16M_red|color16M_blue
|
||||
|
||||
/* LCD color */
|
||||
#define White 0xFFFF
|
||||
#define Black 0x0000
|
||||
#define Grey 0xF7DE
|
||||
#define Blue 0x001F
|
||||
#define Blue2 0x051F
|
||||
#define Red 0xF800
|
||||
#define Magenta 0xF81F
|
||||
#define Green 0x07E0
|
||||
#define Cyan 0x7FFF
|
||||
#define Yellow 0xFFE0
|
||||
|
||||
#define Line0 0
|
||||
#define Line1 24
|
||||
#define Line2 48
|
||||
#define Line3 72
|
||||
#define Line4 96
|
||||
#define Line5 120
|
||||
#define Line6 144
|
||||
#define Line7 168
|
||||
#define Line8 192
|
||||
#define Line9 216
|
||||
#define Line10 240
|
||||
#define Line11 264
|
||||
#define Line12 288
|
||||
#define Line13 312
|
||||
#define Line14 336
|
||||
#define Line15 360
|
||||
#define Line16 384
|
||||
#define Line17 408
|
||||
#define Line18 432
|
||||
#define Line19 456
|
||||
#define Line20 480
|
||||
#define Line21 504
|
||||
#define Line22 528
|
||||
#define Line23 552
|
||||
#define Line24 576
|
||||
#define Line25 600
|
||||
|
||||
void lt768_init(void);
|
||||
|
||||
/* 写数据到内存 */
|
||||
void MPuint8_t_8bpp_Memory_Write(unsigned short x,unsigned short y,unsigned short w,unsigned short h,const unsigned char *data);
|
||||
void MPuint8_t_16bpp_Memory_Write(unsigned short x,unsigned short y,unsigned short w,unsigned short h,const unsigned char *data);
|
||||
void MPuint8_t_24bpp_Memory_Write(unsigned short x,unsigned short y,unsigned short w,unsigned short h,const unsigned char *data);
|
||||
void MPuint16_t_16bpp_Memory_Write(unsigned short x,unsigned short y,unsigned short w,unsigned short h,const unsigned short *data);
|
||||
void MPuint16_t_24bpp_Mode1_Memory_Write(unsigned short x,unsigned short y,unsigned short w,unsigned short h,const unsigned short *data);
|
||||
void MPuint16_t_24bpp_Mode2_Memory_Write(unsigned short x,unsigned short y,unsigned short w,unsigned short h,const unsigned short *data);
|
||||
|
||||
/* 硬件画线段 */
|
||||
void LT768_DrawLine(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned long LineColor);
|
||||
void LT768_DrawLine_Width(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned long LineColor,unsigned short Width);
|
||||
|
||||
/* 硬件画圆 */
|
||||
void LT768_DrawCircle(unsigned short XCenter,unsigned short YCenter,unsigned short R,unsigned long CircleColor);
|
||||
void LT768_DrawCircle_Fill(unsigned short XCenter,unsigned short YCenter,unsigned short R,unsigned long ForegroundColor);
|
||||
void LT768_DrawCircle_Width(unsigned short XCenter,unsigned short YCenter,unsigned short R,unsigned long CircleColor,unsigned long ForegroundColor,unsigned short Width);
|
||||
|
||||
/* 硬件画椭圆 */
|
||||
void LT768_DrawEllipse(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long EllipseColor);
|
||||
void LT768_DrawEllipse_Fill(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long ForegroundColor);
|
||||
void LT768_DrawEllipse_Width(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long EllipseColor,unsigned long ForegroundColor,unsigned short Width);
|
||||
|
||||
/* 硬件画矩形 */
|
||||
void LT768_DrawSquare(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned long SquareColor);
|
||||
void LT768_DrawSquare_Fill(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned long ForegroundColor);
|
||||
void LT768_DrawSquare_Width(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned long SquareColor,unsigned long ForegroundColor,unsigned short Width);
|
||||
|
||||
/* 硬件画圆角矩形 */
|
||||
void LT768_DrawCircleSquare(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X_R,unsigned short Y_R,unsigned long CircleSquareColor);
|
||||
void LT768_DrawCircleSquare_Fill(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X_R,unsigned short Y_R,unsigned long ForegroundColor);
|
||||
void LT768_DrawCircleSquare_Width(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X_R,unsigned short Y_R,unsigned long CircleSquareColor,unsigned long ForegroundColor,unsigned short Width);
|
||||
|
||||
/* 硬件画三角形 */
|
||||
void LT768_DrawTriangle(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned long TriangleColor);
|
||||
void LT768_DrawTriangle_Fill(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned long ForegroundColor);
|
||||
void LT768_DrawTriangle_Frame(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned long TriangleColor,unsigned long ForegroundColor);
|
||||
|
||||
/* 硬件画四边形 */
|
||||
void LT768_DrawQuadrilateral(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned short X4,unsigned short Y4,unsigned long ForegroundColor);
|
||||
void LT768_DrawQuadrilateral_Fill(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned short X4,unsigned short Y4,unsigned long ForegroundColor);
|
||||
void LT768_DrawTriangle_Frame(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned long TriangleColor ,unsigned long ForegroundColor);
|
||||
|
||||
/* 硬件画五边形 */
|
||||
void LT768_DrawPentagon(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned short X4,unsigned short Y4,unsigned short X5,unsigned short Y5,unsigned long ForegroundColor);
|
||||
void LT768_DrawPentagon_Fill(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned short X4,unsigned short Y4,unsigned short X5,unsigned short Y5,unsigned long ForegroundColor);
|
||||
|
||||
/* 硬件画曲线 */
|
||||
void LT768_DrawLeftUpCurve(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long CurveColor);
|
||||
void LT768_DrawLeftDownCurve(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long CurveColor);
|
||||
void LT768_DrawRightUpCurve(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long CurveColor);
|
||||
void LT768_DrawRightDownCurve(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long CurveColor);
|
||||
void LT768_SelectDrawCurve(unsigned short XCenter ,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long CurveColor,unsigned short Dir);
|
||||
|
||||
/* 硬件画1/4椭圆 */
|
||||
void LT768_DrawLeftUpCurve_Fill(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long ForegroundColor);
|
||||
void LT768_DrawLeftDownCurve_Fill(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long ForegroundColor);
|
||||
void LT768_DrawRightUpCurve_Fill(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long ForegroundColor);
|
||||
void LT768_DrawRightDownCurve_Fill(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long ForegroundColor);
|
||||
void LT768_SelectDrawCurve_Fill(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned long CurveColor,unsigned short Dir);
|
||||
|
||||
/* 硬件画圆柱 */
|
||||
unsigned char LT768_DrawCylinder(unsigned short XCenter,unsigned short YCenter,unsigned short X_R,unsigned short Y_R,unsigned short H,unsigned long CylinderColor,unsigned long ForegroundColor);
|
||||
|
||||
/* 硬件画四棱柱 */
|
||||
void LT768_DrawQuadrangular(unsigned short X1,unsigned short Y1,unsigned short X2,unsigned short Y2,unsigned short X3,unsigned short Y3,unsigned short X4,unsigned short Y4,unsigned short X5,unsigned short Y5,unsigned short X6,unsigned short Y6,unsigned long QuadrangularColor,unsigned long ForegroundColor);
|
||||
|
||||
/* 表格 */
|
||||
void LT768_MakeTable(unsigned short X1,unsigned short Y1,unsigned short W,unsigned short H,unsigned short Line,unsigned short Row,unsigned long TableColor,unsigned long ItemColor,unsigned long ForegroundColor,unsigned short width1,unsigned short width2,unsigned char mode);
|
||||
|
||||
/* 线性模式下DMA传输数据到SDRAM中 */
|
||||
void LT768_DMA_24bit_Linear(unsigned char SCS,unsigned char Clk,unsigned long flash_addr,unsigned long memory_ad,unsigned long data_num);
|
||||
void LT768_DMA_32bit_Linear(unsigned char SCS,unsigned char Clk,unsigned long flash_addr,unsigned long memory_ad,unsigned long data_num);
|
||||
|
||||
/* 区块模式下DMA传输数据到SDRAM中 */
|
||||
void LT768_DMA_24bit_Block(unsigned char SCS,unsigned char Clk,unsigned short X1,unsigned short Y1 ,unsigned short X_W,unsigned short Y_H,unsigned short P_W,unsigned long Addr);
|
||||
void LT768_DMA_32bit_Block(unsigned char SCS,unsigned char Clk,unsigned short X1,unsigned short Y1 ,unsigned short X_W,unsigned short Y_H,unsigned short P_W,unsigned long Addr);
|
||||
|
||||
/* 使用内建字库 */
|
||||
void LT768_Select_Internal_Font_Init(unsigned char Size,unsigned char XxN,unsigned char YxN,unsigned char ChromaKey,unsigned char Alignment);
|
||||
void LT768_Print_Internal_Font_String(unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor ,char *c);
|
||||
|
||||
/* nor flash使用外建字库 */
|
||||
/* 16*16 24*24 32*32 */
|
||||
void LT768_Select_Outside_Font_Init(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr,unsigned long Num,unsigned char Size,unsigned char XxN,unsigned char YxN,unsigned char ChromaKey,unsigned char Alignment);
|
||||
void LT768_Print_Outside_Font_String(unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned char *c);
|
||||
void LT768_Print_Outside_Font_GBK_String(unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned char *c);
|
||||
/* 48*48 72*72全角 */
|
||||
void LT768_BTE_Memory_Copy_ColorExpansion_8(unsigned long S0_Addr,unsigned short YS0,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned short X_W,unsigned short Y_H,unsigned long Foreground_color,unsigned long Background_color);
|
||||
void LT768_BTE_Memory_Copy_ColorExpansion_Chroma_key_8(unsigned long S0_Addr,unsigned short YS0,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned short X_W,unsigned short Y_H,unsigned long Foreground_color);
|
||||
void LT768_Print_Outside_Font_GB2312_48_72(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr,unsigned long ShowAddr,unsigned short width,unsigned char Size,unsigned char ChromaKey,unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned short w,unsigned short s,unsigned char *c);
|
||||
void LT768_Print_Outside_Font_BIG5_48_72(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr,unsigned long ShowAddr,unsigned short width,unsigned char Size,unsigned char ChromaKey,unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned short w,unsigned short s,unsigned char *c);
|
||||
void LT768_Print_Outside_Font_GBK_48_72(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr,unsigned long ShowAddr,unsigned short width,unsigned char Size,unsigned char ChromaKey,unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned short w,unsigned short s,unsigned char *c);
|
||||
|
||||
/* nor flash使用自定义字库 */
|
||||
/* 16*16 24*24 32*32 48*48 72*72全角 */
|
||||
int Get_User_Font_P(char chH,char chL);
|
||||
void LT768_Print_Outside_UserDefineFont_GB2312(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr,unsigned long ShowAddr,unsigned short width,unsigned char Size,unsigned char ChromaKey,unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned short w,unsigned short s,unsigned char *c);
|
||||
|
||||
/* 文字光标 */
|
||||
void LT768_Text_cursor_Init(unsigned char On_Off_Blinking,unsigned short Blinking_Time,unsigned short X_W,unsigned short Y_W);
|
||||
void LT768_Enable_Text_Cursor(void);
|
||||
void LT768_Disable_Text_Cursor(void);
|
||||
|
||||
/* 图像光标 */
|
||||
void LT768_Graphic_cursor_Init(unsigned char Cursor_N,unsigned char Color1,unsigned char Color2,unsigned short X_Pos,unsigned short Y_Pos,unsigned char *Cursor_Buf);
|
||||
void LT768_Set_Graphic_cursor_Pos(unsigned char Cursor_N,unsigned short X_Pos,unsigned short Y_Pos);
|
||||
void LT768_Enable_Graphic_Cursor(void);
|
||||
void LT768_Disable_Graphic_Cursor(void);
|
||||
|
||||
/* 区块传输引擎(BitBLT) */
|
||||
void BTE_Solid_Fill(unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned short color,unsigned short X_W,unsigned short Y_H);
|
||||
void LT768_BTE_Memory_Copy(unsigned long S0_Addr,unsigned short S0_W,unsigned short XS0,unsigned short YS0,unsigned long S1_Addr,unsigned short S1_W,unsigned short XS1,unsigned short YS1,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned int ROP_Code,unsigned short X_W,unsigned short Y_H);
|
||||
void LT768_BTE_Memory_Copy_Chroma_key(unsigned long S0_Addr,unsigned short S0_W,unsigned short XS0,unsigned short YS0,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned long Background_color,unsigned short X_W,unsigned short Y_H);
|
||||
void LT768_BTE_Pattern_Fill(unsigned char P_8x8_or_16x16,unsigned long S0_Addr,unsigned short S0_W,unsigned short XS0,unsigned short YS0,unsigned long Des_Addr,unsigned short Des_W, unsigned short XDes,unsigned short YDes,unsigned int ROP_Code ,unsigned short X_W,unsigned short Y_H);
|
||||
void LT768_BTE_Pattern_Fill_With_Chroma_key(unsigned char P_8x8_or_16x16,unsigned long S0_Addr,unsigned short S0_W,unsigned short XS0,unsigned short YS0,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned int ROP_Code,unsigned long Background_color,unsigned short X_W,unsigned short Y_H);
|
||||
void LT768_BTE_MCU_Write_MCU_16bit(unsigned long S1_Addr,unsigned short S1_W,unsigned short XS,unsigned short YS1,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned int ROP_Code,unsigned short X_W,unsigned short Y_H ,const unsigned short *data);
|
||||
void LT768_BTE_MCU_Write_Chroma_key_MCU_16bit(unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned long Background_color,unsigned short X_W,unsigned short Y_H,const unsigned short *data);
|
||||
void LT768_BTE_MCU_Write_ColorExpansion_MCU_16bit(unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned short X_W,unsigned short Y_H,unsigned long Foreground_color ,unsigned long Background_color ,const unsigned short *data);
|
||||
void LT768_BTE_MCU_Write_ColorExpansion_Chroma_key_MCU_16bit(unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned short X_W,unsigned short Y_H,unsigned long Foreground_color,const unsigned short *data);
|
||||
void BTE_Alpha_Blending(unsigned long S0_Addr,unsigned short S0_W,unsigned short XS0,unsigned short YS0,unsigned long S1_Addr,unsigned short S1_W,unsigned short XS1,unsigned short YS1,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned short X_W,unsigned short Y_H,unsigned char alpha);
|
||||
void BTE_Pixel_8bpp_Alpha_Blending(unsigned long S0_Addr,unsigned short S0_W,unsigned short XS0,unsigned short YS0,unsigned long S1_Addr,unsigned short S1_W,unsigned short XS1,unsigned short YS1,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned short X_W,unsigned short Y_H);
|
||||
void BTE_Pixel_16bpp_Alpha_Blending(unsigned long S0_Addr,unsigned short S0_W,unsigned short XS0,unsigned short YS0,unsigned long S1_Addr,unsigned short S1_W,unsigned short XS1,unsigned short YS1,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned short X_W,unsigned short Y_H);
|
||||
|
||||
/* PIP */
|
||||
void LT768_PIP_Init(unsigned char On_Off,unsigned char Select_PIP,unsigned long PAddr,unsigned short XP,unsigned short YP,unsigned long ImageWidth,unsigned short X_Dis,unsigned short Y_Dis,unsigned short X_W,unsigned short Y_H);
|
||||
void LT768_Set_DisWindowPos(unsigned char On_Off,unsigned char Select_PIP,unsigned short X_Dis,unsigned short Y_Dis);
|
||||
|
||||
/* PWM */
|
||||
void LT768_PWM0_Init(unsigned char on_off,unsigned char Clock_Divided,unsigned char Prescalar,unsigned short Count_Buffer,unsigned short Compare_Buffer);
|
||||
void LT768_PWM1_Init(unsigned char on_off,unsigned char Clock_Divided,unsigned char Prescalar,unsigned short Count_Buffer,unsigned short Compare_Buffer);
|
||||
void LT768_PWM0_Duty(unsigned short Compare_Buffer);
|
||||
void LT768_PWM1_Duty(unsigned short Compare_Buffer);
|
||||
|
||||
/* Standby Mode */
|
||||
void LT768_Standby(void);
|
||||
void LT768_Wkup_Standby(void);
|
||||
|
||||
/* Suspend Mode */
|
||||
void LT768_Suspend(void);
|
||||
void LT768_Wkup_Suspend(void);
|
||||
|
||||
/* Sleep Mode */
|
||||
void LT768_SleepMode(void);
|
||||
void LT768_Wkup_Sleep(void);
|
||||
|
||||
/* W25QXX */
|
||||
void LT768_SPI_Init(uint8_t cs,uint8_t div);
|
||||
void W25QXX_Enter_4Byte_AddressMode(void);
|
||||
void LT_W25QXX_Read(uint8_t* pBuffer,uint32_t ReadAddr,uint16_t NumByteToRead);
|
||||
|
||||
/* nand flash W25N01GV */
|
||||
uint8_t W25N01GV_ReadSR(uint8_t reg);
|
||||
void W25N01GV_Write_SR(uint8_t reg,uint8_t val);
|
||||
void W25N01GV_Wait_Busy(void);
|
||||
void W25N01GV_ContinuousRead_Mode(void);
|
||||
void W25N01GV_Write_Page(uint16_t page);
|
||||
void W25N01GV_ReadPageAddr_Data(uint8_t* pBuffer,uint32_t PageNum,uint32_t PageAddr,uint16_t NumByteToRead);
|
||||
void LT_W25N01GV_Read(uint8_t* pBuffer,uint32_t ReadAddr,uint16_t NumByteToRead);
|
||||
|
||||
/* nand flash显示图片 */
|
||||
void LT768_Nand_Pic(unsigned char SCS,unsigned short X1,unsigned short Y1,unsigned short X_W,unsigned short Y_H,unsigned long Addr,unsigned long lay0,unsigned long lay1);
|
||||
|
||||
/* nand flash使用外建字库初始化 */
|
||||
/* 16*16 24*24 32*32 */
|
||||
void NandFlash_Select_Outside_Font_Init(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr,unsigned long Num,unsigned char Size,unsigned char XxN,unsigned char YxN,unsigned char ChromaKey,unsigned char Alignment);
|
||||
|
||||
/* nand flash使用外建字库 */
|
||||
/* 48*48 72*72全角 */
|
||||
void LT768_BTE_Memory_Copy_8(unsigned long S0_Addr,unsigned short S0_W,unsigned short XS0,unsigned short YS0,unsigned long S1_Addr,unsigned short S1_W,unsigned short XS1,unsigned short YS1,unsigned long Des_Addr,unsigned short Des_W,unsigned short XDes,unsigned short YDes,unsigned int ROP_Code,unsigned short X_W,unsigned short Y_H);
|
||||
void LT768_Nand_8bpp_font(unsigned char SCS,unsigned char Clk,unsigned short X1,unsigned short Y1,unsigned short X_W,unsigned short Y_H,unsigned long Addr,unsigned long lay1,unsigned long lay2);
|
||||
void LT768_Print_Outside_Font_GB2312_48_72_Nand(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr1,unsigned long MemoryAddr2,unsigned long ShowAddr,unsigned short width,unsigned char Size,unsigned char ChromaKey,unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned short w,unsigned short s,unsigned char *c);
|
||||
void LT768_Print_Outside_Font_GBK_48_72_Nand(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr1,unsigned long MemoryAddr2,unsigned long ShowAddr,unsigned short width,unsigned char Size,unsigned char ChromaKey,unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned short w,unsigned short s,unsigned char *c);
|
||||
|
||||
/* nand flash使用自定义字库 */
|
||||
/* 16*16 24*24 32*32 48*48 72*72全角 */
|
||||
void LT768_Print_Outside_UserDefineFont_GB2312_Nand(unsigned char SCS,unsigned char Clk,unsigned long FlashAddr,unsigned long MemoryAddr1,unsigned long MemoryAddr2,unsigned long ShowAddr,unsigned short width,unsigned char Size,unsigned char ChromaKey,unsigned short x,unsigned short y,unsigned long FontColor,unsigned long BackGroundColor,unsigned short w,unsigned short s,unsigned char *c);
|
||||
#endif
|
Loading…
Reference in New Issue