Update to the lpc4340-xplorer configuration for Ethernet and other peripherals

This commit is contained in:
Dave Marples
2016-02-19 08:18:49 -06:00
committed by Gregory Nutt
parent 0d10663897
commit 78c0b30140
2 changed files with 70 additions and 37 deletions
+37 -2
View File
@@ -1,8 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/lpc4330-xplorer/include/board.h * configs/lpc4330-xplorer/include/board.h
* include/arch/board/board.h
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -151,6 +150,35 @@
#define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY
/* APB Clocking */
#if defined(CONFIG_LPC43_BUS) || defined(CONFIG_LPC43_MCPWM) || \
defined(CONFIG_LPC43_I2C0) || defined(CONFIG_LPC43_I2S0) || \
defined(CONFIG_LPC43_I2S1) || defined(CONFIG_LPC43_CAN1)
# define BOARD_ABP1_CLKSRC BASE_APB_CLKSEL_XTAL
# define BOARD_ABP1_FREQUENCY BOARD_XTAL_FREQUENCY
#endif
#if defined(CONFIG_LPC43_BUS) || defined(CONFIG_LPC43_I2C1) || \
defined(CONFIG_LPC43_DAC) || defined(CONFIG_LPC43_ADC0) || \
defined(CONFIG_LPC43_ADC1) || defined(CONFIG_LPC43_CAN0)
# define BOARD_ABP3_CLKSRC BASE_APB_CLKSEL_XTAL
# define BOARD_ABP3_FREQUENCY BOARD_XTAL_FREQUENCY
#endif
/* SSP Clocking */
#define BOARD_IDIVA_DIVIDER (2)
#define BOARD_IDIVA_CLKSRC IDIVA_CLKSEL_PLL1
#define BOARD_IDIVA_FREQUENCY (BOARD_FCLKOUT_FREQUENCY/BOARD_IDIVA_DIVIDER)
#define BOARD_SSP0_CLKSRC BASE_SSP0_CLKSEL_IDIVA
#define BOARD_SSP0_BASEFREQ BOARD_IDIVA_FREQUENCY
#define BOARD_SSP1_CLKSRC BASE_SSP1_CLKSEL_IDIVA
#define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY
/* USB0 ********************************************************************/ /* USB0 ********************************************************************/
/* Settings needed in lpc43_cpu.c */ /* Settings needed in lpc43_cpu.c */
@@ -281,6 +309,13 @@
#define PINCONF_U3_RXD PINCONF_U3_RXD_2 #define PINCONF_U3_RXD PINCONF_U3_RXD_2
#define PINCONF_U3_DIR PINCONF_U3_DIR_2 #define PINCONF_U3_DIR PINCONF_U3_DIR_2
/* Ethernet */
#define PINCONF_ENET_RX_DV PINCONF_ENET_RX_DV_2
#define PINCONF_ENET_RESET PINCONF_GPIO0p4
#define GPIO_ENET_RESET (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN4)
#define PINCONF_ENET_MDC PINCONF_ENET_MDC_3
/**************************************************************************** /****************************************************************************
* Public Types * Public Types
****************************************************************************/ ****************************************************************************/
+8 -10
View File
@@ -55,6 +55,7 @@
* -------------------------------- ------- -------------- * -------------------------------- ------- --------------
* gpio1[12] - LED D2 J10-20 LED1 * gpio1[12] - LED D2 J10-20 LED1
* gpio1[11] - LED D3 J10-17 LED2 * gpio1[11] - LED D3 J10-17 LED2
*
****************************************************************************/ ****************************************************************************/
/* Definitions to configure LED pins as GPIOs: /* Definitions to configure LED pins as GPIOs:
@@ -64,18 +65,15 @@
* - No buffering, glitch filtering, slew=slow * - No buffering, glitch filtering, slew=slow
*/ */
#define PINCONFIG_LED1 PINCONF_GPIO1p12 #define PINCONFIG_LED1 PINCONF_GPIO4p0
#define PINCONFIG_LED2 PINCONF_GPIO1p11 #define PINCONFIG_LED2 PINCONF_GPIO1p1
#define GPIO_LED1 (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT2 | GPIO_PIN0)
/* Definitions to configure LED GPIOs as outputs */ #define GPIO_LED2 (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN8)
#define GPIO_LED1 (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN12)
#define GPIO_LED2 (GPIO_MODE_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN11)
/**************************************************************************** /****************************************************************************
* Buttons GPIO PIN SIGNAL NAME * Buttons GPIO
* -------------------------------- ------- -------------- * ----------------------------
* gpio0[7] - User Button SW2 J8-25 BTN1 * gpio2[7] - User Button USR1
****************************************************************************/ ****************************************************************************/
#define LPC4330_XPLORER_BUT1 (GPIO_INTBOTH | GPIO_FLOAT | GPIO_PORT0 | GPIO_PIN7) #define LPC4330_XPLORER_BUT1 (GPIO_INTBOTH | GPIO_FLOAT | GPIO_PORT0 | GPIO_PIN7)