blob: c779ef42332a3a7925cb730934ba8fd581d10271 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001/**
2 * @file flags_api.h
xf.liaa4d92f2023-09-13 00:18:58 -07003 * @brief flags分区接口
xf.li6c8fc1e2023-08-12 00:11:09 -07004 *
5 * Copyright (C) 2023 Sanechips Technology Co., Ltd.
6 * @author
7 * @ingroup
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
xf.liaa4d92f2023-09-13 00:18:58 -070011 * published by the Free Software Foundation. (必选:GPLv2 Licence)
xf.li6c8fc1e2023-08-12 00:11:09 -070012 *
13 */
14
15
16#ifndef FLAGS_API_H
17#define FLAGS_API_H
18
19
20/*******************************************************************************
21 * Include header files *
22 ******************************************************************************/
23#include "pub_flags.h"
24
25
26/*******************************************************************************
27 * Macro definitions *
28 ******************************************************************************/
29
30
31/*******************************************************************************
32 * Type definitions *
33 ******************************************************************************/
34
35
36/*******************************************************************************
37 * Global variable declarations *
38 ******************************************************************************/
39
40
41/*******************************************************************************
42 * Global function declarations *
43 ******************************************************************************/
44/**
xf.liaa4d92f2023-09-13 00:18:58 -070045 * @brief 初始化flags分区
46 * @param[out] p_flags_info flags初始化数据
47 * @return 0 初始化成功, -1 初始化失败
xf.li6c8fc1e2023-08-12 00:11:09 -070048 * @note
49 */
50int flags_init();
51
52
53/**
xf.liaa4d92f2023-09-13 00:18:58 -070054 * @brief 获取flags分区内容
55 * @param[out] p_flags_info flags分区内容
56 * @return 0 获取成功, -1 获取失败
xf.li6c8fc1e2023-08-12 00:11:09 -070057 * @note
58 */
59int flags_get(T_FLAGS_INFO *p_flags_info);
60
61
62/**
xf.liaa4d92f2023-09-13 00:18:58 -070063 * @brief 设置flags分区内容
64 * @param[out] p_flags_info flags分区内容
65 * @return 0 设置成功, -1 设置失败
xf.li6c8fc1e2023-08-12 00:11:09 -070066 * @note
67 */
68int flags_set(T_FLAGS_INFO *p_flags_info);
69
70
71/**
xf.liaa4d92f2023-09-13 00:18:58 -070072 * @brief 获取flags分区中ubifs状态
73 * @param[out] status ubifs状态
74 * @return 0 获取成功, -1 获取失败
xf.li6c8fc1e2023-08-12 00:11:09 -070075 * @note
76 */
77int flags_get_ubifs_status(T_UBIFS_STATUS *p_ubifs_status);
78
79
80/**
xf.liaa4d92f2023-09-13 00:18:58 -070081 * @brief 设置flags分区中ubifs状态
82 * @param[in] status ubifs状态
83 * @return 0 设置成功, -1 设置失败
xf.li6c8fc1e2023-08-12 00:11:09 -070084 * @note
85 */
86int flags_set_ubifs_status(T_UBIFS_STATUS *p_ubifs_status);
87
88
89/**
xf.liaa4d92f2023-09-13 00:18:58 -070090 * @brief 获取当前系统
91 * @return 当前运行系统
xf.li6c8fc1e2023-08-12 00:11:09 -070092 * @note
93 */
94int flags_get_current_system();
95
xf.liaa4d92f2023-09-13 00:18:58 -070096/**
97 * @brief »ñÈ¡flags·ÖÇøÖÐnvro_flag״̬
98 * @param[out]
99 * @return nvro_flag
100 * @note
101 */
102unsigned int flags_get_nvroflag(void);
103
104/**
105 * @brief ÉèÖÃflags·ÖÇøÖÐnvro_flag
106 * @param[in] flag nvro״̬
107 * @return 0 ÉèÖóɹ¦, -1 ÉèÖÃʧ°Ü
108 * @note
109 */
110int flags_set_nvroflag(unsigned int flag);
111
xf.li6c8fc1e2023-08-12 00:11:09 -0700112
113#endif // FLAGS_API_H
114