Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ALL_BSP_COMPILE.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@
"Infineon/psoc6-cy8cproto-062S3-4343W",
"Infineon/psoc6-evaluationkit-062S2",
"Infineon/xmc7200-kit_xmc7200_evk",
"Infineon/xmc7100d-f144k4160aa",
"fujitsu/mb9x/mb9bf500r",
"fujitsu/mb9x/mb9bf506r",
"fujitsu/mb9x/mb9bf618s",
Expand Down
2 changes: 1 addition & 1 deletion bsp/Infineon/libraries/HAL_Drivers/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if GetDepend(['RT_USING_I2C', 'RT_USING_I2C_BITOPS']):
src += ['drv_soft_i2c.c']

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

if GetDepend(['BSP_USING_SDIO1']):
Expand Down
19 changes: 18 additions & 1 deletion bsp/Infineon/libraries/HAL_Drivers/drv_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@
* Change Logs:
* Date Author Notes
* 2022-07-08 Rbb666 first implementation.
* 2025-04-21 Hydevcode adapt xmc7100d
*/

#include "board.h"

#if defined(RT_USING_I2C)
#if defined(BSP_USING_HW_I2C2) || defined(BSP_USING_HW_I2C3) || defined(BSP_USING_HW_I2C4)|| defined(BSP_USING_HW_I2C6)
#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)
#include <rtdevice.h>

#ifndef I2C1_CONFIG
#define I2C1_CONFIG \
{ \
.name = "i2c1", \
.scl_pin = BSP_I2C1_SCL_PIN, \
.sda_pin = BSP_I2C1_SDA_PIN, \
}
#endif /* I2C1_CONFIG */

#ifndef I2C2_CONFIG
#define I2C2_CONFIG \
{ \
Expand Down Expand Up @@ -53,6 +63,9 @@

enum
{
#ifdef BSP_USING_HW_I2C1
I2C1_INDEX,
#endif
#ifdef BSP_USING_HW_I2C2
I2C2_INDEX,
#endif
Expand Down Expand Up @@ -84,6 +97,10 @@ struct ifx_i2c

static struct ifx_i2c_config i2c_config[] =
{
#ifdef BSP_USING_HW_I2C1
I2C1_CONFIG,
#endif

#ifdef BSP_USING_HW_I2C2
I2C2_CONFIG,
#endif
Expand Down
4 changes: 3 additions & 1 deletion bsp/Infineon/libraries/HAL_Drivers/drv_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
* 2022-06-29 Rbb666 first version
* 2025-04-21 hydevcode modify xmc7100d uart
*/

#include <rtthread.h>
Expand Down Expand Up @@ -228,9 +229,10 @@ static rt_err_t ifx_control(struct rt_serial_device *serial, int cmd, void *arg)

/* Enable the interrupt */
#if defined(SOC_SERIES_IFX_XMC)
NVIC_DisableIRQ(UART_NvicMuxN_IRQn);
NVIC_EnableIRQ(UART_NvicMuxN_IRQn);
#else
NVIC_EnableIRQ(uart->config->intrSrc);
NVIC_EnableIRQ(uart->config->UART_SCB_IRQ_cfg->intrSrc);
#endif
break;
}
Expand Down
6 changes: 0 additions & 6 deletions bsp/Infineon/libraries/HAL_Drivers/drv_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@
struct ifx_uart_config
{
cyhal_uart_t *uart_obj;

const char *name;
rt_uint32_t tx_pin;
rt_uint32_t rx_pin;
CySCB_Type *usart_x;
#if defined(SOC_SERIES_IFX_XMC)
rt_uint32_t intrSrc;
#else
IRQn_Type intrSrc;
#endif
cy_israddress userIsr;
cy_stc_sysint_t *UART_SCB_IRQ_cfg;
};
Expand Down
52 changes: 40 additions & 12 deletions bsp/Infineon/libraries/HAL_Drivers/uart_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
* 2022-07-08 Rbb666 first version
* 2025-04-21 Hydevcode adapt xmc7100d
*/

#ifndef __UART_CONFIG_H__
Expand Down Expand Up @@ -45,23 +46,35 @@ extern "C"
/* UART0 device driver structure */
cy_stc_sysint_t UART0_SCB_IRQ_cfg =
{
#if defined(SOC_SERIES_IFX_XMC)
.intrSrc = ((UART_NvicMuxN_IRQn << 16) | (cy_en_intr_t)scb_0_interrupt_IRQn),
#else
.intrSrc = (IRQn_Type)scb_0_interrupt_IRQn,
#endif
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART1
/* UART1 device driver structure */
cy_stc_sysint_t UART1_SCB_IRQ_cfg =
{
#if defined(SOC_SERIES_IFX_XMC)
.intrSrc = ((UART_NvicMuxN_IRQn << 16) | (cy_en_intr_t)scb_1_interrupt_IRQn),
#else
.intrSrc = (IRQn_Type)scb_1_interrupt_IRQn,
#endif
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART2
/* UART2 device driver structure */
cy_stc_sysint_t UART2_SCB_IRQ_cfg =
{
#if defined(SOC_SERIES_IFX_XMC)
.intrSrc = ((UART_NvicMuxN_IRQn << 16) | (cy_en_intr_t)scb_2_interrupt_IRQn),
#else
.intrSrc = (IRQn_Type)scb_2_interrupt_IRQn,
#endif
.intrPriority = (7u),
};
#endif
Expand All @@ -81,23 +94,35 @@ extern "C"
/* UART4 device driver structure */
cy_stc_sysint_t UART4_SCB_IRQ_cfg =
{
#if defined(SOC_SERIES_IFX_XMC)
.intrSrc = ((UART_NvicMuxN_IRQn << 16) |(cy_en_intr_t)scb_4_interrupt_IRQn),
#else
.intrSrc = (IRQn_Type)scb_4_interrupt_IRQn,
#endif
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART5
/* UART5 device driver structure */
cy_stc_sysint_t UART5_SCB_IRQ_cfg =
{
#if defined(SOC_SERIES_IFX_XMC)
.intrSrc = ((UART_NvicMuxN_IRQn << 16) |(cy_en_intr_t)scb_5_interrupt_IRQn),
#else
.intrSrc = (IRQn_Type)scb_5_interrupt_IRQn,
#endif
.intrPriority = (7u),
};
#endif
#ifdef BSP_USING_UART6
/* UART6 device driver structure */
cy_stc_sysint_t UART6_SCB_IRQ_cfg =
{
#if defined(SOC_SERIES_IFX_XMC)
.intrSrc = ((UART_NvicMuxN_IRQn << 16) |(cy_en_intr_t)scb_6_interrupt_IRQn),
#else
.intrSrc = (IRQn_Type)scb_6_interrupt_IRQn,
#endif
.intrPriority = (7u),
};
#endif
Expand All @@ -110,7 +135,6 @@ extern "C"
.tx_pin = P0_3, \
.rx_pin = P0_2, \
.usart_x = SCB0, \
.intrSrc = scb_0_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart0), \
.UART_SCB_IRQ_cfg = &UART0_SCB_IRQ_cfg, \
}
Expand All @@ -126,7 +150,6 @@ extern "C"
.tx_pin = P10_1, \
.rx_pin = P10_0, \
.usart_x = SCB1, \
.intrSrc = scb_1_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart1), \
.UART_SCB_IRQ_cfg = &UART1_SCB_IRQ_cfg, \
}
Expand All @@ -136,14 +159,13 @@ extern "C"

#if defined(BSP_USING_UART2)
#ifndef UART2_CONFIG
#if defined(SOC_CY8C6244LQI_S4D92)
#if defined(SOC_XMC7100D_F144K4160AA)
#define UART2_CONFIG \
{ \
.name = "uart2", \
.tx_pin = P3_1, \
.rx_pin = P3_0, \
.tx_pin = P19_1, \
.rx_pin = P19_0, \
.usart_x = SCB2, \
.intrSrc = scb_2_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart2), \
.UART_SCB_IRQ_cfg = &UART2_SCB_IRQ_cfg, \
}
Expand All @@ -154,7 +176,6 @@ extern "C"
.tx_pin = P9_1, \
.rx_pin = P9_0, \
.usart_x = SCB2, \
.intrSrc = scb_2_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart2), \
.UART_SCB_IRQ_cfg = &UART2_SCB_IRQ_cfg, \
}
Expand All @@ -172,7 +193,6 @@ extern "C"
.tx_pin = P13_1, \
.rx_pin = P13_0, \
.usart_x = SCB3, \
.intrSrc = scb_3_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart3), \
.UART_SCB_IRQ_cfg = &UART3_SCB_IRQ_cfg, \
}
Expand All @@ -183,7 +203,6 @@ extern "C"
.tx_pin = P6_1, \
.rx_pin = P6_0, \
.usart_x = SCB3, \
.intrSrc = scb_3_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart3), \
.UART_SCB_IRQ_cfg = &UART3_SCB_IRQ_cfg, \
}
Expand All @@ -194,16 +213,27 @@ extern "C"

#if defined(BSP_USING_UART4)
#ifndef UART4_CONFIG
#if defined(SOC_XMC7100D_F144K4160AA)
#define UART4_CONFIG \
{ \
.name = "uart4", \
.tx_pin = P10_1, \
.rx_pin = P10_0, \
.usart_x = SCB4, \
.userIsr = uart_isr_callback(uart4), \
.UART_SCB_IRQ_cfg = &UART4_SCB_IRQ_cfg, \
}
#else
#define UART4_CONFIG \
{ \
.name = "uart4", \
.tx_pin = P7_1, \
.rx_pin = P7_0, \
.usart_x = SCB4, \
.intrSrc = scb_4_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart4), \
.UART_SCB_IRQ_cfg = &UART4_SCB_IRQ_cfg, \
}
#endif
void uart4_isr_callback(void);
#endif /* UART4_CONFIG */
#endif /* BSP_USING_UART4 */
Expand All @@ -216,7 +246,6 @@ extern "C"
.tx_pin = P5_1, \
.rx_pin = P5_0, \
.usart_x = SCB5, \
.intrSrc = scb_5_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart5), \
.UART_SCB_IRQ_cfg = &UART5_SCB_IRQ_cfg, \
}
Expand All @@ -232,7 +261,6 @@ extern "C"
.tx_pin = P6_5, \
.rx_pin = P6_4, \
.usart_x = SCB6, \
.intrSrc = scb_6_interrupt_IRQn, \
.userIsr = uart_isr_callback(uart6), \
.UART_SCB_IRQ_cfg = &UART6_SCB_IRQ_cfg, \
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
scons.args: &scons
scons_arg:
- '--strict'
# ------ Drivers CI ------
Drivers.I2C:
<<: *scons
kconfig:
- CONFIG_BSP_USING_I2C=y
- CONFIG_BSP_USING_HW_I2C1=y
Loading