From 3b9a616ca926172f299eb93eab0269bcea26d105 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 31 May 2013 13:57:57 +0700 Subject: change at86rf to 1ghznode rom device runs ok with lpc11uxx --- demos/bsp/boards/board.h | 6 +- demos/bsp/boards/microbuilder/board_at86rf2xx.c | 83 - demos/bsp/boards/microbuilder/board_at86rf2xx.h | 78 - demos/bsp/boards/microbuilder/board_rf1ghznode.c | 88 + demos/bsp/boards/microbuilder/board_rf1ghznode.h | 76 + demos/device/keyboard/.cproject | 2354 ++++++---------------- demos/device/keyboard/main.c | 7 +- demos/device/keyboard/tusb_config.h | 2 +- demos/device/keyboard/tusb_descriptors.c | 4 +- tinyusb/class/hid_device.c | 4 +- tinyusb/device/dcd_lpc11uxx_lpc13xx.h | 64 + tinyusb/device/dcd_lpc13xx.h | 63 - tinyusb/device/dcd_nxp_romdriver.h | 4 +- tinyusb/hal/hal.h | 2 +- tinyusb/hal/hal_lpc11uxx.c | 5 + tinyusb/hal/hal_lpc11uxx.h | 3 - tinyusb/hal/hal_lpc13uxx.c | 4 +- 17 files changed, 862 insertions(+), 1985 deletions(-) delete mode 100644 demos/bsp/boards/microbuilder/board_at86rf2xx.c delete mode 100644 demos/bsp/boards/microbuilder/board_at86rf2xx.h create mode 100644 demos/bsp/boards/microbuilder/board_rf1ghznode.c create mode 100644 demos/bsp/boards/microbuilder/board_rf1ghznode.h create mode 100644 tinyusb/device/dcd_lpc11uxx_lpc13xx.h delete mode 100644 tinyusb/device/dcd_lpc13xx.h diff --git a/demos/bsp/boards/board.h b/demos/bsp/boards/board.h index 1fc15b249..318842357 100644 --- a/demos/bsp/boards/board.h +++ b/demos/bsp/boards/board.h @@ -62,7 +62,7 @@ //--------------------------------------------------------------------+ // BOARD DEFINE //--------------------------------------------------------------------+ -#define BOARD_AT86RF2XX 1 +#define BOARD_RF1GHZNODE 1 #define BOARD_LPCXPRESSO1347 2 #define BOARD_NGX4330 3 @@ -86,8 +86,8 @@ #include "ngx/board_ngx4330.h" #elif BOARD == BOARD_LPCXPRESSO1347 #include "lpcxpresso/board_lpcxpresso1347.h" -#elif BOARD == BOARD_AT86RF2XX - #include "board_at86rf2xx.h" +#elif BOARD == BOARD_RF1GHZNODE + #include "microbuilder/board_rf1ghznode.h" #elif BOARD == BOARD_EA4357 #include "embedded_artists/board_ea4357.h" #elif BOARD == BOARD_MCB4300 diff --git a/demos/bsp/boards/microbuilder/board_at86rf2xx.c b/demos/bsp/boards/microbuilder/board_at86rf2xx.c deleted file mode 100644 index 347dc9dc2..000000000 --- a/demos/bsp/boards/microbuilder/board_at86rf2xx.c +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************/ -/*! - @file board_at86rf2xx.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_AT86RF2XX - -void board_init(void) -{ - SystemInit(); - SysTick_Config(SystemCoreClock / CFG_TICKS_PER_SECOND); // 1 msec tick timer - GPIOInit(); - - GPIOSetDir(CFG_LED_PORT, CFG_LED_PIN, 1); - board_leds(0x01, 0); // turn off the led first - -#if CFG_UART_ENABLE - UARTInit(CFG_UART_BAUDRATE); -#endif -} - -//--------------------------------------------------------------------+ -// LEDS -//--------------------------------------------------------------------+ -void board_leds(uint32_t mask, uint32_t state) -{ - if (mask) - GPIOSetBitValue(CFG_LED_PORT, CFG_LED_PIN, mask & state ? CFG_LED_ON : CFG_LED_OFF); -} - -//--------------------------------------------------------------------+ -// UART -//--------------------------------------------------------------------+ -#if CFG_UART_ENABLE -uint32_t board_uart_send(uint8_t *buffer, uint32_t length) -{ - UARTSend(buffer, length); - return length; -} - -uint32_t board_uart_recv(uint8_t *buffer, uint32_t length) -{ -// *buffer = get_key(); TODO cannot find available code for uart getchar - return 0; -} -#endif - -#endif diff --git a/demos/bsp/boards/microbuilder/board_at86rf2xx.h b/demos/bsp/boards/microbuilder/board_at86rf2xx.h deleted file mode 100644 index 30259fa30..000000000 --- a/demos/bsp/boards/microbuilder/board_at86rf2xx.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************/ -/*! - @file board_at86rf2xx.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. -*/ -/**************************************************************************/ - -/** \file - * \brief TBD - * - * \note TBD - */ - -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - -#ifndef _TUSB_BOARD_AT86RF2XX_H_ -#define _TUSB_BOARD_AT86RF2XX_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#include "LPC11Uxx.h" -#include "lpc11uxx/gpio.h" -#include "lpc11uxx/uart.h" - -#define CFG_PRINTF_TARGET PRINTF_TARGET_UART - -#define CFG_LED_PORT (1) -#define CFG_LED_PIN (31) -#define CFG_LED_ON (0) -#define CFG_LED_OFF (1) - -#define CFG_PRINTF_TARGET PRINTF_TARGET_UART - -#ifdef __cplusplus - } -#endif - -#endif /* _TUSB_BOARD_AT86RF2XX_H_ */ - -/** @} */ diff --git a/demos/bsp/boards/microbuilder/board_rf1ghznode.c b/demos/bsp/boards/microbuilder/board_rf1ghznode.c new file mode 100644 index 000000000..d84ec962d --- /dev/null +++ b/demos/bsp/boards/microbuilder/board_rf1ghznode.c @@ -0,0 +1,88 @@ +/**************************************************************************/ +/*! + @file board_rf1ghznode.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_RF1GHZNODE + +void board_init(void) +{ + SystemInit(); + SysTick_Config(SystemCoreClock / CFG_TICKS_PER_SECOND); // 1 msec tick timer + GPIOInit(); + + GPIOSetDir(CFG_LED_PORT, CFG_LED_PIN, 1); + board_leds(0x01, 0); // turn off the led first + +#if CFG_UART_ENABLE + UARTInit(CFG_UART_BAUDRATE); +#endif +} + +//--------------------------------------------------------------------+ +// LEDS +//--------------------------------------------------------------------+ +void board_leds(uint32_t on_mask, uint32_t off_mask) +{ + if (on_mask & BIT_(0)) + { + GPIOSetBitValue(CFG_LED_PORT, CFG_LED_PIN, CFG_LED_ON); + }else if (off_mask & BIT_(0)) + { + GPIOSetBitValue(CFG_LED_PORT, CFG_LED_PIN, CFG_LED_OFF); + } +} + +//--------------------------------------------------------------------+ +// UART +//--------------------------------------------------------------------+ +#if CFG_UART_ENABLE +uint32_t board_uart_send(uint8_t *buffer, uint32_t length) +{ + UARTSend(buffer, length); + return length; +} + +uint32_t board_uart_recv(uint8_t *buffer, uint32_t length) +{ +// *buffer = get_key(); TODO cannot find available code for uart getchar + return 0; +} +#endif + +#endif diff --git a/demos/bsp/boards/microbuilder/board_rf1ghznode.h b/demos/bsp/boards/microbuilder/board_rf1ghznode.h new file mode 100644 index 000000000..1f8d15fd7 --- /dev/null +++ b/demos/bsp/boards/microbuilder/board_rf1ghznode.h @@ -0,0 +1,76 @@ +/**************************************************************************/ +/*! + @file board_rf1ghznode.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. +*/ +/**************************************************************************/ + +/** \file + * \brief TBD + * + * \note TBD + */ + +/** \ingroup TBD + * \defgroup TBD + * \brief TBD + * + * @{ + */ + +#ifndef _TUSB_BOARD_RF1GHZNODE_H_ +#define _TUSB_BOARD_RF1GHZNODE_H_ + +#ifdef __cplusplus + extern "C" { +#endif + +#include "LPC11Uxx.h" +#include "lpc11uxx/gpio.h" +#include "lpc11uxx/uart.h" + +#define CFG_PRINTF_TARGET PRINTF_TARGET_DEBUG_CONSOLE + +#define CFG_LED_PORT (1) +#define CFG_LED_PIN (31) +#define CFG_LED_ON (0) +#define CFG_LED_OFF (1) + +#ifdef __cplusplus + } +#endif + +#endif /* _TUSB_BOARD_RF1GHZNODE_H_ */ + +/** @} */ diff --git a/demos/device/keyboard/.cproject b/demos/device/keyboard/.cproject index 71034c4cd..b97fad98c 100644 --- a/demos/device/keyboard/.cproject +++ b/demos/device/keyboard/.cproject @@ -58,6 +58,7 @@