diff --git a/demos/bsp/boards/board.h b/demos/bsp/boards/board.h
index 1fc15b24..31884235 100644
--- a/demos/bsp/boards/board.h
+++ b/demos/bsp/boards/board.h
@@ -62,7 +62,7 @@
//--------------------------------------------------------------------+
// BOARD DEFINE
//--------------------------------------------------------------------+
-#define BOARD_AT86RF2XX 1
+#define BOARD_RF1GHZNODE 1
#define BOARD_LPCXPRESSO1347 2
#define BOARD_NGX4330 3
@@ -86,8 +86,8 @@
#include "ngx/board_ngx4330.h"
#elif BOARD == BOARD_LPCXPRESSO1347
#include "lpcxpresso/board_lpcxpresso1347.h"
-#elif BOARD == BOARD_AT86RF2XX
- #include "board_at86rf2xx.h"
+#elif BOARD == BOARD_RF1GHZNODE
+ #include "microbuilder/board_rf1ghznode.h"
#elif BOARD == BOARD_EA4357
#include "embedded_artists/board_ea4357.h"
#elif BOARD == BOARD_MCB4300
diff --git a/demos/bsp/boards/microbuilder/board_at86rf2xx.c b/demos/bsp/boards/microbuilder/board_rf1ghznode.c
similarity index 90%
rename from demos/bsp/boards/microbuilder/board_at86rf2xx.c
rename to demos/bsp/boards/microbuilder/board_rf1ghznode.c
index 347dc9dc..d84ec962 100644
--- a/demos/bsp/boards/microbuilder/board_at86rf2xx.c
+++ b/demos/bsp/boards/microbuilder/board_rf1ghznode.c
@@ -1,6 +1,6 @@
/**************************************************************************/
/*!
- @file board_at86rf2xx.c
+ @file board_rf1ghznode.c
@author hathach (tinyusb.org)
@section LICENSE
@@ -38,7 +38,7 @@
#include "../board.h"
-#if BOARD == BOARD_AT86RF2XX
+#if BOARD == BOARD_RF1GHZNODE
void board_init(void)
{
@@ -57,10 +57,15 @@ void board_init(void)
//--------------------------------------------------------------------+
// LEDS
//--------------------------------------------------------------------+
-void board_leds(uint32_t mask, uint32_t state)
+void board_leds(uint32_t on_mask, uint32_t off_mask)
{
- if (mask)
- GPIOSetBitValue(CFG_LED_PORT, CFG_LED_PIN, mask & state ? CFG_LED_ON : CFG_LED_OFF);
+ if (on_mask & BIT_(0))
+ {
+ GPIOSetBitValue(CFG_LED_PORT, CFG_LED_PIN, CFG_LED_ON);
+ }else if (off_mask & BIT_(0))
+ {
+ GPIOSetBitValue(CFG_LED_PORT, CFG_LED_PIN, CFG_LED_OFF);
+ }
}
//--------------------------------------------------------------------+
diff --git a/demos/bsp/boards/microbuilder/board_at86rf2xx.h b/demos/bsp/boards/microbuilder/board_rf1ghznode.h
similarity index 91%
rename from demos/bsp/boards/microbuilder/board_at86rf2xx.h
rename to demos/bsp/boards/microbuilder/board_rf1ghznode.h
index 30259fa3..1f8d15fd 100644
--- a/demos/bsp/boards/microbuilder/board_at86rf2xx.h
+++ b/demos/bsp/boards/microbuilder/board_rf1ghznode.h
@@ -1,6 +1,6 @@
/**************************************************************************/
/*!
- @file board_at86rf2xx.h
+ @file board_rf1ghznode.h
@author hathach (tinyusb.org)
@section LICENSE
@@ -49,8 +49,8 @@
* @{
*/
-#ifndef _TUSB_BOARD_AT86RF2XX_H_
-#define _TUSB_BOARD_AT86RF2XX_H_
+#ifndef _TUSB_BOARD_RF1GHZNODE_H_
+#define _TUSB_BOARD_RF1GHZNODE_H_
#ifdef __cplusplus
extern "C" {
@@ -60,19 +60,17 @@
#include "lpc11uxx/gpio.h"
#include "lpc11uxx/uart.h"
-#define CFG_PRINTF_TARGET PRINTF_TARGET_UART
+#define CFG_PRINTF_TARGET PRINTF_TARGET_DEBUG_CONSOLE
#define CFG_LED_PORT (1)
#define CFG_LED_PIN (31)
#define CFG_LED_ON (0)
#define CFG_LED_OFF (1)
-#define CFG_PRINTF_TARGET PRINTF_TARGET_UART
-
#ifdef __cplusplus
}
#endif
-#endif /* _TUSB_BOARD_AT86RF2XX_H_ */
+#endif /* _TUSB_BOARD_RF1GHZNODE_H_ */
/** @} */
diff --git a/demos/device/keyboard/.cproject b/demos/device/keyboard/.cproject
index 71034c4c..b97fad98 100644
--- a/demos/device/keyboard/.cproject
+++ b/demos/device/keyboard/.cproject
@@ -58,6 +58,7 @@
+
@@ -88,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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -1970,51 +277,614 @@
<?xml version="1.0" encoding="UTF-8"?>
<TargetConfig>
-<Properties property_0="" property_3="NXP" property_4="LPC1347" property_count="5" version="1"/>
-<infoList vendor="NXP"><info chip="LPC1347" match_id="0x08020543" name="LPC1347" stub="crt_emu_lpc11_13_nxp"><chip><name>LPC1347</name>
-<family>LPC13xx (12bit ADC)</family>
+<Properties property_0="" property_3="NXP" property_4="LPC11U37/401" property_count="5" version="1"/>
+<infoList vendor="NXP"><info chip="LPC11U37/401" match_id="0x00017C40" name="LPC11U37/401" stub="crt_emu_lpc11_13_nxp"><chip><name>LPC11U37/401</name>
+<family>LPC11Uxx</family>
<vendor>NXP (formerly Philips)</vendor>
<reset board="None" core="Real" sys="Real"/>
<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/>
<memory can_program="true" id="Flash" is_ro="true" type="Flash"/>
<memory id="RAM" type="RAM"/>
<memory id="Periph" is_volatile="true" type="Peripheral"/>
-<memoryInstance derived_from="Flash" id="MFlash64" location="0x0" size="0x10000"/>
+<memoryInstance derived_from="Flash" id="MFlash128" location="0x0" size="0x20000"/>
<memoryInstance derived_from="RAM" id="RamLoc8" location="0x10000000" size="0x2000"/>
<memoryInstance derived_from="RAM" id="RamUsb2" location="0x20004000" size="0x800"/>
-<memoryInstance derived_from="RAM" id="RamPeriph2" location="0x20000000" size="0x800"/>
-<prog_flash blocksz="0x1000" location="0x0" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/>
-<peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/>
-<peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/>
-<peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/>
-<peripheralInstance derived_from="V7M_ITM" id="ITM" location="0xe0000000"/>
-<peripheralInstance derived_from="I2C" id="I2C" location="0x40000000"/>
-<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40004000"/>
-<peripheralInstance derived_from="USART" id="USART" location="0x40008000"/>
-<peripheralInstance derived_from="CT16B0" id="CT16B0" location="0x4000c000"/>
-<peripheralInstance derived_from="CT16B1" id="CT16B1" location="0x40010000"/>
-<peripheralInstance derived_from="CT32B0" id="CT32B0" location="0x40014000"/>
-<peripheralInstance derived_from="CT32B1" id="CT32B1" location="0x40018000"/>
-<peripheralInstance derived_from="ADC" id="ADC" location="0x4001c000"/>
-<peripheralInstance derived_from="PMU" id="PMU" location="0x40038000"/>
-<peripheralInstance derived_from="FLASHCTRL" id="FLASHCTRL" location="0x4003c000"/>
-<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40040000"/>
-<peripheralInstance derived_from="IOCON" id="IOCON" location="0x40044000"/>
-<peripheralInstance derived_from="SYSCON" id="SYSCON" location="0x40048000"/>
-<peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x4004c000"/>
-<peripheralInstance derived_from="SSP1" id="SSP1" location="0x40058000"/>
-<peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x4005c000"/>
-<peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40060000"/>
-<peripheralInstance derived_from="RITIMER" id="RITIMER" location="0x40064000"/>
-<peripheralInstance derived_from="USB" id="USB" location="0x40080000"/>
-<peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x50000000"/>
+<prog_flash blocksz="0x1000" location="0x0" maxprgbuff="0x400" progwithcode="TRUE" size="0x20000"/>
+<peripheralInstance derived_from="CM0_NVIC" id="NVIC" location="0xe000e000"/>
+<peripheralInstance derived_from="LPC11U_GPIO" id="GPIO" location="0x50000000"/>
+<peripheralInstance derived_from="LPC11U_USBDEV" id="USB" location="0x40080000"/>
+<peripheralInstance derived_from="CM0_DCR" id="DCR" location="0xe000edf0"/>
+<peripheralInstance derived_from="LPC11U_GPIO_GROUP_INT" id="GPIOGROUP0INT" location="0x40060000"/>
+<peripheralInstance derived_from="LPC11U_GPIO_GROUP_INT" id="GPIOGROUP1INT" location="0x4005c000"/>
+<peripheralInstance derived_from="LPC11U_GPIO_INT" id="GPIOINT" location="0x4004c000"/>
+<peripheralInstance derived_from="LPC11_13_SSP" id="SSP1" location="0x40058000"/>
+<peripheralInstance derived_from="LPC11U_FMC" id="FMC" location="0x4003c000"/>
+<peripheralInstance derived_from="LPC11U_SYSCTL" id="SYSCTL" location="0x40048000"/>
+<peripheralInstance derived_from="LPC11U_IOCON" id="IOCON" location="0x40044000"/>
+<peripheralInstance derived_from="LPC11_13_SSP" id="SSP0" location="0x40040000"/>
+<peripheralInstance derived_from="LPC11_13_PMU" id="PMU" location="0x40038000"/>
+<peripheralInstance derived_from="LPC11_13_ADC" id="ADC" location="0x4001c000"/>
+<peripheralInstance derived_from="LPC11_13_TIMER32" id="TIMER1" location="0x40018000"/>
+<peripheralInstance derived_from="LPC11_13_TIMER32" id="TIMER0" location="0x40014000"/>
+<peripheralInstance derived_from="LPC11_13_TIMER16" id="TMR161" location="0x40010000"/>
+<peripheralInstance derived_from="LPC11_13_TIMER16" id="TMR160" location="0x4000c000"/>
+<peripheralInstance derived_from="LPC1xxx_UART_MODEM" id="UART0" location="0x40008000"/>
+<peripheralInstance derived_from="LPC11_13_WDT" id="WDT" location="0x40004000"/>
+<peripheralInstance derived_from="LPC11_13_I2C" id="I2C0" location="0x40000000"/>
</chip>
-<processor><name gcc_name="cortex-m3">Cortex-M3</name>
+<processor><name gcc_name="cortex-m0">Cortex-M0</name>
<family>Cortex-M</family>
</processor>
-<link href="nxp_lpc13Uxx_peripheral.xme" show="embed" type="simple"/>
+<link href="nxp_lpc11_13_peripheral.xme" show="embed" type="simple"/>
</info>
</infoList>
</TargetConfig>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/demos/device/keyboard/main.c b/demos/device/keyboard/main.c
index 76c6383f..77bbc655 100644
--- a/demos/device/keyboard/main.c
+++ b/demos/device/keyboard/main.c
@@ -23,7 +23,7 @@ int main(void)
board_init();
tusb_init();
- print_greeting();
+ //print_greeting();
while (1)
{
if (current_tick + 1000 < system_ticks)
@@ -38,8 +38,13 @@ int main(void)
if (usb_isConfigured())
{
#if TUSB_CFG_DEVICE_HID_KEYBOARD
+ static uint32_t count =0;
+ if (count < 4)
+ {
uint8_t keys[6] = {0x04}; // A character
tusbd_hid_keyboard_send_report(0x00, keys, 1);
+ count++;
+ }
#endif
#if TUSB_CFG_DEVICE_HID_MOUSE
diff --git a/demos/device/keyboard/tusb_config.h b/demos/device/keyboard/tusb_config.h
index a02f24a1..0d1e861e 100644
--- a/demos/device/keyboard/tusb_config.h
+++ b/demos/device/keyboard/tusb_config.h
@@ -102,7 +102,7 @@
#ifdef __CODE_RED // make use of code red's support for ram region macros
#if (MCU == MCU_LPC11UXX) || (MCU == MCU_LPC13UXX)
- #define TUSB_RAM_SECTION ".data.$RAM1"
+ #define TUSB_RAM_SECTION ".data.$RAM1" // TODO overflow usb ram
#elif (MCU == MCU_LPC43XX)
#define TUSB_RAM_SECTION ".data.$RAM3"
#endif
diff --git a/demos/device/keyboard/tusb_descriptors.c b/demos/device/keyboard/tusb_descriptors.c
index f392d65e..c7929aba 100644
--- a/demos/device/keyboard/tusb_descriptors.c
+++ b/demos/device/keyboard/tusb_descriptors.c
@@ -297,7 +297,7 @@ const app_descriptor_configuration_t app_desc_configuration =
{
.bLength = sizeof(tusb_descriptor_endpoint_t),
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
- .bEndpointAddress = 0x81,
+ .bEndpointAddress = 0x81, //HID_KEYBOARD_EP_IN,
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
.wMaxPacketSize = { .size = 0x08 },
.bInterval = 0x0A
@@ -376,8 +376,6 @@ const app_descriptor_configuration_t app_desc_configuration =
.bInterval = 1
},
#endif
-
- .null_termination = 0,
};
TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4)
diff --git a/tinyusb/class/hid_device.c b/tinyusb/class/hid_device.c
index 91c31e04..2e68fd4d 100644
--- a/tinyusb/class/hid_device.c
+++ b/tinyusb/class/hid_device.c
@@ -59,12 +59,12 @@
// IMPLEMENTATION
//--------------------------------------------------------------------+
#if TUSB_CFG_DEVICE_HID_KEYBOARD
-tusb_keyboard_report_t hid_keyboard_report;
+TUSB_CFG_ATTR_USBRAM tusb_keyboard_report_t hid_keyboard_report;
static volatile bool bKeyChanged = false;
#endif
#if TUSB_CFG_DEVICE_HID_MOUSE
-tusb_mouse_report_t hid_mouse_report;
+TUSB_CFG_ATTR_USBRAM tusb_mouse_report_t hid_mouse_report;
static volatile bool bMouseChanged = false;
#endif
diff --git a/tinyusb/device/dcd_lpc13xx.h b/tinyusb/device/dcd_lpc11uxx_lpc13xx.h
similarity index 93%
rename from tinyusb/device/dcd_lpc13xx.h
rename to tinyusb/device/dcd_lpc11uxx_lpc13xx.h
index 9d9780b3..ce7fc90e 100644
--- a/tinyusb/device/dcd_lpc13xx.h
+++ b/tinyusb/device/dcd_lpc11uxx_lpc13xx.h
@@ -1,6 +1,6 @@
/**************************************************************************/
/*!
- @file dcd_lpc13xx.h
+ @file dcd_lpc11uxx_lpc13xx.h
@author hathach (tinyusb.org)
@section LICENSE
@@ -43,8 +43,8 @@
* @{
*/
-#ifndef _TUSB_DCD_LPC13XX_H_
-#define _TUSB_DCD_LPC13XX_H_
+#ifndef _TUSB_DCD_LPC11UXX_LPC13XX_H_
+#define _TUSB_DCD_LPC11UXX_LPC13XX_H_
#define DEVICE_ROM_REG_BASE LPC_USB_BASE
#define DEVICE_ROM_DRIVER_ADDR 0x1FFF1FF8
@@ -54,10 +54,11 @@
#endif
+
#ifdef __cplusplus
}
#endif
-#endif /* _TUSB_DCD_LPC13XX_H_ */
+#endif /* _TUSB_DCD_LPC11UXX_LPC13XX_H_ */
/** @} */
diff --git a/tinyusb/device/dcd_nxp_romdriver.h b/tinyusb/device/dcd_nxp_romdriver.h
index 28e7e298..840ff0f6 100644
--- a/tinyusb/device/dcd_nxp_romdriver.h
+++ b/tinyusb/device/dcd_nxp_romdriver.h
@@ -55,8 +55,8 @@
#if (MCU == MCU_LPC18XX) || (MCU == MCU_LPC43XX)
#include "dcd_lpc18xx_lpc43xx.h"
#define ROM_API ( * ((USBD_API_T**) DEVICE_ROM_DRIVER_ADDR) )
-#elif (MCU == MCU_LPC13UXX)
- #include "dcd_lpc13xx.h"
+#elif (MCU == MCU_LPC13UXX) || (MCU == MCU_LPC11UXX)
+ #include "dcd_lpc11uxx_lpc13xx.h"
#define ROM_API ( * (*((USBD_API_T***) DEVICE_ROM_DRIVER_ADDR)) )
#else
#error forgot something, thach ?
diff --git a/tinyusb/hal/hal.h b/tinyusb/hal/hal.h
index d97f5463..98c1c7e4 100644
--- a/tinyusb/hal/hal.h
+++ b/tinyusb/hal/hal.h
@@ -87,7 +87,7 @@ static inline void hal_interrupt_disable(uint8_t controller_id) ATTR_ALWAYS_INLI
static inline bool hal_debugger_is_attached(void) ATTR_PURE ATTR_ALWAYS_INLINE;
static inline bool hal_debugger_is_attached(void)
{
-#ifndef _TEST_
+#if !defined(_TEST_) && !(MCU==MCU_LPC11UXX)
return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) == CoreDebug_DHCSR_C_DEBUGEN_Msk;
#else
return false;
diff --git a/tinyusb/hal/hal_lpc11uxx.c b/tinyusb/hal/hal_lpc11uxx.c
index ec7ddfc1..a6e3312c 100644
--- a/tinyusb/hal/hal_lpc11uxx.c
+++ b/tinyusb/hal/hal_lpc11uxx.c
@@ -57,4 +57,9 @@ tusb_error_t hal_init()
return TUSB_ERROR_NONE;
}
+void USB_IRQHandler(void)
+{
+ tusb_isr(0);
+}
+
#endif
diff --git a/tinyusb/hal/hal_lpc11uxx.h b/tinyusb/hal/hal_lpc11uxx.h
index 4374586d..77d03e3f 100644
--- a/tinyusb/hal/hal_lpc11uxx.h
+++ b/tinyusb/hal/hal_lpc11uxx.h
@@ -54,9 +54,6 @@
#include "LPC11Uxx.h"
-#define DEVICE_ROM_REG_BASE LPC_USB_BASE
-#define DEVICE_ROM_DRIVER_ADDR 0x1FFF1FF8
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/tinyusb/hal/hal_lpc13uxx.c b/tinyusb/hal/hal_lpc13uxx.c
index 8a9503e2..6f8d72ff 100644
--- a/tinyusb/hal/hal_lpc13uxx.c
+++ b/tinyusb/hal/hal_lpc13uxx.c
@@ -43,7 +43,7 @@
tusb_error_t hal_init()
{
- // TODO usb abstract later
+ // TODO remove magic number
/* Enable AHB clock to the USB block and USB RAM. */
LPC_SYSCON->SYSAHBCLKCTRL |= ((0x1<<14) | (0x1<<27));
@@ -54,8 +54,6 @@ tusb_error_t hal_init()
LPC_IOCON->PIO0_6 &= ~0x07;
LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */
- hal_interrupt_enable(0);
-
return TUSB_ERROR_NONE;
}