summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-11-14 00:22:49 +0700
committerhathach <[email protected]>2018-11-14 00:22:49 +0700
commit4b1f4c7b6f01a4a0a2da6218958f381674e7f52c (patch)
treee3c51eebe001df791c73be74857c3b3c63f56e5d
parente8246dd367526e4495955b2ee0749892c4da2ab5 (diff)
add Adafruit samd-peripherals as submodule.
clean up board
-rw-r--r--.gitmodules5
-rw-r--r--examples/device/device_composite/ses/ses_nrf5x/nrf5x.emProject4
-rw-r--r--hw/bsp/board.h2
-rw-r--r--hw/bsp/ea4357/board_ea4357.c2
-rw-r--r--hw/bsp/hitex/board_hitex4350.c109
-rw-r--r--hw/bsp/hitex/board_hitex4350.h58
-rw-r--r--hw/bsp/keil/board_mcb4300.c2
-rw-r--r--hw/bsp/lpcxpresso/board_lpcxpresso11u14.c2
-rw-r--r--hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c2
-rw-r--r--hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c2
-rw-r--r--hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c2
-rw-r--r--hw/bsp/ngx/board_ngx4330.c2
-rw-r--r--hw/bsp/pca10056/board_pca10056.c3
m---------hw/mcu/microchip/samd/samd-peripherals0
14 files changed, 16 insertions, 179 deletions
diff --git a/.gitmodules b/.gitmodules
index e569dc9c2..30abb53e8 100644
--- a/.gitmodules
+++ b/.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 = [email protected]: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
diff --git a/examples/device/device_composite/ses/ses_nrf5x/nrf5x.emProject b/examples/device/device_composite/ses/ses_nrf5x/nrf5x.emProject
index bb25b9fdc..377ae4347 100644
--- a/examples/device/device_composite/ses/ses_nrf5x/nrf5x.emProject
+++ b/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();"
diff --git a/hw/bsp/board.h b/hw/bsp/board.h
index b4a677bec..fc835d31f 100644
--- a/hw/bsp/board.h
+++ b/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
diff --git a/hw/bsp/ea4357/board_ea4357.c b/hw/bsp/ea4357/board_ea4357.c
index 105f32d15..e4b9a0dc4 100644
--- a/hw/bsp/ea4357/board_ea4357.c
+++ b/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
diff --git a/hw/bsp/hitex/board_hitex4350.c b/hw/bsp/hitex/board_hitex4350.c
deleted file mode 100644
index 23e070a92..000000000
--- a/hw/bsp/hitex/board_hitex4350.c
+++ /dev/null
@@ -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
diff --git a/hw/bsp/hitex/board_hitex4350.h b/hw/bsp/hitex/board_hitex4350.h
deleted file mode 100644
index f52c83fa9..000000000
--- a/hw/bsp/hitex/board_hitex4350.h
+++ /dev/null
@@ -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_ */
diff --git a/hw/bsp/keil/board_mcb4300.c b/hw/bsp/keil/board_mcb4300.c
index 118cef201..1cd8b070e 100644
--- a/hw/bsp/keil/board_mcb4300.c
+++ b/hw/bsp/keil/board_mcb4300.c
@@ -38,7 +38,7 @@
#include "../board.h"
-#if BOARD == BOARD_MCB4300
+#ifdef BOARD_MCB4300
//--------------------------------------------------------------------+
// INCLUDE
diff --git a/hw/bsp/lpcxpresso/board_lpcxpresso11u14.c b/hw/bsp/lpcxpresso/board_lpcxpresso11u14.c
index 20b3c73c6..7b9705436 100644
--- a/hw/bsp/lpcxpresso/board_lpcxpresso11u14.c
+++ b/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)
diff --git a/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c b/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c
index ebf30d480..854d8cda7 100644
--- a/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c
+++ b/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)
diff --git a/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c b/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c
index 3649b3a7d..d72402d66 100644
--- a/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c
+++ b/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)
diff --git a/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c b/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c
index 196199d61..4321a3f3c 100644
--- a/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c
+++ b/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)
diff --git a/hw/bsp/ngx/board_ngx4330.c b/hw/bsp/ngx/board_ngx4330.c
index 01f5f6145..d82decbea 100644
--- a/hw/bsp/ngx/board_ngx4330.c
+++ b/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
diff --git a/hw/bsp/pca10056/board_pca10056.c b/hw/bsp/pca10056/board_pca10056.c
index 54b1488a8..cef272447 100644
--- a/hw/bsp/pca10056/board_pca10056.c
+++ b/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
diff --git a/hw/mcu/microchip/samd/samd-peripherals b/hw/mcu/microchip/samd/samd-peripherals
new file mode 160000
+Subproject f20fcf642b5654ee68d7d551ea7db39716ef83b