mirror of
https://github.com/apache/nuttx.git
synced 2026-09-29 14:29:27 +08:00
Coding style fixes. Run every new file through tools/nxstyle to assure that it is close to the NuttX coding standard.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* boards/arm/lpc17xx_40xx/lx_cpu/include/board.h
|
||||
* include/arch/board/board.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -52,9 +52,11 @@
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
/* NOTE: The following definitions require lpc17_40_syscon.h. It is not included here
|
||||
* because the including C file may not have that file in its include path.
|
||||
|
||||
/* NOTE: The following definitions require lpc17_40_syscon.h. It is not included
|
||||
* here because the including C file may not have that file in its include path.
|
||||
*/
|
||||
|
||||
#define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */
|
||||
@@ -163,11 +165,11 @@
|
||||
|
||||
#define GPIO_USB_PWRD (GPIO_FLOAT | GPIO_PORT2 | GPIO_PIN10)
|
||||
|
||||
/*
|
||||
#define GPIO_USB_PPWR
|
||||
#define GPIO_USB_PWRD
|
||||
#define GPIO_USB_OVRCR
|
||||
*/
|
||||
#if 0
|
||||
# define GPIO_USB_PPWR
|
||||
# define GPIO_USB_PWRD
|
||||
# define GPIO_USB_OVRCR
|
||||
#endif
|
||||
|
||||
/* FLASH Configuration */
|
||||
|
||||
@@ -252,9 +254,10 @@
|
||||
#define BOARD_NADDR 16
|
||||
#define BOARD_NDATA 32
|
||||
|
||||
//#define BOARD_EMC_CONFIG_BY_LOADER 1
|
||||
/* #define BOARD_EMC_CONFIG_BY_LOADER 1 */
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
|
||||
/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in
|
||||
* any way. The following definitions are used to access individual LEDs.
|
||||
*
|
||||
@@ -284,7 +287,7 @@
|
||||
#define LED_HEAPALLOCATE 1 /* ON OFF OFF OFF */
|
||||
#define LED_IRQSENABLED 2 /* OFF ON OFF OFF */
|
||||
#define LED_STACKCREATED 3 /* ON ON OFF OFF */
|
||||
#define LED_INIRQ 4 /* LED3 glows, on while in interrupt */
|
||||
#define LED_INIRQ 4 /* LED3 glows, on while in interrupt */
|
||||
#define LED_SIGNAL 4 /* LED3 glows, on while in signal handler */
|
||||
#define LED_ASSERTION 4 /* LED3 glows, on while in assertion */
|
||||
#define LED_PANIC 4 /* LED3 Flashes at 2Hz */
|
||||
@@ -292,6 +295,7 @@
|
||||
* OFF while sleeping */
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
|
||||
/* The LX_CPU supports several buttons. All must be pulled up by the LX_CPU.
|
||||
* When closed, the pins will be pulled to ground. So the buttons will read "1"
|
||||
* when open and "0" when closed. All except USER1 are capable of generating
|
||||
@@ -313,7 +317,6 @@
|
||||
* release).
|
||||
*/
|
||||
|
||||
|
||||
#define BOARD_BUTTON_USER1 0
|
||||
#define BOARD_BUTTON_USER2 1
|
||||
#define BOARD_BUTTON_USER3 2
|
||||
@@ -448,20 +451,21 @@
|
||||
|
||||
/* XPT2046 Touchscreen:
|
||||
*
|
||||
/* -------------- -------------------- ------------ --------------------------------
|
||||
* -------------- -------------------- ------------ --------------------------------
|
||||
* XTPT2046 Module Module LX_CPU LED
|
||||
* Signal Connector Connector
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
* Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ
|
||||
* Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED)
|
||||
* Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP
|
||||
* LED)
|
||||
* Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY
|
||||
* Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin)
|
||||
* Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up
|
||||
* LED and SD CD pin)
|
||||
* Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV)
|
||||
* Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#define GPIO_SSP1_MISO GPIO_SSP1_MISO_3
|
||||
#define GPIO_SSP1_MOSI GPIO_SSP1_MOSI_2
|
||||
#define GPIO_SSP1_SCK GPIO_SSP1_SCK_2
|
||||
@@ -473,7 +477,8 @@
|
||||
#define UL_DRV_SYSLESS_IRQ LPC17_40_IRQ_UART1
|
||||
#define UL_DRV_SYSLESS_MY_ADR_DEFAULT 3
|
||||
|
||||
typedef struct nuttx_ulan_chip_data {
|
||||
struct nuttx_ulan_chip_data_s
|
||||
{
|
||||
const char *chip;
|
||||
int my_adr;
|
||||
int baud;
|
||||
@@ -482,6 +487,6 @@ typedef struct nuttx_ulan_chip_data {
|
||||
int port;
|
||||
};
|
||||
|
||||
int nuttx_ulan_get_chip_data(int minor, struct nuttx_ulan_chip_data *chip_data);
|
||||
int nuttx_ulan_get_chip_data(int minor, struct nuttx_ulan_chip_data_s *chip_data);
|
||||
|
||||
#endif /* __BOARDS_ARM_LX_CPU_INCLUDE_BOARD_H */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_appinit.c
|
||||
*
|
||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -67,7 +67,7 @@
|
||||
* arg - The boardctl() argument is passed to the board_app_initialize()
|
||||
* implementation without modification. The argument has no
|
||||
* meaning to NuttX; the meaning of the argument is a contract
|
||||
* between the board-specific initalization logic and the
|
||||
* between the board-specific initialization logic and the
|
||||
* matching application logic. The value cold be such things as a
|
||||
* mode enumeration value, a set of DIP switch switch settings, a
|
||||
* pointer to configuration data read from a file or serial FLASH,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 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 @@
|
||||
/************************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_boardinitialize.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -51,14 +51,6 @@
|
||||
|
||||
#include "lx_cpu.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
@@ -67,9 +59,9 @@
|
||||
* Name: lpc17_40_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC17xx architectures must provide the following entry point. This entry point
|
||||
* is called early in the intitialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
* All LPC17xx architectures must provide the following entry point. This entry
|
||||
* point is called early in the initialization -- after all memory has been
|
||||
* configured and mapped but before any devices have been initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/lx_cpu/src/lpc17_40_bringup.c
|
||||
*
|
||||
* Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -62,6 +62,7 @@
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#define NSH_HAVE_MMCSD 1
|
||||
@@ -73,7 +74,8 @@
|
||||
|
||||
/* MMC/SD support */
|
||||
|
||||
#if !defined(CONFIG_LPC17_40_SDCARD) || !defined(CONFIG_MMCSD) && !defined(CONFIG_MMCD_SDIO)
|
||||
#if !defined(CONFIG_LPC17_40_SDCARD) || !defined(CONFIG_MMCSD) && \
|
||||
!defined(CONFIG_MMCD_SDIO)
|
||||
# undef NSH_HAVE_MMCSD
|
||||
#endif
|
||||
|
||||
@@ -83,7 +85,9 @@
|
||||
# undef NSH_HAVE_MMCSD
|
||||
#endif
|
||||
|
||||
/* MMC/SD support requires that an SPI support is enabled and an SPI port is selected */
|
||||
/* MMC/SD support requires that an SPI support is enabled and an SPI port
|
||||
* is selected.
|
||||
*/
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD
|
||||
# if !defined(CONFIG_NSH_MMCSDSLOTNO)
|
||||
@@ -99,9 +103,9 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It is also
|
||||
* used for MOSI1 and USB_UP_LED. The CD pin may be disconnected. There is a jumper
|
||||
* on board that enables the CD pin.
|
||||
/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It
|
||||
* is also used for MOSI1 and USB_UP_LED. The CD pin may be disconnected.
|
||||
* There is a jumper on board that enables the CD pin.
|
||||
*/
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD
|
||||
@@ -180,7 +184,7 @@ static int nsh_waiter(int argc, char *argv[])
|
||||
struct usbhost_hubport_s *hport;
|
||||
|
||||
syslog(LOG_INFO, "nsh_waiter: Running\n");
|
||||
for (;;)
|
||||
for (; ; )
|
||||
{
|
||||
/* Wait for the device to change state */
|
||||
|
||||
@@ -252,9 +256,8 @@ static int nsh_sdinitialize(void)
|
||||
* inserted or deleted.
|
||||
*/
|
||||
|
||||
(void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL);
|
||||
up_enable_irq(LPC17_40_IRQ_P0p13);
|
||||
|
||||
(void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL);
|
||||
up_enable_irq(LPC17_40_IRQ_P0p13);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -321,7 +324,9 @@ static int nsh_usbhostinitialize(void)
|
||||
ret = usbhost_msc_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to register the mass storage class: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -331,7 +336,9 @@ static int nsh_usbhostinitialize(void)
|
||||
ret = usbhost_cdcacm_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to register the CDC/ACM serial class: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* Based on boards/olimex-lpc1766stk/src/lpc17_40_can.c
|
||||
*
|
||||
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2016, 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -61,6 +61,7 @@
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/* Configuration ********************************************************************/
|
||||
|
||||
#define CAN_PORT1 1
|
||||
@@ -71,7 +72,7 @@
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: zkit_can_setup
|
||||
* Name: lx_cpu_can_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize CAN and register the CAN device
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/*****************************************************************************
|
||||
* boards/pnev5180b/src/lpc17_40_composite.c
|
||||
* Configure and register CDC-ACM and CDC-ECM
|
||||
*
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Michael Jung <mijung@gmx.net>
|
||||
*
|
||||
* Configure and register CDC-ACM and CDC-ECM
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@@ -64,9 +63,8 @@
|
||||
|
||||
int board_composite_initialize(int port)
|
||||
{
|
||||
syslog(LOG_INFO, "board_composite_initialize(port: %d)\n", port);
|
||||
|
||||
return OK;
|
||||
syslog(LOG_INFO, "board_composite_initialize(port: %d)\n", port);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/************************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_sdraminitialize.c
|
||||
* arch/arm/src/board/lpc17_40_sdraminitialize.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,10 +53,15 @@
|
||||
|
||||
#include "lx_cpu.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
void lx_cpu_fpga_initialize(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
/* Initialze EMC for FPGA */
|
||||
|
||||
/* Initialize EMC for FPGA */
|
||||
|
||||
lpc17_40_configgpio(BOARD_XC_PROGRAM_PIN);
|
||||
lpc17_40_configgpio(BOARD_XC_DONE_PIN);
|
||||
@@ -73,6 +77,7 @@ void lx_cpu_fpga_initialize(void)
|
||||
* Buffer: disabled
|
||||
* Write protection: disabled
|
||||
*/
|
||||
|
||||
putreg32(0x00000002, LPC17_40_EMC_STATICCONFIG0);
|
||||
|
||||
/* Delays - not measured at this point
|
||||
@@ -81,11 +86,13 @@ void lx_cpu_fpga_initialize(void)
|
||||
* Write: 33 cycles
|
||||
* Turnaround: 2 cycles (cca. 28 ns)
|
||||
*/
|
||||
putreg32(0x1F, LPC17_40_EMC_STATICWAITRD0);
|
||||
putreg32(0x1F, LPC17_40_EMC_STATICWAITWR0);
|
||||
|
||||
putreg32(0x1f, LPC17_40_EMC_STATICWAITRD0);
|
||||
putreg32(0x1f, LPC17_40_EMC_STATICWAITWR0);
|
||||
putreg32(0x01, LPC17_40_EMC_STATICWAITTURN0);
|
||||
|
||||
/* Shift addresses by 2 (32-bit bus) */
|
||||
|
||||
regval = getreg32(LPC17_40_SYSCON_SCS);
|
||||
regval &= ~SYSCON_SCS_EMCSC;
|
||||
putreg32(regval, LPC17_40_SYSCON_SCS);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/lx_cpu/src/lpc17_40_nsh.c
|
||||
* arch/arm/src/board/lpc17_40_nsh.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -60,6 +59,7 @@
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#define NSH_HAVE_MMCSD 1
|
||||
@@ -71,7 +71,8 @@
|
||||
|
||||
/* MMC/SD support */
|
||||
|
||||
#if !defined(CONFIG_LPC17_40_SDCARD) || !defined(CONFIG_MMCSD) && !defined(CONFIG_MMCD_SDIO)
|
||||
#if !defined(CONFIG_LPC17_40_SDCARD) || !defined(CONFIG_MMCSD) && \
|
||||
!defined(CONFIG_MMCD_SDIO)
|
||||
# undef NSH_HAVE_MMCSD
|
||||
#endif
|
||||
|
||||
@@ -81,7 +82,9 @@
|
||||
# undef NSH_HAVE_MMCSD
|
||||
#endif
|
||||
|
||||
/* MMC/SD support requires that an SPI support is enabled and an SPI port is selected */
|
||||
/* MMC/SD support requires that an SPI support is enabled and an SPI port is
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD
|
||||
# if !defined(CONFIG_NSH_MMCSDSLOTNO)
|
||||
@@ -97,9 +100,9 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It is also
|
||||
* used for MOSI1 and USB_UP_LED. The CD pin may be disconnected. There is a jumper
|
||||
* on board that enables the CD pin.
|
||||
/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It
|
||||
* is also used for MOSI1 and USB_UP_LED. The CD pin may be disconnected.
|
||||
* There is a jumper on board that enables the CD pin.
|
||||
*/
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD
|
||||
@@ -178,12 +181,13 @@ static int nsh_waiter(int argc, char *argv[])
|
||||
struct usbhost_hubport_s *hport;
|
||||
|
||||
syslog(LOG_INFO, "nsh_waiter: Running\n");
|
||||
for (;;)
|
||||
for (; ; )
|
||||
{
|
||||
/* Wait for the device to change state */
|
||||
|
||||
DEBUGVERIFY(CONN_WAIT(g_usbconn, &hport));
|
||||
syslog(LOG_INFO, "nsh_waiter: %s\n", hport->connected ? "connected" : "disconnected");
|
||||
syslog(LOG_INFO, "nsh_waiter: %s\n",
|
||||
hport->connected ? "connected" : "disconnected");
|
||||
|
||||
/* Did we just become connected? */
|
||||
|
||||
@@ -244,15 +248,13 @@ static int nsh_sdinitialize(void)
|
||||
|
||||
lpc17_40_configgpio(GPIO_SD_CD);
|
||||
|
||||
#if NSH_HAVE_MMCSD_CDINT
|
||||
/* Attach an interrupt handler to get notifications when a card is
|
||||
* inserted or deleted.
|
||||
*/
|
||||
|
||||
#if NSH_HAVE_MMCSD_CDINT
|
||||
|
||||
(void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt);
|
||||
up_enable_irq(LPC17_40_IRQ_P0p13);
|
||||
|
||||
(void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt);
|
||||
up_enable_irq(LPC17_40_IRQ_P0p13);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -319,7 +321,9 @@ static int nsh_usbhostinitialize(void)
|
||||
ret = usbhost_msc_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to register the mass storage class: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -329,7 +333,9 @@ static int nsh_usbhostinitialize(void)
|
||||
ret = usbhost_cdcacm_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to register the CDC/ACM serial class: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Author: Philippe Coval <p.coval@samsung.com>
|
||||
* Author: Philippe Coval <p.coval@samsung.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -46,7 +46,7 @@
|
||||
#ifdef CONFIG_BOARDCTL_RESET
|
||||
|
||||
/****************************************************************************
|
||||
* Public functions
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,7 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_ssp.c
|
||||
* arch/arm/src/board/lpc17_40_ssp.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -104,30 +103,31 @@ void weak_function lx_cpu_sspdev_initialize(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status
|
||||
*
|
||||
* Description:
|
||||
* The external functions, lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status
|
||||
* 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_40_sspbus_initialize())
|
||||
* are provided by common LPC17xx logic. To use this common SPI logic on your
|
||||
* board:
|
||||
* The external functions, lpc17_40_ssp0/1/2select and
|
||||
* lpc17_40_ssp0/1/2status 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_40_sspbus_initialize()) are provided
|
||||
* by common LPC17xx logic. To use this common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select
|
||||
* pins.
|
||||
* 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status() 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_40_sspbus_initialize() in your low level application
|
||||
* initialization logic
|
||||
* 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the
|
||||
* SPI driver to higher level logic (e.g., calling
|
||||
* 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP
|
||||
* chip select pins.
|
||||
* 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status()
|
||||
* 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_40_sspbus_initialize() in your low level
|
||||
* application initialization logic
|
||||
* 4. The handle returned by lpc17_40_sspbus_initialize() 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).
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC17_40_SSP0
|
||||
void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
||||
|
||||
@@ -56,11 +56,6 @@
|
||||
|
||||
#include "lx_cpu.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* Configuration ********************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
@@ -73,14 +68,15 @@
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
int nuttx_ulan_get_chip_data(int minor, struct nuttx_ulan_chip_data *chip_data)
|
||||
int nuttx_ulan_get_chip_data(int minor, struct nuttx_ulan_chip_data_s *chip_data)
|
||||
{
|
||||
uint32_t regval;
|
||||
irqstate_t flags;
|
||||
|
||||
if (minor > 0)
|
||||
return 0;
|
||||
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Step 1: Enable power on UART1 */
|
||||
|
||||
@@ -115,4 +111,3 @@ int nuttx_ulan_get_chip_data(int minor, struct nuttx_ulan_chip_data *chip_data)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lx_cpu/src/lpc17_40_userleds.c
|
||||
* arch/arm/src/board/lpc17_40_userleds.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lx_cpu/src/lx_cpu.h
|
||||
* arch/arm/src/board/lx_cpu.n
|
||||
*
|
||||
* Copyright (C) 2013, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -32,23 +31,23 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _CONFIGS_LX_CPU_SRC_LX_CPU_H
|
||||
#define _CONFIGS_LX_CPU_SRC_LX_CPU_H
|
||||
#ifndef _BOARDS_ARM_LPC17XX_40XX_LX_CPU_SRC_LX_CPU_SRC_LX_CPU_H
|
||||
#define _BOARDS_ARM_LPC17XX_40XX_LX_CPU_SRC_LX_CPU_SRC_LX_CPU_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* LX_CPU GPIO Pin Definitions ****************************************************/
|
||||
/* LX_CPU GPIO Pin Definitions **********************************************/
|
||||
|
||||
/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in
|
||||
* any way. The following definitions are used to access individual LEDs.
|
||||
@@ -56,36 +55,47 @@
|
||||
* LED1 -- Connected to P1[29] RED
|
||||
* LED2 -- Connected to P0[16] GREEN
|
||||
*
|
||||
* These LEDs are connecte to ground so a high output value will illuminate them.
|
||||
* These LEDs are connected to ground so a high output value will illuminate
|
||||
* them.
|
||||
*/
|
||||
|
||||
#define GPIO_LED1 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN29)
|
||||
#define GPIO_LED2 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN16)
|
||||
#define GPIO_LED1 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | \
|
||||
GPIO_PIN29)
|
||||
#define GPIO_LED2 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | \
|
||||
GPIO_PIN16)
|
||||
|
||||
/* SD Card **************************************************************************/
|
||||
/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It is also
|
||||
* used for MOSI1 and USB_UP_LED. The CD pin may be disconnected. There is a jumper
|
||||
* on board that enables the CD pin.
|
||||
/* SD Card ******************************************************************/
|
||||
|
||||
/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It
|
||||
* is also used for MOSI1 and USB_UP_LED. The CD pin may be disconnected.
|
||||
* There is a jumper on board that enables the CD pin.
|
||||
*
|
||||
* The CD pin is interrupting:
|
||||
*/
|
||||
|
||||
#define GPIO_SD_CD (GPIO_INTBOTH | GPIO_PULLUP | GPIO_PORT0 | GPIO_PIN13)
|
||||
#define GPIO_SD_CD (GPIO_INTBOTH | GPIO_PULLUP | GPIO_PORT0 | \
|
||||
GPIO_PIN13)
|
||||
|
||||
/* LCD **********************************************************************/
|
||||
|
||||
/* LCD ******************************************************************************/
|
||||
/* Backlight enable, P2[1]. Initial state is OFF (zero) */
|
||||
|
||||
#define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | GPIO_PIN1)
|
||||
#define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | \
|
||||
GPIO_PIN1)
|
||||
|
||||
/* XPT2046 Touchscreen **************************************************************/
|
||||
/* -------------- -------------------- ------------ --------------------------------
|
||||
/* XPT2046 Touchscreen ******************************************************/
|
||||
|
||||
/* -------------- -------------------- ------------ ---------------------------------
|
||||
* XTPT2046 Module Module LX_CPU LED
|
||||
* Signal Connector Connector
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
* Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ
|
||||
* Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED)
|
||||
* Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP
|
||||
* LED)
|
||||
* Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY
|
||||
* Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin)
|
||||
* Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device
|
||||
* up LED and SD CD
|
||||
* pin)
|
||||
* Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV)
|
||||
* Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
@@ -100,17 +110,17 @@
|
||||
|
||||
#define LPC17_40_IRQ_PENIRQ LPC17_40_IRQ_P2p15
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lx_cpu_bringup
|
||||
*
|
||||
* Description:
|
||||
@@ -122,57 +132,57 @@
|
||||
* CONFIG_BOARD_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y :
|
||||
* Called from the NSH library via boardctl()
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int lx_cpu_bringup(void);
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lx_cpu_sspdev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the WaveShare LX_CPU board.
|
||||
* Called to configure SPI chip select GPIO pins for the WaveShare LX_CPU
|
||||
* board.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void weak_function lx_cpu_sspdev_initialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lx_cpu_sdram_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize SDRAM
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC17_40_EMC
|
||||
#ifdef CONFIG_LPC17_40_EXTDRAM
|
||||
void lx_cpu_sdram_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lx_cpu_fpga_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize FPGA chipselect
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void lx_cpu_fpga_initialize(void);
|
||||
|
||||
#endif /* CONFIG_LPC17_40_EMC */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lx_cpu_can_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize CAN and register the CAN device
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_CAN
|
||||
int lx_cpu_can_setup(void);
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _CONFIGS_LX_CPU_SRC_LX_CPU_H */
|
||||
#endif /* _BOARDS_ARM_LPC17XX_40XX_LX_CPU_SRC_LX_CPU_SRC_LX_CPU_H */
|
||||
|
||||
Reference in New Issue
Block a user