Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
stm32_flash_api_extensions.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Google Inc
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
8
10 /*
11 * STM32 sector write protection control.
12 *
13 * As an input this operation takes a structure with two sector masks,
14 * first mask is used to enable protection on sectors, while second mask
15 * is used to do the opposite. If both masks are 0, then protection will
16 * remain unchanged. If same sector is set on both masks, protection
17 * will be enabled.
18 *
19 * As an output, sector mask with enabled protection is returned.
20 * Input can be NULL if we only want to get protected sectors.
21 * Output can be NULL if not needed.
22 */
24 /*
25 * STM32 sector readout protection control.
26 *
27 * As an input this operation takes structure with information about
28 * desired RDP state. As an output the status after applying changes
29 * is returned.
30 */
32 /*
33 * STM32 block option register.
34 *
35 * This operation causes option register to be locked until next boot.
36 * After calling, it's not possible to change option bytes (WP, RDP,
37 * user bytes).
38 */
40 /*
41 * STM32 block control register.
42 *
43 * This operation causes control register to be locked until next boot.
44 * After calling, it's not possible to perform basic operation like
45 * erasing or writing.
46 */
48};
49
50#if defined(CONFIG_FLASH_STM32_WRITE_PROTECT)
51struct flash_stm32_ex_op_sector_wp_in {
52 uint32_t enable_mask;
53 uint32_t disable_mask;
54};
55
56struct flash_stm32_ex_op_sector_wp_out {
57 uint32_t protected_mask;
58};
59#endif /* CONFIG_FLASH_STM32_WRITE_PROTECT */
60
61#if defined(CONFIG_FLASH_STM32_READOUT_PROTECTION)
62struct flash_stm32_ex_op_rdp {
63 bool enable;
64 bool permanent;
65};
66#endif /* CONFIG_FLASH_STM32_READOUT_PROTECTION */
Public API for FLASH drivers.
#define FLASH_EX_OP_VENDOR_BASE
Definition flash.h:630
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
stm32_ex_ops
Definition stm32_flash_api_extensions.h:9
@ FLASH_STM32_EX_OP_BLOCK_OPTION_REG
Definition stm32_flash_api_extensions.h:39
@ FLASH_STM32_EX_OP_SECTOR_WP
Definition stm32_flash_api_extensions.h:23
@ FLASH_STM32_EX_OP_BLOCK_CONTROL_REG
Definition stm32_flash_api_extensions.h:47
@ FLASH_STM32_EX_OP_RDP
Definition stm32_flash_api_extensions.h:31