Skip to content

Commit 985f1f0

Browse files
committed
Merge branch 'master' into ktime
2 parents 8aeaa2b + e7cddf3 commit 985f1f0

File tree

1,310 files changed

+47306
-1252141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,310 files changed

+47306
-1252141
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AlignConsecutiveBitFields:
2323
AlignCompound: true
2424
PadOperators: true
2525
AlignConsecutiveDeclarations:
26-
Enabled: false
26+
Enabled: true
2727
AcrossEmptyLines: false
2828
AcrossComments: false
2929
AlignCompound: false

.github/workflows/bsp_buildings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ jobs:
284284
- "Infineon/psoc6-cy8ckit-062-WIFI-BT"
285285
- "Infineon/psoc6-cy8cproto-062S3-4343W"
286286
- "Infineon/psoc6-evaluationkit-062S2"
287+
- "Infineon/xmc7200-kit_xmc7200_evk"
287288
- "fujitsu/mb9x/mb9bf500r"
288289
- "fujitsu/mb9x/mb9bf506r"
289290
- "fujitsu/mb9x/mb9bf618s"

bsp/Infineon/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ PSOC6 系列 BSP 目前支持情况如下表所示:
1212
| [psoc6-cy8ckit-062-WIFI-BT](psoc6-cy8ckit-062-WIFI-BT) | Infineon 官方 psoc6-cy8ckit-062-WIFI-BT 开发板 |
1313
| [psoc6-cy8ckit-062s4](psoc6-cy8ckit-062s4) | Infineon 官方 psoc6-cy8ckit-062s4 开发板 |
1414

15+
XMC 系列 BSP 目前支持情况如下表所示:
16+
17+
| 更多操作**BSP 文件夹名称** | **开发板名称** |
18+
| -------------------------------------------------- | -------------------------------------------- |
19+
| **XMC系列** | |
20+
| [xmc7200-kit_xmc7200_evk](xmc7200-kit_xmc7200_evk) | Infineon 官方 xmc7200-kit_xmc7200_evk 开发板 |
21+
22+
23+
1524
可以通过阅读相应 BSP 下的 README 来快速上手,如果想要使用 BSP 更多功能可参考 docs 文件夹下提供的说明文档,如下表所示:
1625

1726
| **BSP 制作与提交** | **简介** |

bsp/Infineon/libraries/HAL_Drivers/drv_gpio.c

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
#define PIN_GET(pin) ((uint8_t)(((uint8_t)pin) & 0x07U))
1616
#define PORT_GET(pin) ((uint8_t)(((uint8_t)pin) >> 3U))
1717

18-
#define __IFX_PORT_MAX 15u
18+
#if defined(SOC_XMC7200D_E272K8384AA)
19+
#define __IFX_PORT_MAX 35u
20+
#else
21+
#define __IFX_PORT_MAX 14u
22+
#endif
1923

2024
#define PIN_IFXPORT_MAX __IFX_PORT_MAX
2125

2226
static cyhal_gpio_callback_data_t irq_cb_data[PIN_IFXPORT_MAX];
2327

24-
static const struct pin_irq_map pin_irq_map[] =
28+
static struct pin_irq_map pin_irq_map[] =
2529
{
2630
{CYHAL_PORT_0, ioss_interrupts_gpio_0_IRQn},
2731
#if !defined(SOC_CY8C6245LQI_S3D72) && !defined(SOC_CY8C6244LQI_S4D92)
@@ -44,6 +48,27 @@ static const struct pin_irq_map pin_irq_map[] =
4448
{CYHAL_PORT_13, ioss_interrupts_gpio_13_IRQn},
4549
#endif
4650
{CYHAL_PORT_14, ioss_interrupts_gpio_14_IRQn},
51+
#if defined(SOC_XMC7200D_E272K8384AA)
52+
{CYHAL_PORT_15, ioss_interrupts_gpio_15_IRQn},
53+
{CYHAL_PORT_16, ioss_interrupts_gpio_16_IRQn},
54+
{CYHAL_PORT_17, ioss_interrupts_gpio_17_IRQn},
55+
{CYHAL_PORT_18, ioss_interrupts_gpio_18_IRQn},
56+
{CYHAL_PORT_19, ioss_interrupts_gpio_19_IRQn},
57+
{CYHAL_PORT_20, ioss_interrupts_gpio_20_IRQn},
58+
{CYHAL_PORT_21, ioss_interrupts_gpio_21_IRQn},
59+
{CYHAL_PORT_22, ioss_interrupts_gpio_23_IRQn},
60+
{CYHAL_PORT_24, ioss_interrupts_gpio_24_IRQn},
61+
{CYHAL_PORT_25, ioss_interrupts_gpio_25_IRQn},
62+
{CYHAL_PORT_26, ioss_interrupts_gpio_26_IRQn},
63+
{CYHAL_PORT_27, ioss_interrupts_gpio_27_IRQn},
64+
{CYHAL_PORT_28, ioss_interrupts_gpio_28_IRQn},
65+
{CYHAL_PORT_29, ioss_interrupts_gpio_29_IRQn},
66+
{CYHAL_PORT_30, ioss_interrupts_gpio_30_IRQn},
67+
{CYHAL_PORT_31, ioss_interrupts_gpio_31_IRQn},
68+
{CYHAL_PORT_32, ioss_interrupts_gpio_32_IRQn},
69+
{CYHAL_PORT_33, ioss_interrupts_gpio_33_IRQn},
70+
{CYHAL_PORT_34, ioss_interrupts_gpio_34_IRQn},
71+
#endif
4772
};
4873

4974
static struct rt_pin_irq_hdr pin_irq_handler_tab[] =
@@ -64,6 +89,27 @@ static struct rt_pin_irq_hdr pin_irq_handler_tab[] =
6489
{-1, 0, RT_NULL, RT_NULL},
6590
{-1, 0, RT_NULL, RT_NULL},
6691
{-1, 0, RT_NULL, RT_NULL},
92+
#if defined(SOC_XMC7200D_E272K8384AA)
93+
{-1, 0, RT_NULL, RT_NULL},
94+
{-1, 0, RT_NULL, RT_NULL},
95+
{-1, 0, RT_NULL, RT_NULL},
96+
{-1, 0, RT_NULL, RT_NULL},
97+
{-1, 0, RT_NULL, RT_NULL},
98+
{-1, 0, RT_NULL, RT_NULL},
99+
{-1, 0, RT_NULL, RT_NULL},
100+
{-1, 0, RT_NULL, RT_NULL},
101+
{-1, 0, RT_NULL, RT_NULL},
102+
{-1, 0, RT_NULL, RT_NULL},
103+
{-1, 0, RT_NULL, RT_NULL},
104+
{-1, 0, RT_NULL, RT_NULL},
105+
{-1, 0, RT_NULL, RT_NULL},
106+
{-1, 0, RT_NULL, RT_NULL},
107+
{-1, 0, RT_NULL, RT_NULL},
108+
{-1, 0, RT_NULL, RT_NULL},
109+
{-1, 0, RT_NULL, RT_NULL},
110+
{-1, 0, RT_NULL, RT_NULL},
111+
{-1, 0, RT_NULL, RT_NULL},
112+
#endif
67113
};
68114

69115
rt_inline void pin_irq_handler(int irqno)
@@ -275,12 +321,10 @@ static rt_err_t ifx_pin_irq_enable(struct rt_device *device, rt_base_t pin,
275321

276322
#if !defined(COMPONENT_CAT1C)
277323
IRQn_Type irqn = (IRQn_Type)(irqmap->irqno + PORT_GET(irqmap->port));
278-
#endif
279324
irq_cb_data[irqn].callback = irq_callback;
280325
irq_cb_data[irqn].callback_arg = (rt_uint16_t *)&pin_irq_map[gpio_port].port;
281-
282326
cyhal_gpio_register_callback(gpio_pin, &irq_cb_data[irqn]);
283-
327+
#endif
284328
Cy_GPIO_ClearInterrupt(CYHAL_GET_PORTADDR(gpio_pin), CYHAL_GET_PIN(gpio_pin));
285329

286330
switch (pin_irq_handler_tab[gpio_port].mode)
@@ -313,9 +357,8 @@ static rt_err_t ifx_pin_irq_enable(struct rt_device *device, rt_base_t pin,
313357

314358
#if !defined(COMPONENT_CAT1C)
315359
IRQn_Type irqn = (IRQn_Type)(irqmap->irqno + PORT_GET(irqmap->port));
316-
#endif
317360
_cyhal_irq_disable(irqn);
318-
361+
#endif
319362
rt_hw_interrupt_enable(level);
320363
}
321364
else

bsp/Infineon/libraries/HAL_Drivers/drv_gpio.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
struct pin_irq_map
2424
{
2525
rt_uint16_t port;
26+
#if defined(SOC_SERIES_IFX_XMC)
27+
rt_uint32_t irqno;
28+
#else
2629
IRQn_Type irqno;
30+
#endif
2731
};
2832

2933
int rt_hw_pin_init(void);

bsp/Infineon/libraries/HAL_Drivers/drv_uart.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ static rt_err_t ifx_control(struct rt_serial_device *serial, int cmd, void *arg)
226226
Cy_SysInt_Init(uart->config->UART_SCB_IRQ_cfg, uart->config->userIsr);
227227

228228
/* Enable the interrupt */
229+
#if defined(SOC_SERIES_IFX_XMC)
230+
NVIC_EnableIRQ(UART_NvicMuxN_IRQn);
231+
#else
229232
NVIC_EnableIRQ(uart->config->intrSrc);
233+
#endif
230234
break;
231235
}
232236

bsp/Infineon/libraries/HAL_Drivers/drv_uart.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ struct ifx_uart_config
2626
rt_uint32_t tx_pin;
2727
rt_uint32_t rx_pin;
2828
CySCB_Type *usart_x;
29+
#if defined(SOC_SERIES_IFX_XMC)
30+
rt_uint32_t intrSrc;
31+
#else
2932
IRQn_Type intrSrc;
33+
#endif
3034
cy_israddress userIsr;
3135
cy_stc_sysint_t *UART_SCB_IRQ_cfg;
3236
};

bsp/Infineon/libraries/HAL_Drivers/uart_config.h

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ extern "C"
1919
{
2020
#endif
2121

22+
#if defined(SOC_SERIES_IFX_XMC)
23+
#if defined(UART_CPU_IRQ_Number)
24+
#if (UART_CPU_IRQ_Number == 0)
25+
#define UART_NvicMuxN_IRQn NvicMux0_IRQn
26+
#elif(UART_CPU_IRQ_Number == 1)
27+
#define UART_NvicMuxN_IRQn NvicMux1_IRQn
28+
#elif (UART_CPU_IRQ_Number == 2)
29+
#define UART_NvicMuxN_IRQn NvicMux2_IRQn
30+
#elif (UART_CPU_IRQ_Number == 3)
31+
#define UART_NvicMuxN_IRQn NvicMux3_IRQn
32+
#elif (UART_CPU_IRQ_Number == 4)
33+
#define UART_NvicMuxN_IRQn NvicMux4_IRQn
34+
#elif (UART_CPU_IRQ_Number == 5)
35+
#define UART_NvicMuxN_IRQn NvicMux5_IRQn
36+
#elif (UART_CPU_IRQ_Number == 6)
37+
#define UART_NvicMuxN_IRQn NvicMux6_IRQn
38+
#elif (UART_CPU_IRQ_Number == 7)
39+
#define UART_NvicMuxN_IRQn NvicMux7_IRQn
40+
#endif
41+
#endif
42+
#endif
43+
2244
#ifdef BSP_USING_UART0
2345
/* UART0 device driver structure */
2446
cy_stc_sysint_t UART0_SCB_IRQ_cfg =
@@ -47,7 +69,11 @@ extern "C"
4769
/* UART3 device driver structure */
4870
cy_stc_sysint_t UART3_SCB_IRQ_cfg =
4971
{
72+
#if defined(SOC_SERIES_IFX_XMC)
73+
.intrSrc = ((UART_NvicMuxN_IRQn << 16) | (cy_en_intr_t)scb_3_interrupt_IRQn),
74+
#else
5075
.intrSrc = (IRQn_Type)scb_3_interrupt_IRQn,
76+
#endif
5177
.intrPriority = (7u),
5278
};
5379
#endif
@@ -67,7 +93,6 @@ extern "C"
6793
.intrPriority = (7u),
6894
};
6995
#endif
70-
7196
#ifdef BSP_USING_UART6
7297
/* UART6 device driver structure */
7398
cy_stc_sysint_t UART6_SCB_IRQ_cfg =
@@ -76,6 +101,7 @@ extern "C"
76101
.intrPriority = (7u),
77102
};
78103
#endif
104+
79105
#if defined(BSP_USING_UART0)
80106
#ifndef UART0_CONFIG
81107
#define UART0_CONFIG \
@@ -139,6 +165,18 @@ extern "C"
139165

140166
#if defined(BSP_USING_UART3)
141167
#ifndef UART3_CONFIG
168+
#if defined(SOC_XMC7200D_E272K8384AA)
169+
#define UART3_CONFIG \
170+
{ \
171+
.name = "uart3", \
172+
.tx_pin = P13_1, \
173+
.rx_pin = P13_0, \
174+
.usart_x = SCB3, \
175+
.intrSrc = scb_3_interrupt_IRQn, \
176+
.userIsr = uart_isr_callback(uart3), \
177+
.UART_SCB_IRQ_cfg = &UART3_SCB_IRQ_cfg, \
178+
}
179+
#else
142180
#define UART3_CONFIG \
143181
{ \
144182
.name = "uart3", \
@@ -149,6 +187,7 @@ extern "C"
149187
.userIsr = uart_isr_callback(uart3), \
150188
.UART_SCB_IRQ_cfg = &UART3_SCB_IRQ_cfg, \
151189
}
190+
#endif
152191
void uart3_isr_callback(void);
153192
#endif /* UART3_CONFIG */
154193
#endif /* BSP_USING_UART3 */

0 commit comments

Comments
 (0)