void stm32_boardinitialize(void) { #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ board_autoled_initialize(); #endif #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \ defined(CONFIG_STM32_SPI3) /* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the * weak function stm32_spidev_initialize() has been brought into the link. */ stm32_spidev_initialize(); #endif #ifdef CONFIG_STM32_OTGFS /* Initialize USB if the OTG FS controller is in the configuration. * Presumably either CONFIG_USBDEV or CONFIG_USBHOST is also selected. */ stm32_usbinitialize(); #endif }
void stm32_boardinitialize(void) { /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif /* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function * stm32_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) stm32_spidev_initialize(); #endif /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not * disabled, and 3) the weak function stm32_usbinitialize() has been brought * into the build. */ #if defined(CONFIG_USBDEV) && defined(CONFIG_STM32_USB) stm32_usbinitialize(); #endif }
__END_DECLS /**************************************************************************** * Protected Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /************************************************************************************ * Name: stm32_boardinitialize * * Description: * All STM32 architectures must provide the following entry point. This entry point * is called early in the intitialization -- after all memory has been configured * and mapped but before any devices have been initialized. * ************************************************************************************/ __EXPORT void stm32_boardinitialize(void) { /* configure LEDs */ board_autoled_initialize(); /* turn sensors on */ stm32_configgpio(GPIO_VDD_5V_SENSORS_EN); /* configure SPI interfaces */ stm32_spiinitialize(); }
__EXPORT void stm32_boardinitialize(void) { board_on_reset(-1); /* configure LEDs */ board_autoled_initialize(); /* Start with the Sensor voltage off */ stm32_configgpio(GPIO_VDD_3V3_SENSORS_EN); /* configure ADC pins */ stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ stm32_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ stm32_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ stm32_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ /* configure power supply control/sense pins */ stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); stm32_configgpio(GPIO_VDD_BRICK_VALID); stm32_configgpio(GPIO_VDD_SERVO_VALID); stm32_configgpio(GPIO_VDD_USB_VALID); stm32_configgpio(GPIO_VDD_5V_HIPOWER_OC); stm32_configgpio(GPIO_VDD_5V_PERIPH_OC); /* configure SPI interfaces is deferred to board_app_initialize * to delay the sensor power up with out adding a delay */ }
__END_DECLS /**************************************************************************** * Protected Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /************************************************************************************ * Name: stm32_boardinitialize * * Description: * All STM32 architectures must provide the following entry point. This entry point * is called early in the intitialization -- after all memory has been configured * and mapped but before any devices have been initialized. * ************************************************************************************/ __EXPORT void stm32_boardinitialize(void) { /* configure LEDs */ board_autoled_initialize(); stm32_usbinitialize(); }
void stm32_boardinitialize(void) { /* Initialize USB if the 1) OTG FS controller is in the configuration and 2) * disabled, and 3) the weak function stm32_usbinitialize() has been brought * into the build. Presumeably either CONFIG_USBDEV or CONFIG_USBHOST is also * selected. */ #ifdef CONFIG_STM32_OTGFS if (stm32_usbinitialize) { stm32_usbinitialize(); } #endif /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif /* Configure on-board BUTTONs if BUTTON support has been selected. */ #ifdef CONFIG_ARCH_BUTTONS board_button_initialize(); #endif }
void stm32_boardinitialize(void) { #ifdef CONFIG_STM32_FSMC /* If the FSMC is enabled, then enable SRAM access */ stm32_stram_configure(); #endif #ifdef CONFIG_STM32_OTGFS /* Initialize USB if the 1) OTG FS controller is in the configuration and 2) * disabled, and 3) the weak function stm32_usb_configure() has been brought * into the build. Presumably either CONFIG_USBDEV or CONFIG_USBHOST is also * selected. */ stm32_usb_configure(); #endif /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif /* Configure on-board BUTTONs if BUTTON support has been selected. */ #ifdef CONFIG_ARCH_BUTTONS board_button_initialize(); #endif }
void up_boot(void) { /* __start provided the basic MMU mappings for SDRAM. Now provide mappings for all * IO regions (Including the vector region). */ up_setupmappings(); /* Setup up vector block. _vector_start and _vector_end are exported from * up_vector.S */ up_copyvectorblock(); /* Perform board-specific initialiation */ imx_boardinitialize(); /* Set up the board-specific LEDs */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif /* Perform early serial initialization */ #ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif }
__END_DECLS /**************************************************************************** * Protected Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /************************************************************************************ * Name: stm32_boardinitialize * * Description: * All STM32 architectures must provide the following entry point. This entry point * is called early in the intitialization -- after all memory has been configured * and mapped but before any devices have been initialized. * ************************************************************************************/ __EXPORT void stm32_boardinitialize(void) { /* configure always-on ADC pins */ stm32_configgpio(GPIO_ADC1_IN10); stm32_configgpio(GPIO_ADC1_IN11); /* configure SPI interfaces */ stm32_spiinitialize(); /* configure LEDs (empty call to NuttX' ) */ board_autoled_initialize(); }
void sam_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function * sam_spidev_initialize() has been brought into the link. */ #ifdef CONFIG_SAM34_SPI0 if (sam_spidev_initialize) { sam_spidev_initialize(); } #endif /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif /* Setup SD card-related PIOs if 1) HSMCI is selected and 2) the weak * function sam_hsmciinit() has been brought into the build. */ #ifdef CONFIG_SAM34_HSMCI if (sam_hsmciinit) { sam_hsmciinit(); } #endif }
void sam_boardinitialize(void) { #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ board_autoled_initialize(); #endif }
void xmc4_board_initialize(void) { #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ board_autoled_initialize(); #endif #ifdef CONFIG_XMC4_USCI_SPI xmc4_spidev_initialize(); #endif }
void stm32_boardinitialize(void) { #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function * stm32_spidev_initialize() has been brought into the link. */ if (stm32_spidev_initialize) { stm32_spidev_initialize(); } #endif #ifdef CONFIG_STM32_OTGFS /* Initialize USB if the 1) OTG FS controller is in the configuration and 2) * disabled, and 3) the weak function stm32_usbinitialize() has been brought * into the build. Presumably either CONFIG_USBDEV or CONFIG_USBHOST is also * selected. */ if (stm32_usbinitialize) { stm32_usbinitialize(); } #endif #ifdef HAVE_NETMONITOR /* Configure board resources to support networking. */ if (stm32_netinitialize) { stm32_netinitialize(); } #endif #ifdef CONFIG_CANUTILS_UAVCAN (void)stm32_configgpio(GPIO_CAN1_RX); (void)stm32_configgpio(GPIO_CAN1_TX); # if CONFIG_UAVCAN_STM32_NUM_IFACES > 1 (void)stm32_configgpio(GPIO_CAN2_RX); (void)stm32_configgpio(GPIO_CAN2_TX); # endif #endif #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ board_autoled_initialize(); #endif }
__END_DECLS /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ /* Debug ********************************************************************/ /**************************************************************************** * Protected Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /************************************************************************************ * Name: stm32_boardinitialize * * Description: * All STM32 architectures must provide the following entry point. This entry point * is called early in the initialization -- after all memory has been configured * and mapped but before any devices have been initialized. * ************************************************************************************/ __EXPORT void stm32_boardinitialize(void) { /* configure LEDs */ board_autoled_initialize(); board_button_initialize(); stm32_configgpio(GPIO_CAN_CTRL); /* configure CAN interface */ stm32_configgpio(GPIO_CAN1_RX); stm32_configgpio(GPIO_CAN1_TX); #if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || \ defined(CONFIG_STM32_SPI3) board_spiinitialize(); #endif }
void kinetis_boardinitialize(void) { #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function * k28_spidev_initialize() has been brought into the link. */ if (k28_spidev_initialize) { k28_spidev_initialize(); } #endif #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ board_autoled_initialize(); #endif }
void efm32_boardinitialize(void) { #ifdef CONFIG_EFM32_UART0 /* The control MCU acts as a board controller (BC). There is a UART * connection between the EFM and the BC. The connection is made by * setting the EFM_BC_EN (PD13) line high. The EFM can then use the BSP to * send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX and EFM_BC_RX * can be used by other applications. */ efm32_configgpio(GPIO_BC_EN); #endif #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ board_autoled_initialize(); #endif }
void lpc17_boardinitialize(void) { /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak * function lpc1766stk_sspdev_initialize() has been brought into the link. */ #if defined(CONFIG_LPC17_SSP0) || defined(CONFIG_LPC17_SSP1) if (lpc1766stk_sspdev_initialize) { lpc1766stk_sspdev_initialize(); } #endif /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif }
__EXPORT void stm32_boardinitialize(void) { /* configure LEDs */ board_autoled_initialize(); /* configure ADC pins */ //todo:Revisit! ADC3 etc stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ stm32_configgpio(GPIO_ADC1_IN11); /* RSSI analog in */ /* configure power supply control/sense pins */ stm32_configgpio(GPIO_VDD_3V3_PERIPH_EN); stm32_configgpio(GPIO_VDD_BRICK_VALID); stm32_configgpio(GPIO_SBUS_INV); stm32_configgpio(GPIO_8266_GPIO0); // stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); stm32_configgpio(GPIO_8266_PD); stm32_configgpio(GPIO_8266_RST); stm32_configgpio(GPIO_BTN_SAFETY); #ifdef GPIO_RC_OUT stm32_configgpio(GPIO_RC_OUT); /* Serial RC output pin */ stm32_gpiowrite(GPIO_RC_OUT, 1); /* set it high to pull RC input up */ #endif /* configure the GPIO pins to outputs and keep them low */ stm32_configgpio(GPIO_GPIO0_OUTPUT); stm32_configgpio(GPIO_GPIO1_OUTPUT); stm32_configgpio(GPIO_GPIO2_OUTPUT); stm32_configgpio(GPIO_GPIO3_OUTPUT); stm32_configgpio(GPIO_GPIO4_OUTPUT); stm32_configgpio(GPIO_GPIO5_OUTPUT); /* configure SPI interfaces */ stm32_spiinitialize(); stm32_usbinitialize(); }
void sam_boardinitialize(void) { /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function * sam_spidev_initialize() has been brought into the link. */ #ifdef SAMDL_HAVE_SPI if (sam_spidev_initialize) { sam_spidev_initialize(); } #endif /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif }
void tiva_boardinitialize(void) { /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function * lm_ssidev_initialize() has been brought into the link. */ /* The LM3S8962 Eval Kit microSD CS and OLED are on SSI0 (Duh! There is no SSI1) */ #if defined(CONFIG_TIVA_SSI0) /* || defined(CONFIG_TIVA_SSI1) */ if (lm_ssidev_initialize) { lm_ssidev_initialize(); } #endif /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif }
void lpc54_board_initialize(void) { #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ board_autoled_initialize(); #endif /* Configure the LCD GPIOs if LCD support has been selected. This is done * unconditionally because even if the LCD is not configured, we will * still want to turn the backlight off. */ lpc54_lcd_initialize(); #ifdef CONFIG_LPC54_EMC /* Initialize SDRAM */ lpc54_sdram_initialize(); #endif }
void lpc17_boardinitialize(void) { /* Initialize the EMC, SDRAM, NOR FLASH, and NAND FLASH */ #ifdef CONFIG_LPC17_EMC lpc17_emcinitialize(); #ifdef CONFIG_LPC17_EXTDRAM open1788_sdram_initialize(); #endif #ifdef CONFIG_LPC17_EXTNOR open1788_nor_initialize(); #endif #ifdef CONFIG_LPC17_EXTNAND open1788_nand_initialize(); #endif #endif /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak * function open1788_sspdev_initialize() has been brought into the link. */ #if defined(CONFIG_LPC17_SSP0) || defined(CONFIG_LPC17_SSP1) || defined(CONFIG_LPC17_SSP2) if (open1788_sspdev_initialize) { open1788_sspdev_initialize(); } #endif /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif /* Configure the LCD GPIOs if LCD support has been selected. */ #ifdef CONFIG_LPC17_LCD open1788_lcd_initialize(); #endif }
__EXPORT void stm32_boardinitialize(void) { /* configure ADC pins */ stm32_configgpio(GPIO_ADC1_IN10); /* used by battery sense */ stm32_configgpio(GPIO_ADC1_IN11); /* J1 breakout */ stm32_configgpio(GPIO_ADC1_IN12); /* J1 breakout */ stm32_configgpio(GPIO_ADC1_IN13); /* J1 breakout */ /* configure the power mux sense input */ stm32_configgpio(GPIO_POWER_MUX_SENSE); /* configure spektrum power controller gpio */ stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); /* configure SPI interfaces */ stm32_spiinitialize(); /* configure LEDs */ board_autoled_initialize(); }
__EXPORT void stm32_boardinitialize(void) { /* configure LEDs */ board_autoled_initialize(); /* configure ADC pins */ px4_arch_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ px4_arch_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ px4_arch_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ px4_arch_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ px4_arch_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ px4_arch_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ /* configure power supply control/sense pins */ px4_arch_configgpio(GPIO_VDD_5V_PERIPH_EN); px4_arch_configgpio(GPIO_VDD_3V3_SENSORS_EN); px4_arch_configgpio(GPIO_VDD_BRICK_VALID); px4_arch_configgpio(GPIO_VDD_5V_PERIPH_OC); /* configure the GPIO pins to outputs and keep them low */ px4_arch_configgpio(GPIO_GPIO0_OUTPUT); px4_arch_configgpio(GPIO_GPIO1_OUTPUT); px4_arch_configgpio(GPIO_GPIO2_OUTPUT); px4_arch_configgpio(GPIO_GPIO3_OUTPUT); px4_arch_configgpio(GPIO_GPIO4_OUTPUT); px4_arch_configgpio(GPIO_GPIO5_OUTPUT); /* configure SPI interfaces */ stm32_spiinitialize(); /* configure USB interface */ stm32_usbinitialize(); }
__EXPORT void stm32_boardinitialize(void) { board_on_reset(-1); /* configure LEDs */ board_autoled_initialize(); /* configure ADC pins */ stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ stm32_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ stm32_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ stm32_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ /* configure power supply control/sense pins */ stm32_configgpio(GPIO_VDD_5V_PERIPH_EN); stm32_configgpio(GPIO_VDD_3V3_SENSORS_EN); stm32_configgpio(GPIO_VDD_BRICK_VALID); stm32_configgpio(GPIO_VDD_SERVO_VALID); stm32_configgpio(GPIO_VDD_USB_VALID); stm32_configgpio(GPIO_VDD_5V_HIPOWER_OC); stm32_configgpio(GPIO_VDD_5V_PERIPH_OC); /* * CAN GPIO config. * Forced pull up on CAN2 is required for FMUv2 where the second interface lacks a transceiver. * If no transceiver is connected, the RX pin will float, occasionally causing CAN controller to * fail during initialization. */ stm32_configgpio(GPIO_CAN1_RX); stm32_configgpio(GPIO_CAN1_TX); stm32_configgpio(GPIO_CAN2_RX | GPIO_PULLUP); stm32_configgpio(GPIO_CAN2_TX); }
__EXPORT void stm32_boardinitialize(void) { board_on_reset(-1); /* Reset PWM first thing */ /* configure LEDs */ board_autoled_initialize(); /* configure pins */ const uint32_t gpio[] = PX4_GPIO_INIT_LIST; board_gpio_init(gpio, arraySize(gpio)); /* configure SPI interfaces */ stm32_spiinitialize(); /* configure USB interfaces */ stm32_usbinitialize(); }
__EXPORT void stm32_boardinitialize(void) { /* configure LEDs */ board_autoled_initialize(); /* configure ADC pins */ stm32_configgpio(GPIO_ADC1_IN2); /* BATT_VOLTAGE_SENS */ stm32_configgpio(GPIO_ADC1_IN3); /* BATT_CURRENT_SENS */ stm32_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ stm32_configgpio(GPIO_ADC1_IN11); /* RSSI analog in */ /* configure power supply control/sense pins */ stm32_configgpio(GPIO_PERIPH_3V3_EN); stm32_configgpio(GPIO_VDD_BRICK_VALID); stm32_configgpio(GPIO_SBUS_INV); stm32_configgpio(GPIO_8266_GPIO0); stm32_configgpio(GPIO_SPEKTRUM_PWR_EN); stm32_configgpio(GPIO_8266_PD); stm32_configgpio(GPIO_8266_RST); stm32_configgpio(GPIO_BTN_SAFETY); /* configure the GPIO pins to outputs and keep them low */ stm32_configgpio(GPIO_GPIO0_OUTPUT); stm32_configgpio(GPIO_GPIO1_OUTPUT); stm32_configgpio(GPIO_GPIO2_OUTPUT); stm32_configgpio(GPIO_GPIO3_OUTPUT); stm32_configgpio(GPIO_GPIO4_OUTPUT); stm32_configgpio(GPIO_GPIO5_OUTPUT); /* configure SPI interfaces */ stm32_spiinitialize(); }
void sam_boardinitialize(void) { #ifdef CONFIG_SCHED_TICKLESS uint32_t frequency; uint32_t actual; /* If Tickless mode is selected then enabled PCK6 as a possible clock * source for the timer/counters. The ideal frequency could be: * * frequency = 1,000,000 / CONFIG_USEC_PER_TICK * * The main crystal is selected as the frequency source. The maximum * prescaler value is 256 so the minimum frequency is 46,875 Hz which * corresponds to a period of 21.3 microseconds. A value of * CONFIG_USEC_PER_TICK=20, or 50KHz, would give an exact solution with * a divider of 240. */ frequency = USEC_PER_SEC / CONFIG_USEC_PER_TICK; DEBUGASSERT(frequency >= (BOARD_MAINOSC_FREQUENCY / 256)); actual = sam_pck_configure(PCK6, PCKSRC_MAINCK, frequency); /* We expect to achieve this frequency exactly */ DEBUGASSERT(actual == frequency); UNUSED(actual); /* Enable PCK6 */ (void)sam_pck_enable(PCK6, true); #endif #ifdef CONFIG_SAMV7_SDRAMC /* Configure SDRAM if it has been enabled in the NuttX configuration. * Here we assume, of course, that we are not running out SDRAM. */ sam_sdram_config(); #endif #ifdef CONFIG_SAMV7_SPI /* Configure SPI chip selects if SPI has been enabled */ sam_spidev_initialize(); #endif #ifdef HAVE_USB /* Setup USB-related GPIO pins for the SAME70-XPLD board. */ sam_usbinitialize(); #endif #ifdef HAVE_NETWORK /* Configure board resources to support networking if the 1) networking is * enabled, and 2) the EMAC module is enabled */ sam_netinitialize(); #endif /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS board_autoled_initialize(); #endif }
__END_DECLS /**************************************************************************** * Protected Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /************************************************************************************ * Name: stm32_boardinitialize * * Description: * All STM32 architectures must provide the following entry point. This entry point * is called early in the intitialization -- after all memory has been configured * and mapped but before any devices have been initialized. * ************************************************************************************/ __EXPORT void stm32_boardinitialize(void) { /* configure LEDs */ board_autoled_initialize(); /* configure ADC pins */ px4_arch_configgpio(GPIO_ADC1_IN4); /* VDD_5V_SENS */ px4_arch_configgpio(GPIO_ADC1_IN10); /* BATT_CURRENT_SENS */ px4_arch_configgpio(GPIO_ADC1_IN12); /* BATT_VOLTAGE_SENS */ px4_arch_configgpio(GPIO_ADC1_IN11); /* RSSI analog in */ px4_arch_configgpio(GPIO_ADC1_IN13); /* FMU_AUX_ADC_1 */ px4_arch_configgpio(GPIO_ADC1_IN14); /* FMU_AUX_ADC_2 */ px4_arch_configgpio(GPIO_ADC1_IN15); /* PRESSURE_SENS */ /* configure power supply control/sense pins */ px4_arch_configgpio(GPIO_SBUS_INV); px4_arch_configgpio(GPIO_FRSKY_INV); /* configure the GPIO pins to outputs and keep them low */ px4_arch_configgpio(GPIO_GPIO0_OUTPUT); px4_arch_configgpio(GPIO_GPIO1_OUTPUT); px4_arch_configgpio(GPIO_GPIO2_OUTPUT); px4_arch_configgpio(GPIO_GPIO3_OUTPUT); px4_arch_configgpio(GPIO_GPIO4_OUTPUT); px4_arch_configgpio(GPIO_GPIO5_OUTPUT); px4_arch_configgpio(GPIO_GPIO6_OUTPUT); px4_arch_configgpio(GPIO_GPIO7_OUTPUT); /* configure SPI interfaces */ stm32_spiinitialize(); stm32_configgpio(GPIO_I2C2_SCL); stm32_configgpio(GPIO_I2C2_SDA); stm32_configgpio(GPIO_I2C1_SCL); stm32_configgpio(GPIO_I2C1_SDA); }
void sam_boardinitialize(void) { #ifdef CONFIG_SAMA5D3XPLAINED_SLOWCLOCK /* Enable the external slow clock */ sam_sckc_enable(true); #endif /* Configure SPI chip selects if 1) SPI is enable, and 2) the weak function * sam_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_SAMA5_SPI0) || defined(CONFIG_SAMA5_SPI1) if (sam_spidev_initialize) { sam_spidev_initialize(); } #endif #if defined(CONFIG_SAMA5_DDRCS) && !defined(CONFIG_SAMA5_BOOT_SDRAM) /* Configure SDRAM if (1) SDRAM has been enalbled in the NuttX configuration and * (2) if we are not currently running out of SDRAM. If we are now running out * of SDRAM then we have to assume that some second level bootloader has properly * configured SDRAM for our use. */ sam_sdram_config(); #endif /* Initialize USB if the 1) the HS host or device controller is in the * configuration and 2) the weak function sam_usbinitialize() has been brought * into the build. Presumeably either CONFIG_USBDEV or CONFIG_USBHOST is also * selected. */ #if defined(CONFIG_SAMA5_UHPHS) || defined(CONFIG_SAMA5_UDPHS) if (sam_usbinitialize) { sam_usbinitialize(); } #endif /* Configure board resources to support networkingif the 1) networking is enabled, * 2) the EMAC or GMAC module is enabled, and 2) the weak function * sam_netinitialize() has been brought into the build. */ #ifdef HAVE_NETWORK if (sam_netinitialize) { sam_netinitialize(); } #endif #ifdef CONFIG_ARCH_LEDS /* Configure on-board LEDs if LED support has been selected. */ board_autoled_initialize(); #endif }