Skip to content

Commit 6081727

Browse files
authored
Merge pull request #10115 from enebular/raven
Uhuru RAVEN: Adding platform HAL
2 parents 8b5157b + cc6c477 commit 6081727

File tree

11 files changed

+1001
-1
lines changed

11 files changed

+1001
-1
lines changed

components/storage/blockdevice/COMPONENT_SPIF/mbed_lib.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
"SPI_CLK": "PA_5",
5757
"SPI_CS": "PB_12",
5858
"SPI_FREQ": "20000000"
59+
},
60+
"UHURU_RAVEN": {
61+
"SPI_MOSI": "PE_14",
62+
"SPI_MISO": "PE_13",
63+
"SPI_CLK": "PE_12",
64+
"SPI_CS": "PE_11"
5965
}
6066
}
6167
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2016-2019, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* SPDX-License-Identifier: BSD-3-Clause-Clear
7+
*
8+
* Redistribution and use in source and binary forms, with or without
9+
* modification, are permitted provided that the following conditions are met:
10+
*
11+
* 1. Redistributions of source code must retain the above copyright notice,
12+
* this list of conditions and the following disclaimer.
13+
* 2. Redistributions in binary form must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*******************************************************************************
31+
*/
32+
#ifndef MBED_PERIPHERALNAMES_H
33+
#define MBED_PERIPHERALNAMES_H
34+
35+
#include "cmsis.h"
36+
37+
#ifdef __cplusplus
38+
extern "C" {
39+
#endif
40+
41+
typedef enum {
42+
ADC_1 = (int)ADC1_BASE,
43+
ADC_2 = (int)ADC2_BASE,
44+
ADC_3 = (int)ADC3_BASE
45+
} ADCName;
46+
47+
typedef enum {
48+
DAC_1 = DAC_BASE
49+
} DACName;
50+
51+
typedef enum {
52+
UART_1 = (int)USART1_BASE,
53+
UART_2 = (int)USART2_BASE,
54+
UART_3 = (int)USART3_BASE,
55+
UART_4 = (int)UART4_BASE,
56+
UART_5 = (int)UART5_BASE,
57+
UART_6 = (int)USART6_BASE,
58+
UART_7 = (int)UART7_BASE,
59+
UART_8 = (int)UART8_BASE
60+
} UARTName;
61+
62+
typedef enum {
63+
SPI_1 = (int)SPI1_BASE,
64+
SPI_2 = (int)SPI2_BASE,
65+
SPI_3 = (int)SPI3_BASE,
66+
SPI_4 = (int)SPI4_BASE,
67+
SPI_5 = (int)SPI5_BASE,
68+
SPI_6 = (int)SPI6_BASE
69+
} SPIName;
70+
71+
typedef enum {
72+
I2C_1 = (int)I2C1_BASE,
73+
I2C_2 = (int)I2C2_BASE,
74+
I2C_3 = (int)I2C3_BASE,
75+
I2C_4 = (int)I2C4_BASE
76+
} I2CName;
77+
78+
typedef enum {
79+
PWM_1 = (int)TIM1_BASE,
80+
PWM_2 = (int)TIM2_BASE,
81+
PWM_3 = (int)TIM3_BASE,
82+
PWM_4 = (int)TIM4_BASE,
83+
PWM_5 = (int)TIM5_BASE,
84+
PWM_8 = (int)TIM8_BASE,
85+
PWM_9 = (int)TIM9_BASE,
86+
PWM_10 = (int)TIM10_BASE,
87+
PWM_11 = (int)TIM11_BASE,
88+
PWM_12 = (int)TIM12_BASE,
89+
PWM_13 = (int)TIM13_BASE,
90+
PWM_14 = (int)TIM14_BASE
91+
} PWMName;
92+
93+
typedef enum {
94+
CAN_1 = (int)CAN1_BASE,
95+
CAN_2 = (int)CAN2_BASE,
96+
CAN_3 = (int)CAN3_BASE
97+
} CANName;
98+
99+
typedef enum {
100+
QSPI_1 = (int)QSPI_R_BASE,
101+
} QSPIName;
102+
103+
#ifdef __cplusplus
104+
}
105+
#endif
106+
107+
#endif
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/* mbed Microcontroller Library
2+
*******************************************************************************
3+
* Copyright (c) 2016-2019, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* SPDX-License-Identifier: BSD-3-Clause-Clear
7+
*
8+
* Redistribution and use in source and binary forms, with or without
9+
* modification, are permitted provided that the following conditions are met:
10+
*
11+
* 1. Redistributions of source code must retain the above copyright notice,
12+
* this list of conditions and the following disclaimer.
13+
* 2. Redistributions in binary form must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*******************************************************************************
31+
*/
32+
33+
#include "PeripheralPins.h"
34+
#include "mbed_toolchain.h"
35+
36+
// =============================================================================
37+
// Notes:
38+
// * Commented lines are alternative possibilities which are not used per default.
39+
// If you change them, you will have also to modify the corresponding xxx_api.c file
40+
// for pwmout, analogin, analogout, ...
41+
// * Only the pins that are placed on the Arduino connector are described.
42+
// =============================================================================
43+
44+
//*** ADC ***
45+
46+
MBED_WEAK const PinMap PinMap_ADC[] = {
47+
{PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 - Grove1_SIG2
48+
{PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 - Grove1_SIG1
49+
{PA_6, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6 - Grove2_SIG2
50+
{PA_7, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 - Grove2_SIG1
51+
{NC, NC, 0}
52+
};
53+
54+
MBED_WEAK const PinMap PinMap_ADC_Internal[] = {
55+
{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
56+
{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
57+
{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
58+
{NC, NC, 0}
59+
};
60+
61+
//*** DAC ***
62+
63+
MBED_WEAK const PinMap PinMap_DAC[] = {
64+
{NC, NC, 0}
65+
};
66+
67+
//*** I2C ***
68+
69+
MBED_WEAK const PinMap PinMap_I2C_SDA[] = {
70+
{PB_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // - Grove4_SIG2
71+
{PD_13, I2C_4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, // - Grove3_SIG2
72+
{NC, NC, 0}
73+
};
74+
75+
MBED_WEAK const PinMap PinMap_I2C_SCL[] = {
76+
{PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // - Grove4_SIG1
77+
{PD_12, I2C_4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, // - Grove3_SIG1
78+
{NC, NC, 0}
79+
};
80+
81+
//*** PWM ***
82+
83+
MBED_WEAK const PinMap PinMap_PWM[] = {
84+
{PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - Grove1_SIG2
85+
{PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - Grove1_SIG1
86+
{PA_6, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 -Grove2_SIG2
87+
{PA_7, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N -Grove2_SIG2
88+
{PB_8, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 -Grove4_SIG1
89+
{PB_9, PWM_4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 -Grove4_SIG2
90+
{NC, NC, 0}
91+
};
92+
93+
//*** SERIAL ***
94+
95+
MBED_WEAK const PinMap PinMap_UART_TX[] = {
96+
{PA_0, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // - Grove1_SIG2
97+
{PA_2, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // - esp32 tx
98+
{PB_14, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, // - esp32 tx (log)
99+
{PD_8, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // STDIO_TX
100+
{NC, NC, 0}
101+
};
102+
103+
MBED_WEAK const PinMap PinMap_UART_RX[] = {
104+
{PA_1, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // - Grove1_SIG1
105+
{PA_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // - esp32 rx
106+
{PB_15, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, // - esp32 rx (log)
107+
{PD_9, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // STDIO_RX
108+
{NC, NC, 0}
109+
};
110+
111+
MBED_WEAK const PinMap PinMap_UART_RTS[] = {
112+
{NC, NC, 0}
113+
};
114+
115+
MBED_WEAK const PinMap PinMap_UART_CTS[] = {
116+
{NC, NC, 0}
117+
};
118+
119+
//*** SPI ***
120+
121+
MBED_WEAK const PinMap PinMap_SPI_MOSI[] = {
122+
{PC_12, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // - SD_SPI3_MOSI(ReservedPin)
123+
{PE_14, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)}, // - FLASH_SPI4_MOSI
124+
{NC, NC, 0}
125+
};
126+
127+
MBED_WEAK const PinMap PinMap_SPI_MISO[] = {
128+
{PC_11, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // - SD_SPI3_MISO/QSPI_CS(ReservedPin)
129+
{PE_13, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)}, // - FLASH_SPI4_MISO
130+
{NC, NC, 0}
131+
};
132+
133+
MBED_WEAK const PinMap PinMap_SPI_SCLK[] = {
134+
{PC_10, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // - SD_SPI3_SCK
135+
{PE_12, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)}, // FLASH_SPI4_SCK
136+
{NC, NC, 0}
137+
};
138+
139+
MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
140+
{PA_15, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // - SD_SPI3_SSEL
141+
{PE_11, SPI_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI4)}, // - FLASH_SPI4_SSEL
142+
{NC, NC, 0}
143+
};
144+
145+
//*** CAN ***
146+
147+
MBED_WEAK const PinMap PinMap_CAN_RD[] = {
148+
{PB_8, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, // - Grove4_SIG1
149+
{NC, NC, 0}
150+
};
151+
152+
MBED_WEAK const PinMap PinMap_CAN_TD[] = {
153+
{PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, // - Grove4_SIG2
154+
{NC, NC, 0}
155+
};

0 commit comments

Comments
 (0)