summaryrefslogtreecommitdiff
path: root/bsp/nxp/lpc/lpc43xx/M0/applications
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <[email protected]>2025-10-28 23:36:25 +0000
committercopilot-swe-agent[bot] <[email protected]>2025-10-28 23:36:25 +0000
commit35e4335ee752da9adb3029a06cb6004f3d9320f7 (patch)
tree25f26a0a9992f35e877ff08c1d0a41c48fd726c4 /bsp/nxp/lpc/lpc43xx/M0/applications
parent6d2f401e172911b8433bebe6d6a6e76c1b637d5c (diff)
Remove vbus component and related codecopilot/remove-vbus-code-implementation
Co-authored-by: BernardXiong <[email protected]>
Diffstat (limited to 'bsp/nxp/lpc/lpc43xx/M0/applications')
-rw-r--r--bsp/nxp/lpc/lpc43xx/M0/applications/application.c38
-rw-r--r--bsp/nxp/lpc/lpc43xx/M0/applications/board.h1
-rw-r--r--bsp/nxp/lpc/lpc43xx/M0/applications/vbus_conf.h13
-rw-r--r--bsp/nxp/lpc/lpc43xx/M0/applications/vbus_drv.c67
-rw-r--r--bsp/nxp/lpc/lpc43xx/M0/applications/vbus_hw.h40
5 files changed, 5 insertions, 154 deletions
diff --git a/bsp/nxp/lpc/lpc43xx/M0/applications/application.c b/bsp/nxp/lpc/lpc43xx/M0/applications/application.c
index 5ffbfe202a..a542dbdcf9 100644
--- a/bsp/nxp/lpc/lpc43xx/M0/applications/application.c
+++ b/bsp/nxp/lpc/lpc43xx/M0/applications/application.c
@@ -18,10 +18,6 @@
#include <shell.h>
#endif
-#ifdef RT_USING_VBUS
-#include <vbus.h>
-#endif
-
/* thread phase init */
void rt_init_thread_entry(void *parameter)
{
@@ -32,10 +28,6 @@ void rt_init_thread_entry(void *parameter)
finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif
#endif
-
-#ifdef RT_USING_VBUS
- rt_vbus_do_init();
-#endif
}
/*the led thread*/
@@ -45,8 +37,6 @@ static struct rt_thread led_thread;
static void led_thread_entry(void *parameter)
{
rt_device_t led_dev;
- rt_device_t vbus_dev;
- rt_err_t err;
rt_led_hw_init();
@@ -57,32 +47,14 @@ static void led_thread_entry(void *parameter)
return;
}
- vbus_dev = rt_device_find("vecho");
- if (vbus_dev == RT_NULL)
- {
- rt_kprintf("can not find the vbus device\n");
- return;
- }
-
- err = rt_device_open(vbus_dev, RT_DEVICE_OFLAG_RDWR);
- if (err != RT_EOK)
- {
- rt_kprintf("open vbus failed: %d\n", err);
- return;
- }
-
while (1)
{
- rt_uint8_t led_value;
- int len;
-
- len = rt_device_read(vbus_dev, 0, &led_value, sizeof(led_value));
- if (len <= 0)
- {
- rt_kprintf("vbus read err: %d, %d\n", len, rt_get_errno());
- }
-
+ rt_uint8_t led_value = 1;
+ led_dev->write(led_dev, 1, &led_value, sizeof(led_value));
+ rt_thread_delay(500);
+ led_value = 0;
led_dev->write(led_dev, 1, &led_value, sizeof(led_value));
+ rt_thread_delay(500);
}
}
diff --git a/bsp/nxp/lpc/lpc43xx/M0/applications/board.h b/bsp/nxp/lpc/lpc43xx/M0/applications/board.h
index 8462dad0f6..d9ad81c2fb 100644
--- a/bsp/nxp/lpc/lpc43xx/M0/applications/board.h
+++ b/bsp/nxp/lpc/lpc43xx/M0/applications/board.h
@@ -50,6 +50,5 @@ extern int __bss_end;
void rt_hw_board_init(void);
int rt_hw_board_heap_init(void);
-int rt_vbus_do_init(void);
#endif
diff --git a/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_conf.h b/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_conf.h
deleted file mode 100644
index 62bec83227..0000000000
--- a/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_conf.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __VBUS_CONF_H__
-#define __VBUS_CONF_H__
-
-/* Number of blocks in VBus. The total size of VBus is
- * RT_VMM_RB_BLK_NR * 64byte * 2. */
-#define RT_VMM_RB_BLK_NR 20
-
-/* We don't use the IRQ number to trigger IRQ in this BSP. */
-#define RT_VBUS_GUEST_VIRQ 0
-#define RT_VBUS_HOST_VIRQ 0
-
-#endif /* end of include guard: __VBUS_CONF_H__ */
-
diff --git a/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_drv.c b/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_drv.c
deleted file mode 100644
index c905e98b5f..0000000000
--- a/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_drv.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2015-01-07 Grissiom add comment
- */
-
-#include <rtthread.h>
-
-#ifdef RT_USING_VBUS
-#include <rtdevice.h>
-#include <vbus.h>
-#include <board.h>
-
-struct rt_vbus_ring rt_vbus_rings[2] rt_section("vbus_ring");
-
-int rt_vbus_do_init(void)
-{
- return rt_vbus_init(&rt_vbus_rings[1], &rt_vbus_rings[0]);
-}
-INIT_COMPONENT_EXPORT(rt_vbus_do_init);
-
-int rt_vbus_hw_init(void)
-{
- NVIC_ClearPendingIRQ(M0_M4CORE_IRQn);
- NVIC_EnableIRQ(M0_M4CORE_IRQn);
- return 0;
-}
-
-void M4CORE_IRQHandler(void)
-{
- LPC_CREG->M4TXEVENT = 0;
- rt_vbus_isr(M0_M4CORE_IRQn, RT_NULL);
-}
-
-int rt_vbus_hw_eoi(int irqnr, void *param)
-{
- /* Nothing to do here as we cleared the interrupt in IRQHandler. */
- return 0;
-}
-
-struct rt_vbus_dev rt_vbus_chn_devx[] = {
- {
- .req =
- {
- .prio = 30,
- .name = "vecho",
- .is_server = 0,
- .recv_wm.low = RT_VMM_RB_BLK_NR / 3,
- .recv_wm.high = RT_VMM_RB_BLK_NR * 2 / 3,
- .post_wm.low = RT_VMM_RB_BLK_NR / 3,
- .post_wm.high = RT_VMM_RB_BLK_NR * 2 / 3,
- }
- },
- {
- .req =
- {
- .name = RT_NULL,
- }
- },
-};
-
-#endif /* RT_USING_VBUS */
-
diff --git a/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_hw.h b/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_hw.h
deleted file mode 100644
index 0466d2339c..0000000000
--- a/bsp/nxp/lpc/lpc43xx/M0/applications/vbus_hw.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date Author Notes
- * 2015-01-07 Grissiom init commit
- */
-
-#ifndef __VBUS_HW_H__
-#define __VBUS_HW_H__
-
-#include <rtthread.h>
-#include <board.h>
-
-rt_inline void rt_vbus_tick(unsigned int target_cpu, unsigned int irqnr)
-{
- __SEV();
-}
-
-/* Read memory barrier. */
-rt_inline void rt_vbus_smp_rmb(void)
-{
- __DMB();
-}
-
-/* Write memory barrier. */
-rt_inline void rt_vbus_smp_wmb(void)
-{
- __DSB();
-}
-
-/* General memory barrier. */
-rt_inline void rt_vbus_smp_mb(void)
-{
- __DSB();
-}
-
-#endif /* __VBUS_HW_H__ */