From 068e71d0c624d9397e971f0de49efaefc155cc0e Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Tue, 6 Apr 2021 13:45:48 -0400 Subject: [PATCH] stm32h7: Expose flash lock, unlock, and write protect functions to boards. --- arch/arm/src/stm32h7/stm32_flash.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/src/stm32h7/stm32_flash.h b/arch/arm/src/stm32h7/stm32_flash.h index 5c0422364c..ff7e153680 100644 --- a/arch/arm/src/stm32h7/stm32_flash.h +++ b/arch/arm/src/stm32h7/stm32_flash.h @@ -76,6 +76,36 @@ void stm32h7_flash_optmodify(uint32_t clear, uint32_t set); void stm32h7_flash_swapbanks(void); +/**************************************************************************** + * Name: stm32h7_flash_lock + * + * Description: + * Locks a bank + * + ****************************************************************************/ + +int stm32h7_flash_lock(void); + +/**************************************************************************** + * Name: stm32h7_flash_unlock + * + * Description: + * Unlocks a bank + * + ****************************************************************************/ + +int stm32h7_flash_unlock(void); + +/**************************************************************************** + * Name: stm32h7_flash_writeprotect + * + * Description: + * Enable or disable the write protection of a flash sector. + * + ****************************************************************************/ + +int stm32h7_flash_writeprotect(size_t page, bool enabled); + #undef EXTERN #if defined(__cplusplus) }