2015-10-03 15:41:15 +02:00
|
|
|
/****************************************************************************
|
2019-08-05 14:04:14 +02:00
|
|
|
* boards/olimex-stm32-h405/src/olimex-stm32-h405.h
|
2014-06-03 18:34:36 +02:00
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Max Holtzberg. All rights reserved.
|
|
|
|
* Author: Max Holtzberg <mholtzberg@uvc-ingenieure.de>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
2015-10-03 15:41:15 +02:00
|
|
|
****************************************************************************/
|
2014-06-03 18:34:36 +02:00
|
|
|
|
2019-08-06 16:37:27 +02:00
|
|
|
#ifndef __BOARDS_ARM_OLIMEX_STM32_H405_SRC_H
|
|
|
|
#define __BOARDS_ARM_OLIMEX_STM32_H405_SRC_H
|
2014-06-03 18:34:36 +02:00
|
|
|
|
2015-10-03 15:41:15 +02:00
|
|
|
/****************************************************************************
|
2014-06-03 18:34:36 +02:00
|
|
|
* Included Files
|
2015-10-03 15:41:15 +02:00
|
|
|
****************************************************************************/
|
2014-06-03 18:34:36 +02:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
#include <nuttx/compiler.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2015-10-03 15:41:15 +02:00
|
|
|
/****************************************************************************
|
2015-04-08 17:15:17 +02:00
|
|
|
* Pre-processor Definitions
|
2015-10-03 15:41:15 +02:00
|
|
|
****************************************************************************/
|
2014-06-03 18:34:36 +02:00
|
|
|
|
|
|
|
/* Olimex-STM32-P405 GPIOs ****************************************************/
|
|
|
|
/* LEDs */
|
|
|
|
|
|
|
|
#define GPIO_LED_STATUS (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
|
|
|
GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN12)
|
|
|
|
|
|
|
|
/* BUTTONS -- NOTE that all have EXTI interrupts configured */
|
|
|
|
|
|
|
|
#define MIN_IRQBUTTON BUTTON_BUT
|
|
|
|
#define MAX_IRQBUTTON BUTTON_BUT
|
|
|
|
#define NUM_IRQBUTTONS 1
|
|
|
|
|
|
|
|
#define GPIO_BTN_BUT (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTA|GPIO_PIN0)
|
|
|
|
|
|
|
|
/* USB OTG FS
|
|
|
|
*
|
|
|
|
* PC4 OTG_FS_VBUS VBUS sensing
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTC|GPIO_PIN4)
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
/************************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
************************************************************************************/
|
|
|
|
|
|
|
|
/************************************************************************************
|
|
|
|
* Name: stm32_usbinitialize
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Called from stm32_usbinitialize very early in initialization to setup USB-related
|
|
|
|
* GPIO pins for the Olimex-STM32-H405 board.
|
|
|
|
*
|
|
|
|
************************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_STM32_OTGFS
|
|
|
|
void weak_function stm32_usbinitialize(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/************************************************************************************
|
2016-12-06 00:06:08 +01:00
|
|
|
* Name: stm32_adc_setup
|
2014-06-03 18:34:36 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2016-12-06 00:06:08 +01:00
|
|
|
* Initialize ADC and register the ADC driver.
|
2014-06-03 18:34:36 +02:00
|
|
|
*
|
|
|
|
************************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_ADC
|
2016-12-06 00:06:08 +01:00
|
|
|
int stm32_adc_setup(void);
|
2014-06-03 18:34:36 +02:00
|
|
|
#endif
|
|
|
|
|
2016-12-06 15:51:37 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: stm32_can_setup
|
2014-06-03 18:34:36 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2016-12-06 15:51:37 +01:00
|
|
|
* Initialize CAN and register the CAN device
|
2014-06-03 18:34:36 +02:00
|
|
|
*
|
2016-12-06 15:51:37 +01:00
|
|
|
****************************************************************************/
|
2014-06-03 18:34:36 +02:00
|
|
|
|
2016-12-06 15:51:37 +01:00
|
|
|
#ifdef CONFIG_CAN
|
|
|
|
int stm32_can_setup(void);
|
2014-06-03 18:34:36 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
2019-08-06 16:37:27 +02:00
|
|
|
#endif /* __BOARDS_ARM_OLIMEX_STM32_H405_SRC_H */
|