summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-12 14:01:38 +0700
committerhathach <[email protected]>2014-03-12 14:03:17 +0700
commit8f03dea95a5d8cb4ebd72b0da74cd51365c8d936 (patch)
treea7975df64f2a8f1e9a9c4bd71fe47941c3898556 /demos
parentc92b03edfb33deadc06c81206452270f23f2cf17 (diff)
fix iar warning
Diffstat (limited to 'demos')
-rw-r--r--demos/bsp/boards/board.c300
-rw-r--r--demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c350
-rw-r--r--demos/bsp/boards/embedded_artists/oem_base_board/pca9532.c698
-rw-r--r--demos/bsp/boards/lpcxpresso/board_lpcxpresso1347.c266
-rw-r--r--demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c318
-rw-r--r--demos/bsp/boards/microbuilder/board_lpc4357usb.c260
-rw-r--r--demos/bsp/lpc13uxx/LPC13Uxx_DriverLib/inc/type.h104
-rw-r--r--demos/device/device_os_none/device_os_none.ewp953
-rw-r--r--demos/device/device_os_none/device_os_none.uvopt23
-rw-r--r--demos/device/src/tusb_config.h2
-rw-r--r--demos/device/src/tusb_descriptors.h386
11 files changed, 2309 insertions, 1351 deletions
diff --git a/demos/bsp/boards/board.c b/demos/bsp/boards/board.c
index e766bd206..aae65ca25 100644
--- a/demos/bsp/boards/board.c
+++ b/demos/bsp/boards/board.c
@@ -1,150 +1,150 @@
-/**************************************************************************/
-/*!
- @file board.c
- @author hathach (tinyusb.org)
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2013, hathach (tinyusb.org)
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This file is part of the tinyusb stack.
-*/
-/**************************************************************************/
-
-#include "board.h"
-
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
-volatile uint32_t system_ticks = 0;
-
-void SysTick_Handler (void)
-{
- system_ticks++;
- tusb_tick_tock(); // TODO temporarily
-}
-
-#endif
-
-void check_failed(uint8_t *file, uint32_t line)
-{
- (void) file;
- (void) line;
-}
-
-#if 0
-
-/**
- * HardFault_HandlerAsm:
- * Alternative Hard Fault handler to help debug the reason for a fault.
- * To use, edit the vector table to reference this function in the HardFault vector
- * This code is suitable for Cortex-M3 and Cortex-M0 cores
- */
-
-// Use the 'naked' attribute so that C stacking is not used.
-__attribute__((naked))
-void HardFault_HandlerAsm(void){
- /*
- * Get the appropriate stack pointer, depending on our mode,
- * and use it as the parameter to the C handler. This function
- * will never return
- */
-
- __asm( ".syntax unified\n"
- "MOVS R0, #4 \n"
- "MOV R1, LR \n"
- "TST R0, R1 \n"
- "BEQ _MSP \n"
- "MRS R0, PSP \n"
- "B HardFault_HandlerC \n"
- "_MSP: \n"
- "MRS R0, MSP \n"
- "B HardFault_HandlerC \n"
- ".syntax divided\n") ;
-}
-
-/**
- * HardFaultHandler_C:
- * This is called from the HardFault_HandlerAsm with a pointer the Fault stack
- * as the parameter. We can then read the values from the stack and place them
- * into local variables for ease of reading.
- * We then read the various Fault Status and Address Registers to help decode
- * cause of the fault.
- * The function ends with a BKPT instruction to force control back into the debugger
- */
-void HardFault_HandlerC(unsigned long *hardfault_args){
- ATTR_UNUSED volatile unsigned long stacked_r0 ;
- ATTR_UNUSED volatile unsigned long stacked_r1 ;
- ATTR_UNUSED volatile unsigned long stacked_r2 ;
- ATTR_UNUSED volatile unsigned long stacked_r3 ;
- ATTR_UNUSED volatile unsigned long stacked_r12 ;
- ATTR_UNUSED volatile unsigned long stacked_lr ;
- ATTR_UNUSED volatile unsigned long stacked_pc ;
- ATTR_UNUSED volatile unsigned long stacked_psr ;
- ATTR_UNUSED volatile unsigned long _CFSR ;
- ATTR_UNUSED volatile unsigned long _HFSR ;
- ATTR_UNUSED volatile unsigned long _DFSR ;
- ATTR_UNUSED volatile unsigned long _AFSR ;
- ATTR_UNUSED volatile unsigned long _BFAR ;
- ATTR_UNUSED volatile unsigned long _MMAR ;
-
- stacked_r0 = ((unsigned long)hardfault_args[0]) ;
- stacked_r1 = ((unsigned long)hardfault_args[1]) ;
- stacked_r2 = ((unsigned long)hardfault_args[2]) ;
- stacked_r3 = ((unsigned long)hardfault_args[3]) ;
- stacked_r12 = ((unsigned long)hardfault_args[4]) ;
- stacked_lr = ((unsigned long)hardfault_args[5]) ;
- stacked_pc = ((unsigned long)hardfault_args[6]) ;
- stacked_psr = ((unsigned long)hardfault_args[7]) ;
-
- // Configurable Fault Status Register
- // Consists of MMSR, BFSR and UFSR
- _CFSR = (*((volatile unsigned long *)(0xE000ED28))) ;
-
- // Hard Fault Status Register
- _HFSR = (*((volatile unsigned long *)(0xE000ED2C))) ;
-
- // Debug Fault Status Register
- _DFSR = (*((volatile unsigned long *)(0xE000ED30))) ;
-
- // Auxiliary Fault Status Register
- _AFSR = (*((volatile unsigned long *)(0xE000ED3C))) ;
-
- // Read the Fault Address Registers. These may not contain valid values.
- // Check BFARVALID/MMARVALID to see if they are valid values
- // MemManage Fault Address Register
- _MMAR = (*((volatile unsigned long *)(0xE000ED34))) ;
- // Bus Fault Address Register
- _BFAR = (*((volatile unsigned long *)(0xE000ED38))) ;
-
-// if ((CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk)==CoreDebug_DHCSR_C_DEBUGEN_Msk) /* if there is debugger connected */
-// {
-// __asm("BKPT #0\n");
-// }
-
- hal_debugger_breakpoint();
-}
-#endif
+/**************************************************************************/
+/*!
+ @file board.c
+ @author hathach (tinyusb.org)
+
+ @section LICENSE
+
+ Software License Agreement (BSD License)
+
+ Copyright (c) 2013, hathach (tinyusb.org)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This file is part of the tinyusb stack.
+*/
+/**************************************************************************/
+
+#include "board.h"
+
+#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+volatile uint32_t system_ticks = 0;
+
+void SysTick_Handler (void)
+{
+ system_ticks++;
+ tusb_tick_tock(); // TODO temporarily
+}
+
+#endif
+
+void check_failed(uint8_t *file, uint32_t line)
+{
+ (void) file;
+ (void) line;
+}
+
+#if 0
+
+/**
+ * HardFault_HandlerAsm:
+ * Alternative Hard Fault handler to help debug the reason for a fault.
+ * To use, edit the vector table to reference this function in the HardFault vector
+ * This code is suitable for Cortex-M3 and Cortex-M0 cores
+ */
+
+// Use the 'naked' attribute so that C stacking is not used.
+__attribute__((naked))
+void HardFault_HandlerAsm(void){
+ /*
+ * Get the appropriate stack pointer, depending on our mode,
+ * and use it as the parameter to the C handler. This function
+ * will never return
+ */
+
+ __asm( ".syntax unified\n"
+ "MOVS R0, #4 \n"
+ "MOV R1, LR \n"
+ "TST R0, R1 \n"
+ "BEQ _MSP \n"
+ "MRS R0, PSP \n"
+ "B HardFault_HandlerC \n"
+ "_MSP: \n"
+ "MRS R0, MSP \n"
+ "B HardFault_HandlerC \n"
+ ".syntax divided\n") ;
+}
+
+/**
+ * HardFaultHandler_C:
+ * This is called from the HardFault_HandlerAsm with a pointer the Fault stack
+ * as the parameter. We can then read the values from the stack and place them
+ * into local variables for ease of reading.
+ * We then read the various Fault Status and Address Registers to help decode
+ * cause of the fault.
+ * The function ends with a BKPT instruction to force control back into the debugger
+ */
+void HardFault_HandlerC(unsigned long *hardfault_args){
+ ATTR_UNUSED volatile unsigned long stacked_r0 ;
+ ATTR_UNUSED volatile unsigned long stacked_r1 ;
+ ATTR_UNUSED volatile unsigned long stacked_r2 ;
+ ATTR_UNUSED volatile unsigned long stacked_r3 ;
+ ATTR_UNUSED volatile unsigned long stacked_r12 ;
+ ATTR_UNUSED volatile unsigned long stacked_lr ;
+ ATTR_UNUSED volatile unsigned long stacked_pc ;
+ ATTR_UNUSED volatile unsigned long stacked_psr ;
+ ATTR_UNUSED volatile unsigned long _CFSR ;
+ ATTR_UNUSED volatile unsigned long _HFSR ;
+ ATTR_UNUSED volatile unsigned long _DFSR ;
+ ATTR_UNUSED volatile unsigned long _AFSR ;
+ ATTR_UNUSED volatile unsigned long _BFAR ;
+ ATTR_UNUSED volatile unsigned long _MMAR ;
+
+ stacked_r0 = ((unsigned long)hardfault_args[0]) ;
+ stacked_r1 = ((unsigned long)hardfault_args[1]) ;
+ stacked_r2 = ((unsigned long)hardfault_args[2]) ;
+ stacked_r3 = ((unsigned long)hardfault_args[3]) ;
+ stacked_r12 = ((unsigned long)hardfault_args[4]) ;
+ stacked_lr = ((unsigned long)hardfault_args[5]) ;
+ stacked_pc = ((unsigned long)hardfault_args[6]) ;
+ stacked_psr = ((unsigned long)hardfault_args[7]) ;
+
+ // Configurable Fault Status Register
+ // Consists of MMSR, BFSR and UFSR
+ _CFSR = (*((volatile unsigned long *)(0xE000ED28))) ;
+
+ // Hard Fault Status Register
+ _HFSR = (*((volatile unsigned long *)(0xE000ED2C))) ;
+
+ // Debug Fault Status Register
+ _DFSR = (*((volatile unsigned long *)(0xE000ED30))) ;
+
+ // Auxiliary Fault Status Register
+ _AFSR = (*((volatile unsigned long *)(0xE000ED3C))) ;
+
+ // Read the Fault Address Registers. These may not contain valid values.
+ // Check BFARVALID/MMARVALID to see if they are valid values
+ // MemManage Fault Address Register
+ _MMAR = (*((volatile unsigned long *)(0xE000ED34))) ;
+ // Bus Fault Address Register
+ _BFAR = (*((volatile unsigned long *)(0xE000ED38))) ;
+
+// if ((CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk)==CoreDebug_DHCSR_C_DEBUGEN_Msk) /* if there is debugger connected */
+// {
+// __asm("BKPT #0\n");
+// }
+
+ hal_debugger_breakpoint();
+}
+#endif
diff --git a/demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c b/demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c
index 09d4e121c..d0ac98beb 100644
--- a/demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c
+++ b/demos/bsp/boards/embedded_artists/ea4357/board_ea4357.c
@@ -1,175 +1,175 @@
-/**************************************************************************/
-/*!
- @file board_ea4357.c
- @author hathach (tinyusb.org)
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2013, hathach (tinyusb.org)
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This file is part of the tinyusb stack.
-*/
-/**************************************************************************/
-
-#include "../../board.h"
-
-#if BOARD == BOARD_EA4357
-
-#define BOARD_UART_PORT LPC_USART0
-#define BOARD_UART_PIN_PORT 0x0f
-#define BOARD_UART_PIN_TX 10 // PF.10 : UART0_TXD
-#define BOARD_UART_PIN_RX 11 // PF.11 : UART0_RXD
-
-const static struct {
- uint8_t mux_port;
- uint8_t mux_pin;
-
- uint8_t gpio_port;
- uint8_t gpio_pin;
-}buttons[] =
-{
- {0x0a, 3, 4, 10 }, // Joystick up
- {0x09, 1, 4, 13 }, // Joystick down
- {0x0a, 2, 4, 9 }, // Joystick left
- {0x09, 0, 4, 12 }, // Joystick right
- {0x0a, 1, 4, 8 }, // Joystick press
- {0x02, 7, 0, 7 }, // SW6
-};
-
-enum {
- BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0])
-};
-
-void board_init(void)
-{
- CGU_Init();
-
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
- SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND); // 1 msec tick timer
-#endif
-
- //------------- USB -------------//
- // USB0 Power: EA4357 channel B U20 GPIO26 active low (base board), P2_3 on LPC4357
- scu_pinmux(0x02, 3, MD_PUP | MD_EZI, FUNC7); // USB0 VBus Power
-
- #if TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_DEVICE
- scu_pinmux(0x09, 5, GPIO_PDN, FUNC4); // P9_5 (GPIO5[18]) (GPIO28 on oem base) as USB connect, active low.
- GPIO_SetDir(5, BIT_(18), 1);
- #endif
-
- // USB1 Power: EA4357 channel A U20 is enabled by SJ5 connected to pad 1-2, no more action required
- // TODO Remove R170, R171, solder a pair of 15K to USB1 D+/D- to test with USB1 Host
-
- //------------- LED -------------//
- I2C_Init(LPC_I2C0, 100000);
- I2C_Cmd(LPC_I2C0, ENABLE);
- pca9532_init();
-
- //------------- BUTTON -------------//
- for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++)
- {
- scu_pinmux(buttons[i].mux_port, buttons[i].mux_pin, GPIO_NOPULL, FUNC0);
- GPIO_SetDir(buttons[i].gpio_port, BIT_(buttons[i].gpio_pin), 0);
- }
-
- //------------- UART -------------//
- scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN, FUNC1);
- scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_RX, MD_PLN | MD_EZI | MD_ZI, FUNC1);
-
- UART_CFG_Type UARTConfigStruct;
- UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
- UARTConfigStruct.Clock_Speed = 0;
-
- UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
- UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
-
- //------------- NAND Flash (K9FXX) Size = 128M, Page Size = 2K, Block Size = 128K, Number of Block = 1024 -------------//
-// nand_init();
-
-
-#if 0
- //------------- Ethernet -------------//
- LPC_CREG->CREG6 &= ~0x7;
-
- /* RMII mode setup only */
- LPC_CREG->CREG6 |= 0x4;
-
- scu_pinmux(0x1, 18, (MD_EHS | MD_PLN | MD_ZI) , FUNC3); // ENET TXD0
- scu_pinmux(0x1, 20, (MD_EHS | MD_PLN | MD_ZI) , FUNC3); // ENET TXD1
- scu_pinmux(0x0, 1 , (MD_EHS | MD_PLN | MD_ZI) , FUNC6); // ENET TX Enable
-
- scu_pinmux(0x1, 15, (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3); // ENET RXD0
- scu_pinmux(0x0, 0 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC2); // ENET RXD1
- scu_pinmux(0x1, 16, (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC7); // ENET RX Data Valid
-
- scu_pinmux(0x1, 19, (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC0); // ENET REF CLK
- scu_pinmux(0x1, 17, (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3); // ENET MDIO
- scu_pinmux(0xC, 1 , (MD_EHS | MD_PLN | MD_ZI) , FUNC3); // ENET MDC
-#endif
-
-}
-
-//--------------------------------------------------------------------+
-// LEDS
-//--------------------------------------------------------------------+
-void board_leds(uint32_t on_mask, uint32_t off_mask)
-{
- pca9532_setLeds( on_mask << 8, off_mask << 8);
-}
-
-//--------------------------------------------------------------------+
-// BUTTONS
-//--------------------------------------------------------------------+
-static bool button_read(uint8_t id)
-{
- return !BIT_TEST_( GPIO_ReadValue(buttons[id].gpio_port), buttons[id].gpio_pin ); // button is active low
-}
-
-uint32_t board_buttons(void)
-{
- uint32_t result = 0;
-
- for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) result |= (button_read(i) ? BIT_(i) : 0);
-
- return result;
-}
-
-//--------------------------------------------------------------------+
-// UART
-//--------------------------------------------------------------------+
-uint8_t board_uart_getchar(void)
-{
- return UART_ReceiveByte(BOARD_UART_PORT);
-}
-void board_uart_putchar(uint8_t c)
-{
- UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
-}
-
-#endif
+/**************************************************************************/
+/*!
+ @file board_ea4357.c
+ @author hathach (tinyusb.org)
+
+ @section LICENSE
+
+ Software License Agreement (BSD License)
+
+ Copyright (c) 2013, hathach (tinyusb.org)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This file is part of the tinyusb stack.
+*/
+/**************************************************************************/
+
+#include "../../board.h"
+
+#if BOARD == BOARD_EA4357
+
+#define BOARD_UART_PORT LPC_USART0
+#define BOARD_UART_PIN_PORT 0x0f
+#define BOARD_UART_PIN_TX 10 // PF.10 : UART0_TXD
+#define BOARD_UART_PIN_RX 11 // PF.11 : UART0_RXD
+
+const static struct {
+ uint8_t mux_port;
+ uint8_t mux_pin;
+
+ uint8_t gpio_port;
+ uint8_t gpio_pin;
+}buttons[] =
+{
+ {0x0a, 3, 4, 10 }, // Joystick up
+ {0x09, 1, 4, 13 }, // Joystick down
+ {0x0a, 2, 4, 9 }, // Joystick left
+ {0x09, 0, 4, 12 }, // Joystick right
+ {0x0a, 1, 4, 8 }, // Joystick press
+ {0x02, 7, 0, 7 }, // SW6
+};
+
+enum {
+ BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0])
+};
+
+void board_init(void)
+{
+ CGU_Init();
+
+#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+ SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND); // 1 msec tick timer
+#endif
+
+ //------------- USB -------------//
+ // USB0 Power: EA4357 channel B U20 GPIO26 active low (base board), P2_3 on LPC4357
+ scu_pinmux(0x02, 3, MD_PUP | MD_EZI, FUNC7); // USB0 VBus Power
+
+ #if TUSB_CFG_CONTROLLER_0_MODE & TUSB_MODE_DEVICE
+ scu_pinmux(0x09, 5, GPIO_PDN, FUNC4); // P9_5 (GPIO5[18]) (GPIO28 on oem base) as USB connect, active low.
+ GPIO_SetDir(5, BIT_(18), 1);
+ #endif
+
+ // USB1 Power: EA4357 channel A U20 is enabled by SJ5 connected to pad 1-2, no more action required
+ // TODO Remove R170, R171, solder a pair of 15K to USB1 D+/D- to test with USB1 Host
+
+ //------------- LED -------------//
+ I2C_Init(LPC_I2C0, 100000);
+ I2C_Cmd(LPC_I2C0, ENABLE);
+ pca9532_init();
+
+ //------------- BUTTON -------------//
+ for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++)
+ {
+ scu_pinmux(buttons[i].mux_port, buttons[i].mux_pin, GPIO_NOPULL, FUNC0);
+ GPIO_SetDir(buttons[i].gpio_port, BIT_(buttons[i].gpio_pin), 0);
+ }
+
+ //------------- UART -------------//
+ scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN, FUNC1);
+ scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_RX, MD_PLN | MD_EZI | MD_ZI, FUNC1);
+
+ UART_CFG_Type UARTConfigStruct;
+ UART_ConfigStructInit(&UARTConfigStruct);
+ UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
+ UARTConfigStruct.Clock_Speed = 0;
+
+ UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
+ UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
+
+ //------------- NAND Flash (K9FXX) Size = 128M, Page Size = 2K, Block Size = 128K, Number of Block = 1024 -------------//
+// nand_init();
+
+
+#if 0
+ //------------- Ethernet -------------//
+ LPC_CREG->CREG6 &= ~0x7;
+
+ /* RMII mode setup only */
+ LPC_CREG->CREG6 |= 0x4;
+
+ scu_pinmux(0x1, 18, (MD_EHS | MD_PLN | MD_ZI) , FUNC3); // ENET TXD0
+ scu_pinmux(0x1, 20, (MD_EHS | MD_PLN | MD_ZI) , FUNC3); // ENET TXD1
+ scu_pinmux(0x0, 1 , (MD_EHS | MD_PLN | MD_ZI) , FUNC6); // ENET TX Enable
+
+ scu_pinmux(0x1, 15, (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3); // ENET RXD0
+ scu_pinmux(0x0, 0 , (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC2); // ENET RXD1
+ scu_pinmux(0x1, 16, (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC7); // ENET RX Data Valid
+
+ scu_pinmux(0x1, 19, (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC0); // ENET REF CLK
+ scu_pinmux(0x1, 17, (MD_EHS | MD_PLN | MD_EZI | MD_ZI), FUNC3); // ENET MDIO
+ scu_pinmux(0xC, 1 , (MD_EHS | MD_PLN | MD_ZI) , FUNC3); // ENET MDC
+#endif
+
+}
+
+//--------------------------------------------------------------------+
+// LEDS
+//--------------------------------------------------------------------+
+void board_leds(uint32_t on_mask, uint32_t off_mask)
+{
+ pca9532_setLeds( on_mask << 8, off_mask << 8);
+}
+
+//--------------------------------------------------------------------+
+// BUTTONS
+//--------------------------------------------------------------------+
+static bool button_read(uint8_t id)
+{
+ return !BIT_TEST_( GPIO_ReadValue(buttons[id].gpio_port), buttons[id].gpio_pin ); // button is active low
+}
+
+uint32_t board_buttons(void)
+{
+ uint32_t result = 0;
+
+ for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) result |= (button_read(i) ? BIT_(i) : 0);
+
+ return result;
+}
+
+//--------------------------------------------------------------------+
+// UART
+//--------------------------------------------------------------------+
+uint8_t board_uart_getchar(void)
+{
+ return UART_ReceiveByte(BOARD_UART_PORT);
+}
+void board_uart_putchar(uint8_t c)
+{
+ UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
+}
+
+#endif
diff --git a/demos/bsp/boards/embedded_artists/oem_base_board/pca9532.c b/demos/bsp/boards/embedded_artists/oem_base_board/pca9532.c
index 0acf43fe8..d663604c3 100644
--- a/demos/bsp/boards/embedded_artists/oem_base_board/pca9532.c
+++ b/demos/bsp/boards/embedded_artists/oem_base_board/pca9532.c
@@ -1,349 +1,349 @@
-/*****************************************************************************
- *
- * Copyright(C) 2011, Embedded Artists AB
- * All rights reserved.
- *
- ******************************************************************************
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * products. This software is supplied "AS IS" without any warranties.
- * Embedded Artists AB assumes no responsibility or liability for the
- * use of the software, conveys no license or title under any patent,
- * copyright, or mask work right to the product. Embedded Artists AB
- * reserves the right to make changes in the software without
- * notification. Embedded Artists AB also make no representation or
- * warranty that such application will be suitable for the specified
- * use without further testing or modification.
- *****************************************************************************/
-
-/*
- * NOTE: I2C must have been initialized before calling any functions in this
- * file.
- */
-
-/******************************************************************************
- * Includes
- *****************************************************************************/
-#include "../../board.h"
-
-#if BOARD == BOARD_EA4357
-
-#include "lpc43xx_i2c.h"
-#include "lpc43xx_cgu.h"
-#include "lpc_types.h"
-#include "pca9532.h"
-
-/******************************************************************************
- * Defines and typedefs
- *****************************************************************************/
-
-#define I2C_PORT (LPC_I2C0)
-
-#define LS_MODE_ON 0x01
-#define LS_MODE_BLINK0 0x02
-#define LS_MODE_BLINK1 0x03
-
-/******************************************************************************
- * External global variables
- *****************************************************************************/
-
-
-/******************************************************************************
- * Local variables
- *****************************************************************************/
-
-static uint16_t blink0Shadow = 0;
-static uint16_t blink1Shadow = 0;
-static uint16_t ledStateShadow = 0;
-
-/******************************************************************************
- * Local Functions
- *****************************************************************************/
-
-static Status I2CWrite(uint32_t addr, uint8_t* buf, uint32_t len)
-{
- I2C_M_SETUP_Type i2cData;
-
- i2cData.sl_addr7bit = addr;
- i2cData.tx_data = buf;
- i2cData.tx_length = len;
- i2cData.rx_data = NULL;
- i2cData.rx_length = 0;
- i2cData.retransmissions_max = 3;
-
- return I2C_MasterTransferData(I2C_PORT, &i2cData, I2C_TRANSFER_POLLING);
-}
-
-static Status I2CRead(uint32_t addr, uint8_t* buf, uint32_t len)
-{
- I2C_M_SETUP_Type i2cData;
-
- i2cData.sl_addr7bit = addr;
- i2cData.tx_data = NULL;
- i2cData.tx_length = 0;
- i2cData.rx_data = buf;
- i2cData.rx_length = len;
- i2cData.retransmissions_max = 3;
-
- return I2C_MasterTransferData(I2C_PORT, &i2cData, I2C_TRANSFER_POLLING);
-}
-
-static void setLsStates(uint16_t states, uint8_t* ls, uint8_t mode)
-{
-#define IS_LED_SET(bit, x) ( ( ((x) & (bit)) != 0 ) ? 1 : 0 )
-
- int i = 0;
-
- for (i = 0; i < 4; i++) {
-
- ls[i] |= ( (IS_LED_SET(0x0001, states)*mode << 0)
- | (IS_LED_SET(0x0002, states)*mode << 2)
- | (IS_LED_SET(0x0004, states)*mode << 4)
- | (IS_LED_SET(0x0008, states)*mode << 6) );
-
- states >>= 4;
- }
-}
-
-static void setLeds(void)
-{
- uint8_t buf[5];
- uint8_t ls[4] = {0,0,0,0};
- uint16_t states = ledStateShadow;
-
- /* LEDs in On/Off state */
- setLsStates(states, ls, LS_MODE_ON);
-
- /* set the LEDs that should blink */
- setLsStates(blink0Shadow, ls, LS_MODE_BLINK0);
- setLsStates(blink1Shadow, ls, LS_MODE_BLINK1);
-
-
- buf[0] = PCA9532_LS0 | PCA9532_AUTO_INC;
- buf[1] = ls[0];
- buf[2] = ls[1];
- buf[3] = ls[2];
- buf[4] = ls[3];
- I2CWrite(PCA9532_I2C_ADDR, buf, 5);
-}
-
-/******************************************************************************
- * Public Functions
- *****************************************************************************/
-
-/******************************************************************************
- *
- * Description:
- * Initialize the PCA9532 Device
- *
- *****************************************************************************/
-void pca9532_init (void)
-{
- /* nothing to initialize */
-}
-
-/******************************************************************************
- *
- * Description:
- * Get the LED states
- *
- * Params:
- * [in] shadow - TRUE if the states should be retrieved from the shadow
- * variables. The shadow variable are updated when any
- * of setLeds, setBlink0Leds and/or setBlink1Leds are
- * called.
- *
- * FALSE if the state should be retrieved from the PCA9532
- * device. A blinkin LED may be reported as on or off
- * depending on the state when calling the function.
- *
- * Returns:
- * A mask where a 1 indicates that a LED is on (or blinking).
- *
- *****************************************************************************/
-uint16_t pca9532_getLedState (uint32_t shadow)
-{
- uint8_t buf[2];
- uint16_t ret = 0;
-
- if (shadow) {
- /* a blink LED is reported as on*/
- ret = (ledStateShadow | blink0Shadow | blink1Shadow);
- }
- else {
-
- /*
- * A blinking LED may be reported as on or off depending on
- * its state when reading the Input register.
- */
-
- buf[0] = PCA9532_INPUT0;
- I2CWrite(PCA9532_I2C_ADDR, buf, 1);
-
- I2CRead(PCA9532_I2C_ADDR, buf, 1);
- ret = buf[0];
-
-
- buf[0] = PCA9532_INPUT1;
- I2CWrite(PCA9532_I2C_ADDR, buf, 1);
-
- I2CRead(PCA9532_I2C_ADDR, buf, 1);
- ret |= (buf[0] << 8);
-
-
- /* invert since LEDs are active low */
- ret = ((~ret) & 0xFFFF);
- }
-
- return (ret & ~PCA9532_NOT_USED);
-}
-
-
-/******************************************************************************
- *
- * Description:
- * Set LED states (on or off).
- *
- * Params:
- * [in] ledOnMask - The LEDs that should be turned on. This mask has
- * priority over ledOffMask
- * [in] ledOffMask - The LEDs that should be turned off.
- *
- *****************************************************************************/
-void pca9532_setLeds (uint16_t ledOnMask, uint16_t ledOffMask)
-{
- /* turn off leds */
- ledStateShadow &= (~(ledOffMask) & 0xffff);
-
- /* ledOnMask has priority over ledOffMask */
- ledStateShadow |= ledOnMask;
-
- /* turn off blinking */
- blink0Shadow &= (~(ledOffMask) & 0xffff);
- blink1Shadow &= (~(ledOffMask) & 0xffff);
-
- setLeds();
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the blink period for PWM0. Valid values are 0 - 255 where 0
- * means 152 Hz and 255 means 0.59 Hz. A value of 151 means 1 Hz.
- *
- * Params:
- * [in] period - the period for pwm0
- *
- *****************************************************************************/
-void pca9532_setBlink0Period(uint8_t period)
-{
- uint8_t buf[2];
-
- buf[0] = PCA9532_PSC0;
- buf[1] = period;
- I2CWrite(PCA9532_I2C_ADDR, buf, 2);
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the duty cycle for PWM0. Valid values are 0 - 100. 25 means the LED
- * is on 25% of the period.
- *
- * Params:
- * [in] duty - duty cycle
- *
- *****************************************************************************/
-void pca9532_setBlink0Duty(uint8_t duty)
-{
- uint8_t buf[2];
- uint32_t tmp = duty;
- if (tmp > 100) {
- tmp = 100;
- }
-
- tmp = (256 * tmp)/100;
-
- buf[0] = PCA9532_PWM0;
- buf[1] = tmp;
- I2CWrite(PCA9532_I2C_ADDR, buf, 2);
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the LEDs that should blink with rate and duty cycle from PWM0.
- * Blinking is turned off with pca9532_setLeds.
- *
- * Params:
- * [in] ledMask - LEDs that should blink.
- *
- *****************************************************************************/
-void pca9532_setBlink0Leds(uint16_t ledMask)
-{
- blink0Shadow |= ledMask;
- setLeds();
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the blink period for PWM1. Valid values are 0 - 255 where 0
- * means 152 Hz and 255 means 0.59 Hz. A value of 151 means 1 Hz.
- *
- * Params:
- * [in] period - The period for PWM1
- *
- *****************************************************************************/
-void pca9532_setBlink1Period(uint8_t period)
-{
- uint8_t buf[2];
-
- buf[0] = PCA9532_PSC1;
- buf[1] = period;
- I2CWrite(PCA9532_I2C_ADDR, buf, 2);
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the duty cycle for PWM1. Valid values are 0 - 100. 25 means the LED
- * is on 25% of the period.
- *
- * Params:
- * [in] duty - duty cycle.
- *
- *****************************************************************************/
-void pca9532_setBlink1Duty(uint8_t duty)
-{
- uint8_t buf[2];
-
- uint32_t tmp = duty;
- if (tmp > 100) {
- tmp = 100;
- }
-
- tmp = (256 * tmp)/100;
-
- buf[0] = PCA9532_PWM1;
- buf[1] = tmp;
- I2CWrite(PCA9532_I2C_ADDR, buf, 2);
-}
-
-/******************************************************************************
- *
- * Description:
- * Set the LEDs that should blink with rate and duty cycle from PWM1.
- * Blinking is turned off with pca9532_setLeds.
- *
- * Params:
- * [in] ledMask - LEDs that should blink.
- *
- *****************************************************************************/
-void pca9532_setBlink1Leds(uint16_t ledMask)
-{
- blink1Shadow |= ledMask;
- setLeds();
-}
-
-#endif
+/*****************************************************************************
+ *
+ * Copyright(C) 2011, Embedded Artists AB
+ * All rights reserved.
+ *
+ ******************************************************************************
+ * Software that is described herein is for illustrative purposes only
+ * which provides customers with programming information regarding the
+ * products. This software is supplied "AS IS" without any warranties.
+ * Embedded Artists AB assumes no responsibility or liability for the
+ * use of the software, conveys no license or title under any patent,
+ * copyright, or mask work right to the product. Embedded Artists AB
+ * reserves the right to make changes in the software without
+ * notification. Embedded Artists AB also make no representation or
+ * warranty that such application will be suitable for the specified
+ * use without further testing or modification.
+ *****************************************************************************/
+
+/*
+ * NOTE: I2C must have been initialized before calling any functions in this
+ * file.
+ */
+
+/******************************************************************************
+ * Includes
+ *****************************************************************************/
+#include "../../board.h"
+
+#if BOARD == BOARD_EA4357
+
+#include "lpc43xx_i2c.h"
+#include "lpc43xx_cgu.h"
+#include "lpc_types.h"
+#include "pca9532.h"
+
+/******************************************************************************
+ * Defines and typedefs
+ *****************************************************************************/
+
+#define I2C_PORT (LPC_I2C0)
+
+#define LS_MODE_ON 0x01
+#define LS_MODE_BLINK0 0x02
+#define LS_MODE_BLINK1 0x03
+
+/******************************************************************************
+ * External global variables
+ *****************************************************************************/
+
+
+/******************************************************************************
+ * Local variables
+ *****************************************************************************/
+
+static uint16_t blink0Shadow = 0;
+static uint16_t blink1Shadow = 0;
+static uint16_t ledStateShadow = 0;
+
+/******************************************************************************
+ * Local Functions
+ *****************************************************************************/
+
+static Status I2CWrite(uint32_t addr, uint8_t* buf, uint32_t len)
+{
+ I2C_M_SETUP_Type i2cData;
+
+ i2cData.sl_addr7bit = addr;
+ i2cData.tx_data = buf;
+ i2cData.tx_length = len;
+ i2cData.rx_data = NULL;
+ i2cData.rx_length = 0;
+ i2cData.retransmissions_max = 3;
+
+ return I2C_MasterTransferData(I2C_PORT, &i2cData, I2C_TRANSFER_POLLING);
+}
+
+static Status I2CRead(uint32_t addr, uint8_t* buf, uint32_t len)
+{
+ I2C_M_SETUP_Type i2cData;
+
+ i2cData.sl_addr7bit = addr;
+ i2cData.tx_data = NULL;
+ i2cData.tx_length = 0;
+ i2cData.rx_data = buf;
+ i2cData.rx_length = len;
+ i2cData.retransmissions_max = 3;
+
+ return I2C_MasterTransferData(I2C_PORT, &i2cData, I2C_TRANSFER_POLLING);
+}
+
+static void setLsStates(uint16_t states, uint8_t* ls, uint8_t mode)
+{
+#define IS_LED_SET(bit, x) ( ( ((x) & (bit)) != 0 ) ? 1 : 0 )
+
+ int i = 0;
+
+ for (i = 0; i < 4; i++) {
+
+ ls[i] |= ( (IS_LED_SET(0x0001, states)*mode << 0)
+ | (IS_LED_SET(0x0002, states)*mode << 2)
+ | (IS_LED_SET(0x0004, states)*mode << 4)
+ | (IS_LED_SET(0x0008, states)*mode << 6) );
+
+ states >>= 4;
+ }
+}
+
+static void setLeds(void)
+{
+ uint8_t buf[5];
+ uint8_t ls[4] = {0,0,0,0};
+ uint16_t states = ledStateShadow;
+
+ /* LEDs in On/Off state */
+ setLsStates(states, ls, LS_MODE_ON);
+
+ /* set the LEDs that should blink */
+ setLsStates(blink0Shadow, ls, LS_MODE_BLINK0);
+ setLsStates(blink1Shadow, ls, LS_MODE_BLINK1);
+
+
+ buf[0] = PCA9532_LS0 | PCA9532_AUTO_INC;
+ buf[1] = ls[0];
+ buf[2] = ls[1];
+ buf[3] = ls[2];
+ buf[4] = ls[3];
+ I2CWrite(PCA9532_I2C_ADDR, buf, 5);
+}
+
+/******************************************************************************
+ * Public Functions
+ *****************************************************************************/
+
+/******************************************************************************
+ *
+ * Description:
+ * Initialize the PCA9532 Device
+ *
+ *****************************************************************************/
+void pca9532_init (void)
+{
+ /* nothing to initialize */
+}
+
+/******************************************************************************
+ *
+ * Description:
+ * Get the LED states
+ *
+ * Params:
+ * [in] shadow - TRUE if the states should be retrieved from the shadow
+ * variables. The shadow variable are updated when any
+ * of setLeds, setBlink0Leds and/or setBlink1Leds are
+ * called.
+ *
+ * FALSE if the state should be retrieved from the PCA9532
+ * device. A blinkin LED may be reported as on or off
+ * depending on the state when calling the function.
+ *
+ * Returns:
+ * A mask where a 1 indicates that a LED is on (or blinking).
+ *
+ *****************************************************************************/
+uint16_t pca9532_getLedState (uint32_t shadow)
+{
+ uint8_t buf[2];
+ uint16_t ret = 0;
+
+ if (shadow) {
+ /* a blink LED is reported as on*/
+ ret = (ledStateShadow | blink0Shadow | blink1Shadow);
+ }
+ else {
+
+ /*
+ * A blinking LED may be reported as on or off depending on
+ * its state when reading the Input register.
+ */
+
+ buf[0] = PCA9532_INPUT0;
+ I2CWrite(PCA9532_I2C_ADDR, buf, 1);
+
+ I2CRead(PCA9532_I2C_ADDR, buf, 1);
+ ret = buf[0];
+
+
+ buf[0] = PCA9532_INPUT1;
+ I2CWrite(PCA9532_I2C_ADDR, buf, 1);
+
+ I2CRead(PCA9532_I2C_ADDR, buf, 1);
+ ret |= (buf[0] << 8);
+
+
+ /* invert since LEDs are active low */
+ ret = ((~ret) & 0xFFFF);
+ }
+
+ return (ret & ~PCA9532_NOT_USED);
+}
+
+
+/******************************************************************************
+ *
+ * Description:
+ * Set LED states (on or off).
+ *
+ * Params:
+ * [in] ledOnMask - The LEDs that should be turned on. This mask has
+ * priority over ledOffMask
+ * [in] ledOffMask - The LEDs that should be turned off.
+ *
+ *****************************************************************************/
+void pca9532_setLeds (uint16_t ledOnMask, uint16_t ledOffMask)
+{
+ /* turn off leds */
+ ledStateShadow &= (~(ledOffMask) & 0xffff);
+
+ /* ledOnMask has priority over ledOffMask */
+ ledStateShadow |= ledOnMask;
+
+ /* turn off blinking */
+ blink0Shadow &= (~(ledOffMask) & 0xffff);
+ blink1Shadow &= (~(ledOffMask) & 0xffff);
+
+ setLeds();
+}
+
+/******************************************************************************
+ *
+ * Description:
+ * Set the blink period for PWM0. Valid values are 0 - 255 where 0
+ * means 152 Hz and 255 means 0.59 Hz. A value of 151 means 1 Hz.
+ *
+ * Params:
+ * [in] period - the period for pwm0
+ *
+ *****************************************************************************/
+void pca9532_setBlink0Period(uint8_t period)
+{
+ uint8_t buf[2];
+
+ buf[0] = PCA9532_PSC0;
+ buf[1] = period;
+ I2CWrite(PCA9532_I2C_ADDR, buf, 2);
+}
+
+/******************************************************************************
+ *
+ * Description:
+ * Set the duty cycle for PWM0. Valid values are 0 - 100. 25 means the LED
+ * is on 25% of the period.
+ *
+ * Params:
+ * [in] duty - duty cycle
+ *
+ *****************************************************************************/
+void pca9532_setBlink0Duty(uint8_t duty)
+{
+ uint8_t buf[2];
+ uint32_t tmp = duty;
+ if (tmp > 100) {
+ tmp = 100;
+ }
+
+ tmp = (256 * tmp)/100;
+
+ buf[0] = PCA9532_PWM0;
+ buf[1] = tmp;
+ I2CWrite(PCA9532_I2C_ADDR, buf, 2);
+}
+
+/******************************************************************************
+ *
+ * Description:
+ * Set the LEDs that should blink with rate and duty cycle from PWM0.
+ * Blinking is turned off with pca9532_setLeds.
+ *
+ * Params:
+ * [in] ledMask - LEDs that should blink.
+ *
+ *****************************************************************************/
+void pca9532_setBlink0Leds(uint16_t ledMask)
+{
+ blink0Shadow |= ledMask;
+ setLeds();
+}
+
+/******************************************************************************
+ *
+ * Description:
+ * Set the blink period for PWM1. Valid values are 0 - 255 where 0
+ * means 152 Hz and 255 means 0.59 Hz. A value of 151 means 1 Hz.
+ *
+ * Params:
+ * [in] period - The period for PWM1
+ *
+ *****************************************************************************/
+void pca9532_setBlink1Period(uint8_t period)
+{
+ uint8_t buf[2];
+
+ buf[0] = PCA9532_PSC1;
+ buf[1] = period;
+ I2CWrite(PCA9532_I2C_ADDR, buf, 2);
+}
+
+/******************************************************************************
+ *
+ * Description:
+ * Set the duty cycle for PWM1. Valid values are 0 - 100. 25 means the LED
+ * is on 25% of the period.
+ *
+ * Params:
+ * [in] duty - duty cycle.
+ *
+ *****************************************************************************/
+void pca9532_setBlink1Duty(uint8_t duty)
+{
+ uint8_t buf[2];
+
+ uint32_t tmp = duty;
+ if (tmp > 100) {
+ tmp = 100;
+ }
+
+ tmp = (256 * tmp)/100;
+
+ buf[0] = PCA9532_PWM1;
+ buf[1] = tmp;
+ I2CWrite(PCA9532_I2C_ADDR, buf, 2);
+}
+
+/******************************************************************************
+ *
+ * Description:
+ * Set the LEDs that should blink with rate and duty cycle from PWM1.
+ * Blinking is turned off with pca9532_setLeds.
+ *
+ * Params:
+ * [in] ledMask - LEDs that should blink.
+ *
+ *****************************************************************************/
+void pca9532_setBlink1Leds(uint16_t ledMask)
+{
+ blink1Shadow |= ledMask;
+ setLeds();
+}
+
+#endif
diff --git a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1347.c b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1347.c
index 1a6f9493f..816e1c951 100644
--- a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1347.c
+++ b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1347.c
@@ -1,133 +1,133 @@
-/**************************************************************************/
-/*!
- @file board_lpcexpresso1347.c
- @author hathach (tinyusb.org)
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2013, hathach (tinyusb.org)
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This file is part of the tinyusb stack.
-*/
-/**************************************************************************/
-
-#include "../board.h"
-
-#if BOARD == BOARD_LPCXPRESSO1347
-
-#define LED_PORT (0)
-#define LED_PIN (7)
-#define LED_ON (1)
-#define LED_OFF (0)
-
-const static struct {
- uint8_t port;
- uint8_t pin;
-} buttons[] =
-{
- {1, 22 }, // Joystick up
- {1, 20 }, // Joystick down
- {1, 23 }, // Joystick left
- {1, 21 }, // Joystick right
- {1, 19 }, // Joystick press
- {0, 1 }, // SW3
-// {1, 4 }, // SW4 (require to remove J28)
-};
-
-enum {
- BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0])
-};
-
-
-void board_init(void)
-{
- SystemInit();
-
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
- SysTick_Config(SystemCoreClock / CFG_TICKS_PER_SECOND); // 1 msec tick timer
-#endif
-
- GPIOInit();
-
- //------------- LED -------------//
- GPIOSetDir(LED_PORT, LED_PIN, 1);
- LPC_GPIO->CLR[LED_PORT] = (1 << LED_PIN);
-
- //------------- BUTTON -------------//
- for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) GPIOSetDir(buttons[i].port, BIT_(buttons[i].pin), 0);
-
- //------------- UART -------------//
- UARTInit(CFG_UART_BAUDRATE);
-
-}
-
-//--------------------------------------------------------------------+
-// LEDS
-//--------------------------------------------------------------------+
-void board_leds(uint32_t on_mask, uint32_t off_mask)
-{
- if (on_mask & BIT_(0))
- {
- GPIOSetBitValue(LED_PORT, LED_PIN, LED_ON);
- }else if (off_mask & BIT_(0))
- {
- GPIOSetBitValue(LED_PORT, LED_PIN, LED_OFF);
- }
-}
-
-//--------------------------------------------------------------------+
-// BUTTONS
-//--------------------------------------------------------------------+
-static bool button_read(uint8_t id)
-{
- return !GPIOGetPinValue(buttons[id].port, buttons[id].pin); // button is active low
-}
-
-uint32_t board_buttons(void)
-{
- uint32_t result = 0;
-
- for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) result |= (button_read(i) ? BIT_(i) : 0);
-
- return result;
-}
-
-//--------------------------------------------------------------------+
-// UART
-//--------------------------------------------------------------------+
-void board_uart_putchar(uint8_t c)
-{
- UARTSend(&c, 1);
-}
-
-uint8_t board_uart_getchar(void)
-{
- return 0;
-}
-
-#endif
+/**************************************************************************/
+/*!
+ @file board_lpcexpresso1347.c
+ @author hathach (tinyusb.org)
+
+ @section LICENSE
+
+ Software License Agreement (BSD License)
+
+ Copyright (c) 2013, hathach (tinyusb.org)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This file is part of the tinyusb stack.
+*/
+/**************************************************************************/
+
+#include "../board.h"
+
+#if BOARD == BOARD_LPCXPRESSO1347
+
+#define LED_PORT (0)
+#define LED_PIN (7)
+#define LED_ON (1)
+#define LED_OFF (0)
+
+const static struct {
+ uint8_t port;
+ uint8_t pin;
+} buttons[] =
+{
+ {1, 22 }, // Joystick up
+ {1, 20 }, // Joystick down
+ {1, 23 }, // Joystick left
+ {1, 21 }, // Joystick right
+ {1, 19 }, // Joystick press
+ {0, 1 }, // SW3
+// {1, 4 }, // SW4 (require to remove J28)
+};
+
+enum {
+ BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0])
+};
+
+
+void board_init(void)
+{
+ SystemInit();
+
+#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+ SysTick_Config(SystemCoreClock / CFG_TICKS_PER_SECOND); // 1 msec tick timer
+#endif
+
+ GPIOInit();
+
+ //------------- LED -------------//
+ GPIOSetDir(LED_PORT, LED_PIN, 1);
+ LPC_GPIO->CLR[LED_PORT] = (1 << LED_PIN);
+
+ //------------- BUTTON -------------//
+ for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) GPIOSetDir(buttons[i].port, BIT_(buttons[i].pin), 0);
+
+ //------------- UART -------------//
+ UARTInit(CFG_UART_BAUDRATE);
+
+}
+
+//--------------------------------------------------------------------+
+// LEDS
+//--------------------------------------------------------------------+
+void board_leds(uint32_t on_mask, uint32_t off_mask)
+{
+ if (on_mask & BIT_(0))
+ {
+ GPIOSetBitValue(LED_PORT, LED_PIN, LED_ON);
+ }else if (off_mask & BIT_(0))
+ {
+ GPIOSetBitValue(LED_PORT, LED_PIN, LED_OFF);
+ }
+}
+
+//--------------------------------------------------------------------+
+// BUTTONS
+//--------------------------------------------------------------------+
+static bool button_read(uint8_t id)
+{
+ return !GPIOGetPinValue(buttons[id].port, buttons[id].pin); // button is active low
+}
+
+uint32_t board_buttons(void)
+{
+ uint32_t result = 0;
+
+ for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) result |= (button_read(i) ? BIT_(i) : 0);
+
+ return result;
+}
+
+//--------------------------------------------------------------------+
+// UART
+//--------------------------------------------------------------------+
+void board_uart_putchar(uint8_t c)
+{
+ UARTSend(&c, 1);
+}
+
+uint8_t board_uart_getchar(void)
+{
+ return 0;
+}
+
+#endif
diff --git a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c
index dbb455dfe..238559d8e 100644
--- a/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c
+++ b/demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c
@@ -1,159 +1,159 @@
-/**************************************************************************/
-/*!
- @file board_lpcxpresso1769.c
- @author hathach (tinyusb.org)
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2013, hathach (tinyusb.org)
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This file is part of the tinyusb stack.
-*/
-/**************************************************************************/
-
-#include "../board.h"
-
-#if BOARD == BOARD_LPCXPRESSO1769
-
-#define BOARD_LED_PORT (0)
-#define BOARD_LED_PIN (22)
-
-const static struct {
- uint8_t port;
- uint8_t pin;
-} buttons[] =
-{
- {2, 3 }, // Joystick up
- {0, 15 }, // Joystick down
- {2, 4 }, // Joystick left
- {0, 16 }, // Joystick right
- {0, 17 }, // Joystick press
- {0, 4 }, // SW3
-// {1, 31 }, // SW4 (require to remove J28)
-};
-
-enum {
- BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0])
-};
-
-#define BOARD_UART_PORT LPC_UART3
-
-void board_init(void)
-{
- SystemInit();
-
-#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
- SysTick_Config(SystemCoreClock / CFG_TICKS_PER_SECOND); // 1 msec tick timer
-#endif
-
- //------------- LED -------------//
- GPIO_SetDir(BOARD_LED_PORT, BIT_(BOARD_LED_PIN), 1);
-
- //------------- BUTTON -------------//
- for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) GPIO_SetDir(buttons[i].port, BIT_(buttons[i].pin), 0);
-
-#if MODE_DEVICE_SUPPORTED
- //------------- USB Device -------------//
- // VBUS sense is wrongly connected to P0_5 (instead of P1_30). So we need to always pull P1_30 to high
- // so that USB device block can work. However, Device Controller (thus tinyusb) cannot able to determine
- // if device is disconnected or not
- PINSEL_ConfigPin( &(PINSEL_CFG_Type) {
- .Portnum = 1, .Pinnum = 30,
- .Funcnum = 2, .Pinmode = PINSEL_PINMODE_PULLUP} );
-
- //P0_21 instead of P2_9 as USB connect
-#endif
-
- //------------- UART -------------//
- PINSEL_CFG_Type PinCfg =
- {
- .Portnum = 0,
- .Pinnum = 0, // TXD is P0.0
- .Funcnum = 2,
- .OpenDrain = 0,
- .Pinmode = 0
- };
- PINSEL_ConfigPin(&PinCfg);
-
- PinCfg.Portnum = 0;
- PinCfg.Pinnum = 1; // RXD is P0.1
- PINSEL_ConfigPin(&PinCfg);
-
- UART_CFG_Type UARTConfigStruct;
- UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
-
- UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
- UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
-}
-
-//--------------------------------------------------------------------+
-// LEDS
-//--------------------------------------------------------------------+
-void board_leds(uint32_t on_mask, uint32_t off_mask)
-{
- if (on_mask & BIT_(0))
- {
- GPIO_SetValue(BOARD_LED_PORT, BIT_(BOARD_LED_PIN));
- }else if (off_mask & BIT_(0))
- {
- GPIO_ClearValue(BOARD_LED_PORT, BIT_(BOARD_LED_PIN));
- }
-}
-
-//--------------------------------------------------------------------+
-// BUTTONS
-//--------------------------------------------------------------------+
-static bool button_read(uint8_t id)
-{
- return !BIT_TEST_( GPIO_ReadValue(buttons[id].port), buttons[id].pin ); // button is active low
-}
-
-uint32_t board_buttons(void)
-{
- uint32_t result = 0;
-
- for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) result |= (button_read(i) ? BIT_(i) : 0);
-
- return result;
-}
-
-//--------------------------------------------------------------------+
-// UART
-//--------------------------------------------------------------------+
-void board_uart_putchar(uint8_t c)
-{
- UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
-}
-
-uint8_t board_uart_getchar(void)
-{
- return UART_ReceiveByte(BOARD_UART_PORT);
-}
-
-#endif
+/**************************************************************************/
+/*!
+ @file board_lpcxpresso1769.c
+ @author hathach (tinyusb.org)
+
+ @section LICENSE
+
+ Software License Agreement (BSD License)
+
+ Copyright (c) 2013, hathach (tinyusb.org)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This file is part of the tinyusb stack.
+*/
+/**************************************************************************/
+
+#include "../board.h"
+
+#if BOARD == BOARD_LPCXPRESSO1769
+
+#define BOARD_LED_PORT (0)
+#define BOARD_LED_PIN (22)
+
+const static struct {
+ uint8_t port;
+ uint8_t pin;
+} buttons[] =
+{
+ {2, 3 }, // Joystick up
+ {0, 15 }, // Joystick down
+ {2, 4 }, // Joystick left
+ {0, 16 }, // Joystick right
+ {0, 17 }, // Joystick press
+ {0, 4 }, // SW3
+// {1, 31 }, // SW4 (require to remove J28)
+};
+
+enum {
+ BOARD_BUTTON_COUNT = sizeof(buttons) / sizeof(buttons[0])
+};
+
+#define BOARD_UART_PORT LPC_UART3
+
+void board_init(void)
+{
+ SystemInit();
+
+#if TUSB_CFG_OS == TUSB_OS_NONE // TODO may move to main.c
+ SysTick_Config(SystemCoreClock / CFG_TICKS_PER_SECOND); // 1 msec tick timer
+#endif
+
+ //------------- LED -------------//
+ GPIO_SetDir(BOARD_LED_PORT, BIT_(BOARD_LED_PIN), 1);
+
+ //------------- BUTTON -------------//
+ for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) GPIO_SetDir(buttons[i].port, BIT_(buttons[i].pin), 0);
+
+#if MODE_DEVICE_SUPPORTED
+ //------------- USB Device -------------//
+ // VBUS sense is wrongly connected to P0_5 (instead of P1_30). So we need to always pull P1_30 to high
+ // so that USB device block can work. However, Device Controller (thus tinyusb) cannot able to determine
+ // if device is disconnected or not
+ PINSEL_ConfigPin( &(PINSEL_CFG_Type) {
+ .Portnum = 1, .Pinnum = 30,
+ .Funcnum = 2, .Pinmode = PINSEL_PINMODE_PULLUP} );
+
+ //P0_21 instead of P2_9 as USB connect
+#endif
+
+ //------------- UART -------------//
+ PINSEL_CFG_Type PinCfg =
+ {
+ .Portnum = 0,
+ .Pinnum = 0, // TXD is P0.0
+ .Funcnum = 2,
+ .OpenDrain = 0,
+ .Pinmode = 0
+ };
+ PINSEL_ConfigPin(&PinCfg);
+
+ PinCfg.Portnum = 0;
+ PinCfg.Pinnum = 1; // RXD is P0.1
+ PINSEL_ConfigPin(&PinCfg);
+
+ UART_CFG_Type UARTConfigStruct;
+ UART_ConfigStructInit(&UARTConfigStruct);
+ UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
+
+ UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
+ UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
+}
+
+//--------------------------------------------------------------------+
+// LEDS
+//--------------------------------------------------------------------+
+void board_leds(uint32_t on_mask, uint32_t off_mask)
+{
+ if (on_mask & BIT_(0))
+ {
+ GPIO_SetValue(BOARD_LED_PORT, BIT_(BOARD_LED_PIN));
+ }else if (off_mask & BIT_(0))
+ {
+ GPIO_ClearValue(BOARD_LED_PORT, BIT_(BOARD_LED_PIN));
+ }
+}
+
+//--------------------------------------------------------------------+
+// BUTTONS
+//--------------------------------------------------------------------+
+static bool button_read(uint8_t id)
+{
+ return !BIT_TEST_( GPIO_ReadValue(buttons[id].port), buttons[id].pin ); // button is active low
+}
+
+uint32_t board_buttons(void)
+{
+ uint32_t result = 0;
+
+ for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) result |= (button_read(i) ? BIT_(i) : 0);
+
+ return result;
+}
+
+//--------------------------------------------------------------------+
+// UART
+//--------------------------------------------------------------------+
+void board_uart_putchar(uint8_t c)
+{
+ UART_Send(BOARD_UART_PORT, &c, 1, BLOCKING);
+}
+
+uint8_t board_uart_getchar(void)
+{
+ return UART_ReceiveByte(BOARD_UART_PORT);
+}
+
+#endif
diff --git a/demos/bsp/boards/microbuilder/board_lpc4357usb.c b/demos/bsp/boards/microbuilder/board_lpc4357usb.c
index a27372f66..35d800956 100644
--- a/demos/bsp/boards/microbuilder/board_lpc4357usb.c
+++ b/demos/bsp/boards/microbuilder/board_lpc4357usb.c
@@ -1,130 +1,130 @@
-/**************************************************************************/
-/*!
- @file board_lpc4357usb.c
- @author hathach (tinyusb.org)
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2013, hathach (tinyusb.org)
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This file is part of the tinyusb stack.
-*/
-/**************************************************************************/
-
-#include "../board.h"
-
-#if BOARD == BOARD_LPC4357USB
-
-#define BOARD_UART_PORT (LPC_USART0)
-#define BOARD_UART_PIN_PORT (0x0F)
-#define BOARD_UART_PIN_TX (10) // PF.10 : UART0_TXD
-#define BOARD_UART_PIN_RX (11) // PF.11 : UART0_RXD
-
-#define BOARD_LED0_PORT (0x0C)
-#define BOARD_LED0_PIN (2) // PC.2 = User LED
-#define BOARD_LED0_FUNCTION (4) // GPIO multiplexed as function 4 on PC.2
-#define BOARD_LED0_GPIO_PORT (6)
-#define BOARD_LED0_GPIO_PIN (1) // PC.2 = GPIO 6[1]
-
-void board_init(void)
-{
- CGU_Init();
-
- /* Setup the systick time for 1ms ticks */
- SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND);
-
- /* Configure LED0 as GPIO */
- scu_pinmux(BOARD_LED0_PORT, BOARD_LED0_PIN, MD_PDN, BOARD_LED0_FUNCTION);
- GPIO_SetDir(BOARD_LED0_GPIO_PORT, (1 << BOARD_LED0_GPIO_PIN), 1);
-
- /* Configure TRACE pins */
- scu_pinmux(0xF, 4, MD_PDN, 0x2); /* PF_4 = TRACECLK */
- scu_pinmux(0x7, 4, MD_PDN, 0x5); /* P7_4 = TRACEDATA[0] */
- scu_pinmux(0x7, 5, MD_PDN, 0x5); /* P7_5 = TRACEDATA[1] */
- scu_pinmux(0x7, 6, MD_PDN, 0x5); /* P7_6 = TRACEDATA[2] */
- scu_pinmux(0x7, 7, MD_PDN, 0x5); /* P7_7 = TRACEDATA[3] */
-
- // USB0 Power: EA4357 channel B U20 GPIO26 active low (base board), P2_3 on LPC4357
- scu_pinmux(0x2, 3, MD_PUP | MD_EZI, FUNC7); // USB0 VBus Power
-
- // 1.5Kohm pull-up resistor is needed on the USB DP data signal. GPIO28 (base), P9_5 (LPC4357) controls
- //scu_pinmux(0x9, 5, MD_PUP|MD_EZI|MD_ZI, FUNC4); // GPIO5[18]
- //GPIO_SetDir(5, BIT_(18), 1); // output
- //GPIO_ClearValue(5, BIT_(18));
-
- /* Init I2C @ 400kHz */
- I2C_Init(LPC_I2C0, 400000);
- I2C_Cmd(LPC_I2C0, ENABLE);
-
-#if CFG_UART_ENABLE
- //------------- UART init -------------//
- scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN , FUNC1);
- scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_RX, MD_PLN|MD_EZI|MD_ZI, FUNC1);
-
- UART_CFG_Type UARTConfigStruct;
- UART_ConfigStructInit(&UARTConfigStruct);
- UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
- UARTConfigStruct.Clock_Speed = 0;
-
- UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
- UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
-#endif
-}
-
-//--------------------------------------------------------------------+
-// LEDS
-//--------------------------------------------------------------------+
-void board_leds(uint32_t on_mask, uint32_t off_mask)
-{
- if (on_mask & 0x01)
- {
- LPC_GPIO_PORT->SET[BOARD_LED0_GPIO_PORT] = (1 << BOARD_LED0_GPIO_PIN);
- }
-
- if (off_mask & 0x01)
- {
- LPC_GPIO_PORT->CLR[BOARD_LED0_GPIO_PORT] = (1 << BOARD_LED0_GPIO_PIN);
- }
-}
-
-//--------------------------------------------------------------------+
-// UART
-//--------------------------------------------------------------------+
-#if CFG_UART_ENABLE
-uint32_t board_uart_send(uint8_t *buffer, uint32_t length)
-{
- return UART_Send(BOARD_UART_PORT, buffer, length, BLOCKING);
-}
-
-uint32_t board_uart_recv(uint8_t *buffer, uint32_t length)
-{
- return UART_Receive(BOARD_UART_PORT, buffer, length, BLOCKING);
-}
-#endif
-
-#endif
+/**************************************************************************/
+/*!
+ @file board_lpc4357usb.c
+ @author hathach (tinyusb.org)
+
+ @section LICENSE
+
+ Software License Agreement (BSD License)
+
+ Copyright (c) 2013, hathach (tinyusb.org)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This file is part of the tinyusb stack.
+*/
+/**************************************************************************/
+
+#include "../board.h"
+
+#if BOARD == BOARD_LPC4357USB
+
+#define BOARD_UART_PORT (LPC_USART0)
+#define BOARD_UART_PIN_PORT (0x0F)
+#define BOARD_UART_PIN_TX (10) // PF.10 : UART0_TXD
+#define BOARD_UART_PIN_RX (11) // PF.11 : UART0_RXD
+
+#define BOARD_LED0_PORT (0x0C)
+#define BOARD_LED0_PIN (2) // PC.2 = User LED
+#define BOARD_LED0_FUNCTION (4) // GPIO multiplexed as function 4 on PC.2
+#define BOARD_LED0_GPIO_PORT (6)
+#define BOARD_LED0_GPIO_PIN (1) // PC.2 = GPIO 6[1]
+
+void board_init(void)
+{
+ CGU_Init();
+
+ /* Setup the systick time for 1ms ticks */
+ SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND);
+
+ /* Configure LED0 as GPIO */
+ scu_pinmux(BOARD_LED0_PORT, BOARD_LED0_PIN, MD_PDN, BOARD_LED0_FUNCTION);
+ GPIO_SetDir(BOARD_LED0_GPIO_PORT, (1 << BOARD_LED0_GPIO_PIN), 1);
+
+ /* Configure TRACE pins */
+ scu_pinmux(0xF, 4, MD_PDN, 0x2); /* PF_4 = TRACECLK */
+ scu_pinmux(0x7, 4, MD_PDN, 0x5); /* P7_4 = TRACEDATA[0] */
+ scu_pinmux(0x7, 5, MD_PDN, 0x5); /* P7_5 = TRACEDATA[1] */
+ scu_pinmux(0x7, 6, MD_PDN, 0x5); /* P7_6 = TRACEDATA[2] */
+ scu_pinmux(0x7, 7, MD_PDN, 0x5); /* P7_7 = TRACEDATA[3] */
+
+ // USB0 Power: EA4357 channel B U20 GPIO26 active low (base board), P2_3 on LPC4357
+ scu_pinmux(0x2, 3, MD_PUP | MD_EZI, FUNC7); // USB0 VBus Power
+
+ // 1.5Kohm pull-up resistor is needed on the USB DP data signal. GPIO28 (base), P9_5 (LPC4357) controls
+ //scu_pinmux(0x9, 5, MD_PUP|MD_EZI|MD_ZI, FUNC4); // GPIO5[18]
+ //GPIO_SetDir(5, BIT_(18), 1); // output
+ //GPIO_ClearValue(5, BIT_(18));
+
+ /* Init I2C @ 400kHz */
+ I2C_Init(LPC_I2C0, 400000);
+ I2C_Cmd(LPC_I2C0, ENABLE);
+
+#if CFG_UART_ENABLE
+ //------------- UART init -------------//
+ scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_TX, MD_PDN , FUNC1);
+ scu_pinmux(BOARD_UART_PIN_PORT, BOARD_UART_PIN_RX, MD_PLN|MD_EZI|MD_ZI, FUNC1);
+
+ UART_CFG_Type UARTConfigStruct;
+ UART_ConfigStructInit(&UARTConfigStruct);
+ UARTConfigStruct.Baud_rate = CFG_UART_BAUDRATE;
+ UARTConfigStruct.Clock_Speed = 0;
+
+ UART_Init(BOARD_UART_PORT, &UARTConfigStruct);
+ UART_TxCmd(BOARD_UART_PORT, ENABLE); // Enable UART Transmit
+#endif
+}
+
+//--------------------------------------------------------------------+
+// LEDS
+//--------------------------------------------------------------------+
+void board_leds(uint32_t on_mask, uint32_t off_mask)
+{
+ if (on_mask & 0x01)
+ {
+ LPC_GPIO_PORT->SET[BOARD_LED0_GPIO_PORT] = (1 << BOARD_LED0_GPIO_PIN);
+ }
+
+ if (off_mask & 0x01)
+ {
+ LPC_GPIO_PORT->CLR[BOARD_LED0_GPIO_PORT] = (1 << BOARD_LED0_GPIO_PIN);
+ }
+}
+
+//--------------------------------------------------------------------+
+// UART
+//--------------------------------------------------------------------+
+#if CFG_UART_ENABLE
+uint32_t board_uart_send(uint8_t *buffer, uint32_t length)
+{
+ return UART_Send(BOARD_UART_PORT, buffer, length, BLOCKING);
+}
+
+uint32_t board_uart_recv(uint8_t *buffer, uint32_t length)
+{
+ return UART_Receive(BOARD_UART_PORT, buffer, length, BLOCKING);
+}
+#endif
+
+#endif
diff --git a/demos/bsp/lpc13uxx/LPC13Uxx_DriverLib/inc/type.h b/demos/bsp/lpc13uxx/LPC13Uxx_DriverLib/inc/type.h
index ff9520927..8360217ee 100644
--- a/demos/bsp/lpc13uxx/LPC13Uxx_DriverLib/inc/type.h
+++ b/demos/bsp/lpc13uxx/LPC13Uxx_DriverLib/inc/type.h
@@ -1,52 +1,52 @@
-/****************************************************************************
- * $Id:: type.h 6172 2011-01-13 18:22:51Z usb00423 $
- * Project: NXP LPC13Uxx software example
- *
- * Description:
- * This file contains different type definition.
- *
- ****************************************************************************
- * Software that is described herein is for illustrative purposes only
- * which provides customers with programming information regarding the
- * products. This software is supplied "AS IS" without any warranties.
- * NXP Semiconductors assumes no responsibility or liability for the
- * use of the software, conveys no license or title under any patent,
- * copyright, or mask work right to the product. NXP Semiconductors
- * reserves the right to make changes in the software without
- * notification. NXP Semiconductors also make no representation or
- * warranty that such application will be suitable for the specified
- * use without further testing or modification.
-****************************************************************************/
-#ifndef __TYPE_H__
-#define __TYPE_H__
-
-#if defined (__GNUC__)
-#include <stdint.h>
-
-#else
-/* exact-width signed integer types */
-typedef signed char int8_t;
-typedef signed short int int16_t;
-typedef signed int int32_t;
-typedef signed __int64 int64_t;
-
- /* exact-width unsigned integer types */
-typedef unsigned char uint8_t;
-typedef unsigned short int uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned __int64 uint64_t;
-#endif
-
-#ifndef NULL
-#define NULL ((void *)0)
-#endif
-
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
-#endif /* __TYPE_H__ */
+/****************************************************************************
+ * $Id:: type.h 6172 2011-01-13 18:22:51Z usb00423 $
+ * Project: NXP LPC13Uxx software example
+ *
+ * Description:
+ * This file contains different type definition.
+ *
+ ****************************************************************************
+ * Software that is described herein is for illustrative purposes only
+ * which provides customers with programming information regarding the
+ * products. This software is supplied "AS IS" without any warranties.
+ * NXP Semiconductors assumes no responsibility or liability for the
+ * use of the software, conveys no license or title under any patent,
+ * copyright, or mask work right to the product. NXP Semiconductors
+ * reserves the right to make changes in the software without
+ * notification. NXP Semiconductors also make no representation or
+ * warranty that such application will be suitable for the specified
+ * use without further testing or modification.
+****************************************************************************/
+#ifndef __TYPE_H__
+#define __TYPE_H__
+
+#if defined (__GNUC__)
+#include <stdint.h>
+
+#else
+/* exact-width signed integer types */
+typedef signed char int8_t;
+typedef signed short int int16_t;
+typedef signed int int32_t;
+//typedef signed __int64 int64_t;
+
+ /* exact-width unsigned integer types */
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+//typedef unsigned __int64 uint64_t;
+#endif
+
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+#ifndef FALSE
+#define FALSE (0)
+#endif
+
+#ifndef TRUE
+#define TRUE (1)
+#endif
+
+#endif /* __TYPE_H__ */
diff --git a/demos/device/device_os_none/device_os_none.ewp b/demos/device/device_os_none/device_os_none.ewp
index 57be60bff..fc7810f2b 100644
--- a/demos/device/device_os_none/device_os_none.ewp
+++ b/demos/device/device_os_none/device_os_none.ewp
@@ -3690,6 +3690,928 @@
<data/>
</settings>
</configuration>
+ <configuration>
+ <name>Board LPCXpresso1347</name>
+ <toolchain>
+ <name>ARM</name>
+ </toolchain>
+ <debug>1</debug>
+ <settings>
+ <name>General</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <version>21</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>ExePath</name>
+ <state>Board LPCXpresso1347\Exe</state>
+ </option>
+ <option>
+ <name>ObjPath</name>
+ <state>Board LPCXpresso1347\Obj</state>
+ </option>
+ <option>
+ <name>ListPath</name>
+ <state>Board LPCXpresso1347\List</state>
+ </option>
+ <option>
+ <name>Variant</name>
+ <version>20</version>
+ <state>38</state>
+ </option>
+ <option>
+ <name>GEndianMode</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input variant</name>
+ <version>3</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Input description</name>
+ <state>Automatic choice of formatter.</state>
+ </option>
+ <option>
+ <name>Output variant</name>
+ <version>2</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>Output description</name>
+ <state>Automatic choice of formatter.</state>
+ </option>
+ <option>
+ <name>GOutputBinary</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FPU</name>
+ <version>2</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGCoreOrChip</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelect</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GRuntimeLibSelectSlave</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>RTDescription</name>
+ <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
+ </option>
+ <option>
+ <name>OGProductVersion</name>
+ <state>6.50.5.4846</state>
+ </option>
+ <option>
+ <name>OGLastSavedByProductVersion</name>
+ <state>6.50.5.4846</state>
+ </option>
+ <option>
+ <name>GeneralEnableMisra</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraVerbose</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGChipSelectEditMenu</name>
+ <state>LPC1347 NXP LPC1347</state>
+ </option>
+ <option>
+ <name>GenLowLevelInterface</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>GEndianModeBE</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OGBufferedTerminalOutput</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GenStdoutInterface</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>GeneralMisraVer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>GeneralMisraRules04</name>
+ <version>0</version>
+ <state>111101010010111111111000110011111101111111111111110110010111101111010101111111111111111111111111101111111011110001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>RTConfigPath2</name>
+ <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
+ </option>
+ <option>
+ <name>GFPUCoreSlave</name>
+ <version>20</version>
+ <state>38</state>
+ </option>
+ <option>
+ <name>GBECoreSlave</name>
+ <version>20</version>
+ <state>38</state>
+ </option>
+ <option>
+ <name>OGUseCmsis</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OGUseCmsisDspLib</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>ICCARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>28</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>CCDefines</name>
+ <state>TUSB_CFG_MCU=MCU_LPC13UXX</state>
+ <state>BOARD=BOARD_LPCXPRESSO1347</state>
+ <state>TUSB_CFG_OS=TUSB_OS_NONE</state>
+ </option>
+ <option>
+ <name>CCPreprocFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocComments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPreprocLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMnemonics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListCMessages</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCListAssSource</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagSuppress</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagRemark</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagWarning</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCDiagError</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCAllowList</name>
+ <version>1</version>
+ <state>0000000</state>
+ </option>
+ <option>
+ <name>CCDebugInfo</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IEndianMode</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IExtraOptionsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CCLangConformance</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCSignedPlainChar</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCRequirePrototypes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCMultibyteSupport</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCDiagWarnAreErr</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCompilerRuntimeInfo</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>CCLibConfigHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>PreInclude</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CompilerMisraOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCIncludePath2</name>
+ <state>$PROJ_DIR$\..\src</state>
+ <state>$PROJ_DIR$\..\..\bsp\lpc13uxx\CMSISv2p10_LPC13Uxx\inc</state>
+ <state>$PROJ_DIR$\..\..\bsp\lpc13uxx\LPC13Uxx_DriverLib\inc</state>
+ <state>$PROJ_DIR$\..\..\bsp</state>
+ <state>$PROJ_DIR$\..\..\..\tinyusb</state>
+ </option>
+ <option>
+ <name>CCStdIncCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCCodeSection</name>
+ <state>.text</state>
+ </option>
+ <option>
+ <name>IInterwork2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IProcessorMode2</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CCOptLevel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptStrategy</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptLevelSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules98</name>
+ <version>0</version>
+ <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+ </option>
+ <option>
+ <name>CompilerMisraRules04</name>
+ <version>0</version>
+ <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+ </option>
+ <option>
+ <name>CCPosIndRopi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndRwpi</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCPosIndNoDynInit</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccLang</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccAllowVLA</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCppDialect</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccExceptions</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccRTTI</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccStaticDestr</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccCppInlineSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IccCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IccFloatSemantics</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CCOptimizationNoSizeConstraints</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>AARM</name>
+ <archiveVersion>2</archiveVersion>
+ <data>
+ <version>8</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>AObjPrefix</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AEndian</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>ACaseSensitivity</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacroChars</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnWhat</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AWarnOne</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange1</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AWarnRange2</name>
+ <state></state>
+ </option>
+ <option>
+ <name>ADebug</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AltRegisterNames</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ADefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AList</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AListHeader</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AListing</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>Includes</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacDefs</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MacExps</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>MacExec</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OnlyAssed</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>MultiLine</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLengthCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>PageLength</name>
+ <state>80</state>
+ </option>
+ <option>
+ <name>TabSpacing</name>
+ <state>8</state>
+ </option>
+ <option>
+ <name>AXRef</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDefines</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefInternal</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AXRefDual</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AFpuProcessor</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>AOutputFile</name>
+ <state>$FILE_BNAME$.o</state>
+ </option>
+ <option>
+ <name>AMultibyteSupport</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsCheck</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>ALimitErrorsEdit</name>
+ <state>100</state>
+ </option>
+ <option>
+ <name>AIgnoreStdInclude</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AUserIncludes</name>
+ <state></state>
+ </option>
+ <option>
+ <name>AExtraOptionsCheckV2</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>AExtraOptionsV2</name>
+ <state></state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>OBJCOPY</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>1</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>OOCOutputFormat</name>
+ <version>2</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OCOutputOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>OOCOutputFile</name>
+ <state>device_os_none.srec</state>
+ </option>
+ <option>
+ <name>OOCCommandLineProducer</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>OOCObjCopyEnable</name>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>CUSTOM</name>
+ <archiveVersion>3</archiveVersion>
+ <data>
+ <extensions></extensions>
+ <cmdline></cmdline>
+ </data>
+ </settings>
+ <settings>
+ <name>BICOMP</name>
+ <archiveVersion>0</archiveVersion>
+ <data/>
+ </settings>
+ <settings>
+ <name>BUILDACTION</name>
+ <archiveVersion>1</archiveVersion>
+ <data>
+ <prebuild></prebuild>
+ <postbuild></postbuild>
+ </data>
+ </settings>
+ <settings>
+ <name>ILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>15</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IlinkLibIOConfig</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>XLinkMisraHandler</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkInputFileSlave</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOutputFile</name>
+ <state>device_os_none.out</state>
+ </option>
+ <option>
+ <name>IlinkDebugInfoEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkKeepSymbols</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySymbol</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinarySegment</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkRawBinaryAlign</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkConfigDefines</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkMapFile</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkLogFile</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogInitialization</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogModule</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogSection</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogVeneer</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIcfFile</name>
+ <state>$TOOLKIT_DIR$\config\linker\NXP\lpc1347.icf</state>
+ </option>
+ <option>
+ <name>IlinkIcfFileSlave</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkEnableRemarks</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkSuppressDiags</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsRem</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsWarn</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkTreatAsErr</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkWarningsAreErrors</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkUseExtraOptions</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkExtraOptions</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkLowLevelInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAutoLibEnable</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkAdditionalLibs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkOverrideProgramEntryLabel</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabelSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkProgramEntryLabel</name>
+ <state>__iar_program_start</state>
+ </option>
+ <option>
+ <name>DoFill</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>FillerByte</name>
+ <state>0xFF</state>
+ </option>
+ <option>
+ <name>FillerStart</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>FillerEnd</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>CrcSize</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcAlign</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcPoly</name>
+ <state>0x11021</state>
+ </option>
+ <option>
+ <name>CrcCompl</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcBitOrder</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ <option>
+ <name>CrcInitialValue</name>
+ <state>0x0</state>
+ </option>
+ <option>
+ <name>DoCrc</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkBE8Slave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkBufferedTerminalOutput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkStdoutInterfaceSlave</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcFullSize</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkIElfToolPostProcess</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogAutoLibSelect</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogRedirSymbols</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkLogUnusedFragments</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcReverseByteOrder</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCrcUseAsInput</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptInline</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsAllow</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptExceptionsForce</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkCmsis</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptMergeDuplSections</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkOptUseVfe</name>
+ <state>1</state>
+ </option>
+ <option>
+ <name>IlinkOptForceVfe</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackAnalysisEnable</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IlinkStackControlFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IlinkStackCallGraphFile</name>
+ <state></state>
+ </option>
+ <option>
+ <name>CrcAlgorithm</name>
+ <version>0</version>
+ <state>1</state>
+ </option>
+ <option>
+ <name>CrcUnitSize</name>
+ <version>0</version>
+ <state>0</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>IARCHIVE</name>
+ <archiveVersion>0</archiveVersion>
+ <data>
+ <version>0</version>
+ <wantNonLocal>1</wantNonLocal>
+ <debug>1</debug>
+ <option>
+ <name>IarchiveInputs</name>
+ <state></state>
+ </option>
+ <option>
+ <name>IarchiveOverride</name>
+ <state>0</state>
+ </option>
+ <option>
+ <name>IarchiveOutput</name>
+ <state>###Unitialized###</state>
+ </option>
+ </data>
+ </settings>
+ <settings>
+ <name>BILINK</name>
+ <archiveVersion>0</archiveVersion>
+ <data/>
+ </settings>
+ </configuration>
<group>
<name>app</name>
<file>
@@ -3731,6 +4653,9 @@
<name>$PROJ_DIR$\..\..\bsp\boards\microbuilder\board_lpc4357usb.c</name>
</file>
<file>
+ <name>$PROJ_DIR$\..\..\bsp\boards\lpcxpresso\board_lpcxpresso1347.c</name>
+ </file>
+ <file>
<name>$PROJ_DIR$\..\..\bsp\boards\lpcxpresso\board_lpcxpresso1769.c</name>
</file>
<file>
@@ -3746,8 +4671,10 @@
<group>
<name>lpc11uxx</name>
<excluded>
+ <configuration>Board EA4357</configuration>
<configuration>Board LPCXpresso1769</configuration>
- <configuration>Board rf1ghznode</configuration>
+ <configuration>Board NGX4330</configuration>
+ <configuration>Board LPCXpresso1347</configuration>
</excluded>
<file>
<name>$PROJ_DIR$\..\..\bsp\lpc11uxx\CMSISv2p00_LPC11Uxx\src\core_cm0.c</name>
@@ -3766,10 +4693,33 @@
</file>
</group>
<group>
+ <name>lpc13uxx</name>
+ <excluded>
+ <configuration>Board EA4357</configuration>
+ <configuration>Board LPCXpresso1769</configuration>
+ <configuration>Board NGX4330</configuration>
+ <configuration>Board rf1ghznode</configuration>
+ </excluded>
+ <file>
+ <name>$PROJ_DIR$\..\..\bsp\lpc13uxx\LPC13Uxx_DriverLib\src\gpio.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\bsp\lpc13uxx\startup_iar\startup_lpc13xx.s</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\bsp\lpc13uxx\CMSISv2p10_LPC13Uxx\src\system_LPC13Uxx.c</name>
+ </file>
+ <file>
+ <name>$PROJ_DIR$\..\..\bsp\lpc13uxx\LPC13Uxx_DriverLib\src\uart.c</name>
+ </file>
+ </group>
+ <group>
<name>lpc175x_6x</name>
<excluded>
<configuration>Board EA4357</configuration>
<configuration>Board NGX4330</configuration>
+ <configuration>Board rf1ghznode</configuration>
+ <configuration>Board LPCXpresso1347</configuration>
</excluded>
<file>
<name>$PROJ_DIR$\..\..\bsp\lpc175x_6x\CMSISv2p00_LPC17xx\src\core_cm3.c</name>
@@ -3798,6 +4748,7 @@
<excluded>
<configuration>Board LPCXpresso1769</configuration>
<configuration>Board rf1ghznode</configuration>
+ <configuration>Board LPCXpresso1347</configuration>
</excluded>
<file>
<name>$PROJ_DIR$\..\..\bsp\lpc43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_cgu.c</name>
diff --git a/demos/device/device_os_none/device_os_none.uvopt b/demos/device/device_os_none/device_os_none.uvopt
index 34031745b..26a8c20b9 100644
--- a/demos/device/device_os_none/device_os_none.uvopt
+++ b/demos/device/device_os_none/device_os_none.uvopt
@@ -73,7 +73,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
- <IsCurrentTarget>0</IsCurrentTarget>
+ <IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>8</CpuCode>
<DllOpt>
@@ -119,6 +119,13 @@
<tIfile></tIfile>
<pMon>Segger\JL2CM3.dll</pMon>
</DebugOpt>
+ <TargetDriverDllRegistry>
+ <SetRegEntry>
+ <Number>0</Number>
+ <Key>JL2CM3</Key>
+ <Name>-U268003250 -O78 -S8 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(4) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD10000000 -FC800 -FN2 -FF0LPC18xx43xx_512_BA -FS01A000000 -FL080000 -FF1LPC18xx43xx_512_BB -FS11B000000 -FL180000</Name>
+ </SetRegEntry>
+ </TargetDriverDllRegistry>
<Breakpoint/>
<DebugFlag>
<trace>0</trace>
@@ -623,7 +630,7 @@
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
- <IsCurrentTarget>1</IsCurrentTarget>
+ <IsCurrentTarget>0</IsCurrentTarget>
</OPTFL>
<CpuCode>8</CpuCode>
<Books>
@@ -920,7 +927,7 @@
<Focus>0</Focus>
<ColumnNumber>24</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>60</TopLine>
+ <TopLine>10</TopLine>
<CurrentLine>11</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\src\main.c</PathWithFileName>
@@ -1044,7 +1051,7 @@
<Group>
<GroupName>tinyusb</GroupName>
- <tvExp>1</tvExp>
+ <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -1436,7 +1443,7 @@
<Group>
<GroupName>boards</GroupName>
- <tvExp>1</tvExp>
+ <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@@ -1648,7 +1655,7 @@
<Focus>0</Focus>
<ColumnNumber>19</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>20</TopLine>
+ <TopLine>21</TopLine>
<CurrentLine>23</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\lpc11uxx\LPC11Uxx_DriverLib\lpc11uxx_gpio.c</PathWithFileName>
@@ -1664,7 +1671,7 @@
<Focus>0</Focus>
<ColumnNumber>19</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>11</TopLine>
+ <TopLine>12</TopLine>
<CurrentLine>14</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\lpc11uxx\LPC11Uxx_DriverLib\lpc11uxx_uart.c</PathWithFileName>
@@ -2008,7 +2015,7 @@
<Focus>0</Focus>
<ColumnNumber>30</ColumnNumber>
<tvExpOptDlg>0</tvExpOptDlg>
- <TopLine>146</TopLine>
+ <TopLine>147</TopLine>
<CurrentLine>150</CurrentLine>
<bDave2>0</bDave2>
<PathWithFileName>..\..\bsp\lpc43xx\startup_keil\startup_LPC43xx.s</PathWithFileName>
diff --git a/demos/device/src/tusb_config.h b/demos/device/src/tusb_config.h
index 70200268d..77cc628a9 100644
--- a/demos/device/src/tusb_config.h
+++ b/demos/device/src/tusb_config.h
@@ -114,7 +114,7 @@
#define TUSB_CFG_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
#elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
#define TUSB_CFG_ATTR_USBRAM
- #elif (TUSB_CFG_MCU == MCU_LPC11UXX)
+ #elif (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
#define TUSB_CFG_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"")
#endif
diff --git a/demos/device/src/tusb_descriptors.h b/demos/device/src/tusb_descriptors.h
index adb5fce92..a2cd62a54 100644
--- a/demos/device/src/tusb_descriptors.h
+++ b/demos/device/src/tusb_descriptors.h
@@ -1,193 +1,193 @@
-/**************************************************************************/
-/*!
- @file tusb_descriptors.h
- @author hathach (tinyusb.org)
-
- @section LICENSE
-
- Software License Agreement (BSD License)
-
- Copyright (c) 2013, hathach (tinyusb.org)
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holders nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- This file is part of the tinyusb stack.
-*/
-/**************************************************************************/
-
-#ifndef _TUSB_DESCRIPTORS_H_
-#define _TUSB_DESCRIPTORS_H_
-
-#include "tusb.h"
-
-//--------------------------------------------------------------------+
-// Descriptors Value (calculated by enabled Classes)
-//--------------------------------------------------------------------+
-#define CFG_VENDORID 0x1FC9 // NXP
-//#define CFG_PRODUCTID 0x4567 // use auto product id to prevent conflict with pc's driver
-
-// each combination of interfaces need to have a unique productid, as windows will bind & remember device driver after the first plug.
-#ifndef CFG_PRODUCTID // Auto ProductID layout's Bitmap: (MSB) MassStorage | Generic | Mouse | Key | CDC (LSB)
- #define PRODUCTID_BITMAP(interface, n) ( (TUSB_CFG_DEVICE_##interface) << (n) )
- #define CFG_PRODUCTID (0x4000 | ( PRODUCTID_BITMAP(CDC, 0) | PRODUCTID_BITMAP(HID_KEYBOARD, 1) | \
- PRODUCTID_BITMAP(HID_MOUSE, 2) | PRODUCTID_BITMAP(HID_GENERIC, 3) | \
- PRODUCTID_BITMAP(MSC, 4) ) )
-#endif
-
-
-#define INTERFACE_NUM_CDC 0
-#define INTERFACE_NUM_HID_KEYBOARD (INTERFACE_NUM_CDC + 2*TUSB_CFG_DEVICE_CDC )
-#define INTERFACE_NUM_HID_MOUSE (INTERFACE_NUM_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_KEYBOARD )
-#define INTERFACE_NUM_HID_GENERIC (INTERFACE_NUM_HID_MOUSE + TUSB_CFG_DEVICE_HID_MOUSE )
-#define INTERFACE_NUM_MSC (INTERFACE_NUM_HID_GENERIC + TUSB_CFG_DEVICE_HID_GENERIC )
-
-#define TOTAL_INTEFACES (2*TUSB_CFG_DEVICE_CDC + TUSB_CFG_DEVICE_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_MOUSE + \
- TUSB_CFG_DEVICE_HID_GENERIC + TUSB_CFG_DEVICE_MSC)
-
-// Interface Assosication Descriptor is required when enable CDC
-#define IAD_DESC_REQUIRED ( TUSB_CFG_DEVICE_CDC )
-
-//--------------------------------------------------------------------+
-// Endpoints Address & Max Packet Size
-//--------------------------------------------------------------------+
-#define EDPT_IN(x) (0x80 | (x))
-#define EDPT_OUT(x) (x)
-
-#if TUSB_CFG_MCU == MCU_LPC175X_6X
-//------------- These MCUs's endpoint number has a fixed type -------------//
-//------------- CDC -------------//
-#define CDC_EDPT_NOTIFICATION_ADDR EDPT_IN (1)
-#define CDC_EDPT_NOTIFICATION_PACKETSIZE 64
-
-#define CDC_EDPT_DATA_OUT_ADDR EDPT_OUT(2)
-#define CDC_EDPT_DATA_IN_ADDR EDPT_IN (2)
-#define CDC_EDPT_DATA_PACKETSIZE 64
-
-//------------- HID Keyboard -------------//
-#define HID_KEYBOARD_EDPT_ADDR EDPT_IN (4)
-#define HID_KEYBOARD_EDPT_PACKETSIZE 8
-
-//------------- HID Mouse -------------//
-#define HID_MOUSE_EDPT_ADDR EDPT_IN (7)
-#define HID_MOUSE_EDPT_PACKETSIZE 8
-
-//------------- HID Generic -------------//
-
-//------------- Mass Storage -------------//
-#define MSC_EDPT_OUT_ADDR EDPT_OUT(5)
-#define MSC_EDPT_IN_ADDR EDPT_IN (5)
-#define MSC_EDPT_PACKETSIZE (TUSB_CFG_DEVICE_FULLSPEED ? 64 : 512)
-
-
-#else
-
-//------------- CDC -------------//
-#define CDC_EDPT_NOTIFICATION_ADDR EDPT_IN (INTERFACE_NUM_CDC+1)
-#define CDC_EDPT_NOTIFICATION_PACKETSIZE 64
-
-#define CDC_EDPT_DATA_OUT_ADDR EDPT_OUT(INTERFACE_NUM_CDC+2)
-#define CDC_EDPT_DATA_IN_ADDR EDPT_IN (INTERFACE_NUM_CDC+2)
-#define CDC_EDPT_DATA_PACKETSIZE 64
-
-//------------- HID Keyboard -------------//
-#define HID_KEYBOARD_EDPT_ADDR EDPT_IN (INTERFACE_NUM_HID_KEYBOARD+1)
-#define HID_KEYBOARD_EDPT_PACKETSIZE 8
-
-//------------- HID Mouse -------------//
-#define HID_MOUSE_EDPT_ADDR EDPT_IN (INTERFACE_NUM_HID_MOUSE+1)
-#define HID_MOUSE_EDPT_PACKETSIZE 8
-
-//------------- HID Generic -------------//
-
-//------------- Mass Storage -------------//
-#define MSC_EDPT_OUT_ADDR EDPT_OUT(INTERFACE_NUM_MSC+1)
-#define MSC_EDPT_IN_ADDR EDPT_IN (INTERFACE_NUM_MSC+1)
-#define MSC_EDPT_PACKETSIZE (TUSB_CFG_DEVICE_FULLSPEED ? 64 : 512)
-
-#endif
-
-//--------------------------------------------------------------------+
-// CONFIGURATION DESCRIPTOR
-//--------------------------------------------------------------------+
-typedef ATTR_PACKED_STRUCT(struct)
-{
- tusb_descriptor_configuration_t configuration;
-
- //------------- CDC -------------//
-#if TUSB_CFG_DEVICE_CDC
- #if IAD_DESC_REQUIRED
- tusb_descriptor_interface_association_t cdc_iad;
- #endif
-
- //CDC Control Interface
- tusb_descriptor_interface_t cdc_comm_interface;
- cdc_desc_func_header_t cdc_header;
- cdc_desc_func_abstract_control_management_t cdc_acm;
- cdc_desc_func_union_t cdc_union;
- tusb_descriptor_endpoint_t cdc_endpoint_notification;
-
- //CDC Data Interface
- tusb_descriptor_interface_t cdc_data_interface;
- tusb_descriptor_endpoint_t cdc_endpoint_out;
- tusb_descriptor_endpoint_t cdc_endpoint_in;
-#endif
-
- //------------- HID Keyboard -------------//
-#if TUSB_CFG_DEVICE_HID_KEYBOARD
- tusb_descriptor_interface_t keyboard_interface;
- tusb_hid_descriptor_hid_t keyboard_hid;
- tusb_descriptor_endpoint_t keyboard_endpoint;
-#endif
-
-//------------- HID Mouse -------------//
-#if TUSB_CFG_DEVICE_HID_MOUSE
- tusb_descriptor_interface_t mouse_interface;
- tusb_hid_descriptor_hid_t mouse_hid;
- tusb_descriptor_endpoint_t mouse_endpoint;
-#endif
-
-//------------- Mass Storage -------------//
-#if TUSB_CFG_DEVICE_MSC
- tusb_descriptor_interface_t msc_interface;
- tusb_descriptor_endpoint_t msc_endpoint_in;
- tusb_descriptor_endpoint_t msc_endpoint_out;
-#endif
-
-} app_descriptor_configuration_t;
-
-//--------------------------------------------------------------------+
-// STRINGS DESCRIPTOR
-//--------------------------------------------------------------------+
-extern uint8_t * const desc_str_table[TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT];
-
-//--------------------------------------------------------------------+
-// Export descriptors
-//--------------------------------------------------------------------+
-extern tusb_descriptor_device_t app_tusb_desc_device;
-extern app_descriptor_configuration_t app_tusb_desc_configuration;
-
-extern uint8_t app_tusb_keyboard_desc_report[];
-extern uint8_t app_tusb_mouse_desc_report[];
-
-#endif
+/**************************************************************************/
+/*!
+ @file tusb_descriptors.h
+ @author hathach (tinyusb.org)
+
+ @section LICENSE
+
+ Software License Agreement (BSD License)
+
+ Copyright (c) 2013, hathach (tinyusb.org)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holders nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This file is part of the tinyusb stack.
+*/
+/**************************************************************************/
+
+#ifndef _TUSB_DESCRIPTORS_H_
+#define _TUSB_DESCRIPTORS_H_
+
+#include "tusb.h"
+
+//--------------------------------------------------------------------+
+// Descriptors Value (calculated by enabled Classes)
+//--------------------------------------------------------------------+
+#define CFG_VENDORID 0x1FC9 // NXP
+//#define CFG_PRODUCTID 0x4567 // use auto product id to prevent conflict with pc's driver
+
+// each combination of interfaces need to have a unique productid, as windows will bind & remember device driver after the first plug.
+#ifndef CFG_PRODUCTID // Auto ProductID layout's Bitmap: (MSB) MassStorage | Generic | Mouse | Key | CDC (LSB)
+ #define PRODUCTID_BITMAP(interface, n) ( (TUSB_CFG_DEVICE_##interface) << (n) )
+ #define CFG_PRODUCTID (0x4000 | ( PRODUCTID_BITMAP(CDC, 0) | PRODUCTID_BITMAP(HID_KEYBOARD, 1) | \
+ PRODUCTID_BITMAP(HID_MOUSE, 2) | PRODUCTID_BITMAP(HID_GENERIC, 3) | \
+ PRODUCTID_BITMAP(MSC, 4) ) )
+#endif
+
+
+#define INTERFACE_NUM_CDC 0
+#define INTERFACE_NUM_HID_KEYBOARD (INTERFACE_NUM_CDC + 2*TUSB_CFG_DEVICE_CDC )
+#define INTERFACE_NUM_HID_MOUSE (INTERFACE_NUM_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_KEYBOARD )
+#define INTERFACE_NUM_HID_GENERIC (INTERFACE_NUM_HID_MOUSE + TUSB_CFG_DEVICE_HID_MOUSE )
+#define INTERFACE_NUM_MSC (INTERFACE_NUM_HID_GENERIC + TUSB_CFG_DEVICE_HID_GENERIC )
+
+#define TOTAL_INTEFACES (2*TUSB_CFG_DEVICE_CDC + TUSB_CFG_DEVICE_HID_KEYBOARD + TUSB_CFG_DEVICE_HID_MOUSE + \
+ TUSB_CFG_DEVICE_HID_GENERIC + TUSB_CFG_DEVICE_MSC)
+
+// Interface Assosication Descriptor is required when enable CDC
+#define IAD_DESC_REQUIRED ( TUSB_CFG_DEVICE_CDC )
+
+//--------------------------------------------------------------------+
+// Endpoints Address & Max Packet Size
+//--------------------------------------------------------------------+
+#define EDPT_IN(x) (0x80 | (x))
+#define EDPT_OUT(x) (x)
+
+#if TUSB_CFG_MCU == MCU_LPC175X_6X
+//------------- These MCUs's endpoint number has a fixed type -------------//
+//------------- CDC -------------//
+#define CDC_EDPT_NOTIFICATION_ADDR EDPT_IN (1)
+#define CDC_EDPT_NOTIFICATION_PACKETSIZE 64
+
+#define CDC_EDPT_DATA_OUT_ADDR EDPT_OUT(2)
+#define CDC_EDPT_DATA_IN_ADDR EDPT_IN (2)
+#define CDC_EDPT_DATA_PACKETSIZE 64
+
+//------------- HID Keyboard -------------//
+#define HID_KEYBOARD_EDPT_ADDR EDPT_IN (4)
+#define HID_KEYBOARD_EDPT_PACKETSIZE 8
+
+//------------- HID Mouse -------------//
+#define HID_MOUSE_EDPT_ADDR EDPT_IN (7)
+#define HID_MOUSE_EDPT_PACKETSIZE 8
+
+//------------- HID Generic -------------//
+
+//------------- Mass Storage -------------//
+#define MSC_EDPT_OUT_ADDR EDPT_OUT(5)
+#define MSC_EDPT_IN_ADDR EDPT_IN (5)
+#define MSC_EDPT_PACKETSIZE (TUSB_CFG_DEVICE_FULLSPEED ? 64 : 512)
+
+
+#else
+
+//------------- CDC -------------//
+#define CDC_EDPT_NOTIFICATION_ADDR EDPT_IN (INTERFACE_NUM_CDC+1)
+#define CDC_EDPT_NOTIFICATION_PACKETSIZE 64
+
+#define CDC_EDPT_DATA_OUT_ADDR EDPT_OUT(INTERFACE_NUM_CDC+2)
+#define CDC_EDPT_DATA_IN_ADDR EDPT_IN (INTERFACE_NUM_CDC+2)
+#define CDC_EDPT_DATA_PACKETSIZE 64
+
+//------------- HID Keyboard -------------//
+#define HID_KEYBOARD_EDPT_ADDR EDPT_IN (INTERFACE_NUM_HID_KEYBOARD+1)
+#define HID_KEYBOARD_EDPT_PACKETSIZE 8
+
+//------------- HID Mouse -------------//
+#define HID_MOUSE_EDPT_ADDR EDPT_IN (INTERFACE_NUM_HID_MOUSE+1)
+#define HID_MOUSE_EDPT_PACKETSIZE 8
+
+//------------- HID Generic -------------//
+
+//------------- Mass Storage -------------//
+#define MSC_EDPT_OUT_ADDR EDPT_OUT(INTERFACE_NUM_MSC+1)
+#define MSC_EDPT_IN_ADDR EDPT_IN (INTERFACE_NUM_MSC+1)
+#define MSC_EDPT_PACKETSIZE (TUSB_CFG_DEVICE_FULLSPEED ? 64 : 512)
+
+#endif
+
+//--------------------------------------------------------------------+
+// CONFIGURATION DESCRIPTOR
+//--------------------------------------------------------------------+
+typedef ATTR_PACKED_STRUCT(struct)
+{
+ tusb_descriptor_configuration_t configuration;
+
+ //------------- CDC -------------//
+#if TUSB_CFG_DEVICE_CDC
+ #if IAD_DESC_REQUIRED
+ tusb_descriptor_interface_association_t cdc_iad;
+ #endif
+
+ //CDC Control Interface
+ tusb_descriptor_interface_t cdc_comm_interface;
+ cdc_desc_func_header_t cdc_header;
+ cdc_desc_func_abstract_control_management_t cdc_acm;
+ cdc_desc_func_union_t cdc_union;
+ tusb_descriptor_endpoint_t cdc_endpoint_notification;
+
+ //CDC Data Interface
+ tusb_descriptor_interface_t cdc_data_interface;
+ tusb_descriptor_endpoint_t cdc_endpoint_out;
+ tusb_descriptor_endpoint_t cdc_endpoint_in;
+#endif
+
+ //------------- HID Keyboard -------------//
+#if TUSB_CFG_DEVICE_HID_KEYBOARD
+ tusb_descriptor_interface_t keyboard_interface;
+ tusb_hid_descriptor_hid_t keyboard_hid;
+ tusb_descriptor_endpoint_t keyboard_endpoint;
+#endif
+
+//------------- HID Mouse -------------//
+#if TUSB_CFG_DEVICE_HID_MOUSE
+ tusb_descriptor_interface_t mouse_interface;
+ tusb_hid_descriptor_hid_t mouse_hid;
+ tusb_descriptor_endpoint_t mouse_endpoint;
+#endif
+
+//------------- Mass Storage -------------//
+#if TUSB_CFG_DEVICE_MSC
+ tusb_descriptor_interface_t msc_interface;
+ tusb_descriptor_endpoint_t msc_endpoint_in;
+ tusb_descriptor_endpoint_t msc_endpoint_out;
+#endif
+
+} app_descriptor_configuration_t;
+
+//--------------------------------------------------------------------+
+// STRINGS DESCRIPTOR
+//--------------------------------------------------------------------+
+extern uint8_t * const desc_str_table[TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT];
+
+//--------------------------------------------------------------------+
+// Export descriptors
+//--------------------------------------------------------------------+
+extern tusb_descriptor_device_t app_tusb_desc_device;
+extern app_descriptor_configuration_t app_tusb_desc_configuration;
+
+extern uint8_t app_tusb_keyboard_desc_report[];
+extern uint8_t app_tusb_mouse_desc_report[];
+
+#endif