Skip to content

Commit 65ee2af

Browse files
committed
add board header files
1 parent f268bc6 commit 65ee2af

File tree

2 files changed

+227
-0
lines changed
  • targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_OSHCHIP

2 files changed

+227
-0
lines changed
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
/*
2+
* Copyright (c) 2013 Nordic Semiconductor ASA
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice, this list
9+
* of conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA
12+
* integrated circuit in a product or a software update for such product, must reproduce
13+
* the above copyright notice, this list of conditions and the following disclaimer in
14+
* the documentation and/or other materials provided with the distribution.
15+
*
16+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be
17+
* used to endorse or promote products derived from this software without specific prior
18+
* written permission.
19+
*
20+
* 4. This software, with or without modification, must only be used with a
21+
* Nordic Semiconductor ASA integrated circuit.
22+
*
23+
* 5. Any software provided in binary or object form under this license must not be reverse
24+
* engineered, decompiled, modified and/or disassembled.
25+
*
26+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
27+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
30+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
33+
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36+
*
37+
*/
38+
39+
#ifndef MBED_PINNAMES_H
40+
#define MBED_PINNAMES_H
41+
42+
#include "cmsis.h"
43+
44+
#ifdef __cplusplus
45+
extern "C" {
46+
#endif
47+
48+
typedef enum {
49+
PIN_INPUT,
50+
PIN_OUTPUT
51+
} PinDirection;
52+
53+
#define PORT_SHIFT 3
54+
55+
typedef enum {
56+
p0 = 0,
57+
p1 = 1,
58+
p2 = 2,
59+
p3 = 3,
60+
p4 = 4,
61+
p5 = 5,
62+
p6 = 6,
63+
p7 = 7,
64+
p8 = 8,
65+
p9 = 9,
66+
p10 = 10,
67+
p11 = 11,
68+
p12 = 12,
69+
p13 = 13,
70+
p14 = 14,
71+
p15 = 15,
72+
p16 = 16,
73+
p17 = 17,
74+
p18 = 18,
75+
p19 = 19,
76+
p20 = 20,
77+
p21 = 21,
78+
p22 = 22,
79+
p23 = 23,
80+
p24 = 24,
81+
p25 = 25,
82+
p26 = 26,
83+
p27 = 27,
84+
p28 = 28,
85+
p29 = 29,
86+
p30 = 30,
87+
88+
P0_0 = p0,
89+
P0_1 = p1,
90+
P0_2 = p2,
91+
P0_3 = p3,
92+
P0_4 = p4,
93+
P0_5 = p5,
94+
P0_6 = p6,
95+
P0_7 = p7,
96+
97+
P0_8 = p8,
98+
P0_9 = p9,
99+
P0_10 = p10,
100+
P0_11 = p11,
101+
P0_12 = p12,
102+
P0_13 = p13,
103+
P0_14 = p14,
104+
P0_15 = p15,
105+
106+
P0_16 = p16,
107+
P0_17 = p17,
108+
P0_18 = p18,
109+
P0_19 = p19,
110+
P0_20 = p20,
111+
P0_21 = p21,
112+
P0_22 = p22,
113+
P0_23 = p23,
114+
115+
P0_24 = p24,
116+
P0_25 = p25,
117+
P0_26 = p26,
118+
P0_27 = p27,
119+
P0_28 = p28,
120+
P0_29 = p29,
121+
P0_30 = p30,
122+
123+
OSHCHIP_PIN_1 = p20,
124+
OSHCHIP_PIN_2 = p18,
125+
OSHCHIP_PIN_3 = p16,
126+
OSHCHIP_PIN_4 = p15,
127+
OSHCHIP_PIN_5 = p12,
128+
OSHCHIP_PIN_6 = p11,
129+
OSHCHIP_PIN_7 = p9,
130+
OSHCHIP_PIN_9 = p1,
131+
OSHCHIP_PIN_10 = p2,
132+
OSHCHIP_PIN_11 = p0,
133+
OSHCHIP_PIN_12 = p27,
134+
OSHCHIP_PIN_13 = p26,
135+
OSHCHIP_PIN_14 = p24,
136+
OSHCHIP_PIN_15 = p21,
137+
138+
LED1 = p8,
139+
LED2 = p5,
140+
LED3 = p3,
141+
142+
LED_RED = LED1,
143+
LED_GREEN = LED2,
144+
LED_BLUE = LED3,
145+
146+
RX_PIN_NUMBER = OSHCHIP_PIN_2,
147+
TX_PIN_NUMBER = OSHCHIP_PIN_1,
148+
CTS_PIN_NUMBER = (int)0xFFFFFFFF, //no connection
149+
RTS_PIN_NUMBER = (int)0xFFFFFFFF, //no connection
150+
151+
// mBed interface Pins
152+
USBTX = TX_PIN_NUMBER,
153+
USBRX = RX_PIN_NUMBER,
154+
155+
SPI_PSELMOSI0 = OSHCHIP_PIN_4,
156+
SPI_PSELMISO0 = OSHCHIP_PIN_5,
157+
SPI_PSELSS0 = OSHCHIP_PIN_6,
158+
SPI_PSELSCK0 = OSHCHIP_PIN_7,
159+
160+
SPI_PSELMOSI1 = OSHCHIP_PIN_4,
161+
SPI_PSELMISO1 = OSHCHIP_PIN_5,
162+
SPI_PSELSS1 = OSHCHIP_PIN_6,
163+
SPI_PSELSCK1 = OSHCHIP_PIN_7,
164+
165+
SPIS_PSELMOSI = OSHCHIP_PIN_4,
166+
SPIS_PSELMISO = OSHCHIP_PIN_5,
167+
SPIS_PSELSS = OSHCHIP_PIN_6,
168+
SPIS_PSELSCK = OSHCHIP_PIN_7,
169+
170+
I2C_SDA0 = OSHCHIP_PIN_14,
171+
I2C_SCL0 = OSHCHIP_PIN_15,
172+
173+
D0 = OSHCHIP_PIN_1,
174+
D1 = OSHCHIP_PIN_2,
175+
D2 = OSHCHIP_PIN_3,
176+
D3 = OSHCHIP_PIN_4,
177+
D4 = OSHCHIP_PIN_5,
178+
D5 = OSHCHIP_PIN_6,
179+
D6 = OSHCHIP_PIN_7,
180+
D7 = OSHCHIP_PIN_15,
181+
D8 = OSHCHIP_PIN_14,
182+
D9 = OSHCHIP_PIN_11,
183+
184+
A0 = OSHCHIP_PIN_13,
185+
A1 = OSHCHIP_PIN_12,
186+
A2 = OSHCHIP_PIN_10,
187+
A3 = OSHCHIP_PIN_9,
188+
189+
// Not connected
190+
NC = (int)0xFFFFFFFF
191+
} PinName;
192+
193+
typedef enum {
194+
PullNone = 0,
195+
PullDown = 1,
196+
PullUp = 3,
197+
PullDefault = PullUp
198+
} PinMode;
199+
200+
#ifdef __cplusplus
201+
}
202+
#endif
203+
204+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
2+
// Check the 'features' section of the target description in 'targets.json' for more details.
3+
/* mbed Microcontroller Library
4+
* Copyright (c) 2006-2013 ARM Limited
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
#ifndef MBED_DEVICE_H
19+
#define MBED_DEVICE_H
20+
21+
#include "objects.h"
22+
23+
#endif

0 commit comments

Comments
 (0)