From a82fc718a74a75d778e485548330414bad85f070 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 14 Jan 2025 09:40:16 +0100 Subject: [PATCH] stm32/mpconfigboard_common: Add MICROPY_HW_SPI_IS_STATIC macro. A board should make this return true if the specified SPI instances should not be deinitialized on soft-reboot. Signed-off-by: iabdalkader --- ports/stm32/mpconfigboard_common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/stm32/mpconfigboard_common.h b/ports/stm32/mpconfigboard_common.h index 5c66b804b..e1c9c159e 100644 --- a/ports/stm32/mpconfigboard_common.h +++ b/ports/stm32/mpconfigboard_common.h @@ -187,6 +187,12 @@ #define MICROPY_HW_SPI_IS_RESERVED(spi_id) (false) #endif +// Function to determine if the given spi_id is static or not. +// Static SPI instances can be accessed by the user but are not deinit'd on soft reset. +#ifndef MICROPY_HW_SPI_IS_STATIC +#define MICROPY_HW_SPI_IS_STATIC(spi_id) (false) +#endif + // Function to determine if the given tim_id is reserved for system use or not. #ifndef MICROPY_HW_TIM_IS_RESERVED #define MICROPY_HW_TIM_IS_RESERVED(tim_id) (false)