Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 227cec0

Browse files
wm-eisosfpistm
authored andcommittedJun 18, 2025·
variant(WL): add Oceanus-I module and EV
Signed-off-by: wm-eisos <wajdi.elmuhtadi@we-online.com>
1 parent 729b087 commit 227cec0

File tree

8 files changed

+1028
-0
lines changed

8 files changed

+1028
-0
lines changed
 

‎README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,8 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
889889
| :green_heart: | STM32WLE5CC | [RAK3172T Module](https://github.com/RAKWireless/rakwireless-docs/tree/master/docs/Product-Categories/WisDuo/RAK3172-Module) | *2.8.1* | RAK3172 Module with TCXO |
890890
| :green_heart: | STM32L151CB | [RAK811 LoRa Tracker](https://www.rakwireless.com/en/) | *1.4.0* | [Wiki](https://github.com/stm32duino/Arduino_Core_STM32/wiki/Connectivities#lora) |
891891
| :green_heart: | STM32L051C8 | [RHF76-052](https://lora-alliance.org/lora_products/rhf76-052/) | *1.7.0* | Basic support |
892+
| :yellow_heart: | STM32WLE5CC | [Oceanus-I Module](https://www.we-online.com/en/components/products/OCEANUS-I) | **2.11.0** | [User Manual](https://www.we-online.com/en/components/products/manual/2618011182000) <br/> LoRa & LoRaWAN support with [STM32LoRaWAN](https://github.com/stm32duino/STM32LoRaWAN) |
893+
| :yellow_heart: | STM32WLE5CC | [Oceanus-I EV](https://www.we-online.com/en/components/products/OCEANUS-I) | **2.11.0** | [User Manual](https://www.we-online.com/en/components/products/manual/2618019382001) <br/> LoRa & LoRaWAN support with [STM32LoRaWAN](https://github.com/stm32duino/STM32LoRaWAN) |
892894

893895
### Midatronics boards
894896

‎boards.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14211,6 +14211,34 @@ LoRa.menu.pnum.ELEKTOR_F072CB.build.st_extra_flags=-D{build.product_line} {build
1421114211
LoRa.menu.pnum.ELEKTOR_F072CB.openocd.target=stm32f0x
1421214212
LoRa.menu.pnum.ELEKTOR_F072CB.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F0xx/STM32F0x2.svd
1421314213

14214+
# Oceanus-I Module
14215+
LoRa.menu.pnum.WE_OCEANUS1=Oceanus-I Module
14216+
LoRa.menu.pnum.WE_OCEANUS1.upload.maximum_size=262144
14217+
LoRa.menu.pnum.WE_OCEANUS1.upload.maximum_data_size=65536
14218+
LoRa.menu.pnum.WE_OCEANUS1.build.mcu=cortex-m4
14219+
LoRa.menu.pnum.WE_OCEANUS1.build.board=WE_OCEANUS1
14220+
LoRa.menu.pnum.WE_OCEANUS1.build.series=STM32WLxx
14221+
LoRa.menu.pnum.WE_OCEANUS1.build.product_line=STM32WLE5xx
14222+
LoRa.menu.pnum.WE_OCEANUS1.build.variant=STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U
14223+
LoRa.menu.pnum.WE_OCEANUS1.build.variant_h=variant_WE_OCEANUS1.h
14224+
LoRa.menu.pnum.WE_OCEANUS1.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS
14225+
LoRa.menu.pnum.WE_OCEANUS1.openocd.target=stm32wlx
14226+
LoRa.menu.pnum.WE_OCEANUS1.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32WLxx/STM32WLE5_CM4.svd
14227+
14228+
# Oceanus-I EV
14229+
LoRa.menu.pnum.WE_OCEANUS1_EV=Oceanus-I EV
14230+
LoRa.menu.pnum.WE_OCEANUS1_EV.upload.maximum_size=262144
14231+
LoRa.menu.pnum.WE_OCEANUS1_EV.upload.maximum_data_size=65536
14232+
LoRa.menu.pnum.WE_OCEANUS1_EV.build.mcu=cortex-m4
14233+
LoRa.menu.pnum.WE_OCEANUS1_EV.build.board=WE_OCEANUS1_EV
14234+
LoRa.menu.pnum.WE_OCEANUS1_EV.build.series=STM32WLxx
14235+
LoRa.menu.pnum.WE_OCEANUS1_EV.build.product_line=STM32WLE5xx
14236+
LoRa.menu.pnum.WE_OCEANUS1_EV.build.variant=STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U
14237+
LoRa.menu.pnum.WE_OCEANUS1_EV.build.variant_h=variant_WE_OCEANUS1_EV.h
14238+
LoRa.menu.pnum.WE_OCEANUS1_EV.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS
14239+
LoRa.menu.pnum.WE_OCEANUS1_EV.openocd.target=stm32wlx
14240+
LoRa.menu.pnum.WE_OCEANUS1_EV.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32WLxx/STM32WLE5_CM4.svd
14241+
1421414242
# Upload menu
1421514243
LoRa.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
1421614244
LoRa.menu.upload_method.swdMethod.upload.protocol=swd

‎cmake/boards_db.cmake

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

‎variants/STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ add_library(variant_bin STATIC EXCLUDE_FROM_ALL
2424
variant_generic.cpp
2525
variant_GENERIC_NODE_SE_TTI.cpp
2626
variant_RAK3172_MODULE.cpp
27+
PeripheralPins_WE_OCEANUS1.c
28+
variant_WE_OCEANUS1.cpp
2729
)
2830
target_link_libraries(variant_bin PUBLIC variant_usage)
2931

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
/*
14+
* Automatically generated from STM32WL54CCUx.xml, STM32WL55CCUx.xml
15+
* STM32WLE4C8Ux.xml, STM32WLE4CBUx.xml
16+
* STM32WLE4CCUx.xml, STM32WLE5C8Ux.xml
17+
* STM32WLE5CBUx.xml, STM32WLE5CCUx.xml
18+
* CubeMX DB release 6.0.140
19+
*/
20+
#if defined(ARDUINO_WE_OCEANUS1) || defined(ARDUINO_WE_OCEANUS1_EV)
21+
#include "Arduino.h"
22+
#include "PeripheralPins.h"
23+
24+
/* =====
25+
* Notes:
26+
* - The pins mentioned Px_y_ALTz are alternative possibilities which use other
27+
* HW peripheral instances. You can use them the same way as any other "normal"
28+
* pin (i.e. analogWrite(PA7_ALT1, 128);).
29+
*
30+
* - Commented lines are alternative possibilities which are not used per default.
31+
* If you change them, you will have to know what you do
32+
* =====
33+
*/
34+
35+
//*** ADC ***
36+
37+
#ifdef HAL_ADC_MODULE_ENABLED
38+
WEAK const PinMap PinMap_ADC[] = {
39+
{PA_10, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6
40+
{PA_11, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7
41+
{PA_12, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8
42+
{PA_13, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9
43+
{PA_14, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC_IN10
44+
{PA_15, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC_IN11
45+
{PB_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4
46+
{PB_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2
47+
{PB_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3
48+
{NC, NP, 0}
49+
};
50+
#endif
51+
52+
//*** DAC ***
53+
54+
#ifdef HAL_DAC_MODULE_ENABLED
55+
WEAK const PinMap PinMap_DAC[] = {
56+
{PA_10, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1
57+
{NC, NP, 0}
58+
};
59+
#endif
60+
61+
//*** I2C ***
62+
63+
#ifdef HAL_I2C_MODULE_ENABLED
64+
WEAK const PinMap PinMap_I2C_SDA[] = {
65+
{PA_10, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
66+
{PA_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
67+
{PA_15, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
68+
{PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
69+
{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
70+
{NC, NP, 0}
71+
};
72+
#endif
73+
74+
#ifdef HAL_I2C_MODULE_ENABLED
75+
WEAK const PinMap PinMap_I2C_SCL[] = {
76+
{PA_7, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
77+
{PA_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
78+
{PA_12, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
79+
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
80+
{PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
81+
{NC, NP, 0}
82+
};
83+
#endif
84+
85+
//*** No I3C ***
86+
87+
//*** TIM ***
88+
89+
#ifdef HAL_TIM_MODULE_ENABLED
90+
WEAK const PinMap PinMap_TIM[] = {
91+
{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
92+
{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
93+
{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
94+
{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
95+
{PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
96+
{PA_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1
97+
{PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
98+
{PA_7_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM17, 1, 0)}, // TIM17_CH1
99+
{PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
100+
{PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
101+
{PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
102+
{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
103+
{PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
104+
{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
105+
{PB_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 1)}, // TIM16_CH1N
106+
{PB_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM17, 1, 1)}, // TIM17_CH1N
107+
{PB_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
108+
{PB_8_ALT1, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1
109+
{NC, NP, 0}
110+
};
111+
#endif
112+
113+
//*** UART ***
114+
115+
#ifdef HAL_UART_MODULE_ENABLED
116+
WEAK const PinMap PinMap_UART_TX[] = {
117+
{PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
118+
{PA_2_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
119+
{PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
120+
{PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
121+
{NC, NP, 0}
122+
};
123+
#endif
124+
125+
#ifdef HAL_UART_MODULE_ENABLED
126+
WEAK const PinMap PinMap_UART_RX[] = {
127+
{PA_3, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
128+
{PA_3_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
129+
{PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
130+
{PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
131+
{NC, NP, 0}
132+
};
133+
#endif
134+
135+
#ifdef HAL_UART_MODULE_ENABLED
136+
WEAK const PinMap PinMap_UART_RTS[] = {
137+
{PA_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
138+
{PA_1_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
139+
{PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
140+
{PB_3, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
141+
// {PB_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
142+
{NC, NP, 0}
143+
};
144+
#endif
145+
146+
#ifdef HAL_UART_MODULE_ENABLED
147+
WEAK const PinMap PinMap_UART_CTS[] = {
148+
{PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
149+
{PA_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
150+
{PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
151+
{PB_4, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
152+
{NC, NP, 0}
153+
};
154+
#endif
155+
156+
//*** SPI ***
157+
158+
#ifdef HAL_SPI_MODULE_ENABLED
159+
WEAK const PinMap PinMap_SPI_MOSI[] = {
160+
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
161+
{PA_7_ALT1, SUBGHZSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF13_DEBUG_SUBGHZSPI)},
162+
{PA_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
163+
{PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
164+
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
165+
{NC, NP, 0}
166+
};
167+
#endif
168+
169+
#ifdef HAL_SPI_MODULE_ENABLED
170+
WEAK const PinMap PinMap_SPI_MISO[] = {
171+
{PA_5, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_SPI2)},
172+
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
173+
{PA_6_ALT1, SUBGHZSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF13_DEBUG_SUBGHZSPI)},
174+
{PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
175+
{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
176+
{NC, NP, 0}
177+
};
178+
#endif
179+
180+
#ifdef HAL_SPI_MODULE_ENABLED
181+
WEAK const PinMap PinMap_SPI_SCLK[] = {
182+
{PA_1, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
183+
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
184+
{PA_5_ALT1, SUBGHZSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF13_DEBUG_SUBGHZSPI)},
185+
{PA_8, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
186+
{PA_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
187+
{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
188+
{NC, NP, 0}
189+
};
190+
#endif
191+
192+
#ifdef HAL_SPI_MODULE_ENABLED
193+
WEAK const PinMap PinMap_SPI_SSEL[] = {
194+
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
195+
{PA_4_ALT1, SUBGHZSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF13_DEBUG_SUBGHZSPI)},
196+
{PA_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_SPI2)},
197+
{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
198+
{PB_2, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
199+
// {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
200+
{NC, NP, 0}
201+
};
202+
#endif
203+
204+
//*** No CAN ***
205+
206+
//*** No ETHERNET ***
207+
208+
//*** No QUADSPI ***
209+
210+
//*** No USB ***
211+
212+
//*** No SD ***
213+
214+
#endif /* ARDUINO_WE_OCEANUS1 || ARDUINO_WE_OCEANUS1_EV */
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#if defined(ARDUINO_WE_OCEANUS1) || defined(ARDUINO_WE_OCEANUS1_EV)
14+
#include "pins_arduino.h"
15+
16+
// Digital PinName array
17+
const PinName digitalPin[] = {
18+
PA_0, // D0
19+
PA_1, // D1
20+
PA_2, // D2 - USART2/LPUART1 TX
21+
PA_3, // D3 - USART2/LPUART1 RX
22+
PA_4, // D4 - SPI_NSS
23+
PA_5, // D5 - SPI_SCK
24+
PA_6, // D6 - SPI_MISO
25+
PA_7, // D7 - SPI_MOSI
26+
PA_8, // D8
27+
PA_9, // D9
28+
PA_10, // D10/A3
29+
PA_11, // D11/A7 - I2C_SDA
30+
PA_12, // D12/A8 - I2C_SCL
31+
PA_13, // D13/A5 - SWDIO
32+
PA_14, // D14/A6 - SWCLK
33+
PA_15, // D15/A4
34+
PB_2, // D16/A2
35+
PB_3, // D17/A0
36+
PB_4, // D18/A1
37+
PB_5, // D19
38+
PB_6, // D20 - USART1_TX
39+
PB_7, // D21 - USAR1_RX
40+
PB_8, // D22
41+
PB_12, // D23
42+
PC_13, // D24
43+
PH_3 // D25 - BOOT0
44+
};
45+
46+
// Analog (Ax) pin number array
47+
const uint32_t analogInputPin[] = {
48+
17, // A0, PB3
49+
18, // A1, PB4
50+
16, // A2, PB2
51+
10, // A3, PA10
52+
15, // A4, PA15
53+
13, // A5, PA13
54+
14, // A6, PA14
55+
11, // A7, PA11
56+
12 // A8, PA12
57+
};
58+
59+
// ----------------------------------------------------------------------------
60+
#ifdef __cplusplus
61+
extern "C" {
62+
#endif
63+
64+
/**
65+
* @brief System Clock Configuration
66+
* @param None
67+
* @retval None
68+
*/
69+
WEAK void SystemClock_Config(void)
70+
{
71+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
72+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
73+
74+
/** Configure LSE Drive Capability
75+
*/
76+
HAL_PWR_EnableBkUpAccess();
77+
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_MEDIUMLOW);
78+
79+
/** Configure the main internal regulator output voltage
80+
*/
81+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
82+
83+
/** Initializes the CPU, AHB and APB buses clocks
84+
*/
85+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_MSI;
86+
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
87+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
88+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
89+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
90+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
91+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11;
92+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
93+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
94+
Error_Handler();
95+
}
96+
97+
/** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
98+
*/
99+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK3 | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
100+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI;
101+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
102+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
103+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
104+
RCC_ClkInitStruct.AHBCLK3Divider = RCC_SYSCLK_DIV1;
105+
106+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
107+
Error_Handler();
108+
}
109+
}
110+
111+
#ifdef __cplusplus
112+
}
113+
#endif
114+
115+
#endif /* ARDUINO_WE_OCEANUS1 || ARDUINO_WE_OCEANUS1_EV */
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* STM32 pins number
17+
*----------------------------------------------------------------------------*/
18+
#define PA0 0
19+
#define PA1 1
20+
#define PA2 2
21+
#define PA3 3
22+
#define PA4 4
23+
#define PA5 5
24+
#define PA6 6
25+
#define PA7 7
26+
#define PA8 8
27+
#define PA9 9
28+
#define PA10 PIN_A3
29+
#define PA11 PIN_A7
30+
#define PA12 PIN_A8
31+
#define PA13 PIN_A5
32+
#define PA14 PIN_A6
33+
#define PA15 PIN_A4
34+
#define PB2 PIN_A2
35+
#define PB3 PIN_A0
36+
#define PB4 PIN_A1
37+
#define PB5 19
38+
#define PB6 20
39+
#define PB7 21
40+
#define PB8 22
41+
#define PB12 23
42+
#define PC13 24
43+
#define PH3 25
44+
45+
// Not available
46+
// PB0
47+
// PC14
48+
// PC15
49+
50+
// Alternate pins number
51+
#define PA1_ALT1 (PA1 | ALT1)
52+
#define PA2_ALT1 (PA2 | ALT1)
53+
#define PA3_ALT1 (PA3 | ALT1)
54+
#define PA4_ALT1 (PA4 | ALT1)
55+
#define PA5_ALT1 (PA5 | ALT1)
56+
#define PA6_ALT1 (PA6 | ALT1)
57+
#define PA7_ALT1 (PA7 | ALT1)
58+
#define PB8_ALT1 (PB8 | ALT1)
59+
60+
#define NUM_DIGITAL_PINS 26
61+
#define NUM_ANALOG_INPUTS 9
62+
63+
// SPI definitions
64+
#ifndef PIN_SPI_SS
65+
#define PIN_SPI_SS PA4
66+
#endif
67+
#ifndef PIN_SPI_SS1
68+
#define PIN_SPI_SS1 PB2
69+
#endif
70+
#ifndef PIN_SPI_SS2
71+
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
72+
#endif
73+
#ifndef PIN_SPI_SS3
74+
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
75+
#endif
76+
#ifndef PIN_SPI_MOSI
77+
#define PIN_SPI_MOSI PA7
78+
#endif
79+
#ifndef PIN_SPI_MISOSPI1_SCK
80+
#define PIN_SPI_MISO PA6
81+
#endif
82+
#ifndef PIN_SPI_SCK
83+
#define PIN_SPI_SCK PA5
84+
#endif
85+
86+
// I2C definitions
87+
#ifndef PIN_WIRE_SDA
88+
#define PIN_WIRE_SDA PA11
89+
#endif
90+
#ifndef PIN_WIRE_SCL
91+
#define PIN_WIRE_SCL PA12
92+
#endif
93+
94+
// Timer Definitions
95+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
96+
#ifndef TIMER_TONE
97+
#define TIMER_TONE TIM16
98+
#endif
99+
#ifndef TIMER_SERVO
100+
#define TIMER_SERVO TIM17
101+
#endif
102+
103+
// UART Definitions
104+
#ifndef SERIAL_UART_INSTANCE
105+
#define SERIAL_UART_INSTANCE 101
106+
#endif
107+
108+
// Default pin used for generic 'Serial' instance
109+
// Mandatory for Firmata
110+
#ifndef PIN_SERIAL_RX
111+
#define PIN_SERIAL_RX PA3
112+
#endif
113+
#ifndef PIN_SERIAL_TX
114+
#define PIN_SERIAL_TX PA2
115+
#endif
116+
117+
// Alias
118+
#ifndef DEBUG_SUBGHZSPI_MOSI
119+
#define DEBUG_SUBGHZSPI_MOSI PA7_ALT1
120+
#endif
121+
#ifndef DEBUG_SUBGHZSPI_MISO
122+
#define DEBUG_SUBGHZSPI_MISO PA6_ALT1
123+
#endif
124+
#ifndef DEBUG_SUBGHZSPI_SCLK
125+
#define DEBUG_SUBGHZSPI_SCLK PA5_ALT1
126+
#endif
127+
#ifndef DEBUG_SUBGHZSPI_SS
128+
#define DEBUG_SUBGHZSPI_SS PA4_ALT1
129+
#endif
130+
131+
// Extra HAL modules
132+
#if !defined(HAL_DAC_MODULE_DISABLED)
133+
#define HAL_DAC_MODULE_ENABLED
134+
#endif
135+
136+
// LoRaWAN definitions
137+
138+
#define LORAWAN_BOARD_HAS_TCXO 1U
139+
#define LORAWAN_BOARD_HAS_DCDC 1U
140+
#define LORAWAN_TX_CONFIG RBI_CONF_RFO_LP
141+
142+
#define LORAWAN_RFSWITCH_PINS PB12, PC13
143+
#define LORAWAN_RFSWITCH_PIN_COUNT 2
144+
#define LORAWAN_RFSWITCH_OFF_VALUES LOW, LOW
145+
#define LORAWAN_RFSWITCH_RX_VALUES HIGH, LOW
146+
#define LORAWAN_RFSWITCH_RFO_LP_VALUES HIGH, HIGH
147+
#define LORAWAN_RFSWITCH_RFO_HP_VALUES HIGH, HIGH
148+
149+
/*----------------------------------------------------------------------------
150+
* Arduino objects - C++ only
151+
*----------------------------------------------------------------------------*/
152+
153+
#ifdef __cplusplus
154+
// These serial port names are intended to allow libraries and architecture-neutral
155+
// sketches to automatically default to the correct port name for a particular type
156+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
157+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
158+
//
159+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
160+
//
161+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
162+
//
163+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
164+
//
165+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
166+
//
167+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
168+
// pins are NOT connected to anything by default.
169+
#ifndef SERIAL_PORT_MONITOR
170+
#define SERIAL_PORT_MONITOR Serial
171+
#endif
172+
#ifndef SERIAL_PORT_HARDWARE
173+
#define SERIAL_PORT_HARDWARE Serial
174+
#endif
175+
#endif
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#pragma once
14+
15+
#include "variant_WE_OCEANUS1.h"
16+
17+
// On-board LED pin number
18+
#define LED_BUILTIN PA7
19+
20+
// On-board user button
21+
#define USER_BTN PA0
22+

0 commit comments

Comments
 (0)
Please sign in to comment.