blob: fc7ace7881563fa080f204b43b7be457fd609dc8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
/*!
* @file apm32f0xx_ob.c
*
* @brief This file contains all the functions for the OB peripheral
*
* @version V1.0.3
*
* @date 2022-09-20
*
* @attention
*
* Copyright (C) 2020-2022 Geehy Semiconductor
*
* You may not use this file except in compliance with the
* GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
*
* The program is only for reference, which is distributed in the hope
* that it will be useful and instructional for customers to develop
* their software. Unless required by applicable law or agreed to in
* writing, the program is distributed on an "AS IS" BASIS, WITHOUT
* ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
* See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
* and limitations under the License.
*/
#include "apm32f0xx_ob.h"
/** @addtogroup APM32F0xx_StdPeriphDriver
@{
*/
/** @addtogroup OB_Driver
@{
*/
/** @defgroup OB_Macros Macros
@{
*/
/**@} end of group OB_Macros*/
/** @defgroup OB_Enumerations Enumerations
@{
*/
/**@} end of group OB_Enumerations*/
/** @defgroup OB_Structures Structures
@{
*/
/**@} end of group OB_Structures*/
/** @defgroup OB_Variables Variables
@{
*/
/**@} end of group OB_Variables*/
/** @defgroup OB_Functions Functions
@{
*/
/*!
* @brief Read Flash Protection Level
*
* @param readProtection: Specifies the read protection level.
* The parameter can be one of following values:
* @arg OB_READ_PRO_LEVEL0: No protection
* @arg OB_READ_PRO_LEVEL1: Read protection of the memory
* @retval None
*/
void OB_ReadProtectionOptionByte(OB_READ_PRO_T readProtection)
{
OB->READPORT_B.READPROT = readProtection;
}
/*!
* @brief Option Bytes Watchdog
*
* @param wdt: Select Watchdog SW/HW
*
* @retval None
*/
void OB_OptionBytesWatchdog(OB_WDT_T wdt)
{
OB->USER_B.WDTSEL = wdt;
}
/*!
* @brief Option Bytes nRST STOP
*
* @param stop: Select nRST STOP RST/SET
*
* @retval None
*/
void OB_OptionBytesStop(OB_STOP_T stop)
{
OB->USER_B.RSTSTOP = stop;
}
/*!
* @brief Option Bytes nRST STDBY
*
* @param standby: Select nRST STDBY RST/SET
*
* @retval None
*/
void OB_OptionBytesStandby(OB_STANDBY_T standby)
{
OB->USER_B.RSTSTDBY = standby;
}
/*!
* @brief Option Bytes nBOOT1
*
* @param boot: Select nRST BOOT1 RST/SET
*
* @retval None
*/
void OB_OptionBytesBoot1(OB_BOOT1_T boot)
{
OB->USER_B.BOT1 = boot;
}
/*!
* @brief Option Bytes VDDA_Analog_Monitoring
*
* @param vdda: Select VDDA ANALOG OFF/ON
*
* @retval None
*/
void OB_OptionBytesVddaAnalog(OB_VDDA_T vdda)
{
OB->USER_B.VDDAMON = vdda;
}
/*!
* @brief Option Bytes RAM PARITY CHECK
*
* @param rpc: Select RAM PARITY OFF/ON
*
* @retval None
*/
void OB_OptionBytesRamParity(OB_RAM_PARITY_CHECK_T ramParityCheck)
{
OB->USER_B.RPC = ramParityCheck;
}
/**@} end of group OB_Functions */
/**@} end of group OB_Driver */
/**@} end of group APM32F0xx_StdPeriphDriver */
|