Skip to content

Commit 7767651

Browse files
authored
Merge pull request #5609 from 0xc0170/fix_lpc546xx_enet
LPC546XX: Add ENET support
2 parents 6d50868 + 1da73df commit 7767651

File tree

17 files changed

+1958
-0
lines changed

17 files changed

+1958
-0
lines changed

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPC546XX/harware_init_LPC546XX.c

Lines changed: 261 additions & 0 deletions
Large diffs are not rendered by default.

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_NXP/TARGET_LPC546XX/lpc546xx_emac.c

Lines changed: 692 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2017 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#ifndef LPC546XX_EMAC_CONFIG_H__
17+
#define LPC546XX_EMAC_CONFIG_H__
18+
19+
#include "fsl_enet.h"
20+
21+
#define ENET_RX_RING_LEN (16)
22+
#define ENET_TX_RING_LEN (8)
23+
24+
#define ENET_ETH_MAX_FLEN (ENET_FRAME_MAX_FRAMELEN)
25+
26+
#if defined(__cplusplus)
27+
extern "C" {
28+
#endif
29+
30+
int phy_link_status(void);
31+
32+
#if defined(__cplusplus)
33+
}
34+
#endif
35+
36+
#endif // #define LPC546XX_EMAC_CONFIG_H__
37+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* Copyright (C) 2012 mbed.org, MIT License
2+
*
3+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
5+
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
6+
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7+
* furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or
10+
* substantial portions of the Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13+
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15+
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17+
*/
18+
19+
#ifndef LWIPOPTS_CONF_H
20+
#define LWIPOPTS_CONF_H
21+
22+
#include "lpc546xx_emac_config.h"
23+
24+
#define LWIP_TRANSPORT_ETHERNET 1
25+
#define ETH_PAD_SIZE 0
26+
27+
#define MEM_SIZE (ENET_RX_RING_LEN * (ENET_ETH_MAX_FLEN + ENET_BUFF_ALIGNMENT) + ENET_TX_RING_LEN * ENET_ETH_MAX_FLEN)
28+
29+
#endif

0 commit comments

Comments
 (0)