lpcxpresso-lpc1115: Update naming to match current coventions
This commit is contained in:
parent
bbdb84c1f4
commit
e4ce738b06
@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 */
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
#
|
||||
# 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
|
||||
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
#
|
||||
# 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}"
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -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 <gnutt@nuttx.org>
|
||||
#
|
||||
# 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))
|
||||
|
@ -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 <code@nuttx.org>
|
||||
@ -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");
|
@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
************************************************************************************/
|
@ -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 <code@nuttx.org>
|
||||
@ -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");
|
@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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);
|
||||
}
|
@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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",
|
@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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");
|
@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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;
|
@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 */
|
Loading…
Reference in New Issue
Block a user