mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
Merged nuttx/nuttx into master
This commit is contained in:
@@ -100,13 +100,13 @@ static void up_calibratedelay(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 3
|
#if defined(CONFIG_STACK_COLORATION) && CONFIG_ARCH_INTERRUPTSTACK > 7
|
||||||
static inline void up_color_intstack(void)
|
static inline void up_color_intstack(void)
|
||||||
{
|
{
|
||||||
uint32_t *ptr = (uint32_t *)&g_intstackalloc;
|
uint32_t *ptr = (uint32_t *)&g_intstackalloc;
|
||||||
ssize_t size;
|
ssize_t size;
|
||||||
|
|
||||||
for (size = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
for (size = (CONFIG_ARCH_INTERRUPTSTACK & ~7);
|
||||||
size > 0;
|
size > 0;
|
||||||
size -= sizeof(uint32_t))
|
size -= sizeof(uint32_t))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5325,14 +5325,14 @@ static void stm32_hwinitialize(FAR struct stm32_usbdev_s *priv)
|
|||||||
* some bug / errata in the chip.
|
* some bug / errata in the chip.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regval = stm32_getreg(STM32_RCC_AHB1LPENR);
|
regval = stm32_getreg(STM32_RCC_AHB1LPENR);
|
||||||
regval &= ~RCC_AHB1ENR_OTGHSULPIEN;
|
regval &= ~RCC_AHB1ENR_OTGHSULPIEN;
|
||||||
stm32_putreg(regval, STM32_RCC_AHB1LPENR);
|
stm32_putreg(regval, STM32_RCC_AHB1LPENR);
|
||||||
|
|
||||||
/* Enable the interrupts in the INTMSK */
|
/* Enable the interrupts in the INTMSK */
|
||||||
|
|
||||||
regval = (OTGHS_GINT_RXFLVL | OTGHS_GINT_USBSUSP | OTGHS_GINT_ENUMDNE |
|
regval = (OTGHS_GINT_RXFLVL | OTGHS_GINT_USBSUSP | OTGHS_GINT_ENUMDNE |
|
||||||
OTGHS_GINT_IEP | OTGHS_GINT_OEP | OTGHS_GINT_USBRST);
|
OTGHS_GINT_IEP | OTGHS_GINT_OEP | OTGHS_GINT_USBRST);
|
||||||
|
|
||||||
#ifdef CONFIG_USBDEV_ISOCHRONOUS
|
#ifdef CONFIG_USBDEV_ISOCHRONOUS
|
||||||
regval |= (OTGHS_GINT_IISOIXFR | OTGHS_GINT_IISOOXFR);
|
regval |= (OTGHS_GINT_IISOIXFR | OTGHS_GINT_IISOOXFR);
|
||||||
|
|||||||
@@ -195,8 +195,16 @@ static inline void rcc_enableahb1(void)
|
|||||||
#ifdef CONFIG_STM32_OTGHS
|
#ifdef CONFIG_STM32_OTGHS
|
||||||
/* USB OTG HS */
|
/* USB OTG HS */
|
||||||
|
|
||||||
|
#ifndef BOARD_DISABLE_USBOTG_HSULPI
|
||||||
|
/* Enable clocking for USB OTG HS and external PHY */
|
||||||
|
|
||||||
regval |= (RCC_AHB1ENR_OTGHSEN | RCC_AHB1ENR_OTGHSULPIEN);
|
regval |= (RCC_AHB1ENR_OTGHSEN | RCC_AHB1ENR_OTGHSULPIEN);
|
||||||
|
#else
|
||||||
|
/* Enable only clocking for USB OTG HS */
|
||||||
|
|
||||||
|
regval |= (RCC_AHB1ENR_OTGHSEN);
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* CONFIG_STM32_OTGHS */
|
||||||
|
|
||||||
putreg32(regval, STM32_RCC_AHB1ENR); /* Enable peripherals */
|
putreg32(regval, STM32_RCC_AHB1ENR); /* Enable peripherals */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,10 +215,15 @@ static inline void rcc_enableahb1(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_STM32_OTGHS
|
#ifdef CONFIG_STM32_OTGHS
|
||||||
/* USB OTG HS */
|
#if 0 /* ifndef BOARD_DISABLE_USBOTG_HSULPI */
|
||||||
|
/* Enable clocking for USB OTG HS and external PHY */
|
||||||
|
|
||||||
|
regval |= (RCC_AHB1ENR_OTGHSEN | RCC_AHB1ENR_OTGHSULPIEN);
|
||||||
|
#else
|
||||||
|
/* Enable only clocking for USB OTG HS */
|
||||||
|
|
||||||
regval |= RCC_AHB1ENR_OTGHSEN;
|
regval |= RCC_AHB1ENR_OTGHSEN;
|
||||||
|
#endif
|
||||||
#endif /* CONFIG_STM32_OTGHS */
|
#endif /* CONFIG_STM32_OTGHS */
|
||||||
|
|
||||||
#ifdef CONFIG_STM32_DMA2D
|
#ifdef CONFIG_STM32_DMA2D
|
||||||
|
|||||||
@@ -225,10 +225,15 @@ static inline void rcc_enableahb1(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_STM32F7_OTGHS
|
#ifdef CONFIG_STM32F7_OTGHS
|
||||||
/* USB OTG HS */
|
#if 0 /* ifndef BOARD_DISABLE_USBOTG_HSULPI */
|
||||||
|
/* Enable clocking for USB OTG HS and external PHY */
|
||||||
|
|
||||||
|
regval |= (RCC_AHB1ENR_OTGHSEN | RCC_AHB1ENR_OTGHSULPIEN);
|
||||||
|
#else
|
||||||
|
/* Enable only clocking for USB OTG HS */
|
||||||
|
|
||||||
regval |= RCC_AHB1ENR_OTGHSEN;
|
regval |= RCC_AHB1ENR_OTGHSEN;
|
||||||
|
#endif
|
||||||
#endif /* CONFIG_STM32F7_OTGHS */
|
#endif /* CONFIG_STM32F7_OTGHS */
|
||||||
|
|
||||||
putreg32(regval, STM32_RCC_AHB1ENR); /* Enable peripherals */
|
putreg32(regval, STM32_RCC_AHB1ENR); /* Enable peripherals */
|
||||||
|
|||||||
@@ -221,10 +221,15 @@ static inline void rcc_enableahb1(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_STM32F7_OTGHS
|
#ifdef CONFIG_STM32F7_OTGHS
|
||||||
/* USB OTG HS */
|
#if 0 /* ifndef BOARD_DISABLE_USBOTG_HSULPI */
|
||||||
|
/* Enable clocking for USB OTG HS and external PHY */
|
||||||
|
|
||||||
|
regval |= (RCC_AHB1ENR_OTGHSEN | RCC_AHB1ENR_OTGHSULPIEN);
|
||||||
|
#else
|
||||||
|
/* Enable only clocking for USB OTG HS */
|
||||||
|
|
||||||
regval |= RCC_AHB1ENR_OTGHSEN;
|
regval |= RCC_AHB1ENR_OTGHSEN;
|
||||||
|
#endif
|
||||||
#endif /* CONFIG_STM32F7_OTGHS */
|
#endif /* CONFIG_STM32F7_OTGHS */
|
||||||
|
|
||||||
putreg32(regval, STM32_RCC_AHB1ENR); /* Enable peripherals */
|
putreg32(regval, STM32_RCC_AHB1ENR); /* Enable peripherals */
|
||||||
|
|||||||
@@ -959,6 +959,9 @@ config ARCH_BOARD_SPARK
|
|||||||
config ARCH_BOARD_PHOTON
|
config ARCH_BOARD_PHOTON
|
||||||
bool "Photon wifi board"
|
bool "Photon wifi board"
|
||||||
depends on ARCH_CHIP_STM32F205RG
|
depends on ARCH_CHIP_STM32F205RG
|
||||||
|
select ARCH_HAVE_LEDS
|
||||||
|
select ARCH_HAVE_BUTTONS
|
||||||
|
select ARCH_HAVE_IRQBUTTONS
|
||||||
---help---
|
---help---
|
||||||
A configuration for the Photon from Particle Devices
|
A configuration for the Photon from Particle Devices
|
||||||
(https://www.particle.io). This board features the STM32F205RGY6
|
(https://www.particle.io). This board features the STM32F205RGY6
|
||||||
|
|||||||
@@ -146,6 +146,23 @@
|
|||||||
#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
#define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||||
#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
#define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY)
|
||||||
|
|
||||||
|
/* USB OTG HS definitions ***********************************************************/
|
||||||
|
/* Do not enable external PHY clock or OTG_HS module will not work */
|
||||||
|
|
||||||
|
#define BOARD_DISABLE_USBOTG_HSULPI 1
|
||||||
|
|
||||||
|
/* LED definitions ******************************************************************/
|
||||||
|
|
||||||
|
#define BOARD_LED1 0
|
||||||
|
#define BOARD_NLEDS 1
|
||||||
|
#define BOARD_LED1_BIT (1 << BOARD_LED1)
|
||||||
|
|
||||||
|
/* Button definitions ***************************************************************/
|
||||||
|
|
||||||
|
#define BOARD_BUTTON1 0
|
||||||
|
#define NUM_BUTTONS 1
|
||||||
|
#define BOARD_BUTTON1_BIT (1 << BOARD_BUTTON1)
|
||||||
|
|
||||||
/* Alternate function pin selections ************************************************/
|
/* Alternate function pin selections ************************************************/
|
||||||
/* UART1 */
|
/* UART1 */
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,16 @@ ifeq ($(CONFIG_PHOTON_DFU_BOOTLOADER),y)
|
|||||||
CSRCS += dfu_signature.c
|
CSRCS += dfu_signature.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_BUTTONS),y)
|
||||||
|
CSRCS += stm32_buttons.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_USERLED),y)
|
||||||
|
CSRCS += stm32_leds.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_PHOTON_WDG),y)
|
ifeq ($(CONFIG_PHOTON_WDG),y)
|
||||||
CSRCS += photon_wdt.c
|
CSRCS += stm32_wdt.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_STM32_OTGHS),y)
|
ifeq ($(CONFIG_STM32_OTGHS),y)
|
||||||
|
|||||||
@@ -48,6 +48,19 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* LEDs */
|
||||||
|
|
||||||
|
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
||||||
|
GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN13)
|
||||||
|
|
||||||
|
/* BUTTONS -- EXTI interrupts are available on Photon board button */
|
||||||
|
|
||||||
|
#define MIN_IRQBUTTON BOARD_BUTTON1
|
||||||
|
#define MAX_IRQBUTTON BOARD_BUTTON1
|
||||||
|
#define NUM_IRQBUTTONS 1
|
||||||
|
|
||||||
|
#define GPIO_BUTTON1 (GPIO_INPUT|GPIO_PULLUP|GPIO_EXTI|GPIO_PORTC|GPIO_PIN7)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|||||||
@@ -38,15 +38,15 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
#include "photon.h"
|
#include <syslog.h>
|
||||||
#include <debug.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
|
#include "photon.h"
|
||||||
#include "stm32_wdg.h"
|
#include "stm32_wdg.h"
|
||||||
|
#include <nuttx/input/buttons.h>
|
||||||
|
#include <nuttx/leds/userled.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -89,6 +89,36 @@ int board_app_initialize(uintptr_t arg)
|
|||||||
{
|
{
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
|
#ifdef CONFIG_USERLED
|
||||||
|
#ifdef CONFIG_USERLED_LOWER
|
||||||
|
/* Register the LED driver */
|
||||||
|
|
||||||
|
ret = userled_lower_initialize("/dev/userleds");
|
||||||
|
if (ret != OK)
|
||||||
|
{
|
||||||
|
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
board_userled_initialize();
|
||||||
|
#endif /* CONFIG_USERLED_LOWER */
|
||||||
|
#endif /* CONFIG_USERLED */
|
||||||
|
|
||||||
|
#ifdef CONFIG_BUTTONS
|
||||||
|
#ifdef CONFIG_BUTTONS_LOWER
|
||||||
|
/* Register the BUTTON driver */
|
||||||
|
|
||||||
|
ret = btn_lower_initialize("/dev/buttons");
|
||||||
|
if (ret != OK)
|
||||||
|
{
|
||||||
|
syslog(LOG_ERR, "ERROR: btn_lower_initialize() failed: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
board_button_initialize();
|
||||||
|
#endif /* CONFIG_BUTTONS_LOWER */
|
||||||
|
#endif /* CONFIG_BUTTONS */
|
||||||
|
|
||||||
#ifdef CONFIG_STM32_IWDG
|
#ifdef CONFIG_STM32_IWDG
|
||||||
stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY);
|
stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY);
|
||||||
#endif
|
#endif
|
||||||
@@ -100,9 +130,10 @@ int board_app_initialize(uintptr_t arg)
|
|||||||
ret = photon_watchdog_initialize();
|
ret = photon_watchdog_initialize();
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
{
|
{
|
||||||
serr("Failed to start watchdog thread: %d\n", errno);
|
syslog(LOG_ERR, "Failed to start watchdog thread: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* configs/photon/src/stm32_buttons.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Simon Piriou <spiriou31@gmail.com>
|
||||||
|
*
|
||||||
|
* 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 NuttX 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 AND CONTRIBUTORS
|
||||||
|
* "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 OWNER OR CONTRIBUTORS 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.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <debug.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <arch/board/board.h>
|
||||||
|
#include "photon.h"
|
||||||
|
|
||||||
|
#include "stm32_gpio.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: board_button_initialize
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void board_button_initialize(void)
|
||||||
|
{
|
||||||
|
/* Configure Photon button gpio as input */
|
||||||
|
|
||||||
|
stm32_configgpio(GPIO_BUTTON1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: board_buttons
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
uint8_t board_buttons(void)
|
||||||
|
{
|
||||||
|
/* Check the state of the only button */
|
||||||
|
|
||||||
|
if (stm32_gpioread(GPIO_BUTTON1))
|
||||||
|
{
|
||||||
|
return BOARD_BUTTON1_BIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: board_button_irq
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_ARCH_IRQBUTTONS
|
||||||
|
int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg)
|
||||||
|
{
|
||||||
|
if (id != BOARD_BUTTON1)
|
||||||
|
{
|
||||||
|
/* Invalid button id */
|
||||||
|
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Configure interrupt on falling edge only */
|
||||||
|
|
||||||
|
return stm32_gpiosetevent(GPIO_BUTTON1, false, true, false,
|
||||||
|
irqhandler, arg);
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_ARCH_IRQBUTTONS */
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* configs/photon/src/stm32_leds.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Simon Piriou <spiriou31@gmail.com>
|
||||||
|
*
|
||||||
|
* 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 NuttX 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 AND CONTRIBUTORS
|
||||||
|
* "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 OWNER OR CONTRIBUTORS 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.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <arch/board/board.h>
|
||||||
|
#include "photon.h"
|
||||||
|
|
||||||
|
#include "stm32_gpio.h"
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: board_userled_initialize
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void board_userled_initialize(void)
|
||||||
|
{
|
||||||
|
/* Configure Photon LED gpio as output */
|
||||||
|
|
||||||
|
stm32_configgpio(GPIO_LED1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: board_userled
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void board_userled(int led, bool ledon)
|
||||||
|
{
|
||||||
|
if (led == BOARD_LED1)
|
||||||
|
{
|
||||||
|
stm32_gpiowrite(GPIO_LED1, ledon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: board_userled_all
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void board_userled_all(uint8_t ledset)
|
||||||
|
{
|
||||||
|
stm32_gpiowrite(GPIO_LED1, !!(ledset & BOARD_LED1_BIT));
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* configs/photon/src/photon_wdt.c
|
* configs/photon/src/stm32_wdt.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Simon Piriou <spiriou31@gmail.com>
|
* Author: Simon Piriou <spiriou31@gmail.com>
|
||||||
Reference in New Issue
Block a user