📄 stm32f10x_exti.lst
字号:
92 }
93 }
94
95 /*******************************************************************************
96 * Function Name : EXTI_StructInit
97 * Description : Fills each EXTI_InitStruct member with its reset value.
98 * Input : - EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure
99 * which will be initialized.
100 * Output : None
101 * Return : None
102 *******************************************************************************/
103 void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct)
104 {
105 EXTI_InitStruct->EXTI_Line = EXTI_LineNone;
106 EXTI_InitStruct->EXTI_Mode = EXTI_Mode_Interrupt;
107 EXTI_InitStruct->EXTI_Trigger = EXTI_Trigger_Falling;
108 EXTI_InitStruct->EXTI_LineCmd = DISABLE;
109 }
110
111 /*******************************************************************************
112 * Function Name : EXTI_GenerateSWInterrupt
113 * Description : Generates a Software interrupt.
114 * Input : - EXTI_Line: specifies the EXTI lines to be enabled or
115 * disabled.
116 * This parameter can be:
117 * - EXTI_Linex: External interrupt line x where x(0..18)
118 * Output : None
119 * Return : None
120 *******************************************************************************/
121 void EXTI_GenerateSWInterrupt(u32 EXTI_Line)
122 {
123 /* Check the parameters */
124 assert(IS_EXTI_LINE(EXTI_Line));
125
126 EXTI->SWIER |= EXTI_Line;
127 }
128
129 /*******************************************************************************
130 * Function Name : EXTI_GetFlagStatus
131 * Description : Checks whether the specified EXTI line flag is set or not.
132 * Input : - EXTI_Line: specifies the EXTI lines flag to check.
133 * This parameter can be:
134 * - EXTI_Linex: External interrupt line x where x(0..18)
135 * Output : None
136 * Return : The new state of EXTI_Line (SET or RESET).
137 *******************************************************************************/
138 FlagStatus EXTI_GetFlagStatus(u32 EXTI_Line)
139 {
140 FlagStatus bitstatus = RESET;
141
142 /* Check the parameters */
143 assert(IS_GET_EXTI_LINE(EXTI_Line));
144
145 if ((EXTI->PR & EXTI_Line) != (u32)RESET)
146 {
147 bitstatus = SET;
148 }
149 else
150 {
151 bitstatus = RESET;
152 }
153 return bitstatus;
154 }
155
156 /*******************************************************************************
157 * Function Name : EXTI_ClearFlag
158 * Description : Clears the EXTI抯 line pending flags.
159 * Input : - EXTI_Line: specifies the EXTI lines flags to clear.
160 * This parameter can be:
161 * - EXTI_Linex: External interrupt line x where x(0..18)
162 * Output : None
163 * Return : None
164 *******************************************************************************/
165 void EXTI_ClearFlag(u32 EXTI_Line)
166 {
167 /* Check the parameters */
168 assert(IS_EXTI_LINE(EXTI_Line));
169
170 EXTI->PR = EXTI_Line;
171 }
172
173 /*******************************************************************************
174 * Function Name : EXTI_GetITStatus
175 * Description : Checks whether the specified EXTI line is asserted or not.
176 * Input : - EXTI_Line: specifies the EXTI lines to check.
177 * This parameter can be:
178 * - EXTI_Linex: External interrupt line x where x(0..18)
179 * Output : None
180 * Return : The new state of EXTI_Line (SET or RESET).
181 *******************************************************************************/
182 ITStatus EXTI_GetITStatus(u32 EXTI_Line)
183 {
184 ITStatus bitstatus = RESET;
185 u32 enablestatus = 0;
186
187 /* Check the parameters */
188 assert(IS_GET_EXTI_LINE(EXTI_Line));
189
190 enablestatus = EXTI->IMR & EXTI_Line;
191
192 if (((EXTI->PR & EXTI_Line) != (u32)RESET) && enablestatus)
193 {
194 bitstatus = SET;
195 }
196 else
197 {
198 bitstatus = RESET;
199 }
200 return bitstatus;
201 }
202
203 /*******************************************************************************
204 * Function Name : EXTI_ClearITPendingBit
205 * Description : Clears the EXTI抯 line pending bits.
206 * Input : - EXTI_Line: specifies the EXTI lines to clear.
207 * This parameter can be:
208 * - EXTI_Linex: External interrupt line x where x(0..18)
209 * Output : None
210 * Return : None
211 *******************************************************************************/
212 void EXTI_ClearITPendingBit(u32 EXTI_Line)
213 {
214 /* Check the parameters */
215 assert(IS_EXTI_LINE(EXTI_Line));
216
217 EXTI->PR = EXTI_Line;
218 }
219
220 /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
Errors: 1
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -