Merge pull request #5651 from gorazdko/ff_lpc546xx-add-ethernet

ff_lpc546xx: add enet, change led1 and led3 pins
pull/5732/merge
Jimmy Brisson 2018-01-08 10:35:56 -06:00 committed by GitHub
commit cef1cc26d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 231 additions and 5 deletions

View File

@ -0,0 +1,227 @@
/* mbed Microcontroller Library
* Copyright (c) 2017 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "fsl_iocon.h"
#define IOCON_PIO_DIGITAL_EN 0x0100u /*!<@brief Enables digital function */
#define IOCON_PIO_FUNC0 0x00u /*!<@brief Selects pin function 0 */
#define IOCON_PIO_FUNC1 0x01u /*!<@brief Selects pin function 1 */
#define IOCON_PIO_FUNC6 0x06u /*!<@brief Selects pin function 6 */
#define IOCON_PIO_FUNC7 0x07u /*!<@brief Selects pin function 7 */
#define IOCON_PIO_INPFILT_OFF 0x0200u /*!<@brief Input filter disabled */
#define IOCON_PIO_INV_DI 0x00u /*!<@brief Input function is not inverted */
#define IOCON_PIO_MODE_INACT 0x00u /*!<@brief No addition pin function */
#define IOCON_PIO_MODE_PULLUP 0x20u /*!<@brief Selects pull-up function */
#define IOCON_PIO_OPENDRAIN_DI 0x00u /*!<@brief Open drain is disabled */
#define IOCON_PIO_SLEW_FAST 0x0400u /*!<@brief Fast mode, slew rate control is disabled */
#define IOCON_PIO_SLEW_STANDARD 0x00u /*!<@brief Standard mode, output slew rate control is enabled */
/*******************************************************************************
* Code
******************************************************************************/
void lpc546xx_init_eth_hardware(void)
{
CLOCK_EnableClock(kCLOCK_InputMux);
/* Enables the clock for the IOCON block. 0 = Disable; 1 = Enable.: 0x01u */
CLOCK_EnableClock(kCLOCK_Iocon);
const uint32_t port0_pin10_config = (/* Pin is configured as SWO */
IOCON_PIO_FUNC6 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT0 PIN10 (coords: P2) is configured as SWO */
IOCON_PinMuxSet(IOCON, 0U, 10U, port0_pin10_config);
const uint32_t port1_pin10_config = (/* Pin is configured as ENET_TXD1 */
IOCON_PIO_FUNC1 /* IOCON_PIO_FUNC1 */ |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN10 (coords: E14) is configured as ENET_TXD1 */
IOCON_PinMuxSet(IOCON, 1U, 10U, port1_pin10_config);
const uint32_t port1_pin18_config = (/* Pin is configured as ENET_PHY_RST */
IOCON_PIO_FUNC0 |
/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN18 (coords: H11) is configured as ENET_PHY_RST */
IOCON_PinMuxSet(IOCON, 1U, 18U, port1_pin18_config);
const uint32_t port1_pin14_config = (/* Pin is configured as ENET_RX_DV */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN14 (coords: B9) is configured as ENET_RX_DV */
IOCON_PinMuxSet(IOCON, 1U, 14U, port1_pin14_config);
const uint32_t port1_pin12_config = (/* Pin is configured as ENET_RXD0 */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN12 (coords: A9) is configured as ENET_RXD0 */
IOCON_PinMuxSet(IOCON, 1U, 12U, port1_pin12_config);
const uint32_t port1_pin13_config = (/* Pin is configured as ENET_RXD1 */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT4 PIN12 (coords: A6) is configured as ENET_RXD1 */
IOCON_PinMuxSet(IOCON, 1U, 13U, port1_pin13_config);
const uint32_t port1_pin11_config = (/* Pin is configured as ENET_TX_EN */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT4 PIN13 (coords: B6) is configured as ENET_TX_EN */
IOCON_PinMuxSet(IOCON, 1U, 11U, port1_pin11_config);
const uint32_t port1_pin15_config = (/* Pin is configured as ENET_RX_CLK */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT4 PIN14 (coords: B5) is configured as ENET_RX_CLK */
IOCON_PinMuxSet(IOCON, 1U, 15U, port1_pin15_config);
const uint32_t port1_pin16_config = (/* Pin is configured as ENET_MDC */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT4 PIN15 (coords: A4) is configured as ENET_MDC */
IOCON_PinMuxSet(IOCON, 1U, 16U, port1_pin16_config);
const uint32_t port1_pin17_config = (/* Pin is configured as ENET_MDIO */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT4 PIN16 (coords: C4) is configured as ENET_MDIO */
IOCON_PinMuxSet(IOCON, 1U, 17U, port1_pin17_config);
const uint32_t port1_pin9_config = (/* Pin is configured as ENET_TXD0 */
IOCON_PIO_FUNC1 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT4 PIN8 (coords: B14) is configured as ENET_TXD0 */
IOCON_PinMuxSet(IOCON, 1U, 9U, port1_pin9_config);
}

View File

@ -120,6 +120,6 @@ const PinMap PinMap_PWM[] = {
{P0_19 , PWM_3, 4},
{P0_22 , PWM_4, 4},
{P0_28 , PWM_8, 4},
{P0_29 , PWM_9, 4},
{P1_31 , PWM_7, 4},
{NC , NC, 0}
};

View File

@ -183,9 +183,9 @@ typedef enum {
// mbed original LED naming
LED1 = P0_13,
LED1 = P1_3,
LED2 = P1_27,
LED3 = P0_14,
LED3 = P1_26,
LED4 = P1_28,
@ -223,7 +223,7 @@ typedef enum {
p23 = P0_19,
p24 = P0_22,
p25 = P0_28,
p26 = P0_29,
p26 = P1_31,
p27 = P1_30,
p28 = P1_29,
p29 = P0_0,

View File

@ -744,7 +744,6 @@
"FF_LPC546XX": {
"inherits": ["LPC546XX"],
"extra_labels_remove" : ["LPCXpresso"],
"features_remove": ["LWIP"],
"supported_form_factors": [""],
"detect_code": ["8081"]
},