text: /**
   * \file
   *
   * \brief SAM3U-EK board init.
   *
   * Copyright (c) 2011 - 2014 Atmel Corporation. All rights reserved.
   *
   * \asf_license_start
   *
   * \page License
   *
   * 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 Atmel may not be used to endorse or promote products derived
   *    from this software without specific prior written permission.
   *
   * 4. This software may only be redistributed and used in connection with an
   *    Atmel microcontroller product.
   *
   * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
   * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
   *
   * \asf_license_stop
   *
   */
   /**
   * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
   */
  
  #include "compiler.h"
  #include "board.h"
  #include "conf_board.h"
  #ifdef CONF_BOARD_MMA7341L
  #include "conf_mma7341l.h"
  #endif
  #include "gpio.h"
  #include "ioport.h"
  
  void board_init(void)
  {
  #ifndef CONF_BOARD_KEEP_WATCHDOG_AT_INIT
  	/* Disable the watchdog */
  	WDT->WDT_MR = WDT_MR_WDDIS;
  #endif
  
  	/* GPIO has been deprecated, the old code just keeps it for compatibility.
  	 * In new designs IOPORT is used instead.
  	 * Here IOPORT must be initialized for others to use before setting up IO.
  	 */
  	ioport_init();
  
  	/* Configure LED pins */
  	gpio_configure_pin(LED0_GPIO, LED0_FLAGS);
  	gpio_configure_pin(LED1_GPIO, LED1_FLAGS);
  
  	/* Configure Push Button pins */
  	gpio_configure_pin(GPIO_PUSH_BUTTON_1, GPIO_PUSH_BUTTON_1_FLAGS);
  	gpio_configure_pin(GPIO_PUSH_BUTTON_2, GPIO_PUSH_BUTTON_2_FLAGS);
  
  #ifdef CONF_BOARD_UART_CONSOLE
  	/* Configure UART pins */
  	gpio_configure_group(PINS_UART_PIO, PINS_UART, PINS_UART_FLAGS);
  #endif
  
  	/* Configure ADC example pins */
  #ifdef CONF_BOARD_ADC
  	/* TC TIOA configuration */
  	gpio_configure_pin(PIN_TC0_TIOA0,PIN_TC0_TIOA0_FLAGS);
  
  	/* ADC Trigger configuration */
  	gpio_configure_pin(PINS_ADC12B_TRIG, PINS_ADC12B_TRIG_FLAG);
  
  	/* PWMH0 configuration */
  	gpio_configure_pin(PIN_PWMC_PWMH0_TRIG, PIN_PWMC_PWMH0_TRIG_FLAG);
  #endif
  
  #ifdef CONF_BOARD_PWM_LED0
  	/* Configure PWM LED0 pin */
  	gpio_configure_pin(PIN_PWM_LED0_GPIO, PIN_PWM_LED0_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_PWM_LED1
  	/* Configure PWM LED1 pin */
  	gpio_configure_pin(PIN_PWM_LED1_GPIO, PIN_PWM_LED1_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_PWM_LED2
  	/* Configure PWM LED2 pin */
  	gpio_configure_pin(PIN_PWM_LED2_GPIO, PIN_PWM_LED2_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_TWI0
  	gpio_configure_pin(TWI0_DATA_GPIO, TWI0_DATA_FLAGS);
  	gpio_configure_pin(TWI0_CLK_GPIO, TWI0_CLK_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_TWI1
  	gpio_configure_pin(TWI1_DATA_GPIO, TWI1_DATA_FLAGS);
  	gpio_configure_pin(TWI1_CLK_GPIO, TWI1_CLK_FLAGS);
  #endif
  
  	/* Configure SPI pins */
  #ifdef CONF_BOARD_SPI
  	gpio_configure_pin(SPI_MISO_GPIO, SPI_MISO_FLAGS);
  	gpio_configure_pin(SPI_MOSI_GPIO, SPI_MOSI_FLAGS);
  	gpio_configure_pin(SPI_SPCK_GPIO, SPI_SPCK_FLAGS);
  
  	/**
  	 * For NPCS 1, 2, and 3, different PINs can be used to access the same NPCS line.
  	 * Depending on the application requirements, the default PIN may not be available.
  	 * Hence a different PIN should be selected using the CONF_BOARD_SPI_NPCS_GPIO and
  	 * CONF_BOARD_SPI_NPCS_FLAGS macros.
  	 */
  
  #  ifdef CONF_BOARD_SPI_NPCS0
  	gpio_configure_pin(SPI_NPCS0_GPIO, SPI_NPCS0_FLAGS);
  #  endif
  
  #  ifdef CONF_BOARD_SPI_NPCS1
  #    if defined(CONF_BOARD_SPI_NPCS1_GPIO) && defined(CONF_BOARD_SPI_NPCS1_FLAGS)
  	gpio_configure_pin(CONF_BOARD_SPI_NPCS1_GPIO, CONF_BOARD_SPI_NPCS1_FLAGS);
  #    else
  	gpio_configure_pin(SPI_NPCS1_PA0_GPIO, SPI_NPCS1_PA0_FLAGS);
  #    endif
  #  endif
  
  #  ifdef CONF_BOARD_SPI_NPCS2
  #    if defined(CONF_BOARD_SPI_NPCS2_GPIO) && defined(CONF_BOARD_SPI_NPCS2_FLAGS)
  	gpio_configure_pin(CONF_BOARD_SPI_NPCS2_GPIO, CONF_BOARD_SPI_NPCS2_FLAGS);
  #    else
  	gpio_configure_pin(SPI_NPCS2_PA1_GPIO, SPI_NPCS2_PA1_FLAGS);
  #    endif
  #  endif
  
  #  ifdef CONF_BOARD_SPI_NPCS3
  #    if defined(CONF_BOARD_SPI_NPCS3_GPIO) && defined(CONF_BOARD_SPI_NPCS3_FLAGS)
  	gpio_configure_pin(CONF_BOARD_SPI_NPCS3_GPIO, CONF_BOARD_SPI_NPCS3_FLAGS);
  #    else
  	gpio_configure_pin(SPI_NPCS3_PA19_GPIO, SPI_NPCS3_PA19_FLAGS);
  #    endif
  #  endif
  #endif /* CONF_BOARD_SPI */
  
  #ifdef CONF_BOARD_USART_RXD
  	/* Configure USART RXD pin */
  	gpio_configure_pin(PIN_USART1_RXD_IDX, PIN_USART1_RXD_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_USART_TXD
  	/* Configure USART TXD pin */
  	gpio_configure_pin(PIN_USART1_TXD_IDX, PIN_USART1_TXD_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_USART_CTS
  	/* Configure USART CTS pin */
  	gpio_configure_pin(PIN_USART1_CTS_IDX, PIN_USART1_CTS_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_USART_RTS
  	/* Configure USART RTS pin */
  	gpio_configure_pin(PIN_USART1_RTS_IDX, PIN_USART1_RTS_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_USART_SCK
  	/* Configure USART synchronous communication SCK pin */
  	gpio_configure_pin(PIN_USART1_SCK_IDX, PIN_USART1_SCK_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_TFDU4300_SD
  	/* Configure IrDA transceiver shutdown pin */
  	gpio_configure_pin(PIN_IRDA_SD_IDX, PIN_IRDA_SD_FLAGS);
  	gpio_set_pin_low(PIN_IRDA_SD_IDX);
  #endif
  
  #ifdef CONF_BOARD_ADM3485_RE
  	/* Configure RS485 transceiver RE pin */
  	gpio_configure_pin(PIN_RE_IDX, PIN_RE_FLAGS);
  	gpio_set_pin_low(PIN_RE_IDX);
  #endif
  
  #ifdef CONF_BOARD_SMC_PSRAM
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D0, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D1, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D2, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D3, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D4, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D5, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D6, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D7, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D8, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D9, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D10, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D11, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D12, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D13, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D14, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D15, PIN_EBI_DATA_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_NRD, PIN_EBI_NRD_FLAGS);
  	gpio_configure_pin(PIN_EBI_NWE, PIN_EBI_NWE_FLAGS);
  	gpio_configure_pin(PIN_EBI_NCS0, PIN_EBI_NCS0_FLAGS);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_NBS0, PIN_EBI_ADDR_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_NBS1, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A1, PIN_EBI_ADDR_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A2, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A3, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A4, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A5, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A6, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A7, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A8, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A9, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A10, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A11, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A12, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A13, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A14, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A15, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A16, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A17, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A18, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A19, PIN_EBI_ADDR_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_ADDR_BUS_A20, PIN_EBI_ADDR_BUS_FLAG2);
  #endif
  
  #ifdef CONF_BOARD_HX8347A
  	/* Configure LCD EBI pins */
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D0, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D1, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D2, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D3, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D4, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D5, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D6, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D7, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D8, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D9, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D10, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D11, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D12, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D13, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D14, PIN_EBI_DATA_BUS_FLAG1);
  	gpio_configure_pin(PIN_EBI_DATA_BUS_D15, PIN_EBI_DATA_BUS_FLAG2);
  	gpio_configure_pin(PIN_EBI_NRD, PIN_EBI_NRD_FLAGS);
  	gpio_configure_pin(PIN_EBI_NWE, PIN_EBI_NWE_FLAGS);
  	gpio_configure_pin(PIN_EBI_NCS2, PIN_EBI_NCS2_FLAGS);
  	gpio_configure_pin(PIN_EBI_LCD_RS, PIN_EBI_LCD_RS_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_AAT3194
  	/* Configure Backlight control pin */
  	gpio_configure_pin(BOARD_AAT31XX_SET_GPIO, BOARD_AAT31XX_SET_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_MCP9800
  	/* Configure Temperature Sensor pins */
  	gpio_configure_pin(TWI0_DATA_GPIO, TWI0_DATA_FLAGS);
  	gpio_configure_pin(TWI0_CLK_GPIO, TWI0_CLK_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_MMA7341L
  	/* Configure MMA7341L mode set control pin */
  	gpio_configure_pin(PIN_MMA7341L_MODE, PIN_MMA7341L_MODE_FLAG);
  	/* Configure MMA7341L x,y,z axis output voltage pin */
  	gpio_configure_pin(PIN_MMA7341L_X_AXIS, PIN_MMA7341L_X_AXIS_FLAG);
  	gpio_configure_pin(PIN_MMA7341L_Y_AXIS, PIN_MMA7341L_Y_AXIS_FLAG);
  	gpio_configure_pin(PIN_MMA7341L_Z_AXIS, PIN_MMA7341L_Z_AXIS_FLAG);
  #endif
  
  #ifdef CONF_BOARD_ADS7843
  	/* Configure Touchscreen SPI pins */
  	gpio_configure_pin(BOARD_ADS7843_IRQ_GPIO,BOARD_ADS7843_IRQ_FLAGS);
  	gpio_configure_pin(BOARD_ADS7843_BUSY_GPIO, BOARD_ADS7843_BUSY_FLAGS);
  	gpio_configure_pin(SPI_MISO_GPIO, SPI_MISO_FLAGS);
  	gpio_configure_pin(SPI_MOSI_GPIO, SPI_MOSI_FLAGS);
  	gpio_configure_pin(SPI_SPCK_GPIO, SPI_SPCK_FLAGS);
  	gpio_configure_pin(SPI_NPCS2_PC14_GPIO, SPI_NPCS2_PC14_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_ISO7816_RST
  	/* Configure ISO7816 card reset pin */
  	gpio_configure_pin(PIN_ISO7816_RST_IDX, PIN_ISO7816_RST_FLAG);
  #endif
  
  #ifdef CONF_BOARD_ISO7816
  	/* Configure ISO7816 interface TXD & SCK pin */
  	gpio_configure_pin(PIN_USART0_TXD_IDX, PIN_USART0_TXD_FLAGS);
  	gpio_configure_pin(PIN_USART0_SCK_IDX, PIN_USART0_SCK_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_NAND
  	gpio_configure_pin(PIN_EBI_NANDOE, PIN_EBI_NANDOE_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDWE, PIN_EBI_NANDWE_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDCLE, PIN_EBI_NANDCLE_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDALE, PIN_EBI_NANDALE_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_0, PIN_EBI_NANDIO_0_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_1, PIN_EBI_NANDIO_1_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_2, PIN_EBI_NANDIO_2_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_3, PIN_EBI_NANDIO_3_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_4, PIN_EBI_NANDIO_4_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_5, PIN_EBI_NANDIO_5_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_6, PIN_EBI_NANDIO_6_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_7, PIN_EBI_NANDIO_7_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_8, PIN_EBI_NANDIO_8_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_9, PIN_EBI_NANDIO_9_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_10, PIN_EBI_NANDIO_10_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_11, PIN_EBI_NANDIO_11_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_12, PIN_EBI_NANDIO_12_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_13, PIN_EBI_NANDIO_13_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_14, PIN_EBI_NANDIO_14_FLAGS);
  	gpio_configure_pin(PIN_EBI_NANDIO_15, PIN_EBI_NANDIO_15_FLAGS);
  	gpio_configure_pin(PIN_NF_CE_IDX, PIN_NF_CE_FLAGS);
  	gpio_configure_pin(PIN_NF_RB_IDX, PIN_NF_RB_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_TWI0
  	gpio_configure_pin(TWI0_DATA_GPIO, TWI0_DATA_FLAGS);
  	gpio_configure_pin(TWI0_CLK_GPIO, TWI0_CLK_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_SSC
  	gpio_configure_pin(PIN_SSC_TD, PIN_SSC_TD_FLAGS);
  	gpio_configure_pin(PIN_SSC_TK, PIN_SSC_TK_FLAGS);
  	gpio_configure_pin(PIN_SSC_TF, PIN_SSC_TF_FLAGS);
  	gpio_configure_pin(PIN_SSC_RD, PIN_SSC_RD_FLAGS);
  	gpio_configure_pin(PIN_SSC_RK, PIN_SSC_RK_FLAGS);
  	gpio_configure_pin(PIN_SSC_RF, PIN_SSC_RF_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_PCK0
  	gpio_configure_pin(PIN_PCK0, PIN_PCK0_FLAGS);
  #endif
  
  #ifdef CONF_BOARD_SD_MMC_HSMCI
  	/* Configure HSMCI pins */
  	gpio_configure_pin(PIN_HSMCI_MCCDA_GPIO, PIN_HSMCI_MCCDA_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCCK_GPIO, PIN_HSMCI_MCCK_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCDA0_GPIO, PIN_HSMCI_MCDA0_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCDA1_GPIO, PIN_HSMCI_MCDA1_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCDA2_GPIO, PIN_HSMCI_MCDA2_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCDA3_GPIO, PIN_HSMCI_MCDA3_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCDA4_GPIO, PIN_HSMCI_MCDA4_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCDA5_GPIO, PIN_HSMCI_MCDA5_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCDA6_GPIO, PIN_HSMCI_MCDA6_FLAGS);
  	gpio_configure_pin(PIN_HSMCI_MCDA7_GPIO, PIN_HSMCI_MCDA7_FLAGS);
  
  	/* Configure SD/MMC card detect pin */
  	gpio_configure_pin(SD_MMC_0_CD_GPIO, SD_MMC_0_CD_FLAGS);
  #endif
  
  #if defined(CONF_BOARD_USB_PORT)
  #  if defined(CONF_BOARD_USB_VBUS_DETECT)
  	gpio_configure_pin(USB_VBUS_PIN, USB_VBUS_FLAGS);
  #  endif
  #endif
  }
  