Skip to content

Commit c5bfacf

Browse files
committed
[bsp][Infineon] add a new bsp for XMC7100D-F144K4160AA
1 parent 7371a00 commit c5bfacf

Some content is hidden

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

85 files changed

+68646
-5
lines changed

.github/ALL_BSP_COMPILE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@
338338
"Infineon/psoc6-cy8cproto-062S3-4343W",
339339
"Infineon/psoc6-evaluationkit-062S2",
340340
"Infineon/xmc7200-kit_xmc7200_evk",
341+
"Infineon/xmc7100d-f144k4160aa",
341342
"fujitsu/mb9x/mb9bf500r",
342343
"fujitsu/mb9x/mb9bf506r",
343344
"fujitsu/mb9x/mb9bf618s",

bsp/Infineon/libraries/HAL_Drivers/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
2323
src += ['drv_soft_i2c.c']
2424

2525
if GetDepend(['RT_USING_I2C']):
26-
if GetDepend('BSP_USING_HW_I2C3') or GetDepend('BSP_USING_HW_I2C4') or GetDepend('BSP_USING_HW_I2C6'):
26+
if GetDepend('BSP_USING_HW_I2C1') or GetDepend('BSP_USING_HW_I2C3') or GetDepend('BSP_USING_HW_I2C4') or GetDepend('BSP_USING_HW_I2C6'):
2727
src += ['drv_i2c.c']
2828

2929
if GetDepend(['BSP_USING_SDIO1']):

bsp/Infineon/libraries/HAL_Drivers/drv_i2c.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,24 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2022-07-08 Rbb666 first implementation.
9+
* 2025-04-21 Hydevcode adapt xmc7100d
910
*/
1011

1112
#include "board.h"
1213

1314
#if defined(RT_USING_I2C)
14-
#if defined(BSP_USING_HW_I2C2) || defined(BSP_USING_HW_I2C3) || defined(BSP_USING_HW_I2C4)|| defined(BSP_USING_HW_I2C6)
15+
#if defined(BSP_USING_HW_I2C1) || defined(BSP_USING_HW_I2C2) || defined(BSP_USING_HW_I2C3) || defined(BSP_USING_HW_I2C4)|| defined(BSP_USING_HW_I2C6)
1516
#include <rtdevice.h>
1617

18+
#ifndef I2C1_CONFIG
19+
#define I2C1_CONFIG \
20+
{ \
21+
.name = "i2c1", \
22+
.scl_pin = BSP_I2C1_SCL_PIN, \
23+
.sda_pin = BSP_I2C1_SDA_PIN, \
24+
}
25+
#endif /* I2C1_CONFIG */
26+
1727
#ifndef I2C2_CONFIG
1828
#define I2C2_CONFIG \
1929
{ \
@@ -53,6 +63,9 @@
5363

5464
enum
5565
{
66+
#ifdef BSP_USING_HW_I2C1
67+
I2C1_INDEX,
68+
#endif
5669
#ifdef BSP_USING_HW_I2C2
5770
I2C2_INDEX,
5871
#endif
@@ -84,6 +97,10 @@ struct ifx_i2c
8497

8598
static struct ifx_i2c_config i2c_config[] =
8699
{
100+
#ifdef BSP_USING_HW_I2C1
101+
I2C1_CONFIG,
102+
#endif
103+
87104
#ifdef BSP_USING_HW_I2C2
88105
I2C2_CONFIG,
89106
#endif

bsp/Infineon/libraries/HAL_Drivers/drv_uart.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2022-06-29 Rbb666 first version
9+
* 2025-04-21 hydevcode modify xmc7100d uart
910
*/
1011

1112
#include <rtthread.h>
@@ -228,6 +229,7 @@ static rt_err_t ifx_control(struct rt_serial_device *serial, int cmd, void *arg)
228229

229230
/* Enable the interrupt */
230231
#if defined(SOC_SERIES_IFX_XMC)
232+
NVIC_DisableIRQ(UART_NvicMuxN_IRQn);
231233
NVIC_EnableIRQ(UART_NvicMuxN_IRQn);
232234
#else
233235
NVIC_EnableIRQ(uart->config->intrSrc);

bsp/Infineon/libraries/HAL_Drivers/uart_config.h

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Change Logs:
77
* Date Author Notes
88
* 2022-07-08 Rbb666 first version
9+
* 2025-04-21 Hydevcode adapt xmc7100d
910
*/
1011

1112
#ifndef __UART_CONFIG_H__
@@ -45,23 +46,35 @@ extern "C"
4546
/* UART0 device driver structure */
4647
cy_stc_sysint_t UART0_SCB_IRQ_cfg =
4748
{
49+
#if defined(SOC_SERIES_IFX_XMC)
50+
.intrSrc = ((UART_NvicMuxN_IRQn << 16) | (cy_en_intr_t)scb_0_interrupt_IRQn),
51+
#else
4852
.intrSrc = (IRQn_Type)scb_0_interrupt_IRQn,
53+
#endif
4954
.intrPriority = (7u),
5055
};
5156
#endif
5257
#ifdef BSP_USING_UART1
5358
/* UART1 device driver structure */
5459
cy_stc_sysint_t UART1_SCB_IRQ_cfg =
5560
{
61+
#if defined(SOC_SERIES_IFX_XMC)
62+
.intrSrc = ((UART_NvicMuxN_IRQn << 16) | (cy_en_intr_t)scb_1_interrupt_IRQn),
63+
#else
5664
.intrSrc = (IRQn_Type)scb_1_interrupt_IRQn,
65+
#endif
5766
.intrPriority = (7u),
5867
};
5968
#endif
6069
#ifdef BSP_USING_UART2
6170
/* UART2 device driver structure */
6271
cy_stc_sysint_t UART2_SCB_IRQ_cfg =
6372
{
73+
#if defined(SOC_SERIES_IFX_XMC)
74+
.intrSrc = ((UART_NvicMuxN_IRQn << 16) | (cy_en_intr_t)scb_2_interrupt_IRQn),
75+
#else
6476
.intrSrc = (IRQn_Type)scb_2_interrupt_IRQn,
77+
#endif
6578
.intrPriority = (7u),
6679
};
6780
#endif
@@ -81,23 +94,35 @@ extern "C"
8194
/* UART4 device driver structure */
8295
cy_stc_sysint_t UART4_SCB_IRQ_cfg =
8396
{
97+
#if defined(SOC_SERIES_IFX_XMC)
98+
.intrSrc = ((UART_NvicMuxN_IRQn << 16) |(cy_en_intr_t)scb_4_interrupt_IRQn),
99+
#else
84100
.intrSrc = (IRQn_Type)scb_4_interrupt_IRQn,
101+
#endif
85102
.intrPriority = (7u),
86103
};
87104
#endif
88105
#ifdef BSP_USING_UART5
89106
/* UART5 device driver structure */
90107
cy_stc_sysint_t UART5_SCB_IRQ_cfg =
91108
{
109+
#if defined(SOC_SERIES_IFX_XMC)
110+
.intrSrc = ((UART_NvicMuxN_IRQn << 16) |(cy_en_intr_t)scb_5_interrupt_IRQn),
111+
#else
92112
.intrSrc = (IRQn_Type)scb_5_interrupt_IRQn,
113+
#endif
93114
.intrPriority = (7u),
94115
};
95116
#endif
96117
#ifdef BSP_USING_UART6
97118
/* UART6 device driver structure */
98119
cy_stc_sysint_t UART6_SCB_IRQ_cfg =
99120
{
121+
#if defined(SOC_SERIES_IFX_XMC)
122+
.intrSrc = ((UART_NvicMuxN_IRQn << 16) |(cy_en_intr_t)scb_6_interrupt_IRQn),
123+
#else
100124
.intrSrc = (IRQn_Type)scb_6_interrupt_IRQn,
125+
#endif
101126
.intrPriority = (7u),
102127
};
103128
#endif
@@ -136,12 +161,12 @@ extern "C"
136161

137162
#if defined(BSP_USING_UART2)
138163
#ifndef UART2_CONFIG
139-
#if defined(SOC_CY8C6244LQI_S4D92)
164+
#if defined(SOC_XMC7100D_F144K4160AA)
140165
#define UART2_CONFIG \
141166
{ \
142167
.name = "uart2", \
143-
.tx_pin = P3_1, \
144-
.rx_pin = P3_0, \
168+
.tx_pin = P19_1, \
169+
.rx_pin = P19_0, \
145170
.usart_x = SCB2, \
146171
.intrSrc = scb_2_interrupt_IRQn, \
147172
.userIsr = uart_isr_callback(uart2), \
@@ -194,6 +219,18 @@ extern "C"
194219

195220
#if defined(BSP_USING_UART4)
196221
#ifndef UART4_CONFIG
222+
#if defined(SOC_XMC7100D_F144K4160AA)
223+
#define UART4_CONFIG \
224+
{ \
225+
.name = "uart4", \
226+
.tx_pin = P10_1, \
227+
.rx_pin = P10_0, \
228+
.usart_x = SCB4, \
229+
.intrSrc = scb_4_interrupt_IRQn, \
230+
.userIsr = uart_isr_callback(uart4), \
231+
.UART_SCB_IRQ_cfg = &UART4_SCB_IRQ_cfg, \
232+
}
233+
#else
197234
#define UART4_CONFIG \
198235
{ \
199236
.name = "uart4", \
@@ -204,6 +241,7 @@ extern "C"
204241
.userIsr = uart_isr_callback(uart4), \
205242
.UART_SCB_IRQ_cfg = &UART4_SCB_IRQ_cfg, \
206243
}
244+
#endif
207245
void uart4_isr_callback(void);
208246
#endif /* UART4_CONFIG */
209247
#endif /* BSP_USING_UART4 */

0 commit comments

Comments
 (0)