Add NX configuration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3165 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
6655218d31
commit
29fafdc323
@ -1389,8 +1389,13 @@
|
||||
out-of-band bit to specify if the next word sent to the device is a command
|
||||
or data. This is typical, for example, in "9-bit" displays where the 9th bit
|
||||
is the CMD/DATA bit. The cmddata method provides selection of command or data.
|
||||
* drivers/lcd/p14201.c -- Now used the cmddata() method of the SPI interface.
|
||||
* arch/arm/src/lpc17xx/lpc17_usbdev.c -- LPC17xx USB driver is not functional.
|
||||
* drivers/lcd/p14201.c -- Now uses the cmddata() method of the SPI interface.
|
||||
* arch/arm/src/lpc17xx/lpc17_usbdev.c -- LPC17xx USB driver now appears to
|
||||
to be fully functional. examples/usbstorage configuration verified (the
|
||||
examples/usbserial configuration is untested).
|
||||
* drivers/usbdev/usbserial.c and usbstorage.c -- All USB class drivers need
|
||||
to call DEV_CONNECT() when they are ready to be enumerated. That is,
|
||||
(1) initially when bound to the USB driver, and (2) after a USB reset.
|
||||
* drivers/lcd/nokia6100.c -- A driver for the Nokia 6100 LCD.
|
||||
* configs/olimex-lpc1766stk/nx -- A NX graphics configuration for the Olimex
|
||||
LPC1766-STK board using the Nokia 6100 LCD driver.
|
||||
|
@ -1287,8 +1287,9 @@
|
||||
Verified configurations are now available for the NuttX OS test,
|
||||
for the NuttShell (NSH, see the <a href="ttp://www.nuttx.org/NuttShell.html">NSH User Guide</a>),
|
||||
for the NuttX network test, and for the <a href="http://acme.com/software/thttpd">THTTPD</a> webserver.
|
||||
(Additional USB configurations are in the release as well, but those have not yet been verified).
|
||||
Goals for NuttX-5.15 (and beyond) include: (1) Verified USB support, (2) SD card support, and (3) LCD support.
|
||||
Additional drivers for USB device and MicroSD has also be added and verified are available in CVS;
|
||||
A driver for the Nokia 6100 LCD has been added and is under test now.
|
||||
All are expected to be released in NuttX-5.15.
|
||||
</p>
|
||||
<p>
|
||||
<b>Development Environments:</b>
|
||||
@ -2010,11 +2011,16 @@ nuttx-5.15 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
out-of-band bit to specify if the next word sent to the device is a command
|
||||
or data. This is typical, for example, in "9-bit" displays where the 9th bit
|
||||
is the CMD/DATA bit. The cmddata method provides selection of command or data.
|
||||
* drivers/lcd/p14201.c -- Now used the cmddata() method of the SPI interface.
|
||||
* arch/arm/src/lpc17xx/lpc17_usbdev.c -- LPC17xx USB driver is not functional.
|
||||
* drivers/lcd/p14201.c -- Now uses the cmddata() method of the SPI interface.
|
||||
* arch/arm/src/lpc17xx/lpc17_usbdev.c -- LPC17xx USB driver now appears to
|
||||
to be fully functional. examples/usbstorage configuration verified (the
|
||||
examples/usbserial configuration is untested).
|
||||
* drivers/usbdev/usbserial.c and usbstorage.c -- All USB class drivers need
|
||||
to call DEV_CONNECT() when they are ready to be enumerated. That is,
|
||||
(1) initially when bound to the USB driver, and (2) after a USB reset.
|
||||
* drivers/lcd/nokia6100.c -- A driver for the Nokia 6100 LCD.
|
||||
* configs/olimex-lpc1766stk/nx -- A NX graphics configuration for the Olimex
|
||||
LPC1766-STK board using the Nokia 6100 LCD driver.
|
||||
|
||||
pascal-2.1 2010-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
<h1><big><font color="#3c34ec">
|
||||
<i>NuttX RTOS Porting Guide</i>
|
||||
</font></big></h1>
|
||||
<p>Last Updated: September 11, 2010</p>
|
||||
<p>Last Updated: December 4, 2010</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -2814,6 +2814,48 @@ build
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Nokia 6100 Configuration Settings:</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<code>CONFIG_NOKIA6100_SPIMODE</code>: Controls the SPI mode,
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NOKIA6100_FREQUENCY</code>: Define to use a different bus frequency.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NOKIA6100_NINTERFACES</code>:Specifies the number of physical Nokia
|
||||
6100 devices that will be supported.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NOKIA6100_BPP</code>: Device supports 8, 12, and 16 bits per pixel.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NOKIA6100_S1D15G10</code>: Selects the Epson S1D15G10 display controller
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NOKIA6100_PCF8833</code>: Selects the Phillips PCF8833 display controller
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_NOKIA6100_BLINIT</code>: Initial backlight setting
|
||||
</li>
|
||||
<p>
|
||||
Required LCD driver settings:
|
||||
</p>
|
||||
<li>
|
||||
<code>CONFIG_LCD_NOKIA6100</code>: Enable Nokia 6100 support
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_LCD_MAXCONTRAST</code>: Must be 63 with the Epson controller and 127 with
|
||||
the Phillips controller.
|
||||
</li>
|
||||
<li>
|
||||
<code>CONFIG_LCD_MAXPOWER</code>:Maximum value of backlight setting. The backlight
|
||||
control is managed outside of the 6100 driver so this value has no
|
||||
meaning to the driver. Board-specific logic may place restrictions on
|
||||
this value.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>ENC28J60 Ethernet Driver Configuration Settings</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
@ -75,27 +75,27 @@
|
||||
|
||||
/* Register addresses ***************************************************************/
|
||||
|
||||
#define LPC17_PWM1_IR (LPVC17_PWM1_BASE+LPC17_PWM_IR_OFFSET)
|
||||
#define LPC17_PWM1_TCR (LPVC17_PWM1_BASE+LPC17_PWM_TCR_OFFSET)
|
||||
#define LPC17_PWM1_TC (LPVC17_PWM1_BASE+LPC17_PWM_TC_OFFSET)
|
||||
#define LPC17_PWM1_PR (LPVC17_PWM1_BASE+LPC17_PWM_PR_OFFSET)
|
||||
#define LPC17_PWM1_PC (LPVC17_PWM1_BASE+LPC17_PWM_PC_OFFSET)
|
||||
#define LPC17_PWM1_MCR (LPVC17_PWM1_BASE+LPC17_PWM_MCR_OFFSET)
|
||||
#define LPC17_PWM1_MR0 (LPVC17_PWM1_BASE+LPC17_PWM_MR0_OFFSET)
|
||||
#define LPC17_PWM1_MR1 (LPVC17_PWM1_BASE+LPC17_PWM_MR1_OFFSET)
|
||||
#define LPC17_PWM1_MR2 (LPVC17_PWM1_BASE+LPC17_PWM_MR2_OFFSET)
|
||||
#define LPC17_PWM1_MR3 (LPVC17_PWM1_BASE+LPC17_PWM_MR3_OFFSET)
|
||||
#define LPC17_PWM1_MR4 (LPVC17_PWM1_BASE+LPC17_PWM_MR4_OFFSET)
|
||||
#define LPC17_PWM1_MR5 (LPVC17_PWM1_BASE+LPC17_PWM_MR5_OFFSET)
|
||||
#define LPC17_PWM1_MR6 (LPVC17_PWM1_BASE+LPC17_PWM_MR6_OFFSET)
|
||||
#define LPC17_PWM1_CCR (LPVC17_PWM1_BASE+LPC17_PWM_CCR_OFFSET)
|
||||
#define LPC17_PWM1_CR0 (LPVC17_PWM1_BASE+LPC17_PWM_CR0_OFFSET)
|
||||
#define LPC17_PWM1_CR1 (LPVC17_PWM1_BASE+LPC17_PWM_CR1_OFFSET)
|
||||
#define LPC17_PWM1_CR2 (LPVC17_PWM1_BASE+LPC17_PWM_CR2_OFFSET)
|
||||
#define LPC17_PWM1_CR3 (LPVC17_PWM1_BASE+LPC17_PWM_CR3_OFFSET)
|
||||
#define LPC17_PWM1_PCR (LPVC17_PWM1_BASE+LPC17_PWM_PCR_OFFSET)
|
||||
#define LPC17_PWM1_LER (LPVC17_PWM1_BASE+LPC17_PWM_LER_OFFSET)
|
||||
#define LPC17_PWM1_CTCR (LPVC17_PWM1_BASE+LPC17_PWM_CTCR_OFFSET)
|
||||
#define LPC17_PWM1_IR (LPC17_PWM1_BASE+LPC17_PWM_IR_OFFSET)
|
||||
#define LPC17_PWM1_TCR (LPC17_PWM1_BASE+LPC17_PWM_TCR_OFFSET)
|
||||
#define LPC17_PWM1_TC (LPC17_PWM1_BASE+LPC17_PWM_TC_OFFSET)
|
||||
#define LPC17_PWM1_PR (LPC17_PWM1_BASE+LPC17_PWM_PR_OFFSET)
|
||||
#define LPC17_PWM1_PC (LPC17_PWM1_BASE+LPC17_PWM_PC_OFFSET)
|
||||
#define LPC17_PWM1_MCR (LPC17_PWM1_BASE+LPC17_PWM_MCR_OFFSET)
|
||||
#define LPC17_PWM1_MR0 (LPC17_PWM1_BASE+LPC17_PWM_MR0_OFFSET)
|
||||
#define LPC17_PWM1_MR1 (LPC17_PWM1_BASE+LPC17_PWM_MR1_OFFSET)
|
||||
#define LPC17_PWM1_MR2 (LPC17_PWM1_BASE+LPC17_PWM_MR2_OFFSET)
|
||||
#define LPC17_PWM1_MR3 (LPC17_PWM1_BASE+LPC17_PWM_MR3_OFFSET)
|
||||
#define LPC17_PWM1_MR4 (LPC17_PWM1_BASE+LPC17_PWM_MR4_OFFSET)
|
||||
#define LPC17_PWM1_MR5 (LPC17_PWM1_BASE+LPC17_PWM_MR5_OFFSET)
|
||||
#define LPC17_PWM1_MR6 (LPC17_PWM1_BASE+LPC17_PWM_MR6_OFFSET)
|
||||
#define LPC17_PWM1_CCR (LPC17_PWM1_BASE+LPC17_PWM_CCR_OFFSET)
|
||||
#define LPC17_PWM1_CR0 (LPC17_PWM1_BASE+LPC17_PWM_CR0_OFFSET)
|
||||
#define LPC17_PWM1_CR1 (LPC17_PWM1_BASE+LPC17_PWM_CR1_OFFSET)
|
||||
#define LPC17_PWM1_CR2 (LPC17_PWM1_BASE+LPC17_PWM_CR2_OFFSET)
|
||||
#define LPC17_PWM1_CR3 (LPC17_PWM1_BASE+LPC17_PWM_CR3_OFFSET)
|
||||
#define LPC17_PWM1_PCR (LPC17_PWM1_BASE+LPC17_PWM_PCR_OFFSET)
|
||||
#define LPC17_PWM1_LER (LPC17_PWM1_BASE+LPC17_PWM_LER_OFFSET)
|
||||
#define LPC17_PWM1_CTCR (LPC17_PWM1_BASE+LPC17_PWM_CTCR_OFFSET)
|
||||
|
||||
/* Register bit definitions *********************************************************/
|
||||
/* Registers holding 32-bit numeric values (no bit field definitions):
|
||||
|
@ -546,6 +546,26 @@ defconfig -- This is a configuration file similar to the Linux
|
||||
- All pixel writes must be aligned to byte boundaries.
|
||||
The latter limitation effectively reduces the 128x96 disply to 64x96.
|
||||
|
||||
Nokia 6100 Configuration Settings:
|
||||
|
||||
CONFIG_NOKIA6100_SPIMODE - Controls the SPI mode
|
||||
CONFIG_NOKIA6100_FREQUENCY - Define to use a different bus frequency
|
||||
CONFIG_NOKIA6100_NINTERFACES - Specifies the number of physical Nokia
|
||||
6100 devices that will be supported.
|
||||
CONFIG_NOKIA6100_BPP - Device supports 8, 12, and 16 bits per pixel.
|
||||
CONFIG_NOKIA6100_S1D15G10 - Selects the Epson S1D15G10 display controller
|
||||
CONFIG_NOKIA6100_PCF8833 - Selects the Phillips PCF8833 display controller
|
||||
CONFIG_NOKIA6100_BLINIT - Initial backlight setting
|
||||
|
||||
Required LCD driver settings:
|
||||
CONFIG_LCD_NOKIA6100 - Enable Nokia 6100 support
|
||||
CONFIG_LCD_MAXCONTRAST - must be 63 with the Epson controller and 127 with
|
||||
the Phillips controller.
|
||||
CONFIG_LCD_MAXPOWER - Maximum value of backlight setting. The backlight
|
||||
control is managed outside of the 6100 driver so this value has no
|
||||
meaning to the driver. Board-specific logic may place restrictions on
|
||||
this value.
|
||||
|
||||
ENC28J60 Ethernet Driver Configuration Settings:
|
||||
CONFIG_NET_ENC28J60 - Enabled ENC28J60 support
|
||||
CONFIG_ENC28J60_SPIMODE - Controls the SPI mode
|
||||
|
@ -431,6 +431,10 @@ Where <subdir> is one of the following:
|
||||
driver is waiting for the network to come up. That is probably
|
||||
a bug in the Ethernet driver behavior!
|
||||
|
||||
nx:
|
||||
And example using the NuttX graphics system (NX). This example
|
||||
uses the P14201 OLED driver.
|
||||
|
||||
ostest:
|
||||
This configuration directory, performs a simple OS test using
|
||||
examples/ostest.
|
||||
|
@ -651,12 +651,21 @@ sudirectory and can be selected as follow:
|
||||
|
||||
Where <subdir> is one of the following:
|
||||
|
||||
nettest:
|
||||
This configuration directory may be used to enable networking using the
|
||||
LPC17xx's Ethernet controller. It uses examples/nettest to excercise the
|
||||
TCP/IP network.
|
||||
|
||||
nsh:
|
||||
Configures the NuttShell (nsh) located at examples/nsh. The
|
||||
Configuration enables both the serial and telnet NSH interfaces.
|
||||
Support for the board's SPI-based MicroSD card is included
|
||||
(but not passing tests as of this writing).
|
||||
|
||||
nx:
|
||||
And example using the NuttX graphics system (NX). This example
|
||||
uses the Nokia 6100 LCD driver.
|
||||
|
||||
ostest:
|
||||
This configuration directory, performs a simple OS test using
|
||||
examples/ostest.
|
||||
|
162
configs/olimex-lpc1766stk/nx/Make.defs
Executable file
162
configs/olimex-lpc1766stk/nx/Make.defs
Executable file
@ -0,0 +1,162 @@
|
||||
############################################################################
|
||||
# configs/olimex-lpc1766stk/nx/Make.defs
|
||||
#
|
||||
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# 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
|
||||
|
||||
# Setup for the selected toolchain
|
||||
|
||||
ifeq ($(CONFIG_LPC17_CODESOURCERYW),y)
|
||||
# CodeSourcery under Windows
|
||||
CROSSDEV = arm-none-eabi-
|
||||
WINTOOL = y
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC17_CODESOURCERYL),y)
|
||||
# CodeSourcery under Linux
|
||||
CROSSDEV = arm-none-eabi-
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
MAXOPTIMIZATION = -O2
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC17_DEVKITARM),y)
|
||||
# devkitARM under Windows
|
||||
CROSSDEV = arm-eabi-
|
||||
WINTOOL = y
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC17_BUILDROOT),y)
|
||||
# NuttX buildroot under Linux or Cygwin
|
||||
CROSSDEV = arm-elf-
|
||||
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
MAXOPTIMIZATION = -Os
|
||||
endif
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
DIRLINK = $(TOPDIR)/tools/winlink.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)/nx/ld.script}"
|
||||
MAXOPTIMIZATION = -O2
|
||||
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)/nx/ld.script
|
||||
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
|
||||
|
||||
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) -pipe
|
||||
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) -pipe
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
|
||||
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
||||
|
||||
NXFLATLDFLAGS1 = -r -d -warn-common
|
||||
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld -no-check-sections
|
||||
LDNXFLATFLAGS = -e main -s 2048
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
ifneq ($(CROSSDEV),arm-elf-)
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
endif
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
define PREPROCESS
|
||||
@echo "CPP: $1->$2"
|
||||
@$(CPP) $(CPPFLAGS) $1 -o $2
|
||||
endef
|
||||
|
||||
define COMPILE
|
||||
@echo "CC: $1"
|
||||
@$(CC) -c $(CFLAGS) $1 -o $2
|
||||
endef
|
||||
|
||||
define COMPILEXX
|
||||
@echo "CXX: $1"
|
||||
@$(CXX) -c $(CXXFLAGS) $1 -o $2
|
||||
endef
|
||||
|
||||
define ASSEMBLE
|
||||
@echo "AS: $1"
|
||||
@$(CC) -c $(AFLAGS) $1 -o $2
|
||||
endef
|
||||
|
||||
define ARCHIVE
|
||||
echo "AR: $2"; \
|
||||
$(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; }
|
||||
endef
|
||||
|
||||
define CLEAN
|
||||
@rm -f *.o *.a
|
||||
endef
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
1101
configs/olimex-lpc1766stk/nx/defconfig
Executable file
1101
configs/olimex-lpc1766stk/nx/defconfig
Executable file
File diff suppressed because it is too large
Load Diff
109
configs/olimex-lpc1766stk/nx/ld.script
Executable file
109
configs/olimex-lpc1766stk/nx/ld.script
Executable file
@ -0,0 +1,109 @@
|
||||
/****************************************************************************
|
||||
* configs/olimex-lpc1766stk/nx/ld.script
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The LPC1766 has 256Kb of FLASH beginning at address 0x0000:0000 and
|
||||
* 64Kb of total SRAM: 32Kb of SRAM in the CPU block beginning at address
|
||||
* 0x10000000 and 32Kb of AHB SRAM in two banks of 16Kb beginning at addresses
|
||||
* 0x20070000 and 0x20080000. Here we assume that .data and .bss will all fit
|
||||
* into the 32Kb CPU SRAM address range.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
{
|
||||
flash (rx) : ORIGIN = 0x00000000, LENGTH = 256K
|
||||
sram (rwx) : ORIGIN = 0x10000000, LENGTH = 32K
|
||||
}
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_stext)
|
||||
SECTIONS
|
||||
{
|
||||
.text : {
|
||||
_stext = ABSOLUTE(.);
|
||||
*(.vectors)
|
||||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
*(.got)
|
||||
*(.gcc_except_table)
|
||||
*(.gnu.linkonce.r.*)
|
||||
_etext = ABSOLUTE(.);
|
||||
} > flash
|
||||
|
||||
_eronly = ABSOLUTE(.); /* See below */
|
||||
|
||||
.data : {
|
||||
_sdata = ABSOLUTE(.);
|
||||
*(.data .data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
_edata = ABSOLUTE(.);
|
||||
} > sram AT > flash
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} >sram
|
||||
|
||||
.ARM.exidx : {
|
||||
__exidx_start = ABSOLUTE(.);
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = ABSOLUTE(.);
|
||||
} >sram
|
||||
|
||||
.bss : { /* BSS */
|
||||
_sbss = ABSOLUTE(.);
|
||||
*(.bss .bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > sram
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
}
|
47
configs/olimex-lpc1766stk/nx/setenv.sh
Executable file
47
configs/olimex-lpc1766stk/nx/setenv.sh
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
# configs/olimex-lpc1766stk/nx/setenv.sh
|
||||
#
|
||||
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
#
|
||||
# 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 [ "$(basename $0)" = "setenv.sh" ] ; then
|
||||
echo "You must source this script, not run it!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi
|
||||
|
||||
WD=`pwd`
|
||||
export LPCTOOL_DIR="${WD}/configs/olimex-lpc1766stk/tools"
|
||||
export BUILDROOT_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
export PATH="${BUILDROOT_BIN}:${LPCTOOL_DIR}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
@ -808,6 +808,56 @@ CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS=n
|
||||
CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER=n
|
||||
CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=n
|
||||
|
||||
#
|
||||
# Settings for examples/usbstorage
|
||||
#
|
||||
# CONFIG_EXAMPLES_USBSTRG_NLUNS
|
||||
# Defines the number of logical units (LUNs) exported by the USB storage
|
||||
# driver. Each LUN corresponds to one exported block driver (or partition
|
||||
# of a block driver). May be 1, 2, or 3. Default is 1.
|
||||
# CONFIG_EXAMPLES_USBSTRG_DEVMINOR1
|
||||
# The minor device number of the block driver for the first LUN. For
|
||||
# example, N in /dev/mmcsdN. Used for registering the block driver. Default
|
||||
# is zero.
|
||||
# CONFIG_EXAMPLES_USBSTRG_DEVPATH1
|
||||
# The full path to the registered block driver. Default is "/dev/mmcsd0"
|
||||
# CONFIG_EXAMPLES_USBSTRG_DEVMINOR2 and CONFIG_EXAMPLES_USBSTRG_DEVPATH2
|
||||
# Similar parameters that would have to be provided if CONFIG_EXAMPLES_USBSTRG_NLUNS
|
||||
# is 2 or 3. No defaults.
|
||||
# CONFIG_EXAMPLES_USBSTRG_DEVMINOR3 and CONFIG_EXAMPLES_USBSTRG_DEVPATH3
|
||||
# Similar parameters that would have to be provided if CONFIG_EXAMPLES_USBSTRG_NLUNS
|
||||
# is 3. No defaults.
|
||||
#
|
||||
# If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG and CONFIG_DEBUG_USB), then
|
||||
# the example code will also manage the USB trace output. The amount of trace output
|
||||
# can be controlled using:
|
||||
#
|
||||
# CONFIG_EXAMPLES_USBSTRG_TRACEINIT
|
||||
# Show initialization events
|
||||
# CONFIG_EXAMPLES_USBSTRG_TRACECLASS
|
||||
# Show class driver events
|
||||
# CONFIG_EXAMPLES_USBSTRG_TRACETRANSFERS
|
||||
# Show data transfer events
|
||||
# CONFIG_EXAMPLES_USBSTRG_TRACECONTROLLER
|
||||
# Show controller events
|
||||
# CONFIG_EXAMPLES_USBSTRG_TRACEINTERRUPTS
|
||||
# Show interrupt-related events.
|
||||
#
|
||||
CONFIG_EXAMPLES_USBSTRG_NLUNS=1
|
||||
CONFIG_EXAMPLES_USBSTRG_DEVMINOR1=0
|
||||
CONFIG_EXAMPLES_USBSTRG_DEVPATH1="/dev/mmcsd0"
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACEINIT=n
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACECLASS=n
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACETRANSFERS=n
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACECONTROLLER=n
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACEINTERRUPTS=n
|
||||
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACEINIT=n
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACECLASS=n
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACETRANSFERS=n
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACECONTROLLER=n
|
||||
CONFIG_EXAMPLES_USBSTRG_TRACEINTERRUPTS=n
|
||||
|
||||
#
|
||||
# Stack and heap information
|
||||
#
|
||||
|
@ -44,15 +44,18 @@
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/spi.h>
|
||||
#include <nuttx/lcd/lcd.h>
|
||||
#include <nuttx/lcd/nokia6100.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "lpc17_syscon.h"
|
||||
#include "lpc17_pwm.h"
|
||||
#include "lpc17_internal.h"
|
||||
#include "lpc17stk_internal.h"
|
||||
#include "lpc1766stk_internal.h"
|
||||
|
||||
#ifdef defined(CONFIG_NX_LCDDRIVER) && defined(CONFIG_LCD_NOKIA6100) && defined(CONFIG_LPC17_SSP0)
|
||||
#if defined(CONFIG_NX_LCDDRIVER) && defined(CONFIG_LCD_NOKIA6100) && defined(CONFIG_LPC17_SSP0)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
@ -60,8 +63,8 @@
|
||||
|
||||
/* Check power setting */
|
||||
|
||||
#if !defined(CONFIG_LCD_MAXPOWER) || CONFIG_LCD_MAXPOWER != 128
|
||||
# error "CONFIG_LCD_MAXPOWER must be 128"
|
||||
#if !defined(CONFIG_LCD_MAXPOWER) || CONFIG_LCD_MAXPOWER != 127
|
||||
# error "CONFIG_LCD_MAXPOWER must be 127"
|
||||
#endif
|
||||
|
||||
/* Backlight OFF PWM setting */
|
||||
@ -85,7 +88,7 @@
|
||||
|
||||
#ifdef CONFIG_LCD_NOKIADBG
|
||||
# define lcddbg(format, arg...) vdbg(format, ##arg)
|
||||
# define lcd_dumpgpio(m) lm3s_dumpgpio(LPC1766STK_LCD_RST, m)
|
||||
# define lcd_dumpgpio(m) lpc17_dumpgpio(LPC1766STK_LCD_RST, m)
|
||||
#else
|
||||
# define lcddbg(x...)
|
||||
# define lcd_dumpgpio(m)
|
||||
@ -109,7 +112,7 @@ void nokia_blinitialize(void)
|
||||
|
||||
/* Enable clocking of PWM1 */
|
||||
|
||||
regval = regreg32(LPC17_SYSCON_PCONP);
|
||||
regval = getreg32(LPC17_SYSCON_PCONP);
|
||||
regval |= SYSCON_PCONP_PCPWM1;
|
||||
putreg32(regval, LPC17_SYSCON_PCONP);
|
||||
|
||||
@ -189,16 +192,16 @@ FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno)
|
||||
/* Configure the LCD GPIOs */
|
||||
|
||||
lcd_dumpgpio("up_nxdrvinit: On entry");
|
||||
lm3s_configgpio(LPC1766STK_LCD_RST);
|
||||
lm3s_configgpio(LPC1766STK_LCD_BL);
|
||||
lpc17_configgpio(LPC1766STK_LCD_RST);
|
||||
lpc17_configgpio(LPC1766STK_LCD_BL);
|
||||
lcd_dumpgpio("up_nxdrvinit: After GPIO setup");
|
||||
|
||||
/* Reset the LCD */
|
||||
|
||||
lpc17_gpiowrite(LPC1766STK_LCD_RST, false);
|
||||
up_usdelay(10);
|
||||
up_udelay(10);
|
||||
lpc17_gpiowrite(LPC1766STK_LCD_RST, true);
|
||||
up_msdelay(5);
|
||||
up_mdelay(5);
|
||||
|
||||
/* Configure PWM1 to support the backlight */
|
||||
|
||||
|
@ -55,9 +55,8 @@
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/spi.h>
|
||||
#include <nuttx/lcd.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include <nuttx/lcd/lcd.h>
|
||||
#include <nuttx/lcd/nokia6100.h>
|
||||
|
||||
#ifdef CONFIG_NOKIA6100_PCF8833
|
||||
# include "pcf8833.h"
|
||||
@ -122,6 +121,7 @@
|
||||
# warning "Assuming 8BPP"
|
||||
# define CONFIG_NOKIA6100_BPP 8
|
||||
#endif
|
||||
|
||||
#if CONFIG_NOKIA6100_BPP != 8 && CONFIG_NOKIA6100_BPP != 12
|
||||
# if CONFIG_NOKIA6100_BPP == 16
|
||||
# error "Support for 16BPP no yet implemented"
|
||||
@ -130,6 +130,20 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_NOKIA6100_BPP == 8
|
||||
# ifdef CONFIG_NX_DISABLE_8BPP
|
||||
# warning "8-bit pixel support needed"
|
||||
# endif
|
||||
#elif CONFIG_NOKIA6100_BPP == 12
|
||||
# if defined(CONFIG_NX_DISABLE_12BPP) || !defined(CONFIG_NX_PACKEDMSFIRST)
|
||||
# warning "12-bit, big-endian pixel support needed"
|
||||
# endif
|
||||
#elif CONFIG_NOKIA6100_BPP == 16
|
||||
# ifdef CONFIG_NX_DISABLE_16BPP
|
||||
# warning "16-bit pixel support needed"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Exactly one LCD controller must be selected. "The Olimex boards have both display
|
||||
* controllers possible; if the LCD has a GE-12 sticker on it, it’s a Philips PCF8833.
|
||||
* If it has a GE-8 sticker, it’s an Epson controller."
|
||||
@ -173,12 +187,6 @@
|
||||
# define CONFIG_NOKIA6100_BLINIT (NOKIA_DEFAULT_CONTRAST/3)
|
||||
#endif
|
||||
|
||||
/* Color is 12bpp RGB with leftmost column contained in bits 7:4 */
|
||||
|
||||
#if defined(CONFIG_NX_DISABLE_4BPP) || !defined(CONFIG_NX_PACKEDMSFIRST)
|
||||
# warning "12-bit, big-endian pixel support needed"
|
||||
#endif
|
||||
|
||||
/* Word width must be 9 bits */
|
||||
|
||||
#if defined(CONFIG_NOKIA6100_WORDWIDTH) && CONFIG_NOKIA6100_WORDWIDTH != 9
|
||||
@ -280,8 +288,9 @@ struct nokia_dev_s
|
||||
|
||||
/* Private LCD-specific information follows */
|
||||
|
||||
uint8_t contrast;
|
||||
uint16_t linebuf[NOKIA_STRIDE+1];
|
||||
FAR struct spi_dev_s *spi; /* Contained SPI driver instance */
|
||||
uint8_t contrast; /* Current contrast setting */
|
||||
uint8_t power; /* Current power (backlight) setting */
|
||||
};
|
||||
|
||||
/**************************************************************************************
|
||||
@ -362,6 +371,15 @@ static uint8_t g_runbuffer[(3*NOKIA_XRES+1)/2];
|
||||
static uint16_t g_runbuffer[NOKIA_XRES];
|
||||
#endif
|
||||
|
||||
/* g_rowbuf is another buffer, but used internally by the Nokia 6100 driver in order
|
||||
* expand the pixel data into 9-bit data needed by the LCD. There are some
|
||||
* customizations that would eliminate the need for this extra buffer and for the
|
||||
* extra expansion/copy, but those customizations would require a special, non-standard
|
||||
* SPI driver that could expand 8- to 9-bit data on the fly.
|
||||
*/
|
||||
|
||||
static uint16_t g_rowbuf[NOKIA_STRIDE+1];
|
||||
|
||||
/* Device Driver Data Structures ******************************************************/
|
||||
|
||||
/* This structure describes the overall LCD video controller */
|
||||
@ -512,7 +530,7 @@ static const uint8_t g_rgbset8[] =
|
||||
|
||||
/* Page address set (PASET) */
|
||||
|
||||
static const uint8_t g_paset[]
|
||||
static const uint8_t g_paset[] =
|
||||
{
|
||||
S1D15G10_PASET, /* Page start address set */
|
||||
NOKIA_PGBIAS,
|
||||
@ -521,7 +539,7 @@ static const uint8_t g_paset[]
|
||||
|
||||
/* Column address set (CASET) */
|
||||
|
||||
static const uint8_t g_caset[]
|
||||
static const uint8_t g_caset[] =
|
||||
{
|
||||
S1D15G10_CASET, /* Column start address set */
|
||||
NOKIA_COLBIAS,
|
||||
@ -719,11 +737,10 @@ static void nokia_sndcmd(FAR struct spi_dev_s *spi, const uint8_t cmd)
|
||||
static void nokia_cmddata(FAR struct spi_dev_s *spi, uint8_t cmd, int datlen,
|
||||
const uint8_t *data)
|
||||
{
|
||||
uint16_t *linebuf = priv->linebuf;
|
||||
uint16_t word;
|
||||
uint16_t *linebuf = g_rowbuf;
|
||||
int i;
|
||||
|
||||
DEBUGASSERT(len <= NOKIA_STRIDE+1);
|
||||
DEBUGASSERT(datlen <= NOKIA_STRIDE);
|
||||
|
||||
/* Copy the command into the line buffer. Bit 8 == 0 denotes a command. */
|
||||
|
||||
@ -731,11 +748,11 @@ static void nokia_cmddata(FAR struct spi_dev_s *spi, uint8_t cmd, int datlen,
|
||||
|
||||
/* Copy any data after the command into the line buffer */
|
||||
|
||||
for (i = 1; i < len; i++)
|
||||
for (i = 0; i < datlen; i++)
|
||||
{
|
||||
/* Bit 8 == 1 denotes data */
|
||||
|
||||
*linebuf++ = (uin16_t)*data++ | NOKIA_LCD_DATA;
|
||||
*linebuf++ = (uint16_t)*data++ | NOKIA_LCD_DATA;
|
||||
}
|
||||
|
||||
/* Select the LCD */
|
||||
@ -744,7 +761,7 @@ static void nokia_cmddata(FAR struct spi_dev_s *spi, uint8_t cmd, int datlen,
|
||||
|
||||
/* Send the line buffer. */
|
||||
|
||||
(void)SPI_SNDBLOCK(spi, priv->linebuf, len);
|
||||
(void)SPI_SNDBLOCK(spi, g_rowbuf, datlen+1);
|
||||
|
||||
/* De-select the LCD */
|
||||
|
||||
@ -787,12 +804,12 @@ static void nokia_cmdarray(FAR struct spi_dev_s *spi, int len, const uint8_t *cm
|
||||
|
||||
static void nokia_clrram(FAR struct spi_dev_s *spi)
|
||||
{
|
||||
uint16_t *linebuf = priv->linebuf;
|
||||
uint16_t *linebuf = g_rowbuf;
|
||||
int i;
|
||||
|
||||
/* Set all zero data in the line buffer */
|
||||
|
||||
for (i = 0; i < NOKIA_STRIDE, i++)
|
||||
for (i = 0; i < NOKIA_STRIDE; i++)
|
||||
{
|
||||
/* Bit 8 == 1 denotes data */
|
||||
|
||||
@ -806,9 +823,9 @@ static void nokia_clrram(FAR struct spi_dev_s *spi)
|
||||
|
||||
/* Send the line buffer, once for each row. */
|
||||
|
||||
for (i = ; i < NOKIA_YRES-1; i++)
|
||||
for (i = 0; i < NOKIA_YRES; i++)
|
||||
{
|
||||
(void)SPI_SNDBLOCK(spi, priv->linebuf, NOKIA_STRIDE);
|
||||
(void)SPI_SNDBLOCK(spi, g_rowbuf, NOKIA_STRIDE);
|
||||
}
|
||||
|
||||
/* De-select the LCD */
|
||||
@ -831,36 +848,37 @@ static void nokia_clrram(FAR struct spi_dev_s *spi)
|
||||
**************************************************************************************/
|
||||
|
||||
static int nokia_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
|
||||
size_t npixels)
|
||||
size_t npixels)
|
||||
{
|
||||
struct nokia_dev_s *priv = &g_lcddev;
|
||||
FAR struct spi_dev_s *spi = priv->spi;
|
||||
uint16_t cmd[3];
|
||||
int datlen;
|
||||
|
||||
gvdbg("row: %d col: %d npixels: %d\n", row, col, npixels);
|
||||
|
||||
#if NOKIA_XBIAS > 0
|
||||
x += NOKIA_XBIAS;
|
||||
col += NOKIA_XBIAS;
|
||||
#endif
|
||||
#if NOKIA_XBIAS > 0
|
||||
y += NOKIA_YBIAS;
|
||||
row += NOKIA_YBIAS;
|
||||
#endif
|
||||
DEBUGASSERT(buffer && col < NOKIA_XRES && row >= 0 && );
|
||||
|
||||
/* Set up to write the run. */
|
||||
|
||||
nokia_select(spi);
|
||||
cmd[0] = PASET;
|
||||
cmd[1] = x | NOKIA_DATA;
|
||||
cmd[2] = NOKIA_ENDPAGE | NOKIA_DATA;
|
||||
cmd[0] = LCD_PASET;
|
||||
cmd[1] = col | NOKIA_LCD_DATA;
|
||||
cmd[2] = NOKIA_ENDPAGE | NOKIA_LCD_DATA;
|
||||
(void)SPI_SNDBLOCK(spi, cmd, 3);
|
||||
nokia_deselect(spi);
|
||||
|
||||
/* De-select the LCD */
|
||||
|
||||
nokia_select(spi);
|
||||
cmd[0] = CASET;
|
||||
cmd[1] = y | NOKIA_DATA;
|
||||
cmd[2] = NOKIA_ENDCOL | NOKIA_DATA;
|
||||
cmd[0] = LCD_CASET;
|
||||
cmd[1] = row | NOKIA_LCD_DATA;
|
||||
cmd[2] = NOKIA_ENDCOL | NOKIA_LCD_DATA;
|
||||
(void)SPI_SNDBLOCK(spi, cmd, 3);
|
||||
nokia_deselect(spi);
|
||||
|
||||
@ -885,7 +903,7 @@ static int nokia_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffe
|
||||
**************************************************************************************/
|
||||
|
||||
static int nokia_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
size_t npixels)
|
||||
size_t npixels)
|
||||
{
|
||||
gvdbg("row: %d col: %d npixels: %d\n", row, col, npixels);
|
||||
DEBUGASSERT(buffer && ((uintptr_t)buffer & 1) == 0);
|
||||
@ -943,8 +961,8 @@ static int nokia_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno,
|
||||
static int nokia_getpower(struct lcd_dev_s *dev)
|
||||
{
|
||||
struct nokia_dev_s *priv = (struct nokia_dev_s *)dev;
|
||||
gvdbg("power: %d\n", 0);
|
||||
return 0;
|
||||
gvdbg("power: %d\n", priv->power);
|
||||
return priv->power;
|
||||
}
|
||||
|
||||
/**************************************************************************************
|
||||
@ -1008,12 +1026,12 @@ static int nokia_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
|
||||
#ifdef CONFIG_NOKIA6100_S1D15G10
|
||||
while (priv->contrast < contrast)
|
||||
{
|
||||
nokia_sndcmd(dev->priv, S1D15G10_VOLUP);
|
||||
nokia_sndcmd(priv->spi, S1D15G10_VOLUP);
|
||||
priv->contrast++;
|
||||
}
|
||||
while (priv->contrast > contrast)
|
||||
{
|
||||
nokia_sndcmd(dev->priv, S1D15G10_VOLDOWN);
|
||||
nokia_sndcmd(priv->spi, S1D15G10_VOLDOWN);
|
||||
priv->contrast--;
|
||||
}
|
||||
#else /* CONFIG_NOKIA6100_PCF8833 */
|
||||
@ -1021,7 +1039,7 @@ static int nokia_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
|
||||
|
||||
cmd[0] = PCF8833_SETCON;
|
||||
cmd[1] = priv->contrast;
|
||||
nokia_sndarry(dev->spi, 2, cmd);
|
||||
nokia_sndarry(priv->spi, 2, cmd);
|
||||
priv->contrast = contrast;
|
||||
#endif
|
||||
}
|
||||
@ -1041,8 +1059,7 @@ static int nokia_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
|
||||
#ifdef CONFIG_NOKIA6100_S1D15G10
|
||||
static int nokia_initialize(struct nokia_dev_s *priv)
|
||||
{
|
||||
struct struct spi_dev_s *spi = priv->spi;
|
||||
int i;
|
||||
struct spi_dev_s *spi = priv->spi;
|
||||
|
||||
/* Configure the display */
|
||||
|
||||
@ -1052,7 +1069,7 @@ static int nokia_initialize(struct nokia_dev_s *priv)
|
||||
nokia_sndcmd(spi, S1D15G10_SLPOUT); /* Sleep out */
|
||||
nokia_cmdarray(spi, sizeof(g_volctr), g_volctr); /* Volume control (contrast) */
|
||||
nokia_cmdarray(spi, sizeof(g_pwrctr), g_pwrctr); /* Turn on voltage regulators */
|
||||
up_msdelay(100);
|
||||
up_mdelay(100);
|
||||
nokia_sndcmd(spi, S1D15G10_DISINV); /* Invert display */
|
||||
nokia_cmdarray(spi, sizeof(g_datctl), g_datctl); /* Data control */
|
||||
#if CONFIG_NOKIA6100_BPP == 8
|
||||
@ -1063,6 +1080,7 @@ static int nokia_initialize(struct nokia_dev_s *priv)
|
||||
nokia_cmdarray(spi, sizeof(g_paset), g_caset); /* Column address set */
|
||||
nokia_clrram(spi);
|
||||
nokia_sndcmd(spi, S1D15G10_DISON); /* Display on */
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1070,7 +1088,6 @@ static int nokia_initialize(struct nokia_dev_s *priv)
|
||||
static int nokia_initialize(struct nokia_dev_s *priv)
|
||||
{
|
||||
struct struct spi_dev_s *spi = priv->spi;
|
||||
int i;
|
||||
|
||||
nokia_sndcmd(spi, PCF8833_SLEEPOUT); /* Exit sleep mode */
|
||||
nokia_sndcmd(spi, PCF8833_BSTRON); /* Turn on voltage booster */
|
||||
@ -1081,6 +1098,7 @@ static int nokia_initialize(struct nokia_dev_s *priv)
|
||||
nokia_sndcmd(spi, PCF8833_NOP); /* No operation */
|
||||
nokia_clrram(spi);
|
||||
nokia_sndcmd(spi, PCF8833_DISPON); /* Display on */
|
||||
return OK;
|
||||
}
|
||||
#endif /* CONFIG_NOKIA6100_PCF8833 */
|
||||
|
||||
@ -1112,7 +1130,6 @@ static int nokia_initialize(struct nokia_dev_s *priv)
|
||||
FAR struct lcd_dev_s *nokia_lcdinitialize(FAR struct spi_dev_s *spi, unsigned int devno)
|
||||
{
|
||||
struct nokia_dev_s *priv = &g_lcddev;
|
||||
int ret;
|
||||
|
||||
gvdbg("Initializing\n");
|
||||
DEBUGASSERT(devno == 0);
|
||||
|
@ -136,6 +136,6 @@
|
||||
|
||||
/* Status register bit definions (after EPSRRD2) */
|
||||
|
||||
#define S1D15G10_SR_VOLUME 0x07 /* Bits 0-2: Built-in resistance ratio */
|
||||
#define S1D15G10_SR_RRATIO 0x07 /* Bits 0-2: Built-in resistance ratio */
|
||||
|
||||
#endif /* __DRIVERS_LCD_S1D15G10_H */
|
@ -123,7 +123,7 @@ EXTERN FAR struct lcd_dev_s *nokia_lcdinitialize(FAR struct spi_dev_s *spi, unsi
|
||||
*
|
||||
**************************************************************************************/
|
||||
|
||||
EXTERN int nokia_setpower(unsigned int power);
|
||||
EXTERN int nokia_backlight(unsigned int power);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
Reference in New Issue
Block a user