diff --git a/demos/bsp/boards/board.h b/demos/bsp/boards/board.h index 2a13995f4..1fc15b249 100644 --- a/demos/bsp/boards/board.h +++ b/demos/bsp/boards/board.h @@ -68,6 +68,7 @@ #define BOARD_NGX4330 3 #define BOARD_EA4357 4 #define BOARD_MCB4300 5 +#define BOARD_HITEX4350 6 //--------------------------------------------------------------------+ // PRINTF TARGET DEFINE @@ -91,6 +92,8 @@ #include "embedded_artists/board_ea4357.h" #elif BOARD == BOARD_MCB4300 #include "keil/board_mcb4300.h" +#elif BOARD == BOARD_HITEX4350 + #include "hitex/board_hitex4350.h" #else #error BOARD is not defined or supported yet #endif diff --git a/demos/bsp/boards/hitex/board_hitex4350.c b/demos/bsp/boards/hitex/board_hitex4350.c new file mode 100644 index 000000000..2ba54e46c --- /dev/null +++ b/demos/bsp/boards/hitex/board_hitex4350.c @@ -0,0 +1,110 @@ +/**************************************************************************/ +/*! + @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) +{ + SystemInit(); + CGU_Init(); + SysTick_Config(CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) / CFG_TICKS_PER_SECOND); // 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/demos/bsp/boards/hitex/board_hitex4350.h b/demos/bsp/boards/hitex/board_hitex4350.h new file mode 100644 index 000000000..d1db09220 --- /dev/null +++ b/demos/bsp/boards/hitex/board_hitex4350.h @@ -0,0 +1,67 @@ +/**************************************************************************/ +/*! + @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. +*/ +/**************************************************************************/ + +/** \ingroup TBD + * \defgroup TBD + * \brief TBD + * + * @{ + */ + +#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_DEBUG_CONSOLE + +#ifdef __cplusplus + } +#endif + +#endif /* _TUSB_BOARD_HITEX4350_H_ */ + +/** @} */ diff --git a/demos/host/host_os_none/.cproject b/demos/host/host_os_none/.cproject index 98e1c28e7..752a62949 100644 --- a/demos/host/host_os_none/.cproject +++ b/demos/host/host_os_none/.cproject @@ -3324,6 +3324,1114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3331,8 +4439,8 @@ <?xml version="1.0" encoding="UTF-8"?> <TargetConfig> -<Properties property_0="" property_2="LPC18x7_43x7_2x512_BootA.cfx" property_3="NXP" property_4="LPC4357" property_count="5" version="1"/> -<infoList vendor="NXP"><info chip="LPC4357" flash_driver="LPC18x7_43x7_2x512_BootA.cfx" match_id="0x0" name="LPC4357" stub="crt_emu_lpc18_43_nxp"><chip><name>LPC4357</name> +<Properties property_0="" property_3="NXP" property_4="LPC4350" property_count="5" version="1"/> +<infoList vendor="NXP"><info chip="LPC4350" match_id="0x0" name="LPC4350" stub="crt_emu_lpc18_43_nxp"><chip><name>LPC4350</name> <family>LPC43xx</family> <vendor>NXP (formerly Philips)</vendor> <reset board="None" core="Real" sys="Real"/> @@ -3340,17 +4448,11 @@ <memory can_program="true" id="Flash" is_ro="true" type="Flash"/> <memory id="RAM" type="RAM"/> <memory id="Periph" is_volatile="true" type="Peripheral"/> -<memoryInstance derived_from="Flash" id="MFlashA512" location="0x1a000000" size="0x80000"/> -<memoryInstance derived_from="Flash" id="MFlashB512" location="0x1b000000" size="0x80000"/> -<memoryInstance derived_from="RAM" id="RamLoc32" location="0x10000000" size="0x8000"/> -<memoryInstance derived_from="RAM" id="RamLoc40" location="0x10080000" size="0xa000"/> +<memoryInstance derived_from="RAM" id="RamLoc128" location="0x10000000" size="0x20000"/> +<memoryInstance derived_from="RAM" id="RamLoc72" location="0x10080000" size="0x12000"/> <memoryInstance derived_from="RAM" id="RamAHB32" location="0x20000000" size="0x8000"/> <memoryInstance derived_from="RAM" id="RamAHB16" location="0x20008000" size="0x4000"/> <memoryInstance derived_from="RAM" id="RamAHB_ETB16" location="0x2000c000" size="0x4000"/> -<prog_flash blocksz="0x2000" location="0x1a000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/> -<prog_flash blocksz="0x10000" location="0x1a010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/> -<prog_flash blocksz="0x2000" location="0x1b000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/> -<prog_flash blocksz="0x10000" location="0x1b010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/> <peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/> <peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/> <peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/> @@ -3402,6 +4504,8 @@ <peripheralInstance derived_from="ADC0" id="ADC0" location="0x400e3000"/> <peripheralInstance derived_from="ADC1" id="ADC1" location="0x400e4000"/> <peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x400f4000"/> +<peripheralInstance derived_from="SPI" id="SPI" location="0x40100000"/> +<peripheralInstance derived_from="SGPIO" id="SGPIO" location="0x40101000"/> </chip> <processor><name gcc_name="cortex-m4">Cortex-M4</name> <family>Cortex-M</family>