summaryrefslogtreecommitdiff
path: root/bsp/nxp
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/nxp')
-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
-rw-r--r--bsp/nxp/lpc/lpc43xx/M0/rtconfig.h3
-rw-r--r--bsp/nxp/lpc/lpc43xx/M0/vbus_local_conf.h8
-rw-r--r--bsp/nxp/lpc/lpc43xx/M4/applications/application.c33
-rw-r--r--bsp/nxp/lpc/lpc43xx/M4/applications/board.h1
-rw-r--r--bsp/nxp/lpc/lpc43xx/M4/applications/vbus_conf.h13
-rw-r--r--bsp/nxp/lpc/lpc43xx/M4/applications/vbus_drv.c67
-rw-r--r--bsp/nxp/lpc/lpc43xx/M4/applications/vbus_hw.h40
-rw-r--r--bsp/nxp/lpc/lpc43xx/M4/rtconfig.h4
-rw-r--r--bsp/nxp/lpc/lpc43xx/M4/vbus_local_conf.h8
14 files changed, 5 insertions, 331 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__ */
diff --git a/bsp/nxp/lpc/lpc43xx/M0/rtconfig.h b/bsp/nxp/lpc/lpc43xx/M0/rtconfig.h
index 68f57e04bc..c6c264d04f 100644
--- a/bsp/nxp/lpc/lpc43xx/M0/rtconfig.h
+++ b/bsp/nxp/lpc/lpc43xx/M0/rtconfig.h
@@ -220,9 +220,6 @@
#define RT_LWIP_MSKADDR3 0
// </section>
-#define RT_USING_VBUS
-#define _RT_VBUS_RING_SZ 64
-#define RT_VBUS_GUEST_VIRQ 0
// </RDTConfigurator>
diff --git a/bsp/nxp/lpc/lpc43xx/M0/vbus_local_conf.h b/bsp/nxp/lpc/lpc43xx/M0/vbus_local_conf.h
deleted file mode 100644
index 571c51e612..0000000000
--- a/bsp/nxp/lpc/lpc43xx/M0/vbus_local_conf.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __VBUS_LOCAL_CONF_H__
-#define __VBUS_LOCAL_CONF_H__
-
-#define RT_VBUS_USING_FLOW_CONTROL
-
-#define RT_VBUS_USING_TESTS
-
-#endif /* end of include guard: __VBUS_LOCAL_CONF_H__ */
diff --git a/bsp/nxp/lpc/lpc43xx/M4/applications/application.c b/bsp/nxp/lpc/lpc43xx/M4/applications/application.c
index eb5b3b19dd..c02c3adf9e 100644
--- a/bsp/nxp/lpc/lpc43xx/M4/applications/application.c
+++ b/bsp/nxp/lpc/lpc43xx/M4/applications/application.c
@@ -18,10 +18,6 @@
#include <shell.h>
#endif
-#ifdef RT_USING_VBUS
-#include <vbus.h>
-#endif
-
static const unsigned char _M0_CODE[] rt_section("M0_CODE") = {
// #include "M0_CODE.h"
};
@@ -64,10 +60,6 @@ void rt_init_thread_entry(void *parameter)
#endif
#endif
-#ifdef RT_USING_VBUS
- rt_vbus_do_init();
-#endif
-
_boot_M0();
}
@@ -79,8 +71,6 @@ static void led_thread_entry(void *parameter)
{
rt_uint8_t led_value;
rt_device_t led_dev;
- rt_device_t vbus_dev;
- rt_err_t err;
rt_led_hw_init();
@@ -91,34 +81,11 @@ 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;
- }
-
led_value = 0;
while (1)
{
- int len;
-
led_dev->write(led_dev, 0, &led_value, sizeof(led_value));
-
led_value = !led_value;
- len = rt_device_write(vbus_dev, 0, &led_value, sizeof(led_value));
- if (len <= 0)
- {
- rt_kprintf("vbus write err: %d, %d\n", len, rt_get_errno());
- }
-
rt_thread_delay(1000);
}
}
diff --git a/bsp/nxp/lpc/lpc43xx/M4/applications/board.h b/bsp/nxp/lpc/lpc43xx/M4/applications/board.h
index faf2930854..ffb576502a 100644
--- a/bsp/nxp/lpc/lpc43xx/M4/applications/board.h
+++ b/bsp/nxp/lpc/lpc43xx/M4/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/M4/applications/vbus_conf.h b/bsp/nxp/lpc/lpc43xx/M4/applications/vbus_conf.h
deleted file mode 100644
index 62bec83227..0000000000
--- a/bsp/nxp/lpc/lpc43xx/M4/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/M4/applications/vbus_drv.c b/bsp/nxp/lpc/lpc43xx/M4/applications/vbus_drv.c
deleted file mode 100644
index 88750f37d9..0000000000
--- a/bsp/nxp/lpc/lpc43xx/M4/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[0], &rt_vbus_rings[1]);
-}
-INIT_COMPONENT_EXPORT(rt_vbus_do_init);
-
-int rt_vbus_hw_init(void)
-{
- NVIC_ClearPendingIRQ(M0CORE_IRQn);
- NVIC_EnableIRQ(M0CORE_IRQn);
- return 0;
-}
-
-void M0CORE_IRQHandler(void)
-{
- LPC_CREG->M0TXEVENT = 0;
- rt_vbus_isr(M0CORE_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 = 1,
- .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/M4/applications/vbus_hw.h b/bsp/nxp/lpc/lpc43xx/M4/applications/vbus_hw.h
deleted file mode 100644
index 0466d2339c..0000000000
--- a/bsp/nxp/lpc/lpc43xx/M4/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__ */
diff --git a/bsp/nxp/lpc/lpc43xx/M4/rtconfig.h b/bsp/nxp/lpc/lpc43xx/M4/rtconfig.h
index c9d4baece8..4462be0381 100644
--- a/bsp/nxp/lpc/lpc43xx/M4/rtconfig.h
+++ b/bsp/nxp/lpc/lpc43xx/M4/rtconfig.h
@@ -222,10 +222,6 @@
#define RT_LWIP_MSKADDR3 0
// </section>
-#define RT_USING_VBUS
-
-#define RT_VBUS_GUEST_VIRQ 0
-#define _RT_VBUS_RING_SZ 64
// </RDTConfigurator>
#define RT_CPUS_NR 1
#define RT_BACKTRACE_LEVEL_MAX_NR 32
diff --git a/bsp/nxp/lpc/lpc43xx/M4/vbus_local_conf.h b/bsp/nxp/lpc/lpc43xx/M4/vbus_local_conf.h
deleted file mode 100644
index 571c51e612..0000000000
--- a/bsp/nxp/lpc/lpc43xx/M4/vbus_local_conf.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __VBUS_LOCAL_CONF_H__
-#define __VBUS_LOCAL_CONF_H__
-
-#define RT_VBUS_USING_FLOW_CONTROL
-
-#define RT_VBUS_USING_TESTS
-
-#endif /* end of include guard: __VBUS_LOCAL_CONF_H__ */