Skip to content

Commit 2af7213

Browse files
authored
Merge pull request #5104 from architech-boards/master
add support for SILICA_SENSOR_NODE platform
2 parents 919e145 + 35736f5 commit 2af7213

File tree

7 files changed

+914
-0
lines changed

7 files changed

+914
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2015, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
#ifndef MBED_PERIPHERALNAMES_H
31+
#define MBED_PERIPHERALNAMES_H
32+
33+
#include "cmsis.h"
34+
35+
#ifdef __cplusplus
36+
extern "C" {
37+
#endif
38+
39+
typedef enum {
40+
ADC_1 = (int)ADC1_BASE,
41+
ADC_2 = (int)ADC2_BASE,
42+
ADC_3 = (int)ADC3_BASE
43+
} ADCName;
44+
45+
typedef enum {
46+
DAC_1 = (int)DAC_BASE
47+
} DACName;
48+
49+
typedef enum {
50+
UART_1 = (int)USART1_BASE,
51+
UART_2 = (int)USART2_BASE,
52+
UART_3 = (int)USART3_BASE,
53+
UART_4 = (int)UART4_BASE,
54+
UART_5 = (int)UART5_BASE,
55+
LPUART_1 = (int)LPUART1_BASE
56+
} UARTName;
57+
58+
#define STDIO_UART_TX PC_12
59+
#define STDIO_UART_RX PD_2
60+
#define STDIO_UART UART_5
61+
62+
typedef enum {
63+
SPI_1 = (int)SPI1_BASE,
64+
SPI_2 = (int)SPI2_BASE,
65+
SPI_3 = (int)SPI3_BASE
66+
} SPIName;
67+
68+
typedef enum {
69+
I2C_1 = (int)I2C1_BASE,
70+
I2C_2 = (int)I2C2_BASE,
71+
I2C_3 = (int)I2C3_BASE
72+
} I2CName;
73+
74+
typedef enum {
75+
PWM_1 = (int)TIM1_BASE,
76+
PWM_2 = (int)TIM2_BASE,
77+
PWM_3 = (int)TIM3_BASE,
78+
PWM_4 = (int)TIM4_BASE,
79+
PWM_5 = (int)TIM5_BASE,
80+
PWM_8 = (int)TIM8_BASE,
81+
PWM_15 = (int)TIM15_BASE,
82+
PWM_16 = (int)TIM16_BASE,
83+
PWM_17 = (int)TIM17_BASE
84+
} PWMName;
85+
86+
typedef enum {
87+
CAN_1 = (int)CAN1_BASE
88+
} CANName;
89+
90+
#ifdef __cplusplus
91+
}
92+
#endif
93+
94+
#endif

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/TARGET_SILICA_SENSOR_NODE/PeripheralPins.c

Lines changed: 269 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2016, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
#ifndef MBED_PINNAMES_H
31+
#define MBED_PINNAMES_H
32+
33+
#include "cmsis.h"
34+
#include "PinNamesTypes.h"
35+
36+
#ifdef __cplusplus
37+
extern "C" {
38+
#endif
39+
40+
typedef enum {
41+
PA_0 = 0x00,
42+
PA_1 = 0x01,
43+
PA_2 = 0x02,
44+
PA_3 = 0x03,
45+
PA_4 = 0x04,
46+
PA_5 = 0x05,
47+
PA_6 = 0x06,
48+
PA_7 = 0x07,
49+
PA_8 = 0x08,
50+
PA_9 = 0x09,
51+
PA_10 = 0x0A,
52+
PA_11 = 0x0B,
53+
PA_12 = 0x0C,
54+
PA_13 = 0x0D,
55+
PA_14 = 0x0E,
56+
PA_15 = 0x0F,
57+
58+
PB_0 = 0x10,
59+
PB_1 = 0x11,
60+
PB_2 = 0x12,
61+
PB_3 = 0x13,
62+
PB_4 = 0x14,
63+
PB_5 = 0x15,
64+
PB_6 = 0x16,
65+
PB_7 = 0x17,
66+
PB_8 = 0x18,
67+
PB_9 = 0x19,
68+
PB_10 = 0x1A,
69+
PB_11 = 0x1B,
70+
PB_12 = 0x1C,
71+
PB_13 = 0x1D,
72+
PB_14 = 0x1E,
73+
PB_15 = 0x1F,
74+
75+
PC_0 = 0x20,
76+
PC_1 = 0x21,
77+
PC_2 = 0x22,
78+
PC_3 = 0x23,
79+
PC_4 = 0x24,
80+
PC_5 = 0x25,
81+
PC_6 = 0x26,
82+
PC_7 = 0x27,
83+
PC_8 = 0x28,
84+
PC_9 = 0x29,
85+
PC_10 = 0x2A,
86+
PC_11 = 0x2B,
87+
PC_12 = 0x2C,
88+
PC_13 = 0x2D,
89+
PC_14 = 0x2E,
90+
PC_15 = 0x2F,
91+
92+
PD_2 = 0x32,
93+
94+
PG_9 = 0x69,
95+
PG_10 = 0x6A,
96+
PG_11 = 0x6B,
97+
PG_12 = 0x6C,
98+
99+
PH_0 = 0x70,
100+
PH_1 = 0x71,
101+
102+
// ADC internal channels
103+
ADC_TEMP = 0xF0,
104+
ADC_VREF = 0xF1,
105+
ADC_VBAT = 0xF2,
106+
107+
// Arduino connector namings
108+
A0 = PA_0,
109+
A1 = PA_1,
110+
A2 = PA_4,
111+
A3 = PB_0,
112+
A4 = PC_1,
113+
A5 = PC_0,
114+
D0 = PA_3,
115+
D1 = PA_2,
116+
D2 = PA_10,
117+
D3 = PB_3,
118+
D4 = PB_5,
119+
D5 = PB_4,
120+
D6 = PB_10,
121+
D7 = PA_8,
122+
D8 = PA_9,
123+
D9 = PC_7,
124+
D10 = PB_6,
125+
D11 = PA_7,
126+
D12 = PA_6,
127+
D13 = PA_5,
128+
D14 = PB_9,
129+
D15 = PB_8,
130+
131+
// Generic signals namings
132+
LED1 = PG_12,
133+
LED2 = PG_12,
134+
LED3 = PG_12,
135+
LED4 = PG_12,
136+
USER_BUTTON = PC_13,
137+
// Standardized button names
138+
BUTTON1 = USER_BUTTON,
139+
SERIAL_TX = PC_12,
140+
SERIAL_RX = PD_2,
141+
USBTX = PC_12,
142+
USBRX = PD_2,
143+
I2C_SCL = PC_0,
144+
I2C_SDA = PC_1,
145+
SPI_MOSI = PG_11,
146+
SPI_MISO = PG_10,
147+
SPI_SCK = PG_9,
148+
SPI_CS = PG_12,
149+
PWM_OUT = PB_3,
150+
151+
//USB pins
152+
USB_OTG_FS_SOF = PA_8,
153+
USB_OTG_FS_VBUS = PA_9,
154+
USB_OTG_FS_ID = PA_10,
155+
USB_OTG_FS_DM = PA_11,
156+
USB_OTG_FS_DP = PA_12,
157+
USB_OTG_FS_NOE_ALT = PA_13,
158+
USB_OTG_FS_NOE = PC_9,
159+
160+
// Not connected
161+
NC = (int)0xFFFFFFFF
162+
} PinName;
163+
164+
#ifdef __cplusplus
165+
}
166+
#endif
167+
168+
#endif

0 commit comments

Comments
 (0)