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
7#ifndef __ZEPHYR_INCLUDE_DRIVERS_FLASH_STM32_FLASH_API_EXTENSIONS_H__
8#define __ZEPHYR_INCLUDE_DRIVERS_FLASH_STM32_FLASH_API_EXTENSIONS_H__
9
11
13 /*
14 * STM32 sector write protection control.
15 *
16 * As an input this operation takes a structure with two sector masks,
17 * first mask is used to enable protection on sectors, while second mask
18 * is used to do the opposite. If both masks are 0, then protection will
19 * remain unchanged. If same sector is set on both masks, protection
20 * will be enabled.
21 *
22 * As an output, sector mask with enabled protection is returned.
23 * Input can be NULL if we only want to get protected sectors.
24 * Output can be NULL if not needed.
25 */
27 /*
28 * STM32 sector readout protection control.
29 *
30 * As an input this operation takes structure with information about
31 * desired RDP state. As an output the status after applying changes
32 * is returned.
33 */
35 /*
36 * STM32 block option register.
37 *
38 * This operation causes option register to be locked until next boot.
39 * After calling, it's not possible to change option bytes (WP, RDP,
40 * user bytes).
41 */
43 /*
44 * STM32 block control register.
45 *
46 * This operation causes control register to be locked until next boot.
47 * After calling, it's not possible to perform basic operation like
48 * erasing or writing.
49 */
51 /*
52 * STM32 option bytes read.
53 *
54 * Read the option bytes content, out takes a *uint32_t, in is unused.
55 */
57 /*
58 * STM32 option bytes write.
59 *
60 * Write the option bytes content, in takes the new value, out is
61 * unused. Note that the new value only takes effect after the device
62 * is restarted.
63 */
65};
66
67#if defined(CONFIG_FLASH_STM32_WRITE_PROTECT)
68struct flash_stm32_ex_op_sector_wp_in {
69 uint32_t enable_mask;
70 uint32_t disable_mask;
71};
72
73struct flash_stm32_ex_op_sector_wp_out {
74 uint32_t protected_mask;
75};
76#endif /* CONFIG_FLASH_STM32_WRITE_PROTECT */
77
78#if defined(CONFIG_FLASH_STM32_READOUT_PROTECTION)
79struct flash_stm32_ex_op_rdp {
80 bool enable;
81 bool permanent;
82};
83#endif /* CONFIG_FLASH_STM32_READOUT_PROTECTION */
84
85#endif /* __ZEPHYR_INCLUDE_DRIVERS_FLASH_STM32_FLASH_API_EXTENSIONS_H__ */
Public API for FLASH drivers.
#define FLASH_EX_OP_VENDOR_BASE
Definition flash.h:670
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
stm32_ex_ops
Definition stm32_flash_api_extensions.h:12
@ FLASH_STM32_EX_OP_OPTB_WRITE
Definition stm32_flash_api_extensions.h:64
@ FLASH_STM32_EX_OP_BLOCK_OPTION_REG
Definition stm32_flash_api_extensions.h:42
@ FLASH_STM32_EX_OP_OPTB_READ
Definition stm32_flash_api_extensions.h:56
@ FLASH_STM32_EX_OP_SECTOR_WP
Definition stm32_flash_api_extensions.h:26
@ FLASH_STM32_EX_OP_BLOCK_CONTROL_REG
Definition stm32_flash_api_extensions.h:50
@ FLASH_STM32_EX_OP_RDP
Definition stm32_flash_api_extensions.h:34