able to build with lpc43xx demo

This commit is contained in:
hathach
2012-12-04 14:12:48 +07:00
parent 8f00307986
commit 82820a2066
14 changed files with 887 additions and 17 deletions
+2 -1
View File
@@ -51,8 +51,9 @@
#ifndef _TUSB_ARCH_H_
#define _TUSB_ARCH_H_
#define ARCH_LPC134X
//#define ARCH_LPC134X
//#define ARCH_LPC11XX
#define ARCH_LPC43XX
#define ENDIAN_LITTLE ///< MCU Endian
#define ALIGNMENT (4) ///< MCU Alignment
-2
View File
@@ -54,8 +54,6 @@
#include "arm_mx.h"
#include "LPC13Uxx.h"
#include "system_LPC13Uxx.h"
#endif /* _TUSB_ARCH_LPC134_X_H_ */
+2
View File
@@ -53,6 +53,8 @@
//#define ARM_M0
#include "arm_mx.h"
#include "LPC43xx.h"
#include "lpc43xx_cgu.h"
#endif /* _TUSB_ARCH_LPC43XX_H_ */
-75
View File
@@ -1,75 +0,0 @@
/*
* hal.h
*
* Created on: Dec 2, 2012
* Author: hathach
*/
/*
* Software License Agreement (BSD License)
* Copyright (c) 2012, hathach (tinyusb.net)
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 tiny usb stack.
*/
/** \file
* \brief TBD
*
* \note TBD
*/
/**
* \defgroup Group_HAL Hardware Abtract Layer
* \brief Hardware dependent layer
*
* @{
*/
#ifndef _TUSB_HAL_H_
#define _TUSB_HAL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "common/errors.h"
/** \brief USB hardware init
*
* \param[in] para1
* \param[out] para2
* \return Error Code of the \ref TUSB_ERROR enum
* \note
*/
TUSB_Error_t hal_init();
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_HAL_H_ */
/** @} */
-58
View File
@@ -1,58 +0,0 @@
/*
* hal_lpc134x.c
*
* Created on: Dec 2, 2012
* Author: hathach
*/
/*
* Software License Agreement (BSD License)
* Copyright (c) 2012, hathach (tinyusb.net)
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 tiny usb stack.
*/
#include "common/common.h"
#ifdef ARCH_LPC134X
TUSB_Error_t hal_init()
{
// TODO usb abstract later
/* Enable AHB clock to the USB block and USB RAM. */
LPC_SYSCON->SYSAHBCLKCTRL |= ((0x1<<14) | (0x1<<27));
/* Pull-down is needed, or internally, VBUS will be floating. This is to
address the wrong status in VBUSDebouncing bit in CmdStatus register. */
LPC_IOCON->PIO0_3 &= ~0x1F;
LPC_IOCON->PIO0_3 |= (0x01<<0); /* Secondary function VBUS */
LPC_IOCON->PIO0_6 &= ~0x07;
LPC_IOCON->PIO0_6 |= (0x01<<0); /* Secondary function SoftConn */
return tERROR_NONE;
}
#endif
+1 -1
View File
@@ -63,7 +63,7 @@
#include "tusb_cfg.h"
#include "arch/arch.h"
#include "arch/hal.h"
#include "hal/hal.h"
#include "compiler/compiler.h"
#include "errors.h"
#include "core/tusb_types.h"