//
// WARNING: DO NOT EDIT THIS FILE
//   This file has been generated from the target's JSON hardware description
//

#include "stm32_gpio.h"

static const stm32_adc_input_t _ADC_inputs[] = {
  {
    // LH
    // ADC_INPUT_STICK,
    GPIOC,
    LL_GPIO_PIN_0,
    LL_ADC_CHANNEL_10,
    0 // normal
  },
  {
    // LV
    // ADC_INPUT_STICK,
    GPIOC,
    LL_GPIO_PIN_2,
    LL_ADC_CHANNEL_12,
    0 // normal
  },
  {
    // RV
    // ADC_INPUT_STICK,
    nullptr,
    0,
    0,
    0 // normal
  },
  {
    // RH
    // ADC_INPUT_STICK,
    nullptr,
    0,
    0,
    0 // normal
  },
  {
    // VBAT
    // ADC_INPUT_VBAT,
    nullptr,
    0,
    0,
    0 // normal
  },
  {
    // RTC_BAT
    // ADC_INPUT_RTC_BAT,
    nullptr,
    0,
    0,
    0 // normal
  },
};

static const uint8_t _ADC_MAIN_channels[] = {
    0, // LH
    1, // LV
    2, // RV
    3, // RH
    4, // VBAT
    5, // RTC_BAT
};

static const stm32_adc_t _ADC_adc[] = {
  {
    ADC1,
    GPDMA1,
    LL_GPDMA1_REQUEST_ADC1,
    LL_DMA_CHANNEL_0,
    GPDMA1_Channel0_IRQn,
    _ADC_MAIN_channels,
    0,
    6,
    LL_ADC_SAMPLINGTIME_92CYCLES_5
  },
};

static const stm32_spi_adc_t _ADC_spi[] = {
};

extern "C" void GPDMA1_Channel0_IRQHandler (void)
{
  stm32_hal_adc_dma_isr(&_ADC_adc[0]);
}

extern "C" void ADC_IRQHandler()
{
  stm32_hal_adc_isr(&_ADC_adc[0]);
 
}

#if defined(STM32H7)
extern "C" void ADC3_IRQHandler()
{
  stm32_hal_adc_isr(&_ADC_adc[0]);
 
}
#endif

static const uint32_t _ADC_GPIOC_pins[] = {
    LL_GPIO_PIN_0,
    LL_GPIO_PIN_2,
};

static const stm32_adc_gpio_t _ADC_GPIOs[] = {
  { GPIOC, _ADC_GPIOC_pins, 2 },
};
