2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
2019-08-19 15:16:08 +00:00
|
|
|
* boards/arm/stm32/stm32butterfly2/src/stm32_butterfly2.h
|
2016-08-15 17:34:43 +02:00
|
|
|
*
|
2021-06-11 06:47:35 +02:00
|
|
|
* 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
|
2016-08-15 17:34:43 +02:00
|
|
|
*
|
2021-06-11 06:47:35 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2016-08-15 17:34:43 +02:00
|
|
|
*
|
2021-06-11 06:47:35 +02:00
|
|
|
* 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.
|
2016-08-15 17:34:43 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-08-19 15:16:08 +00:00
|
|
|
#ifndef __BOARDS_ARM_STM32_STM32_BUTTERFLY2_SRC_STM32_BUTTERFLY2_H
|
2020-01-31 10:07:39 -08:00
|
|
|
#define __BOARDS_ARM_STM32_STM32_BUTTERFLY2_SRC_STM32_BUTTERFLY2_H
|
2016-08-17 22:03:24 +02:00
|
|
|
|
2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
2016-08-15 17:34:43 +02:00
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "stm32_gpio.h"
|
|
|
|
|
2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
2016-08-15 17:34:43 +02:00
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2016-08-17 20:13:17 +02:00
|
|
|
/* SD Card pins */
|
|
|
|
|
2016-08-15 17:34:43 +02:00
|
|
|
#define GPIO_SD_CS (GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz |\
|
|
|
|
GPIO_OUTPUT_SET | GPIO_PORTA | GPIO_PIN4)
|
|
|
|
#define GPIO_SD_CD (GPIO_INPUT | GPIO_CNF_INFLOAT | GPIO_EXTI |\
|
|
|
|
GPIO_PORTB | GPIO_PIN9)
|
|
|
|
|
2016-08-17 20:13:17 +02:00
|
|
|
/* USB pins */
|
|
|
|
|
|
|
|
#define GPIO_OTGFS_PWRON (GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz |\
|
|
|
|
GPIO_OUTPUT_SET | GPIO_PORTD | GPIO_PIN15)
|
|
|
|
|
2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions Definitions
|
2016-08-15 17:34:43 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
2016-08-17 21:34:51 +02:00
|
|
|
* Name: stm32_led_initialize
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initializes low level gpio pins for board LEDS
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
void stm32_led_initialize(void);
|
|
|
|
|
2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
2016-08-15 17:34:43 +02:00
|
|
|
* Name: stm32_spidev_initialize
|
|
|
|
*
|
|
|
|
* Description:
|
2016-08-17 20:13:17 +02:00
|
|
|
* Called to configure SPI chip select GPIO pins.
|
2016-08-15 17:34:43 +02:00
|
|
|
*
|
|
|
|
* Note:
|
2016-08-17 20:13:17 +02:00
|
|
|
* Here only CS pins are configured as SPI pins are configured by driver
|
|
|
|
* itself.
|
2016-08-15 17:34:43 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
2016-08-17 21:34:51 +02:00
|
|
|
#ifdef CONFIG_STM32_SPI1
|
2016-08-15 17:34:43 +02:00
|
|
|
void stm32_spidev_initialize(void);
|
2016-08-17 21:34:51 +02:00
|
|
|
#else
|
2021-03-18 09:57:48 +01:00
|
|
|
static inline void stm32_spidev_initialize(void)
|
|
|
|
{
|
|
|
|
}
|
2016-08-17 21:34:51 +02:00
|
|
|
#endif
|
2016-08-15 17:34:43 +02:00
|
|
|
|
2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
2016-08-17 21:34:51 +02:00
|
|
|
* Name: stm32_mmcsd_initialize
|
2016-08-15 17:34:43 +02:00
|
|
|
*
|
|
|
|
* Description:
|
2016-08-17 20:13:17 +02:00
|
|
|
* Initializes SPI-based SD card
|
2016-08-15 17:34:43 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2016-08-17 21:34:51 +02:00
|
|
|
#ifdef CONFIG_MMCSD
|
|
|
|
int stm32_mmcsd_initialize(int minor);
|
|
|
|
#else
|
2021-03-18 09:57:48 +01:00
|
|
|
static inline int stm32_mmcsd_initialize(int minor)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2016-08-17 21:34:51 +02:00
|
|
|
#endif
|
2016-08-15 17:34:43 +02:00
|
|
|
|
2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
2016-08-17 20:13:17 +02:00
|
|
|
* Name: stm32_usb_initialize
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initializes USB pins
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_STM32_OTGFS
|
|
|
|
void stm32_usb_initialize(void);
|
|
|
|
#else
|
2021-03-18 09:57:48 +01:00
|
|
|
static inline void stm32_usb_initialize(void)
|
|
|
|
{
|
|
|
|
}
|
2016-08-17 20:13:17 +02:00
|
|
|
#endif
|
|
|
|
|
2021-03-18 09:57:48 +01:00
|
|
|
/****************************************************************************
|
2016-08-17 20:13:17 +02:00
|
|
|
* Name: stm32_usbhost_initialize
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initializes USB host functionality.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef CONFIG_USBHOST
|
|
|
|
int stm32_usbhost_initialize(void);
|
|
|
|
#else
|
2021-03-18 09:57:48 +01:00
|
|
|
static inline int stm32_usbhost_initialize(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2016-08-17 20:13:17 +02:00
|
|
|
#endif
|
|
|
|
|
2019-08-19 15:16:08 +00:00
|
|
|
/****************************************************************************
|
2016-12-05 17:06:08 -06:00
|
|
|
* Name: stm32_adc_setup
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Initialize ADC and register the ADC driver.
|
|
|
|
*
|
2019-08-19 15:16:08 +00:00
|
|
|
****************************************************************************/
|
2016-12-05 17:06:08 -06:00
|
|
|
|
|
|
|
#ifdef CONFIG_STM32_ADC
|
|
|
|
int stm32_adc_setup(void);
|
|
|
|
#else
|
2021-03-18 09:57:48 +01:00
|
|
|
static inline int stm32_adc_setup(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2016-12-05 17:06:08 -06:00
|
|
|
#endif
|
|
|
|
|
2019-08-19 15:16:08 +00:00
|
|
|
#endif /* __BOARDS_ARM_STM32_STM32_BUTTERFLY2_SRC_STM32_BUTTERFLY2_H */
|