LPC17xx SPI and SSP initialization functions both called up_spiinitialize(); Changed to lpc17_spinitialize() and lpc17_sspinitialize().

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5809 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2013-04-01 15:02:22 +00:00
parent 4750867a34
commit 11a4d9cd49
15 changed files with 37 additions and 35 deletions

View File

@ -143,7 +143,7 @@ int nsh_archinitialize(void)
/* Get the SSP port */
ssp = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp)
{
message("nsh_archinitialize: Failed to initialize SSP port %d\n",

View File

@ -123,25 +123,25 @@ FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno)
oleddc_dumpgpio("up_nxdrvinit: After OLED Power/DC setup");
/* Get the SSI port (configure as a Freescale SPI port) */
/* Get the SPI1 port (configure as a Freescale SPI port) */
spi = up_spiinitialize(1);
spi = lpc17_sspinitialize(1);
if (!spi)
{
glldbg("Failed to initialize SSI port 1\n");
glldbg("Failed to initialize SPI port 1\n");
}
else
{
/* Bind the SSI port to the OLED */
/* Bind the SPI port to the OLED */
dev = ug_initialize(spi, devno);
if (!dev)
{
glldbg("Failed to bind SSI port 1 to OLED %d: %d\n", devno);
glldbg("Failed to bind SPI port 1 to OLED %d: %d\n", devno);
}
else
{
gllvdbg("Bound SSI port 1 to OLED %d\n", devno);
gllvdbg("Bound SPI port 1 to OLED %d\n", devno);
/* And turn the OLED on (dim) */

View File

@ -134,7 +134,7 @@ void weak_function lpc17_sspinitialize(void)
* The external functions, lpc17_ssp0/ssp1select and lpc17_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.h). All other methods (including up_spiinitialize())
* include/nuttx/spi.h). All other methods (including lpc17_sspinitialize())
* are provided by common LPC17xx logic. To use this common SPI logic on your
* board:
*
@ -143,9 +143,9 @@ void weak_function lpc17_sspinitialize(void)
* 2. Provide lpc17_ssp0/ssp1select() and lpc17_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 up_spiinitialize() in your low level application
* 3. Add a calls to lpc17_sspinitialize() in your low level application
* initialization logic
* 4. The handle returned by up_spiinitialize() may then be used to bind the
* 4. The handle returned by lpc17_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).

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/lpcxpresso-lpc1768/src/up_usbmsc.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Configure and register the LPC17xx MMC/SD SPI block driver.
@ -113,7 +113,7 @@ int usbmsc_archinitialize(void)
message("usbmsc_archinitialize: Initializing SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO);
spi = up_spiinitialize(LPC17XX_MMCSDSPIPORTNO);
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
if (!spi)
{
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",

View File

@ -2,7 +2,7 @@
* config/nucleus2g/src/up_nsh.c
* arch/arm/src/board/up_nsh.c
*
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2010-2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -136,7 +136,7 @@ int nsh_archinitialize(void)
/* Get the SSP port */
ssp = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp)
{
message("nsh_archinitialize: Failed to initialize SSP port %d\n",

View File

@ -137,7 +137,7 @@ void weak_function lpc17_sspinitialize(void)
* The external functions, lpc17_ssp0/ssp1select and lpc17_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.h). All other methods (including up_spiinitialize())
* include/nuttx/spi.h). All other methods (including lpc17_sspinitialize())
* are provided by common LPC17xx logic. To use this common SPI logic on your
* board:
*
@ -146,9 +146,9 @@ void weak_function lpc17_sspinitialize(void)
* 2. Provide lpc17_ssp0/ssp1select() and lpc17_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 up_spiinitialize() in your low level application
* 3. Add a calls to lpc17_sspinitialize() in your low level application
* initialization logic
* 4. The handle returned by up_spiinitialize() may then be used to bind the
* 4. The handle returned by lpc17_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).

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/nucleus2g/src/up_usbmsc.c
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Configure and register the LPC17xx MMC/SD SPI block driver.
@ -113,7 +113,7 @@ int usbmsc_archinitialize(void)
message("usbmsc_archinitialize: Initializing SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO);
spi = up_spiinitialize(LPC17XX_MMCSDSPIPORTNO);
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
if (!spi)
{
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",

View File

@ -2,7 +2,7 @@
* config/olimex-lpc1766stk/src/up_lcd.c
* arch/arm/src/board/up_lcd.c
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -207,9 +207,9 @@ FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno)
nokia_blinitialize();
/* Get the SSP port (configure as a Freescale SPI port) */
/* Get the SSP0 port (configure as a Freescale SPI port) */
spi = up_spiinitialize(0);
spi = lpc17_sspinitialize(0);
if (!spi)
{
glldbg("Failed to initialize SSP port 0\n");

View File

@ -209,7 +209,7 @@ static int nsh_sdinitialize(void)
/* Get the SSP port */
ssp = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp)
{
message("nsh_archinitialize: Failed to initialize SSP port %d\n",

View File

@ -2,7 +2,7 @@
* configs/olimex-lpc1766stk/src/up_ssp.c
* arch/arm/src/board/up_ssp.c
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -258,7 +258,7 @@ void weak_function lpc17_sspinitialize(void)
* The external functions, lpc17_ssp0/ssp1select and lpc17_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.h). All other methods (including up_spiinitialize())
* include/nuttx/spi.h). All other methods (including lpc17_sspinitialize())
* are provided by common LPC17xx logic. To use this common SPI logic on your
* board:
*
@ -267,9 +267,9 @@ void weak_function lpc17_sspinitialize(void)
* 2. Provide lpc17_ssp0/ssp1select() and lpc17_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 up_spiinitialize() in your low level application
* 3. Add a calls to lpc17_sspinitialize() in your low level application
* initialization logic
* 4. The handle returned by up_spiinitialize() may then be used to bind the
* 4. The handle returned by lpc17_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).

View File

@ -93,7 +93,6 @@
# endif
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -120,7 +119,7 @@ int usbmsc_archinitialize(void)
message("usbmsc_archinitialize: Initializing SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO);
spi = up_spiinitialize(LPC17XX_MMCSDSPIPORTNO);
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
if (!spi)
{
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",

View File

@ -85,6 +85,7 @@
# define leddbg(x...)
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
@ -113,12 +114,13 @@ int up_lcdinitialize(void)
lpc17_gpiowrite(ZKITARM_OLED_CS, 1);
lpc17_gpiowrite(ZKITARM_OLED_RS, 1);
spi = up_spiinitialize(0);
spi = lpc17_sspinitialize(0);
if (!spi)
{
glldbg("Failed to initialize SSI port 0\n");
return 0;
}
lpc17_gpiowrite(ZKITARM_OLED_RST, 0);
up_mdelay(1);
lpc17_gpiowrite(ZKITARM_OLED_RST, 1);
@ -144,6 +146,7 @@ FAR struct lcd_dev_s *up_lcdgetdev(int lcddev)
(void)dev->setpower(dev, CONFIG_LCD_MAXPOWER);
return dev;
}
return NULL;
}

View File

@ -148,7 +148,7 @@ int nsh_archinitialize(void)
/* Get the SSP port */
ssp = up_spiinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
ssp = lpc17_sspinitialize(CONFIG_NSH_MMCSDSPIPORTNO);
if (!ssp)
{
message("nsh_archinitialize: Failed to initialize SSP port %d\n",

View File

@ -135,7 +135,7 @@ void weak_function lpc17_sspinitialize(void)
* The external functions, lpc17_ssp0/ssp1select and lpc17_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.h). All other methods (including up_spiinitialize())
* include/nuttx/spi.h). All other methods (including lpc17_sspinitialize())
* are provided by common LPC17xx logic. To use this common SPI logic on your
* board:
*
@ -144,9 +144,9 @@ void weak_function lpc17_sspinitialize(void)
* 2. Provide lpc17_ssp0/ssp1select() and lpc17_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 up_spiinitialize() in your low level application
* 3. Add a calls to lpc17_sspinitialize() in your low level application
* initialization logic
* 4. The handle returned by up_spiinitialize() may then be used to bind the
* 4. The handle returned by lpc17_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).

View File

@ -117,7 +117,7 @@ int usbmsc_archinitialize(void)
message("usbmsc_archinitialize: Initializing SPI port %d\n",
LPC17XX_MMCSDSPIPORTNO);
spi = up_spiinitialize(LPC17XX_MMCSDSPIPORTNO);
spi = lpc17_sspinitialize(LPC17XX_MMCSDSPIPORTNO);
if (!spi)
{
message("usbmsc_archinitialize: Failed to initialize SPI port %d\n",