From 4f37d09806f9e63e94ca5ddc9c58ac9da29daddb Mon Sep 17 00:00:00 2001
From: Matteo Pignataro <matteo.pignataro@skywarder.eu>
Date: Thu, 27 Jul 2023 07:21:10 +0000
Subject: [PATCH] [RIG] Added CAN pinmapping

---
 .../stm32f429zi_skyward_rig/interfaces-impl/bsp.cpp         | 5 +++++
 .../stm32f429zi_skyward_rig/interfaces-impl/hwmapping.h     | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rig/interfaces-impl/bsp.cpp b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rig/interfaces-impl/bsp.cpp
index 2b498dd7..b64129f8 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rig/interfaces-impl/bsp.cpp
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rig/interfaces-impl/bsp.cpp
@@ -259,6 +259,11 @@ namespace miosix
         uart1::tx::mode(Mode::ALTERNATE);
         uart1::tx::alternateFunction(7);
 
+        can1::rx::mode(Mode::ALTERNATE);
+        can1::rx::alternateFunction(9);
+        can1::tx::mode(Mode::ALTERNATE);
+        can1::tx::alternateFunction(9);
+
         timers::tim4ch2::mode(Mode::ALTERNATE);
         timers::tim11ch1::mode(Mode::ALTERNATE);
         timers::tim3ch1::mode(Mode::ALTERNATE);
diff --git a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rig/interfaces-impl/hwmapping.h b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rig/interfaces-impl/hwmapping.h
index 5286b802..add70849 100644
--- a/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rig/interfaces-impl/hwmapping.h
+++ b/miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rig/interfaces-impl/hwmapping.h
@@ -77,6 +77,12 @@ using tx = Gpio<GPIOA_BASE, 9>;
 using rx = Gpio<GPIOA_BASE, 10>;
 }  // namespace uart1
 
+namespace can1
+{
+using tx = Gpio<GPIOA_BASE, 12>;
+using rx = Gpio<GPIOA_BASE, 11>;
+}  // namespace can1
+
 namespace timers
 {
 using tim4ch2  = Gpio<GPIOB_BASE, 7>;  // Servo 1
-- 
GitLab