Просмотр исходного кода

add lpc17xx build config for host demo

hathach 12 лет назад
Родитель
Сommit
b35d2c8f43

+ 2 - 1
demos/bsp/boards/board.h

@@ -118,9 +118,10 @@
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // Init board peripherals : Clock, UART, LEDs, Buttons
 // Init board peripherals : Clock, UART, LEDs, Buttons
 void board_init(void);
 void board_init(void);
+
 void board_leds(uint32_t on_mask, uint32_t off_mask);
 void board_leds(uint32_t on_mask, uint32_t off_mask);
+
 uint32_t board_uart_send(uint8_t *buffer, uint32_t length);
 uint32_t board_uart_send(uint8_t *buffer, uint32_t length);
-uint32_t board_uart_recv(uint8_t *buffer, uint32_t length);
 uint8_t  board_uart_getchar(void);
 uint8_t  board_uart_getchar(void);
 
 
 extern volatile uint32_t system_ticks;
 extern volatile uint32_t system_ticks;

+ 6 - 0
demos/bsp/boards/embedded_artists/ea4357/emac.c

@@ -15,6 +15,10 @@
  *****                                                        *****
  *****                                                        *****
  ******************************************************************/
  ******************************************************************/
 
 
+#include "../../board.h"
+
+#if BOARD == BOARD_EA4357
+
 #include "EMAC.h"
 #include "EMAC.h"
 //#include "tcpip.h"
 //#include "tcpip.h"
 #include "lpc43xx.h"
 #include "lpc43xx.h"
@@ -472,3 +476,5 @@ void CopyToFrame_EMAC(void *Source, unsigned int Size)
     TxDescIndex = 0;
     TxDescIndex = 0;
 }
 }
 
 
+#endif
+

+ 5 - 2
demos/bsp/boards/embedded_artists/ea4357/nand.c

@@ -20,6 +20,9 @@
 /******************************************************************************
 /******************************************************************************
  * Includes
  * Includes
  *****************************************************************************/
  *****************************************************************************/
+#include "../../board.h"
+
+#if BOARD == BOARD_EA4357
 
 
 #include "lpc_types.h"
 #include "lpc_types.h"
 #include "lpc43xx_scu.h"
 #include "lpc43xx_scu.h"
@@ -383,7 +386,7 @@ uint32_t nand_isBlockValid(uint32_t block)
  *
  *
  * Params:
  * Params:
  *    block - block number to read from
  *    block - block number to read from
- *    page  - page withín block to read from
+ *    page  - page with�n block to read from
  *    pageBuf - data is copied to this buffer. The size must be at least 
  *    pageBuf - data is copied to this buffer. The size must be at least 
  *              pageSize.
  *              pageSize.
  *
  *
@@ -540,4 +543,4 @@ uint32_t nand_eraseBlock(uint32_t block)
   return ((nandStatus() & 0x01) != 0x01); 
   return ((nandStatus() & 0x01) != 0x01); 
 }
 }
 
 
-
+#endif

+ 5 - 0
demos/bsp/boards/embedded_artists/ea4357/sdram.c

@@ -21,6 +21,9 @@
 /******************************************************************************
 /******************************************************************************
  * Includes
  * Includes
  *****************************************************************************/
  *****************************************************************************/
+#include "../../board.h"
+
+#if BOARD == BOARD_EA4357
 
 
 #include "lpc43xx.h"
 #include "lpc43xx.h"
 #include "lpc_types.h"
 #include "lpc_types.h"
@@ -265,3 +268,5 @@ uint32_t sdram_test( void )
   }
   }
   return 0x1;
   return 0x1;
 }
 }
+
+#endif

+ 3 - 2
demos/bsp/boards/lpcxpresso/board_lpcxpresso1769.c

@@ -107,10 +107,11 @@ uint32_t board_uart_send(uint8_t *buffer, uint32_t length)
   return UART_Send(BOARD_UART_PORT, buffer, length, BLOCKING);
   return UART_Send(BOARD_UART_PORT, buffer, length, BLOCKING);
 }
 }
 
 
-uint32_t board_uart_recv(uint8_t *buffer, uint32_t length)
+uint8_t  board_uart_getchar(void)
 {
 {
-  return UART_Receive(BOARD_UART_PORT, buffer, length, BLOCKING);
+  return UART_ReceiveByte(BOARD_UART_PORT);
 }
 }
+
 #endif
 #endif
 
 
 #endif
 #endif

+ 0 - 76
demos/bsp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_libcfg_default.c

@@ -1,76 +0,0 @@
-/**********************************************************************
-* $Id$      lpc17xx_libcfg_default.c                2010-05-21
-*//**
-* @file     lpc17xx_libcfg_default.c
-* @brief    Library configuration source file (default), used to build
-*           library without examples
-* @version  2.0
-* @date     21. May. 2010
-* @author   NXP MCU SW Application Team
-*
-* Copyright(C) 2010, NXP Semiconductor
-* 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.
-* 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.
-* Permission to use, copy, modify, and distribute this software and its
-* documentation is hereby granted, under NXP Semiconductors'
-* relevant copyright in the software, without fee, provided that it
-* is used in conjunction with NXP Semiconductors microcontrollers.  This
-* copyright, permission, and disclaimer notice must appear in all copies of
-* this code.
-**********************************************************************/
-
-/* Library group ----------------------------------------------------------- */
-/** @addtogroup LIBCFG_DEFAULT
- * @{
- */
-
-/* Includes ------------------------------------------------------------------- */
-#include "lpc17xx_libcfg_default.h"
-
-/* Public Functions ----------------------------------------------------------- */
-/** @addtogroup LIBCFG_DEFAULT_Public_Functions
- * @{
- */
-
-#ifndef __BUILD_WITH_EXAMPLE__
-
-#ifdef  DEBUG
-/*******************************************************************************
-* @brief        Reports the name of the source file and the source line number
-*               where the CHECK_PARAM error has occurred.
-* @param[in]    file Pointer to the source file name
-* @param[in]    line assert_param error line source number
-* @return       None
-*******************************************************************************/
-void check_failed(uint8_t *file, uint32_t line)
-{
-    /* User can add his own implementation to report the file name and line number,
-     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
-
-    /* Infinite loop */
-    while(1);
-}
-#endif /* DEBUG */
-
-#endif /* __BUILD_WITH_EXAMPLE__ */
-
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-/* --------------------------------- End Of File ------------------------------ */

+ 13 - 1
demos/device/device_os_none/tusb_config.h

@@ -73,6 +73,8 @@
 #define TUSB_CFG_HOST_HID_MOUSE     0
 #define TUSB_CFG_HOST_HID_MOUSE     0
 #define TUSB_CFG_HOST_HID_GENERIC   0
 #define TUSB_CFG_HOST_HID_GENERIC   0
 #define TUSB_CFG_HOST_MSC           0
 #define TUSB_CFG_HOST_MSC           0
+#define TUSB_CFG_HOST_CDC           0
+#define TUSB_CFG_HOST_CDC_RNDIS     0
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // DEVICE CONFIGURATION
 // DEVICE CONFIGURATION
@@ -96,8 +98,9 @@
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 #define TUSB_CFG_DEBUG                3
 #define TUSB_CFG_DEBUG                3
 
 
-#define TUSB_CFG_OS                   TUSB_OS_NONE // defined using eclipse build
+//#define TUSB_CFG_OS                   TUSB_OS_NONE // defined using eclipse build
 //#define TUSB_CFG_OS_TASK_PRIO
 //#define TUSB_CFG_OS_TASK_PRIO
+
 #define TUSB_CFG_OS_TICKS_PER_SECOND  1000
 #define TUSB_CFG_OS_TICKS_PER_SECOND  1000
 
 
 #ifdef __CODE_RED // make use of code red's support for ram region macros
 #ifdef __CODE_RED // make use of code red's support for ram region macros
@@ -112,10 +115,19 @@
   #endif
   #endif
 
 
   #define TUSB_CFG_ATTR_USBRAM   __attribute__ ((section(TUSB_RAM_SECTION)))
   #define TUSB_CFG_ATTR_USBRAM   __attribute__ ((section(TUSB_RAM_SECTION)))
+
 #elif defined  __CC_ARM // Compiled with Keil armcc
 #elif defined  __CC_ARM // Compiled with Keil armcc
+
   #define TUSB_CFG_ATTR_USBRAM
   #define TUSB_CFG_ATTR_USBRAM
+
+#elif __ICCARM__ // compiled with IAR
+
+  #define TUSB_CFG_ATTR_USBRAM  @ ".ahb_sram1"
+
 #else
 #else
+
   #error compiler not specified
   #error compiler not specified
+
 #endif
 #endif
 
 
 
 

Разница между файлами не показана из-за своего большого размера
+ 86 - 0
demos/host/host_os_none/.cproject


+ 21 - 11
demos/host/src/tusb_config.h

@@ -36,12 +36,6 @@
 */
 */
 /**************************************************************************/
 /**************************************************************************/
 
 
-/** \file
- *  \brief TBD
- *
- *  \note TBD
- */
-
 /** \ingroup TBD
 /** \ingroup TBD
  *  \defgroup TBD
  *  \defgroup TBD
  *  \brief TBD
  *  \brief TBD
@@ -59,8 +53,9 @@
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // CONTROLLER CONFIGURATION
 // CONTROLLER CONFIGURATION
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
+//#define TUSB_CFG_MCU will be passed from IDE for easy board/mcu switching
 #define TUSB_CFG_CONTROLLER_0_MODE  (TUSB_MODE_HOST)
 #define TUSB_CFG_CONTROLLER_0_MODE  (TUSB_MODE_HOST)
-#define TUSB_CFG_CONTROLLER_1_MODE  (TUSB_MODE_NONE)
+#define TUSB_CFG_CONTROLLER_1_MODE  (TUSB_MODE_NONE) // TODO not yet tested
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // HOST CONFIGURATION
 // HOST CONFIGURATION
@@ -83,16 +78,19 @@
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // DEVICE CONFIGURATION
 // DEVICE CONFIGURATION
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
+#define TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE    64 // TODO refractor remove
+#define TUSB_CFG_DEVICE_STRING_DESCRIPTOR_COUNT 4
 
 
 //------------- CLASS -------------//
 //------------- CLASS -------------//
-//#define TUSB_CFG_DEVICE_CDC
-//#define TUSB_CFG_DEVICE_HID_KEYBOARD  1
-//#define TUSB_CFG_DEVICE_HID_MOUSE     1
+#define TUSB_CFG_DEVICE_HID_KEYBOARD  0
+#define TUSB_CFG_DEVICE_HID_MOUSE     0
+#define TUSB_CFG_DEVICE_HID_GENERIC   0
+#define TUSB_CFG_DEVICE_MSC           0
+#define TUSB_CFG_DEVICE_CDC           0
 
 
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 // COMMON CONFIGURATION
 // COMMON CONFIGURATION
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
-
 #define TUSB_CFG_DEBUG                3
 #define TUSB_CFG_DEBUG                3
 
 
 //#define TUSB_CFG_OS                   TUSB_OS_NONE // defined using eclipse build
 //#define TUSB_CFG_OS                   TUSB_OS_NONE // defined using eclipse build
@@ -101,19 +99,31 @@
 #define TUSB_CFG_OS_TICKS_PER_SECOND  1000
 #define TUSB_CFG_OS_TICKS_PER_SECOND  1000
 
 
 #ifdef __CODE_RED // make use of code red's support for ram region macros
 #ifdef __CODE_RED // make use of code red's support for ram region macros
+
   #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
   #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
     #define TUSB_RAM_SECTION  ".data.$RAM2"
     #define TUSB_RAM_SECTION  ".data.$RAM2"
   #elif  (TUSB_CFG_MCU == MCU_LPC43XX)
   #elif  (TUSB_CFG_MCU == MCU_LPC43XX)
     #define TUSB_RAM_SECTION  ".data.$RAM3"
     #define TUSB_RAM_SECTION  ".data.$RAM3"
+  #elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
+    #define TUSB_RAM_SECTION  ".data.$RAM2"
+  #else
+    #error Please define USB RAM section
   #endif
   #endif
 
 
   #define TUSB_CFG_ATTR_USBRAM   __attribute__ ((section(TUSB_RAM_SECTION)))
   #define TUSB_CFG_ATTR_USBRAM   __attribute__ ((section(TUSB_RAM_SECTION)))
+
 #elif defined  __CC_ARM // Compiled with Keil armcc
 #elif defined  __CC_ARM // Compiled with Keil armcc
+
   #define TUSB_CFG_ATTR_USBRAM
   #define TUSB_CFG_ATTR_USBRAM
+
 #elif __ICCARM__ // compiled with IAR
 #elif __ICCARM__ // compiled with IAR
+
   #define TUSB_CFG_ATTR_USBRAM  @ ".ahb_sram1"
   #define TUSB_CFG_ATTR_USBRAM  @ ".ahb_sram1"
+
 #else
 #else
+
   #error compiler not specified
   #error compiler not specified
+
 #endif
 #endif
 
 
 
 

Некоторые файлы не были показаны из-за большого количества измененных файлов