SAMV71-XULT: Add a configuration for testing the maXTouch Xplained Pro connected to the board
This commit is contained in:
parent
157c56d081
commit
c76373280b
@ -5,33 +5,64 @@
|
||||
|
||||
if ARCH_BOARD_SAMV71_XULT
|
||||
|
||||
config SAMV7XULT_HSMCI0_AUTOMOUNT
|
||||
config SAMV71XULT_MXTXPLND
|
||||
bool "MaXTouch Xplained connected"
|
||||
default n
|
||||
|
||||
if SAMV71XULT_MXTXPLND
|
||||
|
||||
choice
|
||||
prompt "MaXTouch Xplained connection"
|
||||
default SAMV71XULT_MXTXPLND_EXT1
|
||||
|
||||
config SAMV71XULT_MXTXPLND_EXT1
|
||||
bool "Connected on EXT1"
|
||||
|
||||
config SAMV71XULT_MXTXPLND_EXT2
|
||||
bool "Connected on EXT2"
|
||||
|
||||
endchoice # MaXTouch Xplained connection
|
||||
|
||||
if INPUT_MXT
|
||||
|
||||
config SAMV71XULT_MXT_I2CFREQUENCY
|
||||
int "maXTouch I2C frequency"
|
||||
default 400000
|
||||
|
||||
config SAMV71XULT_MXT_DEVMINOR
|
||||
int "/dev/input minor number"
|
||||
default 0
|
||||
|
||||
endif # INPUT_MXT
|
||||
endif # SAMV71XULT_MXTXPLND
|
||||
|
||||
config SAMV71XULT_HSMCI0_AUTOMOUNT
|
||||
bool "HSMCI0 automounter"
|
||||
default n
|
||||
depends on FS_AUTOMOUNTER && SAMA5_HSMCI0
|
||||
|
||||
if SAMV7XULT_HSMCI0_AUTOMOUNT
|
||||
if SAMV71XULT_HSMCI0_AUTOMOUNT
|
||||
|
||||
config SAMV7XULT_HSMCI0_AUTOMOUNT_FSTYPE
|
||||
config SAMV71XULT_HSMCI0_AUTOMOUNT_FSTYPE
|
||||
string "HSMCI0 file system type"
|
||||
default "vfat"
|
||||
|
||||
config SAMV7XULT_HSMCI0_AUTOMOUNT_BLKDEV
|
||||
config SAMV71XULT_HSMCI0_AUTOMOUNT_BLKDEV
|
||||
string "HSMCI0 block device"
|
||||
default "/dev/mmcsd0"
|
||||
|
||||
config SAMV7XULT_HSMCI0_AUTOMOUNT_MOUNTPOINT
|
||||
config SAMV71XULT_HSMCI0_AUTOMOUNT_MOUNTPOINT
|
||||
string "HSMCI0 mount point"
|
||||
default "/mnt/sdcard0"
|
||||
|
||||
config SAMV7XULT_HSMCI0_AUTOMOUNT_DDELAY
|
||||
config SAMV71XULT_HSMCI0_AUTOMOUNT_DDELAY
|
||||
int "HSMCI0 debounce delay (milliseconds)"
|
||||
default 1000
|
||||
|
||||
config SAMV7XULT_HSMCI0_AUTOMOUNT_UDELAY
|
||||
config SAMV71XULT_HSMCI0_AUTOMOUNT_UDELAY
|
||||
int "HSMCI0 unmount retry delay (milliseconds)"
|
||||
default 2000
|
||||
|
||||
endif # SAMV7XULT_HSMCI0_AUTOMOUNT
|
||||
endif # SAMV71XULT_HSMCI0_AUTOMOUNT
|
||||
|
||||
endif # ARCH_BOARD_SAMV71_XULT
|
||||
|
@ -5,6 +5,8 @@ This README file discusses the port of NuttX to the Atmel SAM V71 Xplained
|
||||
Ultra Evaluation Kit (SAMV71-XULT). This board features the ATSAMV71Q21 Cortex-M7
|
||||
microcontroller.
|
||||
|
||||
Additional support of provided for the (optional) maXTouch Xplained Pro LCD.
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
@ -16,6 +18,7 @@ Contents
|
||||
- LEDs and Buttons
|
||||
- AT24MAC402 Serial EEPROM
|
||||
- Networking
|
||||
- maXTouch Xplained Pro
|
||||
- Debugging
|
||||
- Configurations
|
||||
|
||||
@ -116,7 +119,7 @@ The BASIC nsh configuration is fully function (as desribed below under
|
||||
sample code and study of the data sheet, but I have not found the key to
|
||||
solving this.
|
||||
|
||||
+nmnmSerial Console
|
||||
Serial Console
|
||||
==============
|
||||
|
||||
The SAMV71-XULT has no on-board RS-232 drivers so it will be necessary to
|
||||
@ -294,12 +297,12 @@ Auto-Mounter
|
||||
CONFIG_FS_AUTOMOUNTER=y
|
||||
|
||||
Board-Specific Options
|
||||
CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT=y
|
||||
CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_FSTYPE="vfat"
|
||||
CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_BLKDEV="/dev/mmcsd0"
|
||||
CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_MOUNTPOINT="/mnt/sdcard"
|
||||
CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_DDELAY=1000
|
||||
CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_UDELAY=2000
|
||||
CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT=y
|
||||
CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_FSTYPE="vfat"
|
||||
CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_BLKDEV="/dev/mmcsd0"
|
||||
CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_MOUNTPOINT="/mnt/sdcard"
|
||||
CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_DDELAY=1000
|
||||
CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_UDELAY=2000
|
||||
|
||||
WARNING: SD cards should never be removed without first unmounting
|
||||
them. This is to avoid data and possible corruption of the file
|
||||
@ -691,6 +694,81 @@ additional settings.
|
||||
CONFIG_NSH_NETINIT_RETRYMSEC=2000 : Configure the network monitor as you like
|
||||
CONFIG_NSH_NETINIT_SIGNO=18
|
||||
|
||||
maXTouch Xplained Pro
|
||||
=====================
|
||||
|
||||
Connectivity
|
||||
------------
|
||||
Testing has also been performed using the maXTouch Xplained Pro LCD
|
||||
(ATMXT-XPRO). That LCD could be connected either via EXT1 or EXT2 using the 2x10
|
||||
20-pin cable and the maXTouch Xplained Pro standard extension header. Access
|
||||
this then performed in SPI mode.
|
||||
|
||||
---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
SAMV71-XULT maxTouch Xplained Pro
|
||||
PIN FUNCTION EXT1 FUNC EXT2 FUNC Description
|
||||
---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
1 ID - - - - Communication line to ID chip
|
||||
2 GND - - - - Ground
|
||||
3 N/C PC31 - PD30 -
|
||||
4 N/C PA19 - PC13 -
|
||||
5 GPIO PB3 GPIO PA6 GPIO Command/Data Select
|
||||
6 N/C PB2 - PD11 -
|
||||
7 PWM PA0 PWMC0_PWMH0 PC19 PWMC0_PMWH2 Backlight control
|
||||
8 N/C PC30 - PD26 -
|
||||
9 GPIO/IRQ PD28 GPIO PA2 GPIO IRQ from maXTouch controller
|
||||
10 GPIO PA5 GPIO PA24 GPIO RESET signal for maXTouch and LCD controller
|
||||
11 I2C SDA PA3 TWID0 PA3 TWID0 I2C Data line for maXTouch controller
|
||||
12 I2C SCL PA4 TWICK0 PA4 TWICK0 I2C Clock line for maXTouch controller
|
||||
13 N/C PB0 - PA21 -
|
||||
14 N/C PB1 - PB4 -
|
||||
15 CS PD25 GPIO PD27 GPIO CS line for LCD controller
|
||||
16 SPI MOSI PD21 SPI0_MOSI PD21 SPI0_MOSI SPI Data to LCD controller
|
||||
17 SPI MISO PD20 SPI0_MISO PD20 SPI0_MISO SPI Data from LCD controller
|
||||
18 SPI SCK PD22 SPI0_SPCK PD22 SPI0_SPCK SPI Clock line
|
||||
19 GND - - - - Ground
|
||||
20 VCC - - - - Target supply voltage
|
||||
---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
|
||||
NOTE: Use of EXT1 conflicts with the Arduino RXD pin (PD28). You cannot
|
||||
put the maXTouch Xplained in EXT1 and also use the Arduion RXD/TXD pins
|
||||
as your serial console.
|
||||
|
||||
It ought be possible to connect the LCD via the flat cable to the EXT4 LCD
|
||||
connector. In this case, you would use the SMC to communicate with the LCD.
|
||||
I have not tried this configuration.
|
||||
|
||||
Configuration Options
|
||||
---------------------
|
||||
|
||||
System Type -> SAMV7 Peripheral Support
|
||||
CONFIG_SAMV7_TWIHS0=y : Needed by the MaXTouch controller
|
||||
CONFIG_SAMV7_TWIHS0_FREQUENCY=100000
|
||||
|
||||
Board Selection ->
|
||||
CONFIG_SAMV71XULT_MXTXPLND=y : MaXTouch Xplained is connected
|
||||
CONFIG_SAMV71XULT_MXTXPLND_EXT1=y : Connected on EXT1, or
|
||||
CONFIG_SAMV71XULT_MXTXPLND_EXT2=y : Connected on EXT2
|
||||
CONFIG_SAMV71XULT_MXT_DEVMINOR=0 : Register as /dev/input0
|
||||
CONFIG_SAMV71XULT_MXT_I2CFREQUENCY=400000
|
||||
|
||||
NOTE: When selecting EXT1 or EXT2, be conscious of possible pin conflicts.
|
||||
EXT1, for example, will conflict with the use of the Arduino TXD and RXD
|
||||
pins for the serial console
|
||||
|
||||
Device Drivers -> Input Devices
|
||||
CONFIG_INPUT=y : Enable support for human input devices
|
||||
CONFIG_INPUT_MXT=y : Enable support for the maXTouch controller
|
||||
|
||||
The following enables a small built-in application that can be used to
|
||||
test the touchscreen:
|
||||
|
||||
Application Configuration -> Examples -> Touchscreen example
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN=y : Enables the example
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT=y : Have board-specific intialization
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH="/dev/input0"
|
||||
CONFIG_EXAMPLES_TOUCHSCREEN_MINOR=0
|
||||
|
||||
Debugging
|
||||
=========
|
||||
|
||||
@ -784,15 +862,70 @@ NOTES:
|
||||
Configuration sub-directories
|
||||
-----------------------------
|
||||
|
||||
nsh:
|
||||
mxtxplned:
|
||||
|
||||
Configures the NuttShell (nsh) located at examples/nsh. There are two
|
||||
NSH configurations:
|
||||
Configures the NuttShell (nsh) located at examples/nsh. There are three
|
||||
very similar NSH configurations:
|
||||
|
||||
- nsh. This configuration is focused on low level, command-line
|
||||
driver testing. It has not network.
|
||||
driver testing. It has no network.
|
||||
- netnsh. This configuration is focused on network testing and
|
||||
has only limited command support.
|
||||
- mxtxplnd. This configuration is identical to the nsh configuration
|
||||
but assumes that you have a maXTouch Xplained Pro LCD attached
|
||||
and includes extra tests for the touchscreen and LCD.
|
||||
|
||||
NOTES:
|
||||
|
||||
1. See the notes associated with the nsh configuration below. Only
|
||||
differences from that configuration will be addressed here.
|
||||
|
||||
2. Basic touchscreen/LCD configuration settings are discussed above in
|
||||
the paragraph entitled, "maXTouch Xplained Pro".
|
||||
|
||||
3. Like the nsh configuration, this configuratino has the serial console
|
||||
setup to used with an Aduino serial shield (UART3). NOTE: Use of
|
||||
EXT1 conflicts with the Arduino RXD pin (PD28). You cannot put the
|
||||
maXTouch Xplained in EXT1 and also use the Arduion RXD/TXD pins as
|
||||
your serial console. Hence, this configuration assumes that you
|
||||
have the maXTouch Xplained Pro connected via EXT2.
|
||||
|
||||
If you need to use EXT1, you will have to re-configure the serial
|
||||
console on a different UART/USART.
|
||||
|
||||
4. When the maXTouch Xplained is connect via EXT2, a new I2C address
|
||||
appears at address 0x4a:
|
||||
|
||||
nsh> i2c dev 3 77
|
||||
0 1 2 3 4 5 6 7 8 9 a b c d e f
|
||||
00: -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- --
|
||||
20: -- -- -- -- -- -- -- -- 28 -- -- -- -- -- -- --
|
||||
30: -- -- -- -- -- -- -- 37 -- -- -- -- -- -- -- --
|
||||
40: -- -- -- -- -- -- -- -- -- -- 4a -- -- -- 4e --
|
||||
50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- 5f
|
||||
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
70: -- -- -- -- -- -- -- --
|
||||
|
||||
This is the I2C address of the maXTouch touchscreen controller.
|
||||
|
||||
(0x1a is the address of the WM8904 Audio CODEC, 0x28 is the
|
||||
address of TWI interface to the EDBG, 0x4e is the address of the
|
||||
CP2100CP programmable PLL, and 0x57 and 0x5f are the addresses of
|
||||
the AT2 EEPROM. I am not sure what the other address, 0x37, is).
|
||||
|
||||
netnsh:
|
||||
|
||||
Configures the NuttShell (nsh) located at examples/nsh. There are three
|
||||
very similar NSH configurations:
|
||||
|
||||
- nsh. This configuration is focused on low level, command-line
|
||||
driver testing. It has no network.
|
||||
- netnsh. This configuration is focused on network testing and
|
||||
has only limited command support.
|
||||
- mxtxplnd. This configuration is identical to the nsh configuration
|
||||
but assumes that you have a maXTouch Xplained Pro LCD attached
|
||||
and includes extra tests for the touchscreen and LCD.
|
||||
|
||||
NOTES:
|
||||
|
||||
@ -897,13 +1030,16 @@ Configuration sub-directories
|
||||
|
||||
nsh:
|
||||
|
||||
Configures the NuttShell (nsh) located at examples/nsh. There are two
|
||||
NSH configurations:
|
||||
Configures the NuttShell (nsh) located at examples/nsh. There are three
|
||||
very similar NSH configurations:
|
||||
|
||||
- nsh. This configuration is focused on low level, command-line
|
||||
driver testing. It has not network.
|
||||
driver testing. It has no network.
|
||||
- netnsh. This configuration is focused on network testing and
|
||||
has only limited command support.
|
||||
- mxtxplnd. This configuration is identical to the nsh configuration
|
||||
but assumes that you have a maXTouch Xplained Pro LCD attached
|
||||
and includes extra tests for the touchscreen and LCD.
|
||||
|
||||
NOTES:
|
||||
|
||||
@ -1062,10 +1198,10 @@ Configuration sub-directories
|
||||
70: -- -- -- -- -- -- -- --
|
||||
nsh>
|
||||
|
||||
Where 0x1a us the address of the WM8904 Audio CODEC, 0x28 is the
|
||||
Where 0x1a is the address of the WM8904 Audio CODEC, 0x28 is the
|
||||
address of TWI interface to the EDBG, 0x4e is the address of the
|
||||
CP2100CP programmable PLL, and 0x57 and 0x5f are the addresses of
|
||||
the AT2 EEPROM (I am not sure what the other address, 0x37, is are
|
||||
the AT2 EEPROM (I am not sure what the other address, 0x37, is
|
||||
as this writing).
|
||||
|
||||
7. TWIHS0 is also used to support 256 byte non-volatile storage for
|
||||
|
@ -337,6 +337,57 @@
|
||||
|
||||
#define GPIO_SSC0_TD GPIO_SSC0_TD_1
|
||||
|
||||
/* maXTouch Xplained Pro LCD
|
||||
*
|
||||
* This LCD could be connected either via EXT1 or EXT2 using the 2x10
|
||||
* 20-pin cable and the maXTouch Xplained Pro standard extension
|
||||
* header. Access this then performed in SPI mode.
|
||||
*
|
||||
* ---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
* SAMV71-XULT maxTouch Xplained Pro
|
||||
* PIN FUNCTION EXT1 FUNC EXT2 FUNC Description
|
||||
* ---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
* 1 ID - - - - Communication line to ID chip
|
||||
* 2 GND - - - - Ground
|
||||
* 3 N/C PC31 - PD30 -
|
||||
* 4 N/C PA19 - PC13 -
|
||||
* 5 GPIO PB3 GPIO PA6 GPIO Command/Data Select
|
||||
* 6 N/C PB2 - PD11 -
|
||||
* 7 PWM PA0 PWMC0_PWMH0 PC19 PWMC0_PMWH2 Backlight control
|
||||
* 8 N/C PC30 - PD26 -
|
||||
* 9 GPIO/IRQ PD28 GPIO PA2 GPIO IRQ from maXTouch controller
|
||||
* 10 GPIO PA5 GPIO PA24 GPIO RESET signal for maXTouch and LCD controller
|
||||
* 11 I2C SDA PA3 TWID0 PA3 TWID0 I2C Data line for maXTouch controller
|
||||
* 12 I2C SCL PA4 TWICK0 PA4 TWICK0 I2C Clock line for maXTouch controller
|
||||
* 13 N/C PB0 - PA21 -
|
||||
* 14 N/C PB1 - PB4 -
|
||||
* 15 CS PD25 GPIO PD27 GPIO CS line for LCD controller
|
||||
* 16 SPI MOSI PD21 SPI0_MOSI PD21 SPI0_MOSI SPI Data to LCD controller
|
||||
* 17 SPI MISO PD20 SPI0_MISO PD20 SPI0_MISO SPI Data from LCD controller
|
||||
* 18 SPI SCK PD22 SPI0_SPCK PD22 SPI0_SPCK SPI Clock line
|
||||
* 19 GND - - - - Ground
|
||||
* 20 VCC - - - - Target supply voltage
|
||||
* ---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
*
|
||||
* There are no alternatives for SPI0 and TWI0 pins. Only the PWM pins require any
|
||||
* disambiguration.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SAMV71XULT_MXTXLND
|
||||
# ifdef CONFIG_SAMV71XULT_MXTXLND_EXT1
|
||||
|
||||
# define GPIO_PWMC0_H0 GPIO_PWMC0_H0_1
|
||||
# define GPIO_MXTXLND_PWM GPIO_PWMC0_H0_1
|
||||
# define GPIO_SPI0_NPCS1 GPIO_SPI0_NPCS1_2
|
||||
|
||||
# else /* CONFIG_SAMV71XULT_MXTXLND_EXT2 */
|
||||
|
||||
# define GPIO_PWMC0_H2 GPIO_PWMC0_H2_5
|
||||
# define GPIO_MXTXLND_PWM GPIO_PWMC0_H2_5
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
|
116
configs/samv71-xult/mxtxplnd/Make.defs
Normal file
116
configs/samv71-xult/mxtxplnd/Make.defs
Normal file
@ -0,0 +1,116 @@
|
||||
############################################################################
|
||||
# configs/samv71-xult/mxtxplnd/Make.defs
|
||||
#
|
||||
# Copyright (C) 2015 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 ($(CONFIG_ARMV7M_DTCM),y)
|
||||
LDSCRIPT = flash-dtcm.ld
|
||||
else
|
||||
LDSCRIPT = flash-sram.ld
|
||||
endif
|
||||
|
||||
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/$(LDSCRIPT)}"
|
||||
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/$(LDSCRIPT)
|
||||
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
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION)
|
||||
endif
|
||||
|
||||
ARCHCFLAGS = -fno-builtin
|
||||
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -fno-strict-aliasing
|
||||
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) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
LDNXFLATFLAGS = -e main -s 2048
|
||||
|
||||
OBJEXT = .o
|
||||
LIBEXT = .a
|
||||
EXEEXT =
|
||||
|
||||
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
||||
LDFLAGS += -nostartfiles -nodefaultlibs
|
||||
endif
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTINCLUDES = -I.
|
||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||
HOSTLDFLAGS =
|
||||
|
1063
configs/samv71-xult/mxtxplnd/defconfig
Normal file
1063
configs/samv71-xult/mxtxplnd/defconfig
Normal file
File diff suppressed because it is too large
Load Diff
77
configs/samv71-xult/mxtxplnd/setenv.sh
Executable file
77
configs/samv71-xult/mxtxplnd/setenv.sh
Executable file
@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
# configs/samv7-xult/mxtxplnd/Make.defs
|
||||
#
|
||||
# Copyright (C) 2015 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 the Cygwin path to the location where I installed the Atmel GCC
|
||||
# toolchain under Windows. You will also have to edit this if you install
|
||||
# this toolchain in any other location
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/Atmel/Atmel Toolchain/ARM GCC/Native/4.7.3.99/arm-gnu-toolchain/bin"
|
||||
|
||||
# This is the Cygwin path to the location where I installed the CodeSourcery
|
||||
# toolchain under windows. You will also have to edit this if you install
|
||||
# the CodeSourcery toolchain in any other location
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin"
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
|
||||
# export TOOLCHAIN_BIN="/cygdrive/c/Users/MyName/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_EABI/bin"
|
||||
|
||||
# This is the location where I installed the ARM "GNU Tools for ARM Embedded Processors"
|
||||
# You can this free toolchain here https://launchpad.net/gcc-arm-embedded
|
||||
export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9 2014q4/bin"
|
||||
|
||||
# This is the path to the location where I installed the devkitARM toolchain
|
||||
# You can get this free toolchain from http://devkitpro.org/ or http://sourceforge.net/projects/devkitpro/
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/devkitARM/bin"
|
||||
|
||||
# This is the Cygwin path to the location where I build the buildroot
|
||||
# toolchain.
|
||||
# export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
|
||||
# Add the path to the toolchain to the PATH varialble
|
||||
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# configs/sam4e-ek/netnsh/Make.defs
|
||||
# configs/samv7-xult/netnsh/Make.defs
|
||||
#
|
||||
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# configs/sam4e-ek/nsh/Make.defs
|
||||
# configs/samv7-xult/nsh/Make.defs
|
||||
#
|
||||
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -94,6 +94,10 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_MXT),y)
|
||||
CSRCS += sam_maxtouch.c
|
||||
endif
|
||||
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
|
@ -64,8 +64,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
#define NSECTORS(n) \
|
||||
(((n)+CONFIG_SAMV7XULT_ROMFS_ROMDISK_SECTSIZE-1) / \
|
||||
CONFIG_SAMV7XULT_ROMFS_ROMDISK_SECTSIZE)
|
||||
(((n)+CONFIG_SAMV71XULT_ROMFS_ROMDISK_SECTSIZE-1) / \
|
||||
CONFIG_SAMV71XULT_ROMFS_ROMDISK_SECTSIZE)
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
@ -125,25 +125,25 @@ int sam_bringup(void)
|
||||
HSMCI0_SLOTNO, HSMCI0_MINOR, ret);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SAMV7XULT_HSMCI0_MOUNT
|
||||
#ifdef CONFIG_SAMV71XULT_HSMCI0_MOUNT
|
||||
else
|
||||
{
|
||||
/* REVISIT: A delay seems to be required here or the mount will fail. */
|
||||
/* Mount the volume on HSMCI0 */
|
||||
|
||||
ret = mount(CONFIG_SAMV7XULT_HSMCI0_MOUNT_BLKDEV,
|
||||
CONFIG_SAMV7XULT_HSMCI0_MOUNT_MOUNTPOINT,
|
||||
CONFIG_SAMV7XULT_HSMCI0_MOUNT_FSTYPE,
|
||||
ret = mount(CONFIG_SAMV71XULT_HSMCI0_MOUNT_BLKDEV,
|
||||
CONFIG_SAMV71XULT_HSMCI0_MOUNT_MOUNTPOINT,
|
||||
CONFIG_SAMV71XULT_HSMCI0_MOUNT_FSTYPE,
|
||||
0, NULL);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
SYSLOG("ERROR: Failed to mount %s: %d\n",
|
||||
CONFIG_SAMV7XULT_HSMCI0_MOUNT_MOUNTPOINT, errno);
|
||||
CONFIG_SAMV71XULT_HSMCI0_MOUNT_MOUNTPOINT, errno);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SAMV7XULT_HSMCI0_MOUNT */
|
||||
#endif /* CONFIG_SAMV71XULT_HSMCI0_MOUNT */
|
||||
#endif /* HAVE_HSMCI */
|
||||
|
||||
#ifdef HAVE_AUTOMOUNTER
|
||||
@ -155,9 +155,9 @@ int sam_bringup(void)
|
||||
#ifdef HAVE_ROMFS
|
||||
/* Create a ROM disk for the /etc filesystem */
|
||||
|
||||
ret = romdisk_register(CONFIG_SAMV7XULT_ROMFS_ROMDISK_MINOR, romfs_img,
|
||||
ret = romdisk_register(CONFIG_SAMV71XULT_ROMFS_ROMDISK_MINOR, romfs_img,
|
||||
NSECTORS(romfs_img_len),
|
||||
CONFIG_SAMV7XULT_ROMFS_ROMDISK_SECTSIZE);
|
||||
CONFIG_SAMV71XULT_ROMFS_ROMDISK_SECTSIZE);
|
||||
if (ret < 0)
|
||||
{
|
||||
SYSLOG("ERROR: romdisk_register failed: %d\n", -ret);
|
||||
@ -166,14 +166,14 @@ int sam_bringup(void)
|
||||
{
|
||||
/* Mount the file system */
|
||||
|
||||
ret = mount(CONFIG_SAMV7XULT_ROMFS_ROMDISK_DEVNAME,
|
||||
CONFIG_SAMV7XULT_ROMFS_MOUNT_MOUNTPOINT,
|
||||
ret = mount(CONFIG_SAMV71XULT_ROMFS_ROMDISK_DEVNAME,
|
||||
CONFIG_SAMV71XULT_ROMFS_MOUNT_MOUNTPOINT,
|
||||
"romfs", MS_RDONLY, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
SYSLOG("ERROR: mount(%s,%s,romfs) failed: %d\n",
|
||||
CONFIG_SAMV7XULT_ROMFS_ROMDISK_DEVNAME,
|
||||
CONFIG_SAMV7XULT_ROMFS_MOUNT_MOUNTPOINT, errno);
|
||||
CONFIG_SAMV71XULT_ROMFS_ROMDISK_DEVNAME,
|
||||
CONFIG_SAMV71XULT_ROMFS_MOUNT_MOUNTPOINT, errno);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -175,7 +175,7 @@ static int sam_hsmci0_cardetect(int irq, void *regs)
|
||||
|
||||
ret = sam_hsmci_cardetect(&g_hsmci0);
|
||||
|
||||
#ifdef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT
|
||||
#ifdef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT
|
||||
/* Let the automounter know about the insertion event */
|
||||
|
||||
sam_automount_event(HSMCI0_SLOTNO, sam_cardinserted(HSMCI0_SLOTNO));
|
||||
|
310
configs/samv71-xult/src/sam_maxtouch.c
Normal file
310
configs/samv71-xult/src/sam_maxtouch.c
Normal file
@ -0,0 +1,310 @@
|
||||
/************************************************************************************
|
||||
* configs/samv7-xult/src/sam_maxtouch.c
|
||||
*
|
||||
* Copyright (C) 2015 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/input/touchscreen.h>
|
||||
#include <nuttx/input/mxt.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "sam_gpio.h"
|
||||
#include "sam_twihs.h"
|
||||
|
||||
#include "samv71-xult.h"
|
||||
|
||||
#ifdef HAVE_MAXTOUCH
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_SAMV71XULT_MXT_I2CFREQUENCY
|
||||
# define CONFIG_SAMV71XULT_MXT_I2CFREQUENCY 500000
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SAMV71XULT_MXT_DEVMINOR
|
||||
# define CONFIG_SAMV71XULT_MXT_DEVMINOR 0
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
struct sama5d4ek_tscinfo_s
|
||||
{
|
||||
/* Standard maXTouch interface */
|
||||
|
||||
struct mxt_lower_s lower;
|
||||
|
||||
/* Extensions for the sama5d4ek board */
|
||||
|
||||
mxt_handler_t handler;
|
||||
FAR void *arg;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/* IRQ/PIO access callbacks. These operations all hidden behind
|
||||
* callbacks to isolate the maXTouch driver from differences in PIO
|
||||
* interrupt handling by varying boards and MCUs. If possible,
|
||||
* interrupts should be configured on both rising and falling edges
|
||||
* so that contact and loss-of-contact events can be detected.
|
||||
*
|
||||
* attach - Attach the maXTouch interrupt handler to the PIO interrupt
|
||||
* enable - Enable or disable the PIO interrupt
|
||||
* clear - Acknowledge/clear any pending PIO interrupt
|
||||
*/
|
||||
|
||||
static int mxt_attach(FAR const struct mxt_lower_s *lower, mxt_handler_t isr,
|
||||
FAR void *arg);
|
||||
static void mxt_enable(FAR const struct mxt_lower_s *lower, bool enable);
|
||||
static void mxt_clear(FAR const struct mxt_lower_s *lower);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/* A reference to a structure of this type must be passed to the maXTouch
|
||||
* driver. This structure provides information about the configuration
|
||||
* of the maXTouch and provides some board-specific hooks.
|
||||
*
|
||||
* Memory for this structure is provided by the caller. It is not copied
|
||||
* by the driver and is presumed to persist while the driver is active.
|
||||
*/
|
||||
|
||||
static struct sama5d4ek_tscinfo_s g_mxtinfo =
|
||||
{
|
||||
.lower =
|
||||
{
|
||||
.address = MXT_I2C_ADDRESS,
|
||||
.frequency = CONFIG_SAMV71XULT_MXT_I2CFREQUENCY,
|
||||
|
||||
.attach = mxt_attach,
|
||||
.enable = mxt_enable,
|
||||
.clear = mxt_clear,
|
||||
},
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* IRQ/PIO access callbacks. These operations all hidden behind
|
||||
* callbacks to isolate the maXTouch driver from differences in PIO
|
||||
* interrupt handling by varying boards and MCUs. If possible,
|
||||
* interrupts should be configured on both rising and falling edges
|
||||
* so that contact and loss-of-contact events can be detected.
|
||||
*
|
||||
* attach - Attach the maXTouch interrupt handler to the PIO interrupt
|
||||
* enable - Enable or disable the PIO interrupt
|
||||
* clear - Acknowledge/clear any pending PIO interrupt
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int mxt_attach(FAR const struct mxt_lower_s *lower, mxt_handler_t isr,
|
||||
FAR void *arg)
|
||||
{
|
||||
if (isr)
|
||||
{
|
||||
/* Just save the address of the handler and its argument for now. The
|
||||
* new handler will called via mxt_interrupt() when the interrupt occurs.
|
||||
*/
|
||||
|
||||
ivdbg("Attaching %p\n", isr);
|
||||
g_mxtinfo.handler = isr;
|
||||
g_mxtinfo.arg = arg;
|
||||
}
|
||||
else
|
||||
{
|
||||
ivdbg("Detaching %p\n", g_mxtinfo.handler);
|
||||
mxt_enable(lower, false);
|
||||
g_mxtinfo.handler = NULL;
|
||||
g_mxtinfo.arg = NULL;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
static void mxt_enable(FAR const struct mxt_lower_s *lower, bool enable)
|
||||
{
|
||||
/* Enable or disable interrupts */
|
||||
|
||||
if (enable && g_mxtinfo.handler)
|
||||
{
|
||||
sam_gpioirqenable(IRQ_MXT_CHG);
|
||||
}
|
||||
else
|
||||
{
|
||||
sam_gpioirqdisable(IRQ_MXT_CHG);
|
||||
}
|
||||
}
|
||||
|
||||
static void mxt_clear(FAR const struct mxt_lower_s *lower)
|
||||
{
|
||||
/* Does nothing */
|
||||
}
|
||||
|
||||
static int mxt_interrupt(int irq, FAR void *context)
|
||||
{
|
||||
/* Just forward the interrupt to the maXTouch driver */
|
||||
|
||||
if (g_mxtinfo.handler)
|
||||
{
|
||||
return g_mxtinfo.handler(&g_mxtinfo.lower, g_mxtinfo.arg);
|
||||
}
|
||||
|
||||
/* We got an interrupt with no handler. This should not
|
||||
* happen.
|
||||
*/
|
||||
|
||||
sam_gpioirqdisable(IRQ_MXT_CHG);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arch_tcinitialize
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the touchscreen device. This function will register the driver
|
||||
* as /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
* returned to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int arch_tcinitialize(int minor)
|
||||
{
|
||||
FAR struct i2c_dev_s *i2c;
|
||||
static bool initialized = false;
|
||||
int ret;
|
||||
|
||||
idbg("minor %d\n", minor);
|
||||
DEBUGASSERT(minor == 0);
|
||||
|
||||
/* Have we already initialized? Since we never uninitialize we must prevent
|
||||
* multiple initializations. This is necessary, for example, when the
|
||||
* touchscreen example is used as a built-in application in NSH and can be
|
||||
* called numerous time. It will attempt to initialize each time.
|
||||
*/
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
/* Configure the maXTouch CHG interrupt pin */
|
||||
|
||||
(void)sam_configgpio(GPIO_MXT_CHG);
|
||||
|
||||
/* Get an instance of the I2C interface for the touchscreen chip select */
|
||||
|
||||
i2c = up_i2cinitialize(MXT_TWI_BUS);
|
||||
if (!i2c)
|
||||
{
|
||||
idbg("Failed to initialize I2C%d\n", MXT_TWI_BUS);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Configure maXTouch CHG interrupts */
|
||||
|
||||
sam_gpioirq(GPIO_MXT_CHG);
|
||||
(void)irq_attach(IRQ_MXT_CHG, mxt_interrupt);
|
||||
|
||||
/* Initialize and register the I2C touchscreen device */
|
||||
|
||||
ret = mxt_register(i2c, &g_mxtinfo.lower, CONFIG_SAMV71XULT_MXT_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
idbg("ERROR: Failed to register touchscreen device\n");
|
||||
irq_detach(IRQ_MXT_CHG);
|
||||
/* up_i2cuninitialize(i2c); */
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now we are initialized */
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arch_tcuninitialize
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void arch_tcuninitialize(void)
|
||||
{
|
||||
/* No support for un-initializing the touchscreen maXTouch device. It will
|
||||
* continue to run and process touch interrupts in the background.
|
||||
*/
|
||||
}
|
||||
|
||||
#endif /* HAVE_MAXTOUCH */
|
@ -61,6 +61,59 @@
|
||||
#define HAVE_NETWORK 1
|
||||
#define HAVE_MACADDR 1
|
||||
#define HAVE_MTDCONFIG 1
|
||||
#define HAVE_MAXTOUCH 1
|
||||
#define HAVE_ILI9488 1
|
||||
|
||||
/* LCD */
|
||||
|
||||
#ifndef CONFIG_SAMV71XULT_MXTXPLND
|
||||
# undef HAVE_MAXTOUCH
|
||||
# undef HAVE_ILI9488
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MAXTOUCH) && !defined(CONFIG_INPUT_MXT)
|
||||
# warning maXTouch support not enabled (CONFIG_INPUT_MXT)
|
||||
# undef HAVE_MAXTOUCH
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MAXTOUCH) && !defined(CONFIG_SAMV7_TWIHS0)
|
||||
# warning maXTouch support requires TWIHS0
|
||||
# undef HAVE_MAXTOUCH
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MAXTOUCH
|
||||
# if defined(CONFIG_SAMV71XULT_MXTXPLND_EXT1)
|
||||
# ifndef CONFIG_SAMV7_GPIOD_IRQ
|
||||
# warning maXTouch on EXT1 requires CONFIG_SAMV7_GPIOD_IRQ
|
||||
# undef HAVE_MAXTOUCH
|
||||
# endif
|
||||
# elif defined(CONFIG_SAMV71XULT_MXTXPLND_EXT2)
|
||||
# ifndef CONFIG_SAMV7_GPIOA_IRQ
|
||||
# warning maXTouch on EXT1 requires CONFIG_SAMV7_GPIOA_IRQ
|
||||
# undef HAVE_MAXTOUCH
|
||||
# endif
|
||||
# else
|
||||
# warning maXTouch requires CONFIG_SAMV71XULT_MXTXPLND_EXT1 or EXT2
|
||||
# undef HAVE_MAXTOUCH
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ILI9488) && !defined(CONFIG_LCD_ILI9488)
|
||||
# warning ILI9488 support not enabled (CONFIG_LCD_ILI9488)
|
||||
# undef HAVE_ILI9488
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ILI9488) && !defined(CONFIG_SAMV7_SPI0)
|
||||
# warning ILI9488 support requires SPI0
|
||||
# undef HAVE_ILI9488
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ILI9488
|
||||
# if !defined(CONFIG_SAMV71XULT_MXTXPLND_EXT1) && !defined(CONFIG_SAMV71XULT_MXTXPLND_EXT2)
|
||||
# warning ILI9488 requires CONFIG_SAMV71XULT_MXTXPLND_EXT1 or EXT2
|
||||
# undef HAVE_ILI9488
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* HSMCI */
|
||||
/* Can't support MMC/SD if the card interface is not enabled */
|
||||
@ -106,37 +159,37 @@
|
||||
|
||||
#if !defined(CONFIG_FS_AUTOMOUNTER) || !defined(HAVE_HSMCI)
|
||||
# undef HAVE_AUTOMOUNTER
|
||||
# undef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT
|
||||
# undef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT
|
||||
#ifndef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT
|
||||
# undef HAVE_AUTOMOUNTER
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AUTOMOUNTER
|
||||
# ifdef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT
|
||||
# ifdef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT
|
||||
/* HSMCI0 Automounter defaults */
|
||||
|
||||
# ifndef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_FSTYPE
|
||||
# define CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_FSTYPE "vfat"
|
||||
# ifndef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_FSTYPE
|
||||
# define CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_FSTYPE "vfat"
|
||||
# endif
|
||||
|
||||
# ifndef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_BLKDEV
|
||||
# define CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_BLKDEV "/dev/mmcds0"
|
||||
# ifndef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_BLKDEV
|
||||
# define CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_BLKDEV "/dev/mmcds0"
|
||||
# endif
|
||||
|
||||
# ifndef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_MOUNTPOINT
|
||||
# define CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_MOUNTPOINT "/mnt/sdcard0"
|
||||
# ifndef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_MOUNTPOINT
|
||||
# define CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_MOUNTPOINT "/mnt/sdcard0"
|
||||
# endif
|
||||
|
||||
# ifndef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_DDELAY
|
||||
# define CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_DDELAY 1000
|
||||
# ifndef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_DDELAY
|
||||
# define CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_DDELAY 1000
|
||||
# endif
|
||||
|
||||
# ifndef CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_UDELAY
|
||||
# define CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT_UDELAY 2000
|
||||
# ifndef CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_UDELAY
|
||||
# define CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT_UDELAY 2000
|
||||
# endif
|
||||
# endif /* CONFIG_SAMV7XULT_HSMCI0_AUTOMOUNT */
|
||||
# endif /* CONFIG_SAMV71XULT_HSMCI0_AUTOMOUNT */
|
||||
#endif /* HAVE_AUTOMOUNTER */
|
||||
|
||||
/* USB Device */
|
||||
@ -181,10 +234,122 @@
|
||||
|
||||
/* SAMV71-XULT GPIO Pin Definitions *************************************************/
|
||||
|
||||
/* LCD:
|
||||
* To be provided
|
||||
/* maXTouch Xplained Pro LCD
|
||||
*
|
||||
* This LCD could be connected either via EXT1 or EXT2 using the 2x10
|
||||
* 20-pin cable and the maXTouch Xplained Pro standard extension
|
||||
* header. Access this then performed in SPI mode.
|
||||
*
|
||||
* ---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
* SAMV71-XULT maxTouch Xplained Pro
|
||||
* PIN FUNCTION EXT1 FUNC EXT2 FUNC Description
|
||||
* ---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
* 1 ID - - - - Communication line to ID chip
|
||||
* 2 GND - - - - Ground
|
||||
* 3 N/C PC31 - PD30 -
|
||||
* 4 N/C PA19 - PC13 -
|
||||
* 5 GPIO PB3 GPIO PA6 GPIO Command/Data Select
|
||||
* 6 N/C PB2 - PD11 -
|
||||
* 7 PWM PA0 PWMC0_PWMH0 PC19 PWMC0_PMWH2 Backlight control
|
||||
* 8 N/C PC30 - PD26 -
|
||||
* 9 GPIO/IRQ PD28 GPIO PA2 GPIO IRQ from maXTouch controller
|
||||
* 10 GPIO PA5 GPIO PA24 GPIO RESET signal for maXTouch and LCD controller
|
||||
* 11 I2C SDA PA3 TWID0 PA3 TWID0 I2C Data line for maXTouch controller
|
||||
* 12 I2C SCL PA4 TWICK0 PA4 TWICK0 I2C Clock line for maXTouch controller
|
||||
* 13 N/C PB0 - PA21 -
|
||||
* 14 N/C PB1 - PB4 -
|
||||
* 15 CS PD25 GPIO PD27 GPIO CS line for LCD controller
|
||||
* 16 SPI MOSI PD21 SPI0_MOSI PD21 SPI0_MOSI SPI Data to LCD controller
|
||||
* 17 SPI MISO PD20 SPI0_MISO PD20 SPI0_MISO SPI Data from LCD controller
|
||||
* 18 SPI SCK PD22 SPI0_SPCK PD22 SPI0_SPCK SPI Clock line
|
||||
* 19 GND - - - - Ground
|
||||
* 20 VCC - - - - Target supply voltage
|
||||
* ---- -------- ---- ----------- ---- ----------- ------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SAMV71XULT_MXTXPLND
|
||||
/* Common maXTouch Xplained Pro board definitions */
|
||||
|
||||
# ifdef CONFIG_SAMV71XULT_MXTXPLND_EXT1
|
||||
|
||||
# define GPIO_MXTXPLND_RESET \
|
||||
(GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_SET | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN5)
|
||||
|
||||
# define GPIO_ILI9488_BLOFF \
|
||||
(GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN0)
|
||||
|
||||
# else /* CONFIG_SAMV71XULT_MXTXPLND_EXT2 */
|
||||
|
||||
# define GPIO_MXTXPLND_RESET \
|
||||
(GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_SET | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN24)
|
||||
|
||||
# define GPIO_ILI9488_BLOFF \
|
||||
(GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOC | GPIO_PIN19)
|
||||
|
||||
# endif /* CONFIG_SAMV71XULT_MXTXPLND_EXT1 */
|
||||
|
||||
# ifdef HAVE_MAXTOUCH
|
||||
/* maXTouch touchscreen controller definitions */
|
||||
|
||||
# ifdef CONFIG_SAMV71XULT_MXTXPLND_EXT1
|
||||
|
||||
# define GPIO_MXT_CHG \
|
||||
(GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_CFG_DEGLITCH | GPIO_INT_FALLING | \
|
||||
GPIO_PORT_PIOD | GPIO_PIN28)
|
||||
# define IRQ_MXT_CHG \
|
||||
SAM_IRQ_PD28
|
||||
|
||||
# else /* if CONFIG_SAMV71XULT_MXTXPLND_EXT2 */
|
||||
|
||||
# define GPIO_MXT_CHG \
|
||||
(GPIO_INPUT | GPIO_CFG_PULLUP | GPIO_CFG_DEGLITCH | GPIO_INT_FALLING | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN2)
|
||||
# define IRQ_MXT_CHG \
|
||||
SAM_IRQ_PA2
|
||||
|
||||
# endif /* CONFIG_SAMV71XULT_MXTXPLND_EXT1 */
|
||||
|
||||
/* The touchscreen communicates on TWI0, I2C address 0x4a */
|
||||
|
||||
# define MXT_TWI_BUS 0
|
||||
# define MXT_I2C_ADDRESS 0x4a
|
||||
|
||||
# endif /* HAVE_MAXTOUCH */
|
||||
|
||||
# ifdef HAVE_ILI9488
|
||||
/* ILI9488 LCD definitions */
|
||||
|
||||
# ifdef CONFIG_SAMV71XULT_MXTXPLND_EXT1
|
||||
# define GPIO_ILI9488_CMDDAT \
|
||||
(GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN23)
|
||||
|
||||
# define GPIO_ILI9488_CS \
|
||||
(PIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
|
||||
GPIO_PORT_PIOD | GPIO_PIN25)
|
||||
# define ILI9488_PORT \
|
||||
SPI0_CS1
|
||||
|
||||
# else /* if CONFIG_SAMV71XULT_MXTXPLND_EXT2 */
|
||||
|
||||
# define GPIO_ILI9488_CMDDAT \
|
||||
(GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_CLEAR | \
|
||||
GPIO_PORT_PIOA | GPIO_PIN23)
|
||||
|
||||
# define GPIO_ILI9488_CS \
|
||||
(PIO_OUTPUT | GPIO_CFG_PULLUP | GPIO_OUTPUT_SET | \
|
||||
GPIO_PORT_PIOD | GPIO_PIN27)
|
||||
# define MXTXLPND_PORT \
|
||||
SPI0_CS3
|
||||
|
||||
# endif /* CONFIG_SAMV71XULT_MXTXPLND_EXT1 */
|
||||
# endif /* HAVE_ILI9488 */
|
||||
#endif /* CONFIG_SAMV71XULT_MXTXPLND */
|
||||
|
||||
/* Ethernet MAC.
|
||||
*
|
||||
* KSZ8061RNBVA Connections
|
||||
|
Loading…
x
Reference in New Issue
Block a user