From e69f9601cd6e10b7fd384375c21016322dd85eb9 Mon Sep 17 00:00:00 2001 From: Matteo Pignataro <matteo.pignataro@skywarder.eu> Date: Wed, 13 Sep 2023 15:25:24 +0200 Subject: [PATCH] [Motor] Init battery voltage sensor pin --- .../stm32f767zi_gemini_motor/interfaces-impl/bsp.cpp | 2 ++ .../stm32f767zi_gemini_motor/interfaces-impl/hwmapping.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/miosix/arch/cortexM7_stm32f7/stm32f767zi_gemini_motor/interfaces-impl/bsp.cpp b/miosix/arch/cortexM7_stm32f7/stm32f767zi_gemini_motor/interfaces-impl/bsp.cpp index a1efbe4e..8a8884f3 100644 --- a/miosix/arch/cortexM7_stm32f7/stm32f767zi_gemini_motor/interfaces-impl/bsp.cpp +++ b/miosix/arch/cortexM7_stm32f7/stm32f767zi_gemini_motor/interfaces-impl/bsp.cpp @@ -295,6 +295,8 @@ void IRQbspInit() { peripherals::tank_level::lvl2::mode(Mode::INPUT); peripherals::tank_level::lvl3::mode(Mode::INPUT); + peripherals::battery_voltage::ch15::mode(Mode::INPUT_ANALOG); + DefaultConsole::instance().IRQset(intrusive_ref_ptr<Device>(new STM32Serial( defaultSerial, defaultSerialSpeed, STM32Serial::NOFLOWCTRL))); } diff --git a/miosix/arch/cortexM7_stm32f7/stm32f767zi_gemini_motor/interfaces-impl/hwmapping.h b/miosix/arch/cortexM7_stm32f7/stm32f767zi_gemini_motor/interfaces-impl/hwmapping.h index 8fd6600f..aa7d8ec5 100644 --- a/miosix/arch/cortexM7_stm32f7/stm32f767zi_gemini_motor/interfaces-impl/hwmapping.h +++ b/miosix/arch/cortexM7_stm32f7/stm32f767zi_gemini_motor/interfaces-impl/hwmapping.h @@ -140,6 +140,11 @@ using lvl2 = Gpio<GPIOG_BASE, 6>; using lvl3 = Gpio<GPIOB_BASE, 14>; } // namespace tank_level +namespace battery_voltage +{ +using ch15 = Gpio<GPIOC_BASE, 5>; +} + } // namespace peripherals } // namespace miosix -- GitLab