267 lines
9.0 KiB
C
Raw Normal View History

/************************************************************************************
Merged in alinjerpelea/nuttx (pull request #963) Move boards to boards folder * boards: rename configs folder to boards This is the proposed layout after the change: boards: - folder containing board folders <board>: - name of each board drivers: - extra drivers specific for platform include: - header files for the boars scripts: - extra scripts specific for platform src: - board specific code tools: - extra tools specific for platform <config>: - board specific configuration(s) Note: <xxx> names are dependent on platform This is a logical change to aim to the arch layout but this is a huge change it should be done in several steps to lower the risk. Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * Kconfig: replace configs with boards The change is needed after the path change Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * Makefile: replace configs with boards The change is needed after the path change Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * Makefile.*: replace configs with boards The change is needed after the path change Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * Make.defs: replace configs with boards The change is needed after the path change Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * .sh: replace configs with boards The change is needed after the path change Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * .mk: replace configs with boards The change is needed after the path change Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * .c & .h: replace configs with boards The change is needed after the path change Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * .bat: replace configs with boards The change is needed after the path change Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-05 12:04:14 +00:00
* boards/nucleo-h743zi/src/nucleo-h743zi.h
*
# Copyright (C) 2017, 2019 Gwenhael Goavec-Merou. All rights reserved.
# Authors: Gwenhael Goavec-Merou<gwenhael.goavec-merou@trabucayre.com>
* David Sidrane <david.sidrane@nscdg.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.
*
************************************************************************************/
Merged in alinjerpelea/nuttx (pull request #966) group boards by architecture * z80: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * z16: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * xtensa: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * x86: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * sim: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * risc-v: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * renesas: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * or1k: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * misoc: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * mips: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * hc: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * avr: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * arm: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * boards: group boards by architecture Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-06 14:37:27 +00:00
#ifndef __BOARDS_ARM_NUCLEO_H743ZI_SRC_NUCLEO_H743ZI_H
#define __BOARDS_ARM_NUCLEO_H743ZI_SRC_NUCLEO_H743ZI_H
/************************************************************************************
* Included Files
************************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* procfs File System */
#ifdef CONFIG_FS_PROCFS
# ifdef CONFIG_NSH_PROC_MOUNTPOINT
# define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
# else
# define STM32_PROCFS_MOUNTPOINT "/proc"
# endif
#endif
#define HAVE_RTC_DRIVER 1
/* Configuration ********************************************************************/
/* LED
*
* The Nucleo-144 board has numerous LEDs but only three, LD1 a Green LED, LD2 a
* Blue LED and LD3 a Red LED, that can be controlled by software. The following
* definitions assume the default Solder Bridges are installed.
*/
#define GPIO_LD1 (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_CLEAR | \
GPIO_PORTB | GPIO_PIN0)
#define GPIO_LD2 (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_CLEAR | \
GPIO_PORTB | GPIO_PIN7)
#define GPIO_LD3 (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_CLEAR | \
GPIO_PORTB | GPIO_PIN14)
#define GPIO_LED_GREEN GPIO_LD1
#define GPIO_LED_BLUE GPIO_LD2
#define GPIO_LED_RED GPIO_LD3
#define LED_DRIVER_PATH "/dev/userleds"
/* BUTTONS
*
* The Blue pushbutton B1, labeled "User", is connected to GPIO PC13. A high value
* will be sensed when the button is depressed.
* Note:
* 1) That the EXTI is included in the definition to enable an interrupt on this
* IO.
* 2) The following definitions assume the default Solder Bridges are installed.
*/
#define GPIO_BTN_USER (GPIO_INPUT | GPIO_FLOAT | GPIO_EXTI | GPIO_PORTC | GPIO_PIN13)
/* USB OTG FS
*
* PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED)
* PG6 OTG_FS_PowerSwitchOn
* PG7 OTG_FS_Overcurrent
*/
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz| \
GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9)
#define GPIO_OTGFS_PWRON (GPIO_OUTPUT|GPIO_FLOAT|GPIO_SPEED_100MHz| \
GPIO_PUSHPULL|GPIO_PORTG|GPIO_PIN6)
#ifdef CONFIG_USBHOST
# define GPIO_OTGFS_OVER (GPIO_INPUT|GPIO_EXTI|GPIO_FLOAT| \
GPIO_SPEED_100MHz|GPIO_PUSHPULL| \
GPIO_PORTG|GPIO_PIN7)
#else
# define GPIO_OTGFS_OVER (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz| \
GPIO_PUSHPULL|GPIO_PORTG|GPIO_PIN7)
#endif
/* X-NUCLEO IKS01A2 */
#define GPIO_LPS22HB_INT1 (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN10)
#define GPIO_LSM6DSL_INT1 (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN4)
#define GPIO_LSM6DSL_INT2 (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN5)
/* NRF24L01
* CS - PA4
* CE - PF12 (D8)
* IRQ - PD15 (D9)
*/
#define GPIO_NRF24L01_CS (GPIO_OUTPUT | GPIO_SPEED_50MHz| \
GPIO_OUTPUT_SET | GPIO_PORTA | GPIO_PIN4)
#define GPIO_NRF24L01_CE (GPIO_OUTPUT | GPIO_SPEED_50MHz| \
GPIO_OUTPUT_CLEAR | GPIO_PORTF | GPIO_PIN12)
#define GPIO_NRF24L01_IRQ (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTD | GPIO_PIN15)
/* LMS9DS1 configuration */
#define LMS9DS1_I2CBUS 1
/* PCA9635 configuration */
#define PCA9635_I2CBUS 1
#define PCA9635_I2CADDR 0x40
/* Oled configuration */
#define OLED_I2C_PORT 2
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: stm32_bringup
*
* Description:
* Perform architecture-specific initialization
*
* CONFIG_BOARD_LATE_INITIALIZE=y :
* Called from board_late_initialize().
*
* CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y :
* Called from the NSH library
*
************************************************************************************/
int stm32_bringup(void);
/************************************************************************************
* Name: stm32_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the Nucleo-H743ZI board.
*
************************************************************************************/
#ifdef CONFIG_STM32H7_SPI
void stm32_spidev_initialize(void);
#endif
/************************************************************************************
* Name: stm32_adc_setup
*
* Description:
* Initialize ADC and register the ADC driver.
*
************************************************************************************/
#ifdef CONFIG_ADC
int stm32_adc_setup(void);
#endif
/************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called from stm32_usbinitialize very early in inialization to setup USB-related
* GPIO pins for the nucleo-144 board.
*
************************************************************************************/
#ifdef CONFIG_STM32H7_OTGFS
void stm32_usbinitialize(void);
#endif
/*****************************************************************************
* Name: stm32_lsm6dsl_initialize
*
* Description:
* Initialize I2C-based LSM6DSL.
2019-04-28 06:46:48 -06:00
*
****************************************************************************/
#ifdef CONFIG_SENSORS_LSM303AGR
int stm32_lsm6dsl_initialize(char *devpath);
#endif
/*****************************************************************************
* Name: stm32_lsm303agr_initialize
*
* Description:
* Initialize I2C-based LSM303AGR.
2019-04-28 06:46:48 -06:00
*
****************************************************************************/
#ifdef CONFIG_SENSORS_LSM6DSL
int stm32_lsm303agr_initialize(char *devpath);
#endif
/*****************************************************************************
* Name: stm32_wlinitialize
*
* Description:
* Initialize NRF24L01 wireless interaface.
****************************************************************************/
#ifdef CONFIG_WL_NRF24L01
int stm32_wlinitialize(void);
#endif
/*****************************************************************************
* Name: stm32_lsm9ds1_initialize
*
* Description:
* Initialize I2C-based LSM9DS1.
****************************************************************************/
#ifdef CONFIG_SENSORS_LSM9DS1
int stm32_lsm9ds1_initialize(char *devpath);
#endif
/****************************************************************************
* Name: stm32_pca9635_initialize
*
* Description:
* Initialize I2C-based PCA9635PW LED driver.
****************************************************************************/
#ifdef CONFIG_PCA9635PW
int stm32_pca9635_initialize(void);
#endif
Merged in alinjerpelea/nuttx (pull request #966) group boards by architecture * z80: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * z16: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * xtensa: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * x86: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * sim: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * risc-v: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * renesas: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * or1k: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * misoc: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * mips: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * hc: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * avr: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * arm: group boards by architecture all boards that share the same architecture are moved to the same arch folder following the soc layout Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * boards: group boards by architecture Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-08-06 14:37:27 +00:00
#endif /* __BOARDS_ARM_NUCLEO_H743ZI_SRC_NUCLEO_H743ZI_H */