5cdd038df2
Squashed commit of the following: arch/arm: Rename include/stm32f0l0 and src/stm32f0l0 to stm32f0l0g0. Change all occurrences of lower-case stm32f0l0 to stm32f0l0g0. Change all occurrences of upper-case STM32F0L0 to STM32F0L0G0.
124 lines
4.7 KiB
C
124 lines
4.7 KiB
C
/****************************************************************************
|
|
* configs/nucleo-f072rb/src/nucleo-f072rb.h
|
|
*
|
|
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
|
* Alan Carvalho de Assis <acassis@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.
|
|
*
|
|
****************************************************************************/
|
|
|
|
#ifndef __CONFIGS_NUCLEO_F072RB_SRC_NUCLEO_F072RB_H
|
|
#define __CONFIGS_NUCLEO_F072RB_SRC_NUCLEO_F072RB_H
|
|
|
|
/****************************************************************************
|
|
* Included Files
|
|
****************************************************************************/
|
|
|
|
#include <nuttx/config.h>
|
|
#include <nuttx/compiler.h>
|
|
#include <stdint.h>
|
|
|
|
#include "stm32_gpio.h"
|
|
|
|
/****************************************************************************
|
|
* Pre-processor Definitions
|
|
****************************************************************************/
|
|
|
|
/* Configuration ************************************************************/
|
|
/* How many SPI modules does this chip support? */
|
|
|
|
#if STM32_NSPI < 1
|
|
# undef CONFIG_STM32F0L0G0_SPI1
|
|
# undef CONFIG_STM32F0L0G0_SPI2
|
|
# undef CONFIG_STM32F0L0G0_SPI3
|
|
#elif STM32_NSPI < 2
|
|
# undef CONFIG_STM32F0L0G0_SPI2
|
|
# undef CONFIG_STM32F0L0G0_SPI3
|
|
#elif STM32_NSPI < 3
|
|
# undef CONFIG_STM32F0L0G0_SPI3
|
|
#endif
|
|
|
|
/* Nucleo-F072RB GPIOs ******************************************************/
|
|
/* LED. User LD2: the green LED is a user LED connected to Arduino signal
|
|
* D13 corresponding to MCU I/O PA5 (pin 21) or PB13 (pin 34) depending on
|
|
* the STM32 target.
|
|
*
|
|
* - When the I/O is HIGH value, the LED is on.
|
|
* - When the I/O is LOW, the LED is off.
|
|
*/
|
|
|
|
#define GPIO_LD2 (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_MEDIUM | \
|
|
GPIO_OUTPUT_CLEAR | GPIO_PORTA | GPIO_PIN5)
|
|
|
|
/* Button definitions *******************************************************/
|
|
/* B1 USER: the user button is connected to the I/O PC13 (pin 2) of the STM32
|
|
* microcontroller.
|
|
*/
|
|
|
|
#define MIN_IRQBUTTON BUTTON_USER
|
|
#define MAX_IRQBUTTON BUTTON_USER
|
|
#define NUM_IRQBUTTONS 1
|
|
|
|
#define GPIO_BTN_USER (GPIO_INPUT | GPIO_FLOAT | GPIO_EXTI | \
|
|
GPIO_PORTC | GPIO_PIN13)
|
|
|
|
/****************************************************************************
|
|
* Public Types
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Public data
|
|
****************************************************************************/
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
/****************************************************************************
|
|
* Public Functions
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
* Name: stm32_bringup
|
|
*
|
|
* Description:
|
|
* Perform architecture-specific initialization
|
|
*
|
|
* CONFIG_BOARD_LATE_INITIALIZE=y :
|
|
* Called from board_late_initialize().
|
|
*
|
|
* CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y :
|
|
* Called from the NSH library
|
|
*
|
|
****************************************************************************/
|
|
|
|
int stm32_bringup(void);
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
#endif /* __CONFIGS_NUCLEO_F072RB_SRC_NUCLEO_F072RB_H */
|