blob: 3631c04262215f253e2940487cce013b46308fee [file] [log] [blame]
/****************************************************************************
* boards/arm/stm32/photon/src/photon.h
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __BOARDS_ARM_STM32_PHOTON_SRC_PHOTON_H
#define __BOARDS_ARM_STM32_PHOTON_SRC_PHOTON_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <arch/stm32/chip.h>
/****************************************************************************
* 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)
/* WLAN chip */
#define SDIO_WLAN0_SLOTNO 0 /* Photon board has only one sdio device */
#define SDIO_WLAN0_MINOR 0 /* Register "wlan0" device */
#define GPIO_WLAN0_RESET (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN1)
#define GPIO_WLAN0_32K_CLK (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1)
#define GPIO_WLAN0_OOB_INT (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|\
GPIO_PORTB|GPIO_PIN0)
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Functions Definitions
****************************************************************************/
/****************************************************************************
* Name: stm32_bringup
*
* Description:
* Called either by board_initialize() if CONFIG_BOARD_LATE_INITIALIZE or
* by board_app_initialize if CONFIG_BOARDCTL is selected. This
* function initializes and configures all on-board features appropriate
* for the selected configuration.
*
****************************************************************************/
#if defined(CONFIG_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE)
int stm32_bringup(void);
#endif
/****************************************************************************
* Name: stm32_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the Photon board.
*
****************************************************************************/
void weak_function stm32_spidev_initialize(void);
/****************************************************************************
* Name: photon_watchdog_initialize()
*
* Description:
* Perform architecture-specific initialization of the Watchdog hardware.
*
* Input Parameters:
* None
*
* Returned Value:
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_PHOTON_WDG
int photon_watchdog_initialize(void);
#endif
/****************************************************************************
* Name: stm32_rgbled_setup
*
* Description:
* This function is called by board initialization logic to configure the
* RGB LED driver. This function will register the driver as /dev/rgbled0.
*
* Input Parameters:
* None
*
* Returned Value:
* Zero is returned on success. Otherwise, a negated errno value is
* returned to indicate the nature of the failure.
*
****************************************************************************/
#ifdef CONFIG_RGBLED
int stm32_rgbled_setup(void);
#endif
/****************************************************************************
* Name: photon_wlan_initialize
*
* Description:
* Initialize wlan hardware and driver for Photon board.
*
* Input Parameters:
* None
*
* Returned Value:
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_PHOTON_WLAN
int photon_wlan_initialize(void);
#endif
/****************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called from stm32_usbinitialize very early in initialization to setup
* USB-related GPIO pins for the Photon board.
*
****************************************************************************/
#ifdef CONFIG_STM32_OTGHS
void weak_function stm32_usbinitialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_STM32_PHOTON_SRC_PHOTON_H */