mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Add an ST7567 LCD driver for ZKIT-ARM-1769
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5772 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -238,10 +238,10 @@
|
||||
#define GPIO_UART2_RXD GPIO_UART2_RXD_1
|
||||
#define GPIO_UART1_TXD GPIO_UART1_TXD_2
|
||||
#define GPIO_UART1_RXD GPIO_UART1_RXD_2
|
||||
#define GPIO_SSP0_SCK GPIO_SSP0_SCK_1
|
||||
#define GPIO_SSP0_SSEL GPIO_SSP0_SSEL_1
|
||||
#define GPIO_SSP0_MISO GPIO_SSP0_MISO_1
|
||||
#define GPIO_SSP0_MOSI GPIO_SSP0_MOSI_1
|
||||
#define GPIO_SSP0_SCK GPIO_SSP0_SCK_2
|
||||
#define GPIO_SSP0_SSEL GPIO_SSP0_SSEL_2
|
||||
#define GPIO_SSP0_MISO GPIO_SSP0_MISO_2
|
||||
#define GPIO_SSP0_MOSI GPIO_SSP0_MOSI_2
|
||||
|
||||
/* P1.0/ENET_TXD0 ETH-TXD0
|
||||
* P1.1/ENET_TXD1 ETH-TXD1
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
############################################################################
|
||||
# configs/zkit-arm-1769/nxhello/Make.defs
|
||||
#
|
||||
# Copyright (C) 2013 Zilogic Systems. All rights reserved.
|
||||
# Author: Manikandan <code@zilogic.com>
|
||||
#
|
||||
# Based on configs/lpcxpresso-lpc1768/nsh/Make.defs
|
||||
#
|
||||
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include ${TOPDIR}/.config
|
||||
include ${TOPDIR}/tools/Config.mk
|
||||
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
||||
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
||||
MKDEP = $(TOPDIR)/tools/mknulldeps.sh
|
||||
ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
|
||||
ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
|
||||
ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script}"
|
||||
MAXOPTIMIZATION = -O2
|
||||
NXFLATLDSCRIPT = -T "${shell cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld}"
|
||||
else
|
||||
# Linux/Cygwin-native toolchain
|
||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
||||
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
||||
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
||||
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/ld.script
|
||||
NXFLATLDSCRIPT = -T"$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld"
|
||||
endif
|
||||
|
||||
CC = $(CROSSDEV)gcc
|
||||
CXX = $(CROSSDEV)g++
|
||||
CPP = $(CROSSDEV)gcc -E
|
||||
LD = $(CROSSDEV)ld
|
||||
AR = $(CROSSDEV)ar rcs
|
||||
NM = $(CROSSDEV)nm
|
||||
OBJCOPY = $(CROSSDEV)objcopy
|
||||
OBJDUMP = $(CROSSDEV)objdump
|
||||
|
||||
MKNXFLAT = mknxflat
|
||||
LDNXFLAT = ldnxflat
|
||||
|
||||
ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
|
||||
ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
ARCHOPTIMIZATION = -g
|
||||
else
|
||||
ARCHOPTIMIZATION = $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||
ARCHWARNINGSXX = -Wall -Wshadow
|
||||
ARCHDEFINES =
|
||||
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
|
||||
|
||||
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||
|
||||
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) $(NXFLATLDSCRIPT) -no-check-sections
|
||||
LDNXFLATFLAGS = -e main -s 2048
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
||||
ifneq ($(CROSSDEV),arm-nuttx-eabi-)
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
File diff suppressed because it is too large
Load Diff
Executable
+72
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
# configs/zkit-arm-1769/nxhello/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2013 Zilogic Systems. All rights reserved.
|
||||
# Author: Manikandan <code@zilogic.com>
|
||||
#
|
||||
# Based on configs/lpcxpresso-lpc1768/thttpd/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
if [ "$_" = "$0" ] ; then
|
||||
echo "You must source this script, not run it!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
WD=`pwd`
|
||||
if [ ! -x "setenv.sh" ]; then
|
||||
echo "This script must be executed from the top-level NuttX build directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${PATH_ORIG}" ]; then
|
||||
export PATH_ORIG="${PATH}"
|
||||
fi
|
||||
|
||||
# This is where the buildroot might reside on a Linux or Cygwin system
|
||||
# A minimal buildroot version with the NXFLAT tools is always required
|
||||
# for this configuration in order to buildthe THTTPD CGI programs
|
||||
export BUILDROOT_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
|
||||
# This is the default install location for Code Red on Linux
|
||||
#export TOOLCHAIN_BIN="/usr/local/LPCXpresso/tools/bin"
|
||||
|
||||
# This the Cygwin path to the LPCXpresso 3.6 install location under Windows
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/nxp/lpcxpresso_3.6/Tools/bin"
|
||||
|
||||
# This is the path to the LPCXpression tool subdirectory
|
||||
export LPCTOOL_DIR="${WD}/configs/zkit-arm-1769/tools"
|
||||
|
||||
# Add the path to the toolchain to the PATH varialble
|
||||
export PATH="${LPCTOOL_DIR}:${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
||||
@@ -41,7 +41,7 @@
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
ASRCS =
|
||||
CSRCS = up_boot.c up_leds.c up_ssp.c up_buttons.c
|
||||
CSRCS = up_boot.c up_leds.c up_ssp.c up_buttons.c up_lcd.c
|
||||
|
||||
ifeq ($(CONFIG_NSH_ARCHINIT),y)
|
||||
CSRCS += up_nsh.c
|
||||
|
||||
@@ -212,6 +212,9 @@
|
||||
#define ZKITARM_OLED_CS (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN6)
|
||||
#define ZKITARM_OLED_DC (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | GPIO_PIN7)
|
||||
#endif
|
||||
#define ZKITARM_OLED_RST (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN25)
|
||||
#define ZKITARM_OLED_CS (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN21)
|
||||
#define ZKITARM_OLED_RS (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN22)
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
|
||||
@@ -227,6 +227,63 @@ config UG9664HSWAG01_POWER
|
||||
|
||||
endif
|
||||
|
||||
config LCD_ST7567
|
||||
bool "ST7567 LCD Display Module"
|
||||
default n
|
||||
---help---
|
||||
LCD Display Module, ST7567, Univision Technology Inc. Used
|
||||
with the LPCXpresso and Embedded Artists base board.
|
||||
|
||||
Required LCD driver settings:
|
||||
LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be accepted.
|
||||
LCD_MAXPOWER should be 1: 0=off, 1=on
|
||||
|
||||
Required SPI driver settings:
|
||||
SPI_CMDDATA - Include support for cmd/data selection.
|
||||
|
||||
if LCD_ST7567
|
||||
|
||||
config ST7567_SPIMODE
|
||||
int "ST7567 SPI Mode"
|
||||
default 0
|
||||
---help---
|
||||
Controls the SPI mode
|
||||
|
||||
config ST7567_FREQUENCY
|
||||
int "ST7567 SPI Frequency"
|
||||
default 3500000
|
||||
---help---
|
||||
Define to use a different bus frequency
|
||||
|
||||
config ST7567_NINTERFACES
|
||||
int "Number of ST7567 Devices"
|
||||
default 1
|
||||
---help---
|
||||
Specifies the number of physical ST7567 devices that will be
|
||||
supported. NOTE: At present, this must be undefined or defined to be 1.
|
||||
|
||||
config ST7567_POWER
|
||||
bool "Power control"
|
||||
default n
|
||||
---help---
|
||||
If the hardware supports a controllable LCD a power supply, this
|
||||
configuration should be defined. In this case the system must
|
||||
provide an interface ug_power().
|
||||
|
||||
config ST7567_XRES
|
||||
int "ST7567 X Resolution"
|
||||
default 128
|
||||
---help---
|
||||
Specifies the X resolution of the LCD.
|
||||
|
||||
config ST7567_YRES
|
||||
int "ST7567 Y Resolution"
|
||||
default 64
|
||||
---help---
|
||||
Specifies the Y resolution of the LCD.
|
||||
|
||||
endif
|
||||
|
||||
config LCD_UG2864AMBAG01
|
||||
bool "UG-2864AMBAG01 OLED Display Module"
|
||||
default n
|
||||
|
||||
@@ -67,6 +67,10 @@ ifeq ($(CONFIG_LCD_MIO283QT2),y)
|
||||
CSRCS += mio283qt2.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ST7567),y)
|
||||
CSRCS += st7567.c
|
||||
endif
|
||||
|
||||
# Include LCD driver build support
|
||||
|
||||
DEPPATH += --dep-path lcd
|
||||
|
||||
@@ -107,6 +107,9 @@ Re-usable LCD drivers reside in the drivers/lcd directory:
|
||||
that you will proably ahve to customize for any particular LCD
|
||||
hardware. (see also configs/hymini-stm32v/src/ssd1289.c below).
|
||||
|
||||
st7567.c. LCD Display Module, ST7567, Univision Technology Inc. Used
|
||||
with the LPCXpresso and Embedded Artists base board.
|
||||
|
||||
ug-9664hswag01.c. OLED Display Module, UG-9664HSWAG01", Univision
|
||||
Technology Inc. Used with the LPC Xpresso and Embedded Artists
|
||||
base board.
|
||||
|
||||
Reference in New Issue
Block a user