From 8d5083edf9b8357b78fec4167a548ddd773d7bf6 Mon Sep 17 00:00:00 2001
From: Pietro Bortolus <Pietro.bortolus@skywarder.eu>
Date: Mon, 17 Mar 2025 18:01:22 +0100
Subject: [PATCH] Changed cs pin definition for pressure sensors

Changed the cs pin definitions for PS0, PS1 and PS2 with the pins of the new board.
Added a PS3 namespace with the correct cs pin for a new pressure sensor and modified the bsp accordingly.
---
 .../config/board_options.cmake                 |  2 +-
 .../interfaces-impl/bsp.cpp                    |  2 ++
 .../interfaces-impl/hwmapping.h                | 18 +++++++++++++++---
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/bsps/stm32f767zi_orion_biscotto/config/board_options.cmake b/src/bsps/stm32f767zi_orion_biscotto/config/board_options.cmake
index 1f21a96fb..7e8ca8490 100644
--- a/src/bsps/stm32f767zi_orion_biscotto/config/board_options.cmake
+++ b/src/bsps/stm32f767zi_orion_biscotto/config/board_options.cmake
@@ -23,7 +23,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>
 
-set(BOARD_NAME stm32f767zi_lyra_biscotto)
+set(BOARD_NAME stm32f767zi_orion_biscotto)
 set(ARCH_NAME cortexM7_stm32f7)
 
 # Base directories with header files for this board
diff --git a/src/bsps/stm32f767zi_orion_biscotto/interfaces-impl/bsp.cpp b/src/bsps/stm32f767zi_orion_biscotto/interfaces-impl/bsp.cpp
index 98eca468c..9eb48d883 100644
--- a/src/bsps/stm32f767zi_orion_biscotto/interfaces-impl/bsp.cpp
+++ b/src/bsps/stm32f767zi_orion_biscotto/interfaces-impl/bsp.cpp
@@ -330,6 +330,8 @@ void IRQbspInit()
     sensors::PS1::cs::high();
     sensors::PS2::cs::mode(Mode::OUTPUT);
     sensors::PS2::cs::high();
+    sensors::PS3::cs::mode(Mode::OUTPUT);
+    sensors::PS3::cs::high();
 
     sensors::VN100::cs::mode(Mode::OUTPUT);
     sensors::VN100::cs::high();
diff --git a/src/bsps/stm32f767zi_orion_biscotto/interfaces-impl/hwmapping.h b/src/bsps/stm32f767zi_orion_biscotto/interfaces-impl/hwmapping.h
index 25e88a3ce..d4cb22e7e 100644
--- a/src/bsps/stm32f767zi_orion_biscotto/interfaces-impl/hwmapping.h
+++ b/src/bsps/stm32f767zi_orion_biscotto/interfaces-impl/hwmapping.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2024 Skyward Experimental Rocketry
+/* Copyright (c) 2025 Skyward Experimental Rocketry
  * Author: Davide Mor
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -180,18 +180,30 @@ using syncIn  = Gpio<GPIOB_BASE, 7>;
 using syncOut = Gpio<GPIOE_BASE, 3>;
 }  // namespace VN100
 
-namespace PS0
+/*
+namespace LSM6_1
 {
 using cs = Gpio<GPIOC_BASE, 7>;
 }
+*/
 
-namespace PS1
+namespace PS0
 {
 using cs = Gpio<GPIOD_BASE, 5>;
 }
 
+namespace PS1
+{
+using cs = Gpio<GPIOB_BASE, 9>;
+}
+
 namespace PS2
 {
+using cs = Gpio<GPIOB_BASE, 8>;
+}
+
+namespace PS3
+{
 using cs = Gpio<GPIOD_BASE, 3>;
 }
 
-- 
GitLab