Преглед изворни кода

add Adafruit samd-peripherals as submodule.

clean up board
hathach пре 7 година
родитељ
комит
4b1f4c7b6f

+ 4 - 1
.gitmodules

@@ -3,4 +3,7 @@
 	url = https://github.com/NordicSemiconductor/nrfx.git
 [submodule "hw/mcu/microchip/samd/asf4"]
 	path = hw/mcu/microchip/samd/asf4
-	url = git@github.com:adafruit/asf4.git
+	url = https://github.com/adafruit/asf4.git
+[submodule "hw/mcu/microchip/samd/samd-peripherals"]
+	path = hw/mcu/microchip/samd/samd-peripherals
+	url = https://github.com/adafruit/samd-peripherals.git

+ 2 - 2
examples/device/device_composite/ses/ses_nrf5x/nrf5x.emProject

@@ -20,13 +20,13 @@
       arm_target_interface_type="SWD"
       build_treat_warnings_as_errors="Yes"
       c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;BOARD_PCA10056"
-      c_user_include_directories="../../src;$(tusbDir)/hw/cmsis/Include;$(tusbDir)/hw;$(tusbDir)/src;$(nrfxDir)/..;$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include"
+      c_user_include_directories="../../src;$(rootDir)/hw/cmsis/Include;$(rootDir)/hw;$(rootDir)/src;$(nrfxDir)/..;$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include"
       debug_register_definition_file="$(ProjectDir)/nrf52840_Registers.xml"
       debug_target_connection="J-Link"
       gcc_entry_point="Reset_Handler"
       linker_memory_map_file="$(ProjectDir)/nRF52840_xxAA_MemoryMap.xml"
       linker_section_placement_file="$(ProjectDir)/flash_placement.xml"
-      macros="DeviceHeaderFile=$(PackagesDir)/nRF/CMSIS/Device/Include/nrf.h;DeviceLibraryIdentifier=M4lf;DeviceSystemFile=$(PackagesDir)/nRF/CMSIS/Device/Source/system_nrf52840.c;DeviceVectorsFile=$(PackagesDir)/nRF/Source/ses_nrf52840_Vectors.s;DeviceFamily=nRF;Target=nRF52840_xxAA;Placement=Flash;tusbDir=../../../../..;nrfxDir=../../../../../hw/mcu/nordic/nrfx"
+      macros="DeviceHeaderFile=$(PackagesDir)/nRF/CMSIS/Device/Include/nrf.h;DeviceLibraryIdentifier=M4lf;DeviceSystemFile=$(PackagesDir)/nRF/CMSIS/Device/Source/system_nrf52840.c;DeviceVectorsFile=$(PackagesDir)/nRF/Source/ses_nrf52840_Vectors.s;DeviceFamily=nRF;Target=nRF52840_xxAA;Placement=Flash;rootDir=../../../../..;nrfxDir=../../../../../hw/mcu/nordic/nrfx"
       project_directory=""
       project_type="Executable"
       target_reset_script="Reset();"

+ 0 - 2
hw/bsp/board.h

@@ -80,8 +80,6 @@
   #include "ea4357/board_ea4357.h"
 #elif defined BOARD_MCB4300
   #include "keil/board_mcb4300.h"
-#elif defined BOARD_HITEX4350
-  #include "hitex/board_hitex4350.h"
 #elif defined BOARD_LPCLINK2
   #include "lpcxpresso/board_lpclink2.h"
 #elif defined BOARD_PCA10056

+ 1 - 1
hw/bsp/ea4357/board_ea4357.c

@@ -38,7 +38,7 @@
 
 #include "../board.h"
 
-#if BOARD == BOARD_EA4357
+#ifdef BOARD_EA4357
 
 #define BOARD_UART_PORT           LPC_USART0
 #define BOARD_UART_PIN_PORT       0x0f

+ 0 - 109
hw/bsp/hitex/board_hitex4350.c

@@ -1,109 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     board_hitex4350.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_HITEX4350
-
-//--------------------------------------------------------------------+
-// MACRO CONSTANT TYPEDEF
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// INTERNAL OBJECT & FUNCTION DECLARATION
-//--------------------------------------------------------------------+
-
-//--------------------------------------------------------------------+
-// IMPLEMENTATION
-//--------------------------------------------------------------------+
-void board_init(void)
-{
-  CGU_Init();
-  SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / BOARD_TICKS_HZ); // 1 msec tick timer
-
-  //------------- USB Bus power HOST ONLY-------------//
-  // Hitex VBUS0 is P2_3
-  scu_pinmux(0x2, 3, MD_PUP | MD_EZI, FUNC7);     	// USB0_PWR_EN, USB0 VBus function
-  scu_pinmux(0x6, 3, MD_PUP | MD_EZI, FUNC1);     		// P6_3 USB0_PWR_EN, USB0 VBus function
-
-  // Hitex VBUS1 is P9_5
-  scu_pinmux(0x9, 5, MD_PUP | MD_EZI, FUNC2);				// USB1_PWR_EN, USB1 VBus function
-
-  //------------- LEDs init -------------//
-  // TODO Leds for hitex
-
-  //------------- UART init -------------//
-  #if CFG_UART_ENABLE
-	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)
-{
-  // TODO LED for hitex
-}
-
-//--------------------------------------------------------------------+
-// 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

+ 0 - 58
hw/bsp/hitex/board_hitex4350.h

@@ -1,58 +0,0 @@
-/**************************************************************************/
-/*!
-    @file     board_hitex4350.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_BOARD_HITEX4350_H_
-#define _TUSB_BOARD_HITEX4350_H_
-
-#include "LPC43xx.h"
-#include "lpc43xx_scu.h"
-#include "lpc43xx_cgu.h"
-#include "lpc43xx_gpio.h"
-#include "lpc43xx_uart.h"
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#define CFG_PRINTF_TARGET       PRINTF_TARGET_SEMIHOST
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_BOARD_HITEX4350_H_ */

+ 1 - 1
hw/bsp/keil/board_mcb4300.c

@@ -38,7 +38,7 @@
 
 #include "../board.h"
 
-#if BOARD == BOARD_MCB4300
+#ifdef BOARD_MCB4300
 
 //--------------------------------------------------------------------+
 // INCLUDE

+ 1 - 1
hw/bsp/lpcxpresso/board_lpcxpresso11u14.c

@@ -38,7 +38,7 @@
 
 #include "../board.h"
 
-#if BOARD == BOARD_LPCXPRESSO11U14
+#ifdef BOARD_LPCXPRESSO11U14
 
 #define LED_PORT                  (0)
 #define LED_PIN                   (7)

+ 1 - 1
hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c

@@ -38,7 +38,7 @@
 
 #include "../board.h"
 
-#if BOARD == BOARD_LPCXPRESSO11U68
+#ifdef BOARD_LPCXPRESSO11U68
 
 #define LED_PORT                  (1)
 #define LED_PIN                   (31)

+ 1 - 1
hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c

@@ -38,7 +38,7 @@
 
 #include "../board.h"
 
-#if BOARD == BOARD_LPCXPRESSO1347
+#ifdef BOARD_LPCXPRESSO1347
 
 #define LED_PORT                  (0)
 #define LED_PIN                   (7)

+ 1 - 1
hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c

@@ -38,7 +38,7 @@
 
 #include "../board.h"
 
-#if BOARD == BOARD_LPCXPRESSO1769
+#ifdef BOARD_LPCXPRESSO1769
 
 #define BOARD_LED_PORT                  (0)
 #define BOARD_LED_PIN                   (22)

+ 1 - 1
hw/bsp/ngx/board_ngx4330.c

@@ -38,7 +38,7 @@
 
 #include "../board.h"
 
-#if BOARD == BOARD_NGX4330
+#ifdef BOARD_NGX4330
 
 #define BOARD_UART_PORT           LPC_USART0
 

+ 3 - 0
hw/bsp/pca10056/board_pca10056.c

@@ -35,6 +35,7 @@
     This file is part of the tinyusb stack.
 */
 /**************************************************************************/
+#ifdef BOARD_PCA10056
 
 #include "bsp/board.h"
 #include "nrfx/hal/nrf_gpio.h"
@@ -251,3 +252,5 @@ void board_uart_putchar(uint8_t c)
 {
 
 }
+
+#endif

+ 1 - 0
hw/mcu/microchip/samd/samd-peripherals

@@ -0,0 +1 @@
+Subproject commit f20fcf642b5654ee68d7d551ea7db39716ef83bf