From e4ce738b060ba7d83e78f0dc3e048d6c6c1a7e9b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 22 May 2015 14:36:01 -0600 Subject: [PATCH] lpcxpresso-lpc1115: Update naming to match current coventions --- configs/lpcxpresso-lpc1115/include/board.h | 14 ++--- configs/lpcxpresso-lpc1115/nsh/Make.defs | 5 +- configs/lpcxpresso-lpc1115/nsh/setenv.sh | 29 +++++++--- configs/lpcxpresso-lpc1115/scripts/ld.script | 2 +- configs/lpcxpresso-lpc1115/src/Makefile | 14 ++--- .../src/{up_adc.c => lpc11_adc.c} | 13 ++--- .../src/{up_boot.c => lpc11_boot.c} | 8 +-- .../src/{up_dac.c => lpc11_dac.c} | 13 +++-- .../src/{up_leds.c => lpc11_leds.c} | 48 ++++++++-------- .../src/{up_nsh.c => lpc11_nsh.c} | 7 +-- .../src/{up_pwm.c => lpc11_pwm.c} | 26 ++++----- .../src/{up_ssp.c => lpc11_ssp.c} | 57 +++++++++---------- ...presso_internal.h => lpcxpresso_lpc1115.h} | 16 +++--- 13 files changed, 131 insertions(+), 121 deletions(-) rename configs/lpcxpresso-lpc1115/src/{up_adc.c => lpc11_adc.c} (94%) rename configs/lpcxpresso-lpc1115/src/{up_boot.c => lpc11_boot.c} (93%) rename configs/lpcxpresso-lpc1115/src/{up_dac.c => lpc11_dac.c} (89%) rename configs/lpcxpresso-lpc1115/src/{up_leds.c => lpc11_leds.c} (90%) rename configs/lpcxpresso-lpc1115/src/{up_nsh.c => lpc11_nsh.c} (96%) rename configs/lpcxpresso-lpc1115/src/{up_pwm.c => lpc11_pwm.c} (88%) rename configs/lpcxpresso-lpc1115/src/{up_ssp.c => lpc11_ssp.c} (80%) rename configs/lpcxpresso-lpc1115/src/{lpcxpresso_internal.h => lpcxpresso_lpc1115.h} (96%) diff --git a/configs/lpcxpresso-lpc1115/include/board.h b/configs/lpcxpresso-lpc1115/include/board.h index d935ea27bf..7cdda317d1 100644 --- a/configs/lpcxpresso-lpc1115/include/board.h +++ b/configs/lpcxpresso-lpc1115/include/board.h @@ -1,8 +1,7 @@ /************************************************************************************ * configs/lpcxpresso-lpc1115/include/board.h - * include/arch/board/board.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -34,8 +33,8 @@ * ************************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __CONFIG_LPCXPRESSO_LPC1115_INCLUDE_BOARD_H +#define __CONFIG_LPCXPRESSO_LPC1115_INCLUDE_BOARD_H /************************************************************************************ * Included Files @@ -217,7 +216,8 @@ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif @@ -235,7 +235,7 @@ extern "C" { * ************************************************************************************/ -EXTERN void lpc11_boardinitialize(void); +void lpc11_boardinitialize(void); #undef EXTERN #if defined(__cplusplus) @@ -243,4 +243,4 @@ EXTERN void lpc11_boardinitialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __CONFIG_LPCXPRESSO_LPC1115_INCLUDE_BOARD_H */ diff --git a/configs/lpcxpresso-lpc1115/nsh/Make.defs b/configs/lpcxpresso-lpc1115/nsh/Make.defs index 836c4e5095..b5ac3d1eb4 100644 --- a/configs/lpcxpresso-lpc1115/nsh/Make.defs +++ b/configs/lpcxpresso-lpc1115/nsh/Make.defs @@ -1,7 +1,7 @@ ############################################################################ -# configs/freedom-kl25z/nsh/Make.defs +# configs/lpcxpresso-lpc1115/nsh/Make.defs # -# Copyright (C) 2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -120,4 +120,3 @@ else # Linux/Cygwin-native host tools MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT) endif - diff --git a/configs/lpcxpresso-lpc1115/nsh/setenv.sh b/configs/lpcxpresso-lpc1115/nsh/setenv.sh index 73ecd99413..c8595cc94a 100644 --- a/configs/lpcxpresso-lpc1115/nsh/setenv.sh +++ b/configs/lpcxpresso-lpc1115/nsh/setenv.sh @@ -1,7 +1,7 @@ #!/bin/bash -# configs/lpcxpresso-lpc1768/nsh/setenv.sh +# configs/lpcxpresso-lpc1115/nsh/setenv.sh # -# Copyright (C) 2013 Gregory Nutt. All rights reserved. +# Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -41,19 +41,32 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi WD=`pwd` -# This is where the buildroot might reside on a Linux or Cygwin system -# export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/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 default install location for Code Red on Linux -export TOOLCHAIN_BIN="/usr/local/LPCXpresso/tools/bin" +# export TOOLCHAIN_BIN="/usr/local/LPCXpresso/tools/bin" # This is the Cygwin path to the LPCXpresso 3.6 install location under Windows #export TOOLCHAIN_BIN="/cygdrive/c/nxp/lpcxpresso_3.6/Tools/bin" -# This is the path to the LPCXpression tool subdirectory -export LPCTOOL_DIR="${WD}/configs/lpcxpresso-lpc1768/tools" +# 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}:${LPCTOOL_DIR}:/sbin:/usr/sbin:${PATH_ORIG}" +export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}" echo "PATH : ${PATH}" diff --git a/configs/lpcxpresso-lpc1115/scripts/ld.script b/configs/lpcxpresso-lpc1115/scripts/ld.script index 44ca50b8d6..8e70278680 100644 --- a/configs/lpcxpresso-lpc1115/scripts/ld.script +++ b/configs/lpcxpresso-lpc1115/scripts/ld.script @@ -1,7 +1,7 @@ /**************************************************************************** * configs/lpcxpresso-lpc1115/scripts/ld.script * - * Copyright (C) 2011-2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/configs/lpcxpresso-lpc1115/src/Makefile b/configs/lpcxpresso-lpc1115/src/Makefile index 93f16b23ab..33a8499aa2 100644 --- a/configs/lpcxpresso-lpc1115/src/Makefile +++ b/configs/lpcxpresso-lpc1115/src/Makefile @@ -1,7 +1,7 @@ ############################################################################ # configs/lpcxpresso-lpc1115/src/Makefile # -# Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. +# Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -40,26 +40,26 @@ CFLAGS += -I$(TOPDIR)/sched ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) -CSRCS = up_boot.c +CSRCS = lpc11_boot.c ifeq ($(CONFIG_NSH_ARCHINIT),y) -CSRCS += up_nsh.c +CSRCS += lpc11_nsh.c endif ifeq ($(CONFIG_KL_SPI0),y) -CSRCS += kl_spi.c +CSRCS += lpc11_spi.c else ifeq ($(CONFIG_KL_SPI1),y) -CSRCS += kl_spi.c +CSRCS += lpc11_spi.c endif endif ifeq ($(CONFIG_ARCH_LEDS),y) -CSRCS += up_leds.c +CSRCS += lpc11_leds.c endif ifeq ($(CONFIG_PWM),y) -CSRCS += up_pwm.c +CSRCS += lpc11_pwm.c endif COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/configs/lpcxpresso-lpc1115/src/up_adc.c b/configs/lpcxpresso-lpc1115/src/lpc11_adc.c similarity index 94% rename from configs/lpcxpresso-lpc1115/src/up_adc.c rename to configs/lpcxpresso-lpc1115/src/lpc11_adc.c index cb5b296b9d..0b76f0c41c 100644 --- a/configs/lpcxpresso-lpc1115/src/up_adc.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_adc.c @@ -1,6 +1,5 @@ /************************************************************************************ - * configs/lpcexpresso-1768/src/up_adc.c - * arch/arm/src/board/up_adc.c + * configs/lpcexpresso-lpc1115/src/lpc11_adc.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -54,13 +53,13 @@ #include "chip.h" #include "up_arch.h" -#include "lpc17_adc.h" -#include "lpcxpresso_internal.h" +#include "lpc11_adc.h" +#include "lpcxpresso_lpc1115.h" #ifdef CONFIG_ADC /************************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************************/ /************************************************************************************ @@ -94,9 +93,9 @@ int adc_devinit(void) if (!initialized) { - /* Call lpc17_adcinitialize() to get an instance of the ADC interface */ + /* Call lpc11_adcinitialize() to get an instance of the ADC interface */ - adc = lpc17_adcinitialize(); + adc = lpc11_adcinitialize(); if (adc == NULL) { adbg("ERROR: Failed to get ADC interface\n"); diff --git a/configs/lpcxpresso-lpc1115/src/up_boot.c b/configs/lpcxpresso-lpc1115/src/lpc11_boot.c similarity index 93% rename from configs/lpcxpresso-lpc1115/src/up_boot.c rename to configs/lpcxpresso-lpc1115/src/lpc11_boot.c index 13456fa2b5..e0be242c21 100644 --- a/configs/lpcxpresso-lpc1115/src/up_boot.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_boot.c @@ -1,7 +1,7 @@ /************************************************************************************ - * configs/lpcxpresso-lpc1115/src/up_boot.c + * configs/lpcxpresso-lpc1115/src/lpc11_boot.c * - * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ #include "up_internal.h" #include "lpc11_ssp.h" -#include "lpcxpresso_internal.h" +#include "lpcxpresso_lpc1115.h" /************************************************************************************ * Pre-processor Definitions @@ -67,7 +67,7 @@ * * Description: * All LPC11xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured + * is called early in the initialization -- after all memory has been configured * and mapped but before any devices have been initialized. * ************************************************************************************/ diff --git a/configs/lpcxpresso-lpc1115/src/up_dac.c b/configs/lpcxpresso-lpc1115/src/lpc11_dac.c similarity index 89% rename from configs/lpcxpresso-lpc1115/src/up_dac.c rename to configs/lpcxpresso-lpc1115/src/lpc11_dac.c index 9b54bea185..3447f33036 100644 --- a/configs/lpcxpresso-lpc1115/src/up_dac.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_dac.c @@ -1,6 +1,5 @@ /************************************************************************************ - * configs/zkit-arm-1769/src/up_dac.c - * arch/arm/src/board/up_dac.c + * configs/lpcxpresso-lpc1115/src/lpc11_dac.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -54,10 +53,14 @@ #include "up_arch.h" #include "up_internal.h" -#include "lpc17_dac.h" +#include "lpc11_dac.h" #ifdef CONFIG_DAC +/************************************************************************************ + * Public Functions + ************************************************************************************/ + /************************************************************************************ * Name: dac_devinit * @@ -75,9 +78,9 @@ int dac_devinit(void) if (!initialized) { - /* Call lpc17_dacinitialize() to get an instance of the dac interface */ + /* Call lpc11_dacinitialize() to get an instance of the dac interface */ - dac = lpc17_dacinitialize(); + dac = lpc11_dacinitialize(); if (dac == NULL) { adbg("ERROR: Failed to get dac interface\n"); diff --git a/configs/lpcxpresso-lpc1115/src/up_leds.c b/configs/lpcxpresso-lpc1115/src/lpc11_leds.c similarity index 90% rename from configs/lpcxpresso-lpc1115/src/up_leds.c rename to configs/lpcxpresso-lpc1115/src/lpc11_leds.c index 2317b135df..222f053614 100644 --- a/configs/lpcxpresso-lpc1115/src/up_leds.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_leds.c @@ -1,7 +1,7 @@ /**************************************************************************** - * configs/lpcxpresso-lpc1168/src/up_leds.c + * configs/lpcxpresso-lpc1115/src/lpc11_leds.c * - * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,12 +48,12 @@ #include "up_internal.h" #include "lpc11_gpio.h" -#include "lpcxpresso_internal.h" +#include "lpcxpresso_lpc1115.h" #ifdef CONFIG_ARCH_LEDS /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* CONFIG_DEBUG_LEDS enables debug output from this file (needs CONFIG_DEBUG @@ -108,19 +108,19 @@ void board_led_on(int led) switch (led) { - case 0: - case 2: - off = true; - break; + case 0: + case 2: + off = true; + break; - case 1: - off = false; + case 1: + off = false; g_ncstate = false; - break; + break; - default: - return; - } + default: + return; + } lpc11_gpiowrite(LPCXPRESSO_LED, off); } @@ -135,18 +135,18 @@ void board_led_off(int led) switch (led) { - case 0: - case 1: - off = false; - break; + case 0: + case 1: + off = false; + break; - case 2: - off = g_ncstate; - break; + case 2: + off = g_ncstate; + break; - default: - return; - } + default: + return; + } lpc11_gpiowrite(LPCXPRESSO_LED, off); } diff --git a/configs/lpcxpresso-lpc1115/src/up_nsh.c b/configs/lpcxpresso-lpc1115/src/lpc11_nsh.c similarity index 96% rename from configs/lpcxpresso-lpc1115/src/up_nsh.c rename to configs/lpcxpresso-lpc1115/src/lpc11_nsh.c index 93cb3c0b2c..2806a941c6 100644 --- a/configs/lpcxpresso-lpc1115/src/up_nsh.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_nsh.c @@ -1,8 +1,7 @@ /**************************************************************************** - * config/lpcxpresso-lpc1768/src/up_nsh.c - * arch/arm/src/board/up_nsh.c + * config/lpcxpresso-lpc1115/src/lpc11_nsh.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -127,7 +126,7 @@ int nsh_archinitialize(void) /* Get the SSP port */ - ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO); + ssp = lpc11_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO); if (!ssp) { syslog(LOG_ERR, "ERROR: Failed to initialize SSP port %d\n", diff --git a/configs/lpcxpresso-lpc1115/src/up_pwm.c b/configs/lpcxpresso-lpc1115/src/lpc11_pwm.c similarity index 88% rename from configs/lpcxpresso-lpc1115/src/up_pwm.c rename to configs/lpcxpresso-lpc1115/src/lpc11_pwm.c index 88741fd0d7..d42ff511c0 100644 --- a/configs/lpcxpresso-lpc1115/src/up_pwm.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_pwm.c @@ -1,7 +1,7 @@ /************************************************************************************ - * configs/lpcexpresso-lpc1768/up_pwm.c + * configs/lpcexpresso-lpc1115/lpc11_pwm.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,19 +48,19 @@ #include "chip.h" #include "up_arch.h" -#include "lpc17_pwm.h" -#include "lpc17_timer.h" -#include "lpcxpresso_internal.h" +#include "lpc11_pwm.h" +#include "lpc11_timer.h" +#include "lpcxpresso_lpc1115.h" /************************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************************/ #ifdef CONFIG_PWM -FAR struct pwm_lowerhalf_s *lpc17_pwminitialize(int timer); -FAR struct pwm_lowerhalf_s *lpc17_mcpwminitialize(int timer); -FAR struct pwm_lowerhalf_s *lpc17_timerinitialize(int timer); +FAR struct pwm_lowerhalf_s *lpc11_pwminitialize(int timer); +FAR struct pwm_lowerhalf_s *lpc11_mcpwminitialize(int timer); +FAR struct pwm_lowerhalf_s *lpc11_timerinitialize(int timer); /************************************************************************************ * Private Functions @@ -91,9 +91,9 @@ int pwm_devinit(void) if (!initialized) { - /* Call lpc17_pwminitialize() to get an instance of the PWM interface */ + /* Call lpc11_pwminitialize() to get an instance of the PWM interface */ - pwm = lpc17_pwminitialize(0); + pwm = lpc11_pwminitialize(0); if (!pwm) { adbg("Failed to get the LPC17XX PWM lower half\n"); @@ -109,7 +109,7 @@ int pwm_devinit(void) return ret; } - mcpwm = lpc17_mcpwminitialize(0); + mcpwm = lpc11_mcpwminitialize(0); if (!mcpwm) { adbg("Failed to get the LPC17XX MOTOR PWM lower half\n"); @@ -125,7 +125,7 @@ int pwm_devinit(void) return ret; } - timer = lpc17_timerinitialize(0); + timer = lpc11_timerinitialize(0); if (!timer) { adbg("Failed to get the LPC17XX TIMER lower half\n"); diff --git a/configs/lpcxpresso-lpc1115/src/up_ssp.c b/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c similarity index 80% rename from configs/lpcxpresso-lpc1115/src/up_ssp.c rename to configs/lpcxpresso-lpc1115/src/lpc11_ssp.c index f16bc396c6..2211e22e0d 100644 --- a/configs/lpcxpresso-lpc1115/src/up_ssp.c +++ b/configs/lpcxpresso-lpc1115/src/lpc11_ssp.c @@ -1,8 +1,7 @@ /************************************************************************************ - * configs/lpcxpresso-lpc1768/src/up_ssp.c - * arch/arm/src/board/up_ssp.c + * configs/lpcxpresso-lpc1115/src/lpc11_ssp.c * - * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -49,14 +48,14 @@ #include "up_arch.h" #include "chip.h" -#include "lpc17_gpio.h" -#include "lpc17_ssp.h" -#include "lpcxpresso_internal.h" +#include "lpc11_gpio.h" +#include "lpc11_ssp.h" +#include "lpcxpresso_lpc1115.h" #if defined(CONFIG_LPC17_SSP0) || defined(CONFIG_LPC17_SSP1) /************************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************************/ /* Enables debug output from this file (needs CONFIG_DEBUG too) */ @@ -80,7 +79,7 @@ /* Dump GPIO registers */ #ifdef SSP_VERBOSE -# define ssp_dumpgpio(m) lpc17_dumpgpio(SDCCS_GPIO, m) +# define ssp_dumpgpio(m) lpc11_dumpgpio(SDCCS_GPIO, m) #else # define ssp_dumpgpio(m) #endif @@ -112,15 +111,15 @@ void weak_function lpcxpresso_sspinitialize(void) */ #ifdef CONFIG_LPC17_SSP1 - (void)lpc17_configgpio(LPCXPRESSO_SD_CS); - (void)lpc17_configgpio(LPCXPRESSO_SD_CD); + (void)lpc11_configgpio(LPCXPRESSO_SD_CS); + (void)lpc11_configgpio(LPCXPRESSO_SD_CD); /* Configure chip select for the OLED. For the SPI interface, insert jumpers in * J42, J43, J45 pin1-2 and J46 pin 1-2. */ #ifdef CONFIG_NX_LCDDRIVER - (void)lpc17_configgpio(LPCXPRESSO_OLED_CS); + (void)lpc11_configgpio(LPCXPRESSO_OLED_CS); #endif #endif @@ -128,24 +127,24 @@ void weak_function lpcxpresso_sspinitialize(void) } /************************************************************************************ - * Name: lpc17_ssp0/ssp1select and lpc17_ssp0/ssp1status + * Name: lpc11_ssp0/ssp1select and lpc11_ssp0/ssp1status * * Description: - * The external functions, lpc17_ssp0/ssp1select and lpc17_ssp0/ssp1status + * The external functions, lpc11_ssp0/ssp1select and lpc11_ssp0/ssp1status * must be provided by board-specific logic. They are implementations of the select * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_sspinitialize()) + * include/nuttx/spi/spi.h). All other methods (including lpc11_sspinitialize()) * are provided by common LPC17xx logic. To use this common SPI logic on your * board: * - * 1. Provide logic in lpc17_boardinitialize() to configure SPI/SSP chip select + * 1. Provide logic in lpc11_boardinitialize() to configure SPI/SSP chip select * pins. - * 2. Provide lpc17_ssp0/ssp1select() and lpc17_ssp0/ssp1status() functions + * 2. Provide lpc11_ssp0/ssp1select() and lpc11_ssp0/ssp1status() functions * in your board-specific logic. These functions will perform chip selection * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_sspinitialize() in your low level application + * 3. Add a calls to lpc11_sspinitialize() in your low level application * initialization logic - * 4. The handle returned by lpc17_sspinitialize() may then be used to bind the + * 4. The handle returned by lpc11_sspinitialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). @@ -153,17 +152,17 @@ void weak_function lpcxpresso_sspinitialize(void) ************************************************************************************/ #ifdef CONFIG_LPC17_SSP0 -void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) +void lpc11_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - ssp_dumpgpio("lpc17_ssp0select() Entry"); + ssp_dumpgpio("lpc11_ssp0select() Entry"); #warning "Assert CS here (false)" - ssp_dumpgpio("lpc17_ssp0select() Exit"); + ssp_dumpgpio("lpc11_ssp0select() Exit"); } -uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) +uint8_t lpc11_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { sspdbg("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; @@ -171,35 +170,35 @@ uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) #endif #ifdef CONFIG_LPC17_SSP1 -void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) +void lpc11_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { sspdbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); - ssp_dumpgpio("lpc17_ssp1select() Entry"); + ssp_dumpgpio("lpc11_ssp1select() Entry"); if (devid == SPIDEV_MMCSD) { /* Assert/de-assert the CS pin to the card */ - (void)lpc17_gpiowrite(LPCXPRESSO_SD_CS, !selected); + (void)lpc11_gpiowrite(LPCXPRESSO_SD_CS, !selected); } #ifdef CONFIG_NX_LCDDRIVER else if (devid == SPIDEV_DISPLAY) { /* Assert the CS pin to the OLED display */ - (void)lpc17_gpiowrite(LPCXPRESSO_OLED_CS, !selected); + (void)lpc11_gpiowrite(LPCXPRESSO_OLED_CS, !selected); } #endif - ssp_dumpgpio("lpc17_ssp1select() Exit"); + ssp_dumpgpio("lpc11_ssp1select() Exit"); } -uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) +uint8_t lpc11_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { if (devid == SPIDEV_MMCSD) { /* Read the state of the card-detect bit */ - if (lpc17_gpioread(LPCXPRESSO_SD_CD) == 0) + if (lpc11_gpioread(LPCXPRESSO_SD_CD) == 0) { sspdbg("Returning SPI_STATUS_PRESENT\n"); return SPI_STATUS_PRESENT; diff --git a/configs/lpcxpresso-lpc1115/src/lpcxpresso_internal.h b/configs/lpcxpresso-lpc1115/src/lpcxpresso_lpc1115.h similarity index 96% rename from configs/lpcxpresso-lpc1115/src/lpcxpresso_internal.h rename to configs/lpcxpresso-lpc1115/src/lpcxpresso_lpc1115.h index 30b156a274..de017bc8d1 100644 --- a/configs/lpcxpresso-lpc1115/src/lpcxpresso_internal.h +++ b/configs/lpcxpresso-lpc1115/src/lpcxpresso_lpc1115.h @@ -1,8 +1,7 @@ /************************************************************************************ - * configs/lpcxpresso-lpc1768/src/lpcxpresso_internal.h - * arch/arm/src/board/lpcxpresso_internal.n + * configs/lpcxpresso-lpc1115/src/lpcxpresso_lpc1115.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -34,8 +33,8 @@ * ************************************************************************************/ -#ifndef _CONFIGS_LPCXPRESSO_LPC1115_SRC_LPCXPRESSO_INTERNAL_H -#define _CONFIGS_LPCXPRESSO_LPC1115_SRC_LPCXPRESSO_INTERNAL_H +#ifndef _CONFIGS_LPCXPRESSO_LPC1115_SRC_LPCXPRESSO_LPC1115L_H +#define _CONFIGS_LPCXPRESSO_LPC1115_SRC_LPCXPRESSO_LPC1115L_H /************************************************************************************ * Included Files @@ -141,8 +140,8 @@ * SD Signal Pin Pin * --- ----------- ----- -------- * CS PIO1_11* 55 P2.2 (See LPCXPRESSO_SD_CS) - * DIN PIO0_9-MOSI 5 P0.9 MOSI1 (See GPIO_SSP1_MOSI in chip/lpc17_ssp.h) - * DOUT PIO0_8-MISO 6 P0.8 MISO1 (See GPIO_SSP1_MISO in chip/lpc17_ssp.h) + * DIN PIO0_9-MOSI 5 P0.9 MOSI1 (See GPIO_SSP1_MOSI in chip/lpc11_ssp.h) + * DOUT PIO0_8-MISO 6 P0.8 MISO1 (See GPIO_SSP1_MISO in chip/lpc11_ssp.h) * CLK PIO2_11-SCK 7 P0.9 SCK1 (See GPIO_SSP1_SCK in board.h) * CD PIO2_10 52 P2.11 (See LPCXPRESSO_SD_CD) */ @@ -232,5 +231,4 @@ void weak_function lpcxpresso_sspinitialize(void); #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPCXPRESSO_LPC1115_SRC_LPCXPRESSO_INTERNAL_H */ - +#endif /* _CONFIGS_LPCXPRESSO_LPC1115_SRC_LPCXPRESSO_LPC1115L_H */