Skip to content

Commit e3ba010

Browse files
committed
introduce S1SBP6A
Signed-off-by: Heuisam Kwag <[email protected]>
1 parent 7bc9d54 commit e3ba010

Some content is hidden

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

48 files changed

+8525
-1
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/****************************************************************************
2+
*
3+
* Copyright 2020 Samsung Electronics All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
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,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15+
* either express or implied. See the License for the specific
16+
* language governing permissions and limitations under the License.
17+
*
18+
****************************************************************************/
19+
20+
#ifndef MBED_PERIPHERALNAMES_H
21+
#define MBED_PERIPHERALNAMES_H
22+
23+
#include "cmsis.h"
24+
#include "PinNames.h"
25+
#include "PeripheralNames.h"
26+
27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif
30+
31+
typedef enum {
32+
UART_0 = (int)BP_UART0_BASE,
33+
UART_1 = (int)BP_UART1_BASE,
34+
UART_2 = (int)BP_UART2_BASE
35+
} UARTName;
36+
37+
#define DEVICE_SPI_COUNT 5
38+
typedef enum {
39+
SPI_0 = (int)BP_SPI0_BASE,
40+
SPI_1 = (int)BP_SPI1_BASE,
41+
SPI_2 = (int)BP_SPI2_BASE,
42+
SPI_3 = (int)BP_SPI3_BASE,
43+
SPI_4 = (int)BP_SPI4_BASE
44+
} SPIName;
45+
46+
typedef enum {
47+
I2C_0 = (int)BP_I2C0_BASE,
48+
I2C_1 = (int)BP_I2C1_BASE,
49+
I2C_2 = (int)BP_I2C2_BASE,
50+
I2C_3 = (int)BP_I2C3_BASE,
51+
I2C_4 = (int)BP_I2C4_BASE
52+
} I2CName;
53+
54+
typedef enum {
55+
ADC_0 = 0,
56+
ADC_1 = 1,
57+
ADC_2 = 2,
58+
ADC_MAX_NUM
59+
} ADCName;
60+
61+
typedef enum {
62+
PWM_0 = (int)BP_PWM_TIMER_BASE,
63+
} PWMName;
64+
65+
#define _UART_NAME_(a, b) a ## b
66+
#define _UART_NAME(a, b) _UART_NAME_(a, b)
67+
68+
#ifndef UART_STDIO_PORT
69+
#define STDIO_UART_TX UART_TX0
70+
#define STDIO_UART_RX UART_RX0
71+
#define STDIO_UART UART_0
72+
#else
73+
#define STDIO_UART_TX _UART_NAME(UART_TX, UART_STDIO_PORT)
74+
#define STDIO_UART_RX _UART_NAME(UART_RX, UART_STDIO_PORT)
75+
#define STDIO_UART _UART_NAME(UART_, UART_STDIO_PORT)
76+
#endif
77+
78+
#define USBTX UART_TX0
79+
#define USBRX UART_RX0
80+
81+
#ifdef __cplusplus
82+
}
83+
#endif
84+
85+
#endif
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
/****************************************************************************
2+
*
3+
* Copyright 2020 Samsung Electronics All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
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,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15+
* either express or implied. See the License for the specific
16+
* language governing permissions and limitations under the License.
17+
*
18+
****************************************************************************/
19+
20+
#ifndef MBED_PERIPHERALNAMES_H
21+
#define MBED_PERIPHERALNAMES_H
22+
#include "cmsis.h"
23+
#include "PeripheralPins.h"
24+
25+
const PinMap PinMap_empty[] = {
26+
{ NC, NC, 0 }
27+
};
28+
29+
#if DEVICE_SERIAL
30+
//*** SERIAL ***
31+
const PinMap PinMap_UART_TX[] = {
32+
{ UART0_TX, BP_UART0_BASE, BP6A_PIN_DATA(ALT0, PIN_OUTPUT, PullNone, 0) },
33+
{ UART1_TX, BP_UART1_BASE, BP6A_PIN_DATA(ALT0, PIN_OUTPUT, PullNone, 1) },
34+
{ UART2_TX, BP_UART2_BASE, BP6A_PIN_DATA(ALT0, PIN_OUTPUT, PullNone, 2) },
35+
{ NC, NC, 0 }
36+
};
37+
38+
const PinMap PinMap_UART_RX[] = {
39+
{ UART0_RX, BP_UART0_BASE, BP6A_PIN_DATA(ALT0, PIN_INPUT, PullNone, 0) },
40+
{ UART1_RX, BP_UART1_BASE, BP6A_PIN_DATA(ALT0, PIN_INPUT, PullNone, 1) },
41+
{ UART2_RX, BP_UART2_BASE, BP6A_PIN_DATA(ALT0, PIN_INPUT, PullNone, 2) },
42+
{ NC, NC, 0 }
43+
};
44+
45+
const PinMap PinMap_UART_CTS[] = {
46+
{ UART0_CTS, BP_UART0_BASE, BP6A_PIN_DATA(ALT0, PIN_INPUT, PullNone, 0)},
47+
{ UART1_CTS, BP_UART1_BASE, BP6A_PIN_DATA(ALT0, PIN_INPUT, PullNone, 1)},
48+
{ UART2_CTS, BP_UART2_BASE, BP6A_PIN_DATA(ALT0, PIN_INPUT, PullNone, 2)},
49+
{NC, NC, 0}
50+
};
51+
52+
const PinMap PinMap_UART_RTS[] = {
53+
{ UART0_RTS, BP_UART0_BASE, BP6A_PIN_DATA(ALT0, PIN_OUTPUT, PullNone, 0)},
54+
{ UART1_RTS, BP_UART1_BASE, BP6A_PIN_DATA(ALT0, PIN_OUTPUT, PullNone, 1)},
55+
{ UART2_RTS, BP_UART2_BASE, BP6A_PIN_DATA(ALT0, PIN_OUTPUT, PullNone, 2)},
56+
{NC, NC, 0}
57+
};
58+
#endif
59+
60+
61+
#if DEVICE_SPI
62+
//*** SPI ***
63+
const PinMap PinMap_SPI_SCLK[] = {
64+
{ SPI0_SCLK, BP_SPI0_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 0) },
65+
{ SPI1_SCLK, BP_SPI1_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 1) },
66+
{ SPI2_SCLK, BP_SPI2_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 2) },
67+
{ SPI3_SCLK, BP_SPI3_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 3) },
68+
{ SPI4_SCLK, BP_SPI4_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 4) },
69+
70+
{ NC, NC, 0 }
71+
};
72+
73+
const PinMap PinMap_SPI_SSEL[] = {
74+
{ SPI0_SSEL, BP_SPI0_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 0) },
75+
{ SPI1_SSEL, BP_SPI1_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 1) },
76+
{ SPI2_SSEL, BP_SPI2_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 2) },
77+
{ SPI3_SSEL, BP_SPI3_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 3) },
78+
{ SPI4_SSEL, BP_SPI4_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 4) },
79+
{ NC, NC, 0 }
80+
};
81+
82+
const PinMap PinMap_SPI_MOSI[] = {
83+
{ SPI0_MOSI, BP_SPI0_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 0) },
84+
{ SPI1_MOSI, BP_SPI1_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 1) },
85+
{ SPI2_MOSI, BP_SPI2_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 2) },
86+
{ SPI3_MOSI, BP_SPI3_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 3) },
87+
{ SPI4_MOSI, BP_SPI4_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 4) },
88+
{ NC, NC, 0 }
89+
};
90+
91+
const PinMap PinMap_SPI_MISO[] = {
92+
{ SPI0_MISO, BP_SPI0_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 0) },
93+
{ SPI1_MISO, BP_SPI1_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 1) },
94+
{ SPI2_MISO, BP_SPI2_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 2) },
95+
{ SPI3_MISO, BP_SPI3_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 3) },
96+
{ SPI4_MISO, BP_SPI4_BASE, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullNone, 4) },
97+
{ NC, NC, 0 }
98+
};
99+
#endif
100+
//*** I2C ***
101+
#if DEVICE_I2C
102+
const PinMap PinMap_I2C_SDA[] = {
103+
{ I2C0_SDA, 0, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 0) },
104+
{ I2C1_SDA, 1, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 1) },
105+
{ I2C2_SDA, 2, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 2) },
106+
{ I2C3_SDA, 3, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 3) },
107+
{ I2C4_SDA, 4, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 4) },
108+
{ NC, NC, 0 }
109+
};
110+
111+
const PinMap PinMap_I2C_SCL[] = {
112+
{ I2C0_SCL, 0, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 0) },
113+
{ I2C1_SCL, 1, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 1) },
114+
{ I2C2_SCL, 2, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 2) },
115+
{ I2C3_SCL, 3, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 3) },
116+
{ I2C4_SCL, 4, BP6A_PIN_DATA(ALT0, (PIN_INPUT | PIN_OUTPUT), PullUp_2200, 4) },
117+
{ NC, NC, 0 }
118+
};
119+
#endif
120+
121+
#if DEVICE_ANALOGIN
122+
static const PinMap PinMap_ADC[] = {
123+
{AN0, ADC_0, GPIO_FUNC1},
124+
{AN1, ADC_1, GPIO_FUNC1},
125+
{AN2, ADC_2, GPIO_FUNC1},
126+
{NC, NC, 0}
127+
};
128+
129+
#endif
130+
131+
#endif
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/****************************************************************************
2+
*
3+
* Copyright 2020 Samsung Electronics All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
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,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15+
* either express or implied. See the License for the specific
16+
* language governing permissions and limitations under the License.
17+
*
18+
****************************************************************************/
19+
20+
#ifndef MBED_PERIPHERALPINS_H
21+
#define MBED_PERIPHERALPINS_H
22+
23+
#include "pinmap.h"
24+
25+
#define BP6A_PIN_DATA(sel, dir, mode, channel) (sel | (dir << 8) | (mode << 16) | (channel << 24))
26+
27+
#define GET_PIN_SEL(data) ( data & 0xff)
28+
#define GET_PIN_DIR(data) ((data >> 8) & 0xff)
29+
#define GET_PIN_MODE(data) ((data >> 16) & 0xff)
30+
#define GET_PIN_CHAN(data) ((data >> 24) & 0xff)
31+
32+
extern const PinMap PinMap_empty[];
33+
34+
//*** ADC ***
35+
#if DEVICE_ANALOGIN
36+
extern const PinMap PinMap_ADC[];
37+
extern const PinMap PinMap_ADC_Internal[];
38+
#endif
39+
40+
//*** I2C ***
41+
#if DEVICE_I2C
42+
extern const PinMap PinMap_I2C_SDA[];
43+
extern const PinMap PinMap_I2C_SCL[];
44+
#endif
45+
46+
//*** PWM ***
47+
#if DEVICE_PWMOUT
48+
extern const PinMap PinMap_PWM[];
49+
#endif
50+
51+
//*** SERIAL ***
52+
#if DEVICE_SERIAL
53+
extern const PinMap PinMap_UART_TX[];
54+
extern const PinMap PinMap_UART_RX[];
55+
extern const PinMap PinMap_UART_CTS[];
56+
extern const PinMap PinMap_UART_RTS[];
57+
#endif
58+
59+
//*** SPI ***
60+
#if DEVICE_SPI
61+
extern const PinMap PinMap_SPI_MOSI[];
62+
extern const PinMap PinMap_SPI_MISO[];
63+
extern const PinMap PinMap_SPI_SCLK[];
64+
extern const PinMap PinMap_SPI_SSEL[];
65+
#endif
66+
67+
#endif

0 commit comments

Comments
 (0)