Skip to content

Commit 7749b6d

Browse files
committed
Merge branch 'master' into emmc_dev
2 parents fe061b5 + 70bd285 commit 7749b6d

File tree

323 files changed

+103264
-1206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+103264
-1206
lines changed

.project

+72-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,72 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<projectDescription>
3-
<name>ChibiOS-RT (whole tree)</name>
4-
<comment></comment>
5-
<projects>
6-
</projects>
7-
<buildSpec>
8-
</buildSpec>
9-
<natures>
10-
</natures>
11-
</projectDescription>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>ChibiOS-RT (whole tree)</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.linuxtools.cdt.autotools.core.genmakebuilderV2</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
15+
<triggers>clean,full,incremental,</triggers>
16+
<arguments>
17+
<dictionary>
18+
<key>?name?</key>
19+
<value></value>
20+
</dictionary>
21+
<dictionary>
22+
<key>org.eclipse.cdt.make.core.append_environment</key>
23+
<value>true</value>
24+
</dictionary>
25+
<dictionary>
26+
<key>org.eclipse.cdt.make.core.buildArguments</key>
27+
<value></value>
28+
</dictionary>
29+
<dictionary>
30+
<key>org.eclipse.cdt.make.core.buildCommand</key>
31+
<value>make</value>
32+
</dictionary>
33+
<dictionary>
34+
<key>org.eclipse.cdt.make.core.contents</key>
35+
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
36+
</dictionary>
37+
<dictionary>
38+
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
39+
<value>false</value>
40+
</dictionary>
41+
<dictionary>
42+
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
43+
<value>true</value>
44+
</dictionary>
45+
<dictionary>
46+
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
47+
<value>true</value>
48+
</dictionary>
49+
<dictionary>
50+
<key>org.eclipse.cdt.make.core.stopOnError</key>
51+
<value>true</value>
52+
</dictionary>
53+
<dictionary>
54+
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
55+
<value>true</value>
56+
</dictionary>
57+
</arguments>
58+
</buildCommand>
59+
<buildCommand>
60+
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
61+
<triggers>full,incremental,</triggers>
62+
<arguments>
63+
</arguments>
64+
</buildCommand>
65+
</buildSpec>
66+
<natures>
67+
<nature>org.eclipse.cdt.core.cnature</nature>
68+
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
69+
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
70+
<nature>org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2</nature>
71+
</natures>
72+
</projectDescription>

boards/EA_LPCXPRESSO_LPC1769/board.c

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
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+
17+
#include "ch.h"
18+
#include "hal.h"
19+
20+
/**
21+
* @brief PAL setup.
22+
* @details Digital I/O ports static configuration as defined in @p board.h.
23+
* This variable is used by the HAL when initializing the PAL driver.
24+
*/
25+
#if HAL_USE_PAL || defined(__DOXYGEN__)
26+
const PALConfig pal_default_config = {
27+
{VAL_GPIO0DATA, VAL_GPIO0DIR},
28+
{VAL_GPIO1DATA, VAL_GPIO1DIR},
29+
{VAL_GPIO2DATA, VAL_GPIO2DIR},
30+
{VAL_GPIO3DATA, VAL_GPIO3DIR},
31+
{VAL_GPIO4DATA, VAL_GPIO4DIR}
32+
};
33+
#endif
34+
35+
#if HAL_USE_MAC
36+
/*
37+
* Board Ethernet pins configuration.
38+
* ENET_REF_CLK pin must be set before macInit().
39+
*/
40+
static void board_eth_pin_config(void) {
41+
42+
/* Ethernet pin config */
43+
LPC_PINCON->PINSEL2 |= (1UL << 30) | (1UL << 28) | (1UL << 20) | (1UL << 18) \
44+
| (1UL << 16) | (1UL << 8) | (1UL << 2) | (1UL << 0); /* Set Ethernet ENET_REF_CLK P1.15, ENET_RX_ER P1.14,
45+
ENET_RXD1 P1.10, ENET_RXD0 P1.9, ENET_CRS P1.8, ENET_TX_EN P1.4,
46+
ENET_TXD1 P1.1, ENET_TXD0 P1.0 pins. */
47+
LPC_PINCON->PINMODE2 |= (2UL << 30) | (2UL << 28) | (2UL << 20) | (2UL << 18) \
48+
| (2UL << 16) | (2UL << 8) | (2UL << 2) | (2UL << 0); /* Disable pull-up on ENET_REF_CLK P1.15, ENET_RX_ER P1.14,
49+
ENET_RXD1 P1.10, ENET_RXD0 P1.9, ENET_CRS P1.8, ENET_TX_EN P1.4,
50+
ENET_TXD1 P1.1, ENET_TXD0 P1.0 pins. */
51+
LPC_PINCON->PINSEL3 |= (1UL << 2) | (1UL << 0); /* Set ENET_MDIO P1.17, ENET_MDC P1.16 */
52+
LPC_PINCON->PINMODE3 |= (2UL << 2) | (2UL << 0); /* Disable pull-up on ENET_MDIO P1.17, ENET_MDC P1.16 */
53+
54+
}
55+
#endif
56+
57+
/*
58+
* Early initialization code.
59+
* This initialization must be performed just after stack setup and before
60+
* any other initialization.
61+
*/
62+
void __early_init(void) {
63+
64+
LPC17xx_clock_init();
65+
#if HAL_USE_MAC
66+
board_eth_pin_config();
67+
#endif
68+
}
69+
70+
/*
71+
* Board-specific initialization code.
72+
*/
73+
void boardInit(void) {
74+
75+
/*
76+
* Extra, board-specific, initializations.
77+
*/
78+
/* UART0 pin config */
79+
LPC_PINCON->PINSEL0 |= (1UL << 4) | (1UL << 6); /* Set UART0 TXD0 P0.2 and RXD0 P0.3 pins.*/
80+
LPC_PINCON->PINMODE0 |= (2UL << 4) | (2UL << 6); /* Disable pull-up on UART0 TXD0 and RXD0 pins.*/
81+
82+
/* CLKOUT pin config */
83+
/* LPC_PINCON->PINSEL3 |= (1UL << 22); */ /* Set CLKOUT P1.27 pin.*/
84+
/* LPC_PINCON->PINMODE3 |= (2UL << 22); */ /* Disable pull-up on CLKOUT pin. */
85+
86+
/* I2C1 pin config */
87+
LPC_PINCON->PINSEL1 |= (3UL << 8) | (3UL << 6); /* Set I2C1 SCL1 P0.20, SDA1 P0.19 pins. */
88+
LPC_PINCON->PINMODE1 |= (2UL << 8) | (2UL << 6); /* Disable pull-up on I2C1 SCL1 P0.20, SDA1 P0.19 pins. */
89+
LPC_PINCON->PINMODE_OD0 |= (1UL << 20) | (1UL << 19); /* Set I2C1 SCL1 P0.20, SDA1 P0.19 as open drain pins. */
90+
91+
/* DAC pin config */
92+
/* DAC pin set in dac_lld_start() */
93+
94+
#if HAL_USE_CAN
95+
/* CAN config i/o */
96+
LPC_PINCON->PINSEL0 |= (1UL << 2) | (1UL << 0); /* Set CAN1 TD1 P0.1 and RD1 P0.0 pins. */
97+
LPC_PINCON->PINMODE0 |= (2UL << 2) | (2UL << 0); /* Disable pull-up on TD1 and RD1 pins.*/
98+
99+
LPC_PINCON->PINSEL0 |= (2UL << 10) | (2UL << 8); /* Set CAN2 TD2 P0.5 and RD2 P0.4 pins. */
100+
LPC_PINCON->PINMODE0 |= (2UL << 10) | (2UL << 8); /* Disable pull-up on TD1 and RD1 pins.*/
101+
#endif
102+
103+
}

boards/EA_LPCXPRESSO_LPC1769/board.h

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
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+
17+
#ifndef _BOARD_H_
18+
#define _BOARD_H_
19+
20+
/*
21+
* Setup for Embedded Artists LPCXpresso LPC1769.
22+
*/
23+
24+
/*
25+
* Board identifiers.
26+
*/
27+
#define BOARD_EA_LPCXPRESSO_1769
28+
#define BOARD_NAME "Embedded Artists LPCXpresso LPC1769"
29+
30+
/*
31+
* Ethernet PHY type.
32+
*/
33+
#define MII_LAN8720_ID 0x0007C0F0
34+
#define BOARD_PHY_ID MII_LAN8720_ID
35+
#define BOARD_PHY_RMII
36+
37+
//#define BOARD_PHY_ADDRESS
38+
39+
#define LPC17xx_HAS_CAN1 TRUE
40+
#define LPC17xx_HAS_CAN2 TRUE
41+
42+
/*
43+
* Board frequencies.
44+
*/
45+
#define MAINOSCCLK 12000000UL
46+
#define RTCOSCCLK 32768UL
47+
48+
/*
49+
* GPIO 0 initial setup.
50+
*/
51+
#define VAL_GPIO0DIR PAL_PORT_BIT(GPIO0_LED2_RED) | \
52+
PAL_PORT_BIT(GPIO0_LED3_EXT)
53+
#define VAL_GPIO0DATA 0x00000000
54+
55+
/*
56+
* GPIO 1 initial setup.
57+
*/
58+
#define VAL_GPIO1DIR 0x00000000
59+
#define VAL_GPIO1DATA 0x00000000
60+
61+
/*
62+
* GPIO 2 initial setup.
63+
*/
64+
#define VAL_GPIO2DIR 0x00000000
65+
#define VAL_GPIO2DATA 0x00000000
66+
67+
/*
68+
* GPIO 3 initial setup.
69+
*/
70+
#define VAL_GPIO3DIR 0x00000000
71+
#define VAL_GPIO3DATA 0x00000000
72+
73+
/*
74+
* GPIO 4 initial setup.
75+
*/
76+
#define VAL_GPIO4DIR 0x00000000
77+
#define VAL_GPIO4DATA 0x00000000
78+
79+
/*
80+
* Pin definitions.
81+
*/
82+
#define GPIO0_LED2_RED 22
83+
#define GPIO0_LED3_EXT 28 /* Connect LED to board. */
84+
85+
#define GPIO2_PIN12_TO_GND 12
86+
87+
#if !defined(_FROM_ASM_)
88+
#ifdef __cplusplus
89+
extern "C" {
90+
#endif
91+
void boardInit(void);
92+
#ifdef __cplusplus
93+
}
94+
#endif
95+
#endif /* _FROM_ASM_ */
96+
97+
#endif /* _BOARD_H_ */

boards/EA_LPCXPRESSO_LPC1769/board.mk

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# List of all the board related files.
2+
BOARDSRC = ${CHIBIOS}/boards/EA_LPCXPRESSO_LPC1769/board.c
3+
4+
# Required include directories
5+
BOARDINC = ${CHIBIOS}/boards/EA_LPCXPRESSO_LPC1769

0 commit comments

Comments
 (0)