Skip to content

Commit 1264660

Browse files
author
Arto Kinnunen
authored
Merge pull request ARMmbed#10972 from 0xc0170/test_target
add new target IM880B
2 parents bd762ce + c327f4f commit 1264660

21 files changed

+11086
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/* mbed Microcontroller Library
2+
*
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*******************************************************************************
5+
* Copyright (c) 2015, STMicroelectronics
6+
* All rights reserved.
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+
} 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+
} UARTName;
54+
55+
typedef enum {
56+
SPI_1 = (int)SPI1_BASE,
57+
SPI_2 = (int)SPI2_BASE
58+
} SPIName;
59+
60+
typedef enum {
61+
I2C_1 = (int)I2C1_BASE,
62+
I2C_2 = (int)I2C2_BASE
63+
} I2CName;
64+
65+
typedef enum {
66+
PWM_2 = (int)TIM2_BASE,
67+
PWM_3 = (int)TIM3_BASE,
68+
PWM_4 = (int)TIM4_BASE, // used as us_ticker
69+
PWM_9 = (int)TIM9_BASE,
70+
PWM_10 = (int)TIM10_BASE,
71+
PWM_11 = (int)TIM11_BASE
72+
} PWMName;
73+
74+
#ifdef __cplusplus
75+
}
76+
#endif
77+
78+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
/* mbed Microcontroller Library
2+
*
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*******************************************************************************
5+
* Copyright (c) 2016, STMicroelectronics
6+
* All rights reserved.
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+
35+
// =====
36+
// Note: 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+
// =====
40+
41+
//*** ADC ***
42+
43+
const PinMap PinMap_ADC[] = {
44+
{PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0
45+
{PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1
46+
{PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3
47+
{PB_12, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC_IN18
48+
{PB_13, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC_IN19
49+
{PB_14, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 20, 0)}, // ADC_IN20
50+
{PB_15, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 21, 0)}, // ADC_IN21
51+
{NC, NC, 0}
52+
};
53+
54+
const PinMap PinMap_ADC_Internal[] = {
55+
{ADC_TEMP, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)},
56+
{ADC_VREF, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)},
57+
{NC, NC, 0}
58+
};
59+
60+
//*** DAC ***
61+
62+
const PinMap PinMap_DAC[] = {
63+
{NC, NC, 0}
64+
};
65+
66+
//*** I2C ***
67+
68+
const PinMap PinMap_I2C_SDA[] = {
69+
{PB_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
70+
{NC, NC, 0}
71+
};
72+
73+
const PinMap PinMap_I2C_SCL[] = {
74+
{PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
75+
{NC, NC, 0}
76+
};
77+
78+
//*** PWM ***
79+
80+
// TIM4 cannot be used because already used by the us_ticker.
81+
const PinMap PinMap_PWM[] = {
82+
{PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
83+
{PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
84+
{PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
85+
{PB_13, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1
86+
// {PA_3, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
87+
{PB_14, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
88+
{PB_8, PWM_10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
89+
{PB_12, PWM_10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
90+
// {PB_8, PWM_11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
91+
{PB_15, PWM_11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
92+
{NC, NC, 0}
93+
};
94+
95+
//*** SERIAL ***
96+
97+
const PinMap PinMap_UART_TX[] = {
98+
{PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
99+
{NC, NC, 0}
100+
};
101+
102+
const PinMap PinMap_UART_RX[] = {
103+
{PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
104+
{NC, NC, 0}
105+
};
106+
107+
//*** SPI ***
108+
109+
const PinMap PinMap_SPI_MOSI[] = {
110+
{PA_7, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
111+
{PB_15, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
112+
{NC, NC, 0}
113+
};
114+
115+
const PinMap PinMap_SPI_MISO[] = {
116+
{PA_6, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
117+
{PB_14, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
118+
{NC, NC, 0}
119+
};
120+
121+
const PinMap PinMap_SPI_SCLK[] = {
122+
{PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
123+
{PB_13, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
124+
{NC, NC, 0}
125+
};
126+
127+
const PinMap PinMap_SPI_SSEL[] = {
128+
{PB_0, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
129+
{PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
130+
{NC, NC, 0}
131+
};

0 commit comments

Comments
 (0)