#ifndef _ARENA_BOARD_CONFIG_F072_H_
#define _ARENA_BOARD_CONFIG_F072_H_
//-----------------------------------------------------------------------------
///
/// \brief  Libbiwak board description
///
///         Basic STM32F072 Nucleo board
///
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//-----------------------------------------------------------------------------


#include <arena/boards/generic_stm32.h>    // Based on STM32 board


#define ARENA_ADC_1           eAdc1
#define ARENA_ADC_1_NAME      Adc1

#define ARENA_ADC_TEMPERATURE_INDEX    0
#define ARENA_ADC_TEMPERATURE_CHANNEL  ADC_CHANNEL_TEMPSENSOR
#define ARENA_ADC_VREF_CHANNEL         ADC_CHANNEL_VREFINT

#define ARENA_HAS_LED         1
#define ARENA_USE_LED         1
#define ARENA_LED_1           eGpioPeripheralA, eGpioPin5   // LD2, Pin D13

#define ARENA_OUT_1           eGpioPeripheralB, eGpioPin0
#define ARENA_OUT_2           eGpioPeripheralC, eGpioPin1

#if ARENA_WANT_WATCHDOG >0
   #define ARENA_USE_WATCHDOG       1
   #define ARENA_WATCHDOG_1         1
#endif

#define ARENA_RETAIN_1        1
#define ARENA_RETAIN_2        2
#define ARENA_SPI_1           eSpi1, \
                              eGpioPeripheralB, eGpioPin3,     /* SCK  D3 */ \
                              eGpioPeripheralB, eGpioPin5,     /* MOSI D4 */ \
                              eGpioPeripheralB, eGpioPin4      /* MISO D5 */

#define ARENA_HAS_UART           1
#define ARENA_USE_UART           ARENA_MIN(ARENA_WANT_UART, ARENA_HAS_UART)
#if ARENA_USE_UART >= 1
#define ARENA_UART_1          eUsart2, \
                              eGpioPeripheralA, eGpioPin2,    /* Tx yel  D1*/ \
                              eGpioPeripheralA, eGpioPin15    /* RX red  VAV 5V  */
#define ARENA_DEBUG_UART      0
#define ARENA_UART_1_IRQ     USART2_IRQHandler
#endif

#define ARENA_HAS_I2C            1
#define ARENA_USE_I2C            ARENA_MIN(ARENA_WANT_I2C, ARENA_HAS_I2C)
#if ARENA_USE_I2C >= 1
#define ARENA_I2C_1           eI2c1, \
                              eGpioPeripheralB, eGpioPin6,      /* SCL */ \
                              eGpioPeripheralB, eGpioPin7      /* SDA */
#endif

#define ARENA_GPIO_1          eGpioPeripheralC, eGpioPin3   // Pin CN7 37 (left)
#define ARENA_GPIO_1_EXTI_IRQ EXTI2_3_IRQHandler
#define ARENA_GPIO_2          eGpioPeripheralC, eGpioPin8
//#define ARENA_IR_1            eGpioPeripheralC, eGpioPin2   // Pin CN7 35 (left)
#define ARENA_GPIO_3          eGpioPeripheralC, eGpioPin2   // Pin CN7 35 (left)

#if ARENA_WANT_RTC > 0
   #define ARENA_USE_RTC         1
   #define ARENA_RTC_1           yep
#endif

#define ARENA_HAS_BUTTON         1
#if ARENA_WANT_BUTTON > 0
   #define ARENA_USE_BUTTON         1
   #define ARENA_BUTTON_1          eGpioPeripheralC, eGpioPin13   // USER B1
   #define ARENA_BUTTON_1_EXTI_IRQ EXTI4_15_IRQHandler
   #define eInterruptExtiButton    eInterruptExti13
#endif

//---fin-----------------------------------------------------------------------
#endif // ? ! _ARENA_BOARD_CONFIG_F072_H_
