Converted configs/pcblogic-pic32mx configurations to use kconfig-frontends. Re-organization of files in configs/pcblogic-pic32mx/src
This commit is contained in:
parent
ee20a6dfde
commit
4867c1f891
@ -1,10 +1,10 @@
|
|||||||
configs/pic32mx README
|
configs/pic32mx README
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
This README file discusses the port of NuttX to the PIC32MX board from
|
This README file discusses the port of NuttX to the PIC32MX board from
|
||||||
PCB Logic Design Co. This board features the MicroChip PIC32MX460F512L.
|
PCB Logic Design Co. This board features the MicroChip PIC32MX460F512L.
|
||||||
The board is a very simple -- little more than a carrier for the PIC32
|
The board is a very simple -- little more than a carrier for the PIC32
|
||||||
MCU plus voltage regulation, debug interface, and an OTG connector.
|
MCU plus voltage regulation, debug interface, and an OTG connector.
|
||||||
|
|
||||||
Contents
|
Contents
|
||||||
========
|
========
|
||||||
@ -13,6 +13,7 @@ Contents
|
|||||||
MAX3232 Connection
|
MAX3232 Connection
|
||||||
Toolchains
|
Toolchains
|
||||||
Loading NuttX with PICkit2
|
Loading NuttX with PICkit2
|
||||||
|
LCD1602
|
||||||
PIC32MX Configuration Options
|
PIC32MX Configuration Options
|
||||||
Configurations
|
Configurations
|
||||||
|
|
||||||
@ -324,6 +325,35 @@ Loading NuttX with PICkit2
|
|||||||
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path
|
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path
|
||||||
# to the top-level build directory. It is the only
|
# to the top-level build directory. It is the only
|
||||||
# required input to mkpichex.
|
# required input to mkpichex.
|
||||||
|
LCD1602
|
||||||
|
=======
|
||||||
|
The LCD1602 is an HD4478OU-based LCD from Wave share. The function
|
||||||
|
up_lcd1602_initialize() initializes the LCD1602 hardware and registers the
|
||||||
|
SLCD character driver as /dev/lcd1602. See include/nuttx/lcd/hd4478ou.h
|
||||||
|
|
||||||
|
LCD pin mapping:
|
||||||
|
|
||||||
|
----------------------------------- ---------- ----------------------------------
|
||||||
|
PIC32 LCD1602 PCBLogic PIN
|
||||||
|
PIN SIGNAL NAME PIN NAME(s)
|
||||||
|
----------------------------------- ---------- ----------------------------------
|
||||||
|
1. Vss --> Powerpoint GND
|
||||||
|
2. Vdd --> Powerpoint USB+5V
|
||||||
|
3. Vee N/C To ground via 10K potentiometer
|
||||||
|
4 AN15/OCFB/PMALL/PMA0/CN12/RB15 4. RS 4 PMA0, Selects registers
|
||||||
|
82 PMRD/CN14/RD5 5. RW 82 PMRD/PMWR, Selects read or write
|
||||||
|
81 OC5/PMWR/CN13/RD4 6. E 81 PMENB, Starts data read/write
|
||||||
|
93 PMD0/RE0 7. D0 93 PMD0
|
||||||
|
94 PMD1/RE1 8. D1 94 PMD1
|
||||||
|
98 PMD2/RE2 9. D2 98 PMD2
|
||||||
|
99 PMD3/RE3 10. D3 99 PMD3
|
||||||
|
100 PMD4/RE4 11. D4 100 PMD4
|
||||||
|
3 PMD5/RE5 12. D5 3 PMD5
|
||||||
|
4 PMD6/RE6 13. D6 4 PMD6
|
||||||
|
5 PMD7/RE7 14. D7 5 PMD7
|
||||||
|
15. A N/C To Vcc (5V) via 10K potentiometer
|
||||||
|
16. K --> Powerpoint GND
|
||||||
|
----------------------------------- ---------- ----------------------------------
|
||||||
|
|
||||||
PIC32MX Configuration Options
|
PIC32MX Configuration Options
|
||||||
=============================
|
=============================
|
||||||
@ -524,20 +554,126 @@ PIC32MX Configuration Options
|
|||||||
Configurations
|
Configurations
|
||||||
==============
|
==============
|
||||||
|
|
||||||
Each PIC32MX configuration is maintained in a sub-directory and can be
|
Each PIC32MX configuration is maintained in a sub-directory and can be
|
||||||
selected as follow:
|
selected as follow:
|
||||||
|
|
||||||
cd tools
|
cd tools
|
||||||
./configure.sh pcblogic-pic32mx/<subdir>
|
./configure.sh pcblogic-pic32mx/<subdir>
|
||||||
cd -
|
cd -
|
||||||
. ./setenv.sh
|
. ./setenv.sh
|
||||||
|
|
||||||
Where <subdir> is one of the following:
|
Where <subdir> is one of the following sub-directories.
|
||||||
|
|
||||||
|
NOTE: These configurations use the mconf-based configuration tool. To
|
||||||
|
change any of these configurations using that tool, you should:
|
||||||
|
|
||||||
|
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
|
||||||
|
and misc/tools/
|
||||||
|
|
||||||
|
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
||||||
|
reconfiguration process.
|
||||||
|
|
||||||
|
Configuration sub-directories
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
ostest:
|
ostest:
|
||||||
This configuration directory, performs a simple OS test using
|
This configuration directory, performs a simple OS test using
|
||||||
apps/examples/ostest.
|
apps/examples/ostest.
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
|
||||||
|
1. The serial console is on UART1. Therefore, you will need an external
|
||||||
|
RS232 driver or TTL serial-to-USB converter. The UART1 TX and RX
|
||||||
|
pins are available on:
|
||||||
|
|
||||||
|
TX -- Pin 53: U1TX/RF8
|
||||||
|
RX -- Pin 52: U1RX/RF2
|
||||||
|
|
||||||
|
Power for the converter is available from the power point connector:
|
||||||
|
|
||||||
|
GND -- POWER POINT: GND
|
||||||
|
Vcc -- POWER POINT: Vdd (3.3V) -- Or P32_VBUS (+5V)
|
||||||
|
Or +5V from a USB PC port.
|
||||||
|
|
||||||
|
The serial console is configured for 115200 8N1 by default.
|
||||||
|
|
||||||
|
2. By default, this configuration uses an older Microchip C32 toolchain
|
||||||
|
for Windows (the newer ones seem to be incompatible) and builds under
|
||||||
|
Cygwin (or probably MSYS). That
|
||||||
|
can easily be reconfigured, of course.
|
||||||
|
|
||||||
|
Build Setup:
|
||||||
|
CONFIG_HOST_WINDOWS=y : Builds under Windows
|
||||||
|
CONFIG_WINDOWS_CYGWIN=y : Using Cygwin
|
||||||
|
|
||||||
|
System Type:
|
||||||
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y : Older C32 toolchain
|
||||||
|
|
||||||
nsh:
|
nsh:
|
||||||
This configuration directory holds configuration files tht can
|
This configuration directory holds configuration files tht can
|
||||||
be used to support the NuttShell (NSH).
|
be used to support the NuttShell (NSH).
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
|
||||||
|
1. The serial console is on UART1. Therefore, you will need an external
|
||||||
|
RS232 driver or TTL serial-to-USB converter. The UART1 TX and RX
|
||||||
|
pins are available on:
|
||||||
|
|
||||||
|
TX -- Pin 53: U1TX/RF8
|
||||||
|
RX -- Pin 52: U1RX/RF2
|
||||||
|
|
||||||
|
Power for the converter is available from the power point connector:
|
||||||
|
|
||||||
|
GND -- POWER POINT: GND
|
||||||
|
Vcc -- POWER POINT: Vdd (3.3V) -- Or P32_VBUS (+5V)
|
||||||
|
Or +5V from a USB PC port.
|
||||||
|
|
||||||
|
The serial console is configured for 115200 8N1 by default.
|
||||||
|
|
||||||
|
2. Support for NSH built-in applications is enabled.
|
||||||
|
|
||||||
|
3. By default, this configuration uses an older Microchip C32 toolchain
|
||||||
|
for Windows (the newer ones seem to be incompatible) and builds under
|
||||||
|
Cygwin (or probably MSYS). That
|
||||||
|
can easily be reconfigured, of course.
|
||||||
|
|
||||||
|
Build Setup:
|
||||||
|
CONFIG_HOST_WINDOWS=y : Builds under Windows
|
||||||
|
CONFIG_WINDOWS_CYGWIN=y : Using Cygwin
|
||||||
|
|
||||||
|
System Type:
|
||||||
|
CONFIG_MIPS32_TOOLCHAIN_MICROCHIPW_LITE=y : Older C32 toolchain
|
||||||
|
|
||||||
|
4. To enable LCD1602 support:
|
||||||
|
|
||||||
|
Device Drivers:
|
||||||
|
CONFIG_LCD=y : Enable LCD menus
|
||||||
|
CONFIG_LCD_LCD1602=y : Select LCD1602
|
||||||
|
|
||||||
|
Library Routines:
|
||||||
|
CONFIG_LIB_SLCDCODEC=y : Enable the SLCD CODEC
|
||||||
|
|
||||||
|
System Type -> PIC32MX Peripheral Support:
|
||||||
|
CONFIG_PIC32MX_PMP=y : Enable PMP support
|
||||||
|
|
||||||
|
To enable apps/examples/slcd to test the LCD:
|
||||||
|
|
||||||
|
Application Configuration:
|
||||||
|
CONFIG_NSH_ARCHINIT=y : Needed to initialize the SLCD
|
||||||
|
CONFIG_EXAMPLES_SLCD=y : Enable apps/examples/slcd use /dev/lcd1602
|
||||||
|
CONFIG_EXAMPLES_SLCD_DEVNAME="/dev/lcd1602"
|
||||||
|
|
||||||
|
To enable LCD debug output:
|
||||||
|
|
||||||
|
Device Drivers:
|
||||||
|
CONFIG_LCD=y : (Needed to enable LCD debug)
|
||||||
|
|
||||||
|
Build Setup:
|
||||||
|
CONFIG_DEBUG=y : Enable debug features
|
||||||
|
CONFIG_DEBUG_VERBOSE=y : Enable LCD debug
|
||||||
|
|
||||||
|
NOTE: At this point in time, testing of the SLCD is very limited because
|
||||||
|
there is not much in apps/examples/slcd. Certainly there are more bugs
|
||||||
|
to be found. There are also many segment-encoded glyphs in stm32_lcd.c
|
||||||
|
But there is a basically functional driver with a working test setup
|
||||||
|
that can be extended if you want a fully functional SLCD driver.
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
############################################################################
|
|
||||||
# configs/pcblogic-pic32mx/nsh/appconfig
|
|
||||||
#
|
|
||||||
# Copyright (C) 2011-2012 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.
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
# Path to example in apps/examples containing the user_start entry point
|
|
||||||
|
|
||||||
CONFIGURED_APPS += examples/nsh
|
|
||||||
|
|
||||||
# The NSH application library
|
|
||||||
|
|
||||||
CONFIGURED_APPS += system/readline
|
|
||||||
CONFIGURED_APPS += nshlib
|
|
||||||
|
|
||||||
# Applications configured as an NX built-in commands
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_NET),y)
|
|
||||||
CONFIGURED_APPS += netutils/uiplib
|
|
||||||
CONFIGURED_APPS += netutils/resolv
|
|
||||||
CONFIGURED_APPS += netutils/webclient
|
|
||||||
CONFIGURED_APPS += netutils/tftpc
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_PWM),y)
|
|
||||||
CONFIGURED_APPS += examples/pwm
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_CAN),y)
|
|
||||||
CONFIGURED_APPS += examples/can
|
|
||||||
endif
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,39 +0,0 @@
|
|||||||
############################################################################
|
|
||||||
# configs/pcblogic-pic32mx/ostest/appconfig
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
# Path to example in apps/examples containing the user_start entry point
|
|
||||||
|
|
||||||
CONFIGURED_APPS += examples/ostest
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# configs/pcblogic-pic32mx/src/Makefile
|
# configs/pcblogic-pic32mx/src/Makefile
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -35,28 +35,32 @@
|
|||||||
|
|
||||||
-include $(TOPDIR)/Make.defs
|
-include $(TOPDIR)/Make.defs
|
||||||
|
|
||||||
CFLAGS += -I$(TOPDIR)/sched
|
CFLAGS += -I$(TOPDIR)/sched
|
||||||
|
|
||||||
ASRCS =
|
ASRCS =
|
||||||
CSRCS = up_boot.c
|
CSRCS = pic32mx_boot.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
ifeq ($(CONFIG_NSH_ARCHINIT),y)
|
||||||
CSRCS += up_leds.c
|
CSRCS += pic32mx_nsh.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
ifeq ($(CONFIG_LCD_LCD1602),y)
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
CSRCS += pic32mx_lcd1602.c
|
||||||
|
endif
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
|
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||||
ifeq ($(WINTOOL),y)
|
ifeq ($(WINTOOL),y)
|
||||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
||||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
||||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/mips32}"
|
-I "${shell cygpath -w $(ARCH_SRCDIR)/mips32}"
|
||||||
else
|
else
|
||||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/mips32
|
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/mips32
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: libboard$(LIBEXT)
|
all: libboard$(LIBEXT)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* configs/pcblogic-pic32mx/src/pcblogic-internal.h
|
* configs/pcblogic-pic32mx/src/pcblogic-internal.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __CONFIGS_PCBLOGIC_PIC32MX_SRC_PCBLOGIC_INTERNAL_H
|
#ifndef __CONFIGS_PCBLOGIC_PIC32MX_SRC_PCBLOGIC_PIC32MX_H
|
||||||
#define __CONFIGS_PCBLOGIC_PIC32MX_SRC_PCBLOGIC_INTERNAL_H
|
#define __CONFIGS_PCBLOGIC_PIC32MX_SRC_PCBLOGIC_PIC32MX_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@ -98,4 +98,4 @@ EXTERN void pic32mx_ledinit(void);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
#endif /* __CONFIGS_PCBLOGIC_PIC32MX_SRC_PCBLOGIC_INTERNAL_H */
|
#endif /* __CONFIGS_PCBLOGIC_PIC32MX_SRC_PCBLOGIC_PIC32MX_H */
|
@ -1,6 +1,5 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* configs/pcblogic-pic32mx/src/up_boot.c
|
* configs/pcblogic-pic32mx/src/pic32mx_boot.c
|
||||||
* arch/mips/src/board/up_boot.c
|
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@ -48,7 +47,7 @@
|
|||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
#include "pic32mx-internal.h"
|
#include "pic32mx-internal.h"
|
||||||
#include "pcblogic-internal.h"
|
#include "pcblogic-pic32mx.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Definitions
|
* Definitions
|
@ -1,8 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* configs/pcblocic-pic32mx/src/up_lcd1602.c
|
* configs/pcblocic-pic32mx/src/pic32mx_lcd1602.c
|
||||||
*
|
*
|
||||||
* This logic supports the connection of an LCD1602 LCD to the
|
* This logic supports the connection of an LCD1602 LCD to the PCB Logic
|
||||||
* STM32F4Discovery board. The LCD1602 is based on the Hitachi HD44780U LCD
|
* PIC32MX board. The LCD1602 is based on the Hitachi HD44780U LCD
|
||||||
* controller
|
* controller
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||||
@ -76,6 +76,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/fs/fs.h>
|
#include <nuttx/fs/fs.h>
|
||||||
#include <nuttx/lcd/hd4478ou.h>
|
#include <nuttx/lcd/hd4478ou.h>
|
||||||
|
|
||||||
@ -83,7 +84,7 @@
|
|||||||
#include "pic32mx-pmp.h"
|
#include "pic32mx-pmp.h"
|
||||||
#include "pic32mx-int.h"
|
#include "pic32mx-int.h"
|
||||||
#include "pic32mx-internal.h"
|
#include "pic32mx-internal.h"
|
||||||
#include "pcblogic-internal.h"
|
#include "pcblogic-pic32mx.h"
|
||||||
|
|
||||||
#ifdef CONFIG_LCD_LCD1602
|
#ifdef CONFIG_LCD_LCD1602
|
||||||
|
|
||||||
@ -129,7 +130,7 @@
|
|||||||
* Private Type Definition
|
* Private Type Definition
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
struct lpc1620_s
|
struct lcd1602_2
|
||||||
{
|
{
|
||||||
bool initialized; /* True: Completed initialization sequence */
|
bool initialized; /* True: Completed initialization sequence */
|
||||||
};
|
};
|
||||||
@ -149,9 +150,9 @@ static int lcd_poll(FAR struct file *filp, FAR struct pollfd *fds,
|
|||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* This is the driver state structure (there is no retained state information) */
|
/* Character driver operations */
|
||||||
|
|
||||||
static const struct file_operations g_lcd1602 =
|
static const struct file_operations g_lcdops =
|
||||||
{
|
{
|
||||||
0, /* open */
|
0, /* open */
|
||||||
0, /* close */
|
0, /* close */
|
||||||
@ -164,6 +165,10 @@ static const struct file_operations g_lcd1602 =
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* This is the driver state structure */
|
||||||
|
|
||||||
|
static struct lcd1602_2 g_lcd1602;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -288,7 +293,8 @@ static int lcd_poll(FAR struct file *filp, FAR struct pollfd *fds,
|
|||||||
* Name: up_lcd1602_initialize
|
* Name: up_lcd1602_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initialize the LCD1602 hardware and register the character driver.
|
* Initialize the LCD1602 hardware and register the character driver as
|
||||||
|
* /dev/lcd1602. Prototype is in include/nuttx/lcd/hd4478ou.h.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -364,7 +370,7 @@ int up_lcd1602_initialize(void)
|
|||||||
|
|
||||||
/* Register the LCD device driver */
|
/* Register the LCD device driver */
|
||||||
|
|
||||||
ret = register_driver("/dev/lcd1602", &g_lcd1602, 0644, &g_lcd1602);
|
ret = register_driver("/dev/lcd1602", &g_lcdops, 0644, &g_lcd1602);
|
||||||
g_lcd1602.initialized = true;
|
g_lcd1602.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
98
configs/pcblogic-pic32mx/src/pic32mx_nsh.c
Normal file
98
configs/pcblogic-pic32mx/src/pic32mx_nsh.c
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* config/pcblocic-pic32mx/src/pic32mx_nsh.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2013 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 <debug.h>
|
||||||
|
|
||||||
|
#include <nuttx/lcd/hd4478ou.h>
|
||||||
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
|
#include "pcblogic-pic32mx.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Pre-Processor Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Configuration ************************************************************/
|
||||||
|
|
||||||
|
#ifndef OK
|
||||||
|
# define OK 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Debug ********************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||||
|
# ifdef CONFIG_DEBUG
|
||||||
|
# define message(...) lowsyslog(__VA_ARGS__)
|
||||||
|
# else
|
||||||
|
# define message(...) printf(__VA_ARGS__)
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifdef CONFIG_DEBUG
|
||||||
|
# define message lowsyslog
|
||||||
|
# else
|
||||||
|
# define message printf
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: nsh_archinitialize
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Perform architecture specific initialization
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int nsh_archinitialize(void)
|
||||||
|
{
|
||||||
|
int ret = OK;
|
||||||
|
|
||||||
|
/* Initialize the LCD1602 and register the device as /dev/lcd1602 */
|
||||||
|
|
||||||
|
#ifdef CONFIG_LCD_LCD1602
|
||||||
|
ret = up_lcd1602_initialize();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
@ -745,7 +745,19 @@ Configurations
|
|||||||
|
|
||||||
configure.bat STM32L-Discovery\<subdir>
|
configure.bat STM32L-Discovery\<subdir>
|
||||||
|
|
||||||
Where <subdir> is one of the following:
|
Where <subdir> is one of the following sub-directories.
|
||||||
|
|
||||||
|
NOTE: These configurations use the mconf-based configuration tool. To
|
||||||
|
change any of these configurations using that tool, you should:
|
||||||
|
|
||||||
|
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
|
||||||
|
and misc/tools/
|
||||||
|
|
||||||
|
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
||||||
|
reconfiguration process.
|
||||||
|
|
||||||
|
Configuration sub-directories
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
nsh:
|
nsh:
|
||||||
---
|
---
|
||||||
@ -753,25 +765,16 @@ Configurations
|
|||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
|
|
||||||
1. This configuration uses the mconf-based configuration tool. To
|
1. The serial console is on UART1 and NuttX LED support is enabled.
|
||||||
change this configuration using that tool, you should:
|
|
||||||
|
|
||||||
a. Build and install the kconfig-mconf tool. See nuttx/README.txt
|
|
||||||
and misc/tools/
|
|
||||||
|
|
||||||
b. Execute 'make menuconfig' in nuttx/ in order to start the
|
|
||||||
reconfiguration process.
|
|
||||||
|
|
||||||
2. The serial console is on UART1 and NuttX LED support is enabled.
|
|
||||||
Therefore, you will need an external RS232 driver or TTL serial-to-
|
Therefore, you will need an external RS232 driver or TTL serial-to-
|
||||||
USB converter. The UART1 TX and RX pins should be available on
|
USB converter. The UART1 TX and RX pins should be available on
|
||||||
PA9 and PA10, respectively.
|
PA9 and PA10, respectively.
|
||||||
|
|
||||||
The serial console is configured for 57600 8N1 by default.
|
The serial console is configured for 57600 8N1 by default.
|
||||||
|
|
||||||
3. Support for NSH built-in applications is *not* enabled.
|
2. Support for NSH built-in applications is *not* enabled.
|
||||||
|
|
||||||
4. By default, this configuration uses the CodeSourcery toolchain
|
3. By default, this configuration uses the CodeSourcery toolchain
|
||||||
for Windows and builds under Cygwin (or probably MSYS). That
|
for Windows and builds under Cygwin (or probably MSYS). That
|
||||||
can easily be reconfigured, of course.
|
can easily be reconfigured, of course.
|
||||||
|
|
||||||
@ -782,7 +785,7 @@ Configurations
|
|||||||
System Type:
|
System Type:
|
||||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery for Windows
|
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery for Windows
|
||||||
|
|
||||||
5. To enable SLCD support:
|
4. To enable SLCD support:
|
||||||
|
|
||||||
Board Selection:
|
Board Selection:
|
||||||
CONFIG_ARCH_LEDS=y : Disable LED support
|
CONFIG_ARCH_LEDS=y : Disable LED support
|
||||||
|
Loading…
Reference in New Issue
Block a user