Skip to content

Commit 5804973

Browse files
hydevcodeRbb666
authored andcommitted
[bsp][Infineon] add a new bsp for XMC7100D-F144K4160AA
1 parent ae83165 commit 5804973

Some content is hidden

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

86 files changed

+68461
-21
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: 3 additions & 1 deletion
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,9 +229,10 @@ 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
233-
NVIC_EnableIRQ(uart->config->intrSrc);
235+
NVIC_EnableIRQ(uart->config->UART_SCB_IRQ_cfg->intrSrc);
234236
#endif
235237
break;
236238
}

bsp/Infineon/libraries/HAL_Drivers/drv_uart.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,10 @@
2121
struct ifx_uart_config
2222
{
2323
cyhal_uart_t *uart_obj;
24-
2524
const char *name;
2625
rt_uint32_t tx_pin;
2726
rt_uint32_t rx_pin;
2827
CySCB_Type *usart_x;
29-
#if defined(SOC_SERIES_IFX_XMC)
30-
rt_uint32_t intrSrc;
31-
#else
32-
IRQn_Type intrSrc;
33-
#endif
3428
cy_israddress userIsr;
3529
cy_stc_sysint_t *UART_SCB_IRQ_cfg;
3630
};

bsp/Infineon/libraries/HAL_Drivers/uart_config.h

Lines changed: 40 additions & 12 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
@@ -110,7 +135,6 @@ extern "C"
110135
.tx_pin = P0_3, \
111136
.rx_pin = P0_2, \
112137
.usart_x = SCB0, \
113-
.intrSrc = scb_0_interrupt_IRQn, \
114138
.userIsr = uart_isr_callback(uart0), \
115139
.UART_SCB_IRQ_cfg = &UART0_SCB_IRQ_cfg, \
116140
}
@@ -126,7 +150,6 @@ extern "C"
126150
.tx_pin = P10_1, \
127151
.rx_pin = P10_0, \
128152
.usart_x = SCB1, \
129-
.intrSrc = scb_1_interrupt_IRQn, \
130153
.userIsr = uart_isr_callback(uart1), \
131154
.UART_SCB_IRQ_cfg = &UART1_SCB_IRQ_cfg, \
132155
}
@@ -136,14 +159,13 @@ extern "C"
136159

137160
#if defined(BSP_USING_UART2)
138161
#ifndef UART2_CONFIG
139-
#if defined(SOC_CY8C6244LQI_S4D92)
162+
#if defined(SOC_XMC7100D_F144K4160AA)
140163
#define UART2_CONFIG \
141164
{ \
142165
.name = "uart2", \
143-
.tx_pin = P3_1, \
144-
.rx_pin = P3_0, \
166+
.tx_pin = P19_1, \
167+
.rx_pin = P19_0, \
145168
.usart_x = SCB2, \
146-
.intrSrc = scb_2_interrupt_IRQn, \
147169
.userIsr = uart_isr_callback(uart2), \
148170
.UART_SCB_IRQ_cfg = &UART2_SCB_IRQ_cfg, \
149171
}
@@ -154,7 +176,6 @@ extern "C"
154176
.tx_pin = P9_1, \
155177
.rx_pin = P9_0, \
156178
.usart_x = SCB2, \
157-
.intrSrc = scb_2_interrupt_IRQn, \
158179
.userIsr = uart_isr_callback(uart2), \
159180
.UART_SCB_IRQ_cfg = &UART2_SCB_IRQ_cfg, \
160181
}
@@ -172,7 +193,6 @@ extern "C"
172193
.tx_pin = P13_1, \
173194
.rx_pin = P13_0, \
174195
.usart_x = SCB3, \
175-
.intrSrc = scb_3_interrupt_IRQn, \
176196
.userIsr = uart_isr_callback(uart3), \
177197
.UART_SCB_IRQ_cfg = &UART3_SCB_IRQ_cfg, \
178198
}
@@ -183,7 +203,6 @@ extern "C"
183203
.tx_pin = P6_1, \
184204
.rx_pin = P6_0, \
185205
.usart_x = SCB3, \
186-
.intrSrc = scb_3_interrupt_IRQn, \
187206
.userIsr = uart_isr_callback(uart3), \
188207
.UART_SCB_IRQ_cfg = &UART3_SCB_IRQ_cfg, \
189208
}
@@ -194,16 +213,27 @@ extern "C"
194213

195214
#if defined(BSP_USING_UART4)
196215
#ifndef UART4_CONFIG
216+
#if defined(SOC_XMC7100D_F144K4160AA)
217+
#define UART4_CONFIG \
218+
{ \
219+
.name = "uart4", \
220+
.tx_pin = P10_1, \
221+
.rx_pin = P10_0, \
222+
.usart_x = SCB4, \
223+
.userIsr = uart_isr_callback(uart4), \
224+
.UART_SCB_IRQ_cfg = &UART4_SCB_IRQ_cfg, \
225+
}
226+
#else
197227
#define UART4_CONFIG \
198228
{ \
199229
.name = "uart4", \
200230
.tx_pin = P7_1, \
201231
.rx_pin = P7_0, \
202232
.usart_x = SCB4, \
203-
.intrSrc = scb_4_interrupt_IRQn, \
204233
.userIsr = uart_isr_callback(uart4), \
205234
.UART_SCB_IRQ_cfg = &UART4_SCB_IRQ_cfg, \
206235
}
236+
#endif
207237
void uart4_isr_callback(void);
208238
#endif /* UART4_CONFIG */
209239
#endif /* BSP_USING_UART4 */
@@ -216,7 +246,6 @@ extern "C"
216246
.tx_pin = P5_1, \
217247
.rx_pin = P5_0, \
218248
.usart_x = SCB5, \
219-
.intrSrc = scb_5_interrupt_IRQn, \
220249
.userIsr = uart_isr_callback(uart5), \
221250
.UART_SCB_IRQ_cfg = &UART5_SCB_IRQ_cfg, \
222251
}
@@ -232,7 +261,6 @@ extern "C"
232261
.tx_pin = P6_5, \
233262
.rx_pin = P6_4, \
234263
.usart_x = SCB6, \
235-
.intrSrc = scb_6_interrupt_IRQn, \
236264
.userIsr = uart_isr_callback(uart6), \
237265
.UART_SCB_IRQ_cfg = &UART6_SCB_IRQ_cfg, \
238266
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
scons.args: &scons
2+
scons_arg:
3+
- '--strict'
4+
# ------ Drivers CI ------
5+
Drivers.I2C:
6+
<<: *scons
7+
kconfig:
8+
- CONFIG_BSP_USING_I2C=y
9+
- CONFIG_BSP_USING_HW_I2C1=y

0 commit comments

Comments
 (0)