diff options
| author | hathach <[email protected]> | 2013-06-04 10:43:58 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-06-04 10:43:58 +0700 |
| commit | cdc830782f3795cd841cd5d95fecfcad2ce06f21 (patch) | |
| tree | e212e6fca2be378b30545afbfb3654eb1c242c1e /tinyusb | |
| parent | a3ed66344d893c2c3ba4be2319af93448d4acb9f (diff) | |
rename tusb_device_is_configured
remove dcd_lpc18xx_lpc43xx.h and dcd_lpc11uxx_lpc13xx move define to hal
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/device/dcd_lpc11uxx_lpc13xx.h | 64 | ||||
| -rw-r--r-- | tinyusb/device/dcd_lpc18xx_lpc43xx.h | 62 | ||||
| -rw-r--r-- | tinyusb/device/dcd_nxp_romdriver.c | 13 | ||||
| -rw-r--r-- | tinyusb/device/dcd_nxp_romdriver.h | 2 | ||||
| -rw-r--r-- | tinyusb/hal/hal_lpc11uxx.h | 3 | ||||
| -rw-r--r-- | tinyusb/hal/hal_lpc13uxx.h | 3 | ||||
| -rw-r--r-- | tinyusb/hal/hal_lpc43xx.h | 3 |
7 files changed, 14 insertions, 136 deletions
diff --git a/tinyusb/device/dcd_lpc11uxx_lpc13xx.h b/tinyusb/device/dcd_lpc11uxx_lpc13xx.h deleted file mode 100644 index aac9cf58f..000000000 --- a/tinyusb/device/dcd_lpc11uxx_lpc13xx.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************/ -/*! - @file dcd_lpc11uxx_lpc13xx.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. -*/ -/**************************************************************************/ - -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - -#ifndef _TUSB_DCD_LPC11UXX_LPC13XX_H_ -#define _TUSB_DCD_LPC11UXX_LPC13XX_H_ - -#define NXP_ROMDRIVER_REG_BASE LPC_USB_BASE -#define NXP_ROMDRIVER_FUNCTION_ADDR 0x1FFF1FF8 - -#ifdef __cplusplus - extern "C" { -#endif - - - -#ifdef __cplusplus - } -#endif - -#endif /* _TUSB_DCD_LPC11UXX_LPC13XX_H_ */ - -/** @} */ diff --git a/tinyusb/device/dcd_lpc18xx_lpc43xx.h b/tinyusb/device/dcd_lpc18xx_lpc43xx.h deleted file mode 100644 index e7bdfad7c..000000000 --- a/tinyusb/device/dcd_lpc18xx_lpc43xx.h +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************/ -/*! - @file dcd_lpc18xx_lpc43xx.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. -*/ -/**************************************************************************/ - -/** \ingroup TBD - * \defgroup TBD - * \brief TBD - * - * @{ - */ - -#ifndef _TUSB_DCD_LPC18XX_LPC43XX_H_ -#define _TUSB_DCD_LPC18XX_LPC43XX_H_ - -#ifdef __cplusplus - extern "C" { -#endif - -#define NXP_ROMDRIVER_REG_BASE LPC_USB0_BASE // TODO USB1 -#define NXP_ROMDRIVER_FUNCTION_ADDR 0x1040011C - -#ifdef __cplusplus - } -#endif - -#endif /* _TUSB_DCD_LPC18XX_LPC43XX_H_ */ - -/** @} */ diff --git a/tinyusb/device/dcd_nxp_romdriver.c b/tinyusb/device/dcd_nxp_romdriver.c index fb3084953..c0fcd64c0 100644 --- a/tinyusb/device/dcd_nxp_romdriver.c +++ b/tinyusb/device/dcd_nxp_romdriver.c @@ -112,15 +112,12 @@ ErrorCode_t USB_Error_Event (USBD_HANDLE_T hUsb, uint32_t param1) tusb_error_t dcd_init(void) { - uint32_t membase = (uint32_t) usb_RomDriver_buffer; - uint32_t memsize = USB_ROM_SIZE; - USBD_API_INIT_PARAM_T usb_param = { .usb_reg_base = NXP_ROMDRIVER_REG_BASE, .max_num_ep = USB_MAX_EP_NUM, - .mem_base = membase, - .mem_size = memsize, + .mem_base = (uint32_t) usb_RomDriver_buffer, + .mem_size = USB_ROM_SIZE, .USB_Configure_Event = USB_Configure_Event, .USB_Reset_Event = USB_Reset_Event, @@ -141,13 +138,13 @@ tusb_error_t dcd_init(void) ASSERT_INT(LPC_OK, ROM_API->hw->Init(&romdriver_hdl, &desc_core, &usb_param), TUSB_ERROR_FAILED); // TODO need to confirm the mem_size is reduced by the number of byte used - membase += (memsize - usb_param.mem_size); - memsize = usb_param.mem_size; +// membase += (memsize - usb_param.mem_size); +// memsize = usb_param.mem_size; return TUSB_ERROR_NONE; } -bool usb_isConfigured(void) +bool tusb_device_is_configured(void) { return usbd_info.state == TUSB_DEVICE_STATE_CONFIGURED; } diff --git a/tinyusb/device/dcd_nxp_romdriver.h b/tinyusb/device/dcd_nxp_romdriver.h index e33c45186..f6f12686a 100644 --- a/tinyusb/device/dcd_nxp_romdriver.h +++ b/tinyusb/device/dcd_nxp_romdriver.h @@ -56,11 +56,9 @@ #define USB_MAX_IF_NUM 8 // maximum interface number supported, should be fixed to 8 #if (MCU == MCU_LPC18XX) || (MCU == MCU_LPC43XX) - #include "dcd_lpc18xx_lpc43xx.h" #define ROM_API ( * ((USBD_API_T**) NXP_ROMDRIVER_FUNCTION_ADDR) ) #define USB_MAX_EP_NUM 6 #elif (MCU == MCU_LPC13UXX) || (MCU == MCU_LPC11UXX) - #include "dcd_lpc11uxx_lpc13xx.h" #define ROM_API ( * (*((USBD_API_T***) NXP_ROMDRIVER_FUNCTION_ADDR)) ) #define USB_MAX_EP_NUM 5 #else diff --git a/tinyusb/hal/hal_lpc11uxx.h b/tinyusb/hal/hal_lpc11uxx.h index 77d03e3fb..e4841af3c 100644 --- a/tinyusb/hal/hal_lpc11uxx.h +++ b/tinyusb/hal/hal_lpc11uxx.h @@ -54,6 +54,9 @@ #include "LPC11Uxx.h" +#define NXP_ROMDRIVER_REG_BASE LPC_USB_BASE +#define NXP_ROMDRIVER_FUNCTION_ADDR 0x1FFF1FF8 + #ifdef __cplusplus extern "C" { #endif diff --git a/tinyusb/hal/hal_lpc13uxx.h b/tinyusb/hal/hal_lpc13uxx.h index 259f9de11..86d8d87a7 100644 --- a/tinyusb/hal/hal_lpc13uxx.h +++ b/tinyusb/hal/hal_lpc13uxx.h @@ -54,6 +54,9 @@ #include "LPC13Uxx.h" +#define NXP_ROMDRIVER_REG_BASE LPC_USB_BASE +#define NXP_ROMDRIVER_FUNCTION_ADDR 0x1FFF1FF8 + #ifdef __cplusplus extern "C" { #endif diff --git a/tinyusb/hal/hal_lpc43xx.h b/tinyusb/hal/hal_lpc43xx.h index 77a0332de..5cb2bbbbe 100644 --- a/tinyusb/hal/hal_lpc43xx.h +++ b/tinyusb/hal/hal_lpc43xx.h @@ -54,6 +54,9 @@ #include "LPC43xx.h" +#define NXP_ROMDRIVER_REG_BASE LPC_USB0_BASE // TODO USB1 +#define NXP_ROMDRIVER_FUNCTION_ADDR 0x1040011C + #ifdef __cplusplus extern "C" { #endif |
