Skip to content

Commit c3f3bcd

Browse files
authored
Merge pull request #3 from axg-onoda/mbed-os-5.11.3-raven
Support TARGET_UHURU_RAVEN.
2 parents f8c2cb2 + cd6945c commit c3f3bcd

File tree

9 files changed

+907
-0
lines changed

9 files changed

+907
-0
lines changed

components/storage/blockdevice/COMPONENT_SPIF/mbed_lib.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@
5555
"SPI_MISO": "PA_6",
5656
"SPI_CLK": "PA_5",
5757
"SPI_CS": "PB_12"
58+
},
59+
"UHURU_RAVEN": {
60+
"SPI_MOSI": "PE_14",
61+
"SPI_MISO": "PE_13",
62+
"SPI_CLK": "PE_12",
63+
"SPI_CS": "PE_11"
5864
}
5965
}
6066
}
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2016-2019, 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 = 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+
UART_6 = (int)USART6_BASE,
56+
UART_7 = (int)UART7_BASE,
57+
UART_8 = (int)UART8_BASE
58+
} UARTName;
59+
60+
typedef enum {
61+
SPI_1 = (int)SPI1_BASE,
62+
SPI_2 = (int)SPI2_BASE,
63+
SPI_3 = (int)SPI3_BASE,
64+
SPI_4 = (int)SPI4_BASE,
65+
SPI_5 = (int)SPI5_BASE,
66+
SPI_6 = (int)SPI6_BASE
67+
} SPIName;
68+
69+
typedef enum {
70+
I2C_1 = (int)I2C1_BASE,
71+
I2C_2 = (int)I2C2_BASE,
72+
I2C_3 = (int)I2C3_BASE,
73+
I2C_4 = (int)I2C4_BASE
74+
} I2CName;
75+
76+
typedef enum {
77+
PWM_1 = (int)TIM1_BASE,
78+
PWM_2 = (int)TIM2_BASE,
79+
PWM_3 = (int)TIM3_BASE,
80+
PWM_4 = (int)TIM4_BASE,
81+
PWM_5 = (int)TIM5_BASE,
82+
PWM_8 = (int)TIM8_BASE,
83+
PWM_9 = (int)TIM9_BASE,
84+
PWM_10 = (int)TIM10_BASE,
85+
PWM_11 = (int)TIM11_BASE,
86+
PWM_12 = (int)TIM12_BASE,
87+
PWM_13 = (int)TIM13_BASE,
88+
PWM_14 = (int)TIM14_BASE
89+
} PWMName;
90+
91+
typedef enum {
92+
CAN_1 = (int)CAN1_BASE,
93+
CAN_2 = (int)CAN2_BASE,
94+
CAN_3 = (int)CAN3_BASE
95+
} CANName;
96+
97+
typedef enum {
98+
QSPI_1 = (int)QSPI_R_BASE,
99+
} QSPIName;
100+
101+
#ifdef __cplusplus
102+
}
103+
#endif
104+
105+
#endif
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2016-2019, 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+
31+
#include "PeripheralPins.h"
32+
#include "mbed_toolchain.h"
33+
34+
// =============================================================================
35+
// Notes:
36+
// * Commented lines are alternative possibilities which are not used per default.
37+
// If you change them, you will have also to modify the corresponding xxx_api.c file
38+
// for pwmout, analogin, analogout, ...
39+
// * Only the pins that are placed on the Arduino connector are described.
40+
// =============================================================================
41+
42+
//*** ADC ***
43+
44+
MBED_WEAK const PinMap PinMap_ADC[] = {
45+
{PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 - Grove1_SIG2
46+
{PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 - Grove1_SIG1
47+
{PA_6, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 - Grove2_SIG2
48+
{PA_7, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 - Grove2_SIG1
49+
{NC, NC, 0}
50+
};
51+
52+
MBED_WEAK const PinMap PinMap_ADC_Internal[] = {
53+
{ADC_TEMP, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)}, // See in analogin_api.c the correct ADC channel used
54+
{ADC_VREF, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // See in analogin_api.c the correct ADC channel used
55+
{ADC_VBAT, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // See in analogin_api.c the correct ADC channel used
56+
{NC, NC, 0}
57+
};
58+
59+
//*** DAC ***
60+
61+
MBED_WEAK const PinMap PinMap_DAC[] = {
62+
{NC, NC, 0}
63+
};
64+
65+
//*** I2C ***
66+
67+
MBED_WEAK const PinMap PinMap_I2C_SDA[] = {
68+
{PB_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // - Grove4_SIG2
69+
{PD_13, I2C_4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, // - Grove3_SIG2
70+
{NC, NC, 0}
71+
};
72+
73+
MBED_WEAK const PinMap PinMap_I2C_SCL[] = {
74+
{PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // - Grove4_SIG1
75+
{PD_12, I2C_4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, // - Grove3_SIG1
76+
{NC, NC, 0}
77+
};
78+
79+
//*** PWM ***
80+
81+
MBED_WEAK const PinMap PinMap_PWM[] = {
82+
{PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - Grove1_SIG2
83+
{PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - Grove1_SIG1
84+
{PA_6, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 -Grove2_SIG2
85+
{PA_7, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N -Grove2_SIG2
86+
{PB_8, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 -Grove4_SIG1
87+
{PB_9, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 -Grove4_SIG2
88+
{NC, NC, 0}
89+
};
90+
91+
//*** SERIAL ***
92+
93+
MBED_WEAK const PinMap PinMap_UART_TX[] = {
94+
{PA_0, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // - Grove1_SIG2
95+
{PA_2, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // - esp32 tx
96+
{PB_14, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, // - esp32 tx (log)
97+
{PD_8, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // STDIO_TX
98+
{NC, NC, 0}
99+
};
100+
101+
MBED_WEAK const PinMap PinMap_UART_RX[] = {
102+
{PA_1, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // - Grove1_SIG1
103+
{PA_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // - esp32 rx
104+
{PB_15, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, // - esp32 rx (log)
105+
{PD_9, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // STDIO_RX
106+
{NC, NC, 0}
107+
};
108+
109+
MBED_WEAK const PinMap PinMap_UART_RTS[] = {
110+
{NC, NC, 0}
111+
};
112+
113+
MBED_WEAK const PinMap PinMap_UART_CTS[] = {
114+
{NC, NC, 0}
115+
};
116+
117+
//*** SPI ***
118+
119+
MBED_WEAK const PinMap PinMap_SPI_MOSI[] = {
120+
{PC_12, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // - SD_SPI3_MOSI(ReservedPin)
121+
{PE_14, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)}, // - FLASH_SPI4_MOSI
122+
{NC, NC, 0}
123+
};
124+
125+
MBED_WEAK const PinMap PinMap_SPI_MISO[] = {
126+
{PC_11, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // - SD_SPI3_MISO/QSPI_CS(ReservedPin)
127+
{PE_13, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)}, // - FLASH_SPI4_MISO
128+
{NC, NC, 0}
129+
};
130+
131+
MBED_WEAK const PinMap PinMap_SPI_SCLK[] = {
132+
{PC_10, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // - SD_SPI3_SCK
133+
{PE_12, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)}, // FLASH_SPI4_SCK
134+
{NC, NC, 0}
135+
};
136+
137+
MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
138+
{PA_15, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // - SD_SPI3_SSEL
139+
{PE_11, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)}, // - FLASH_SPI4_SSEL
140+
{NC, NC, 0}
141+
};
142+
143+
//*** CAN ***
144+
145+
MBED_WEAK const PinMap PinMap_CAN_RD[] = {
146+
{PB_8, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, // - Grove4_SIG1
147+
{NC, NC, 0}
148+
};
149+
150+
MBED_WEAK const PinMap PinMap_CAN_TD[] = {
151+
{PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, // - Grove4_SIG2
152+
{NC, NC, 0}
153+
};

0 commit comments

Comments
 (0)