📄 stm32f10x_i2c.lst
字号:
278 }
\ 00000016 7047 BX LR ;; return
\ ??I2C_StructInit_0:
\ 00000018 88130000 DC32 0x1388
279
280 /*******************************************************************************
281 * Function Name : I2C_Cmd
282 * Description : Enables or disables the specified I2C peripheral.
283 * Input : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
284 * - NewState: new state of the I2Cx peripheral. This parameter
285 * can be: ENABLE or DISABLE.
286 * Output : None
287 * Return : None
288 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
289 void I2C_Cmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
290 {
291 /* Check the parameters */
292 assert(IS_FUNCTIONAL_STATE(NewState));
293
294 if (NewState != DISABLE)
\ I2C_Cmd:
\ 00000000 0029 CMP R1,#+0
\ 00000002 0188 LDRH R1,[R0, #+0]
\ 00000004 03D0 BEQ.N ??I2C_Cmd_0
295 {
296 /* Enable the selected I2C peripheral */
297 I2Cx->CR1 |= CR1_PE_Set;
\ 00000006 51F00101 ORRS R1,R1,#0x1
\ 0000000A 0180 STRH R1,[R0, #+0]
\ 0000000C 7047 BX LR
298 }
299 else
300 {
301 /* Disable the selected I2C peripheral */
302 I2Cx->CR1 &= CR1_PE_Reset;
\ ??I2C_Cmd_0:
\ 0000000E .... LDR.N R2,??DataTable5 ;; 0xfffe
\ 00000010 0A40 ANDS R2,R2,R1
\ 00000012 0280 STRH R2,[R0, #+0]
303 }
304 }
\ 00000014 7047 BX LR ;; return
305
306 /*******************************************************************************
307 * Function Name : I2C_DMACmd
308 * Description : Enables or disables the specified I2C DMA requests.
309 * Input : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
310 * - NewState: new state of the I2C DMA transfer.
311 * This parameter can be: ENABLE or DISABLE.
312 * Output : None
313 * Return : None
314 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
315 void I2C_DMACmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
316 {
317 /* Check the parameters */
318 assert(IS_FUNCTIONAL_STATE(NewState));
319
320 if (NewState != DISABLE)
\ I2C_DMACmd:
\ 00000000 0029 CMP R1,#+0
\ 00000002 8188 LDRH R1,[R0, #+4]
\ 00000004 03D0 BEQ.N ??I2C_DMACmd_0
321 {
322 /* Enable the selected I2C DMA requests */
323 I2Cx->CR2 |= CR2_DMAEN_Set;
\ 00000006 51F40061 ORRS R1,R1,#0x800
\ 0000000A 8180 STRH R1,[R0, #+4]
\ 0000000C 7047 BX LR
324 }
325 else
326 {
327 /* Disable the selected I2C DMA requests */
328 I2Cx->CR2 &= CR2_DMAEN_Reset;
\ ??I2C_DMACmd_0:
\ 0000000E .... LDR.N R2,??DataTable7 ;; 0xf7ff
\ 00000010 0A40 ANDS R2,R2,R1
\ 00000012 8280 STRH R2,[R0, #+4]
329 }
330 }
\ 00000014 7047 BX LR ;; return
331
332 /*******************************************************************************
333 * Function Name : I2C_DMALastTransferCmd
334 * Description : Specifies that the next DMA transfer is the last one.
335 * Input : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
336 * - NewState: new state of the I2C DMA last transfer.
337 * This parameter can be: ENABLE or DISABLE.
338 * Output : None
339 * Return : None
340 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
341 void I2C_DMALastTransferCmd(I2C_TypeDef* I2Cx, FunctionalState NewState)
342 {
343 /* Check the parameters */
344 assert(IS_FUNCTIONAL_STATE(NewState));
345
346 if (NewState != DISABLE)
\ I2C_DMALastTransferCmd:
\ 00000000 0029 CMP R1,#+0
\ 00000002 8188 LDRH R1,[R0, #+4]
\ 00000004 03D0 BEQ.N ??I2C_DMALastTransferCmd_0
347 {
348 /* Next DMA end of transfer is the last transfer */
349 I2Cx->CR2 |= CR2_LAST_Set;
\ 00000006 51F48051 ORRS R1,R1,#0x1000
\ 0000000A 8180 STRH R1,[R0, #+4]
\ 0000000C 7047 BX LR
350 }
351 else
352 {
353 /* Next DMA end of transfer is not the last transfer */
354 I2Cx->CR2 &= CR2_LAST_Reset;
\ ??I2C_DMALastTransferCmd_0:
\ 0000000E .... LDR.N R2,??DataTable6 ;; 0xefff
\ 00000010 0A40 ANDS R2,R2,R1
\ 00000012 8280 STRH R2,[R0, #+4]
355 }
356 }
\ 00000014 7047 BX LR ;; return
357
358 /*******************************************************************************
359 * Function Name : I2C_GenerateSTART
360 * Description : Generates I2Cx communication START condition.
361 * Input : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
362 * - NewState: new state of the I2C START condition generation.
363 * This parameter can be: ENABLE or DISABLE.
364 * Output : None
365 * Return : None.
366 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
367 void I2C_GenerateSTART(I2C_TypeDef* I2Cx, FunctionalState NewState)
368 {
369 /* Check the parameters */
370 assert(IS_FUNCTIONAL_STATE(NewState));
371
372 if (NewState != DISABLE)
\ I2C_GenerateSTART:
\ 00000000 0029 CMP R1,#+0
\ 00000002 0188 LDRH R1,[R0, #+0]
\ 00000004 03D0 BEQ.N ??I2C_GenerateSTART_0
373 {
374 /* Generate a START condition */
375 I2Cx->CR1 |= CR1_START_Set;
\ 00000006 51F48071 ORRS R1,R1,#0x100
\ 0000000A 0180 STRH R1,[R0, #+0]
\ 0000000C 7047 BX LR
376 }
377 else
378 {
379 /* Disable the START condition generation */
380 I2Cx->CR1 &= CR1_START_Reset;
\ ??I2C_GenerateSTART_0:
\ 0000000E 024A LDR.N R2,??I2C_GenerateSTART_1 ;; 0xfeff
\ 00000010 0A40 ANDS R2,R2,R1
\ 00000012 0280 STRH R2,[R0, #+0]
381 }
382 }
\ 00000014 7047 BX LR ;; return
\ 00000016 00BF Nop
\ ??I2C_GenerateSTART_1:
\ 00000018 FFFE0000 DC32 0xfeff
383
384 /*******************************************************************************
385 * Function Name : I2C_GenerateSTOP
386 * Description : Generates I2Cx communication STOP condition.
387 * Input : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
388 * - NewState: new state of the I2C STOP condition generation.
389 * This parameter can be: ENABLE or DISABLE.
390 * Output : None
391 * Return : None.
392 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
393 void I2C_GenerateSTOP(I2C_TypeDef* I2Cx, FunctionalState NewState)
394 {
395 /* Check the parameters */
396 assert(IS_FUNCTIONAL_STATE(NewState));
397
398 if (NewState != DISABLE)
\ I2C_GenerateSTOP:
\ 00000000 0029 CMP R1,#+0
\ 00000002 0188 LDRH R1,[R0, #+0]
\ 00000004 03D0 BEQ.N ??I2C_GenerateSTOP_0
399 {
400 /* Generate a STOP condition */
401 I2Cx->CR1 |= CR1_STOP_Set;
\ 00000006 51F40071 ORRS R1,R1,#0x200
\ 0000000A 0180 STRH R1,[R0, #+0]
\ 0000000C 7047 BX LR
402 }
403 else
404 {
405 /* Disable the STOP condition generation */
406 I2Cx->CR1 &= CR1_STOP_Reset;
\ ??I2C_GenerateSTOP_0:
\ 0000000E 024A LDR.N R2,??I2C_GenerateSTOP_1 ;; 0xfdff
\ 00000010 0A40 ANDS R2,R2,R1
\ 00000012 0280 STRH R2,[R0, #+0]
407 }
408 }
\ 00000014 7047 BX LR ;; return
\ 00000016 00BF Nop
\ ??I2C_GenerateSTOP_1:
\ 00000018 FFFD0000 DC32 0xfdff
409
410 /*******************************************************************************
411 * Function Name : I2C_AcknowledgeConfig
412 * Description : Enables or disables the specified I2C acknowledge feature.
413 * Input : - I2Cx: where x can be 1 or 2 to select the I2C peripheral.
414 * - NewState: new state of the I2C Acknowledgement.
415 * This parameter can be: ENABLE or DISABLE.
416 * Output : None
417 * Return : None.
418 *******************************************************************************/
\ In segment CODE, align 4, keep-with-next
419 void I2C_AcknowledgeConfig(I2C_TypeDef* I2Cx, FunctionalState NewState)
420 {
421 /* Check the parameters */
422 assert(IS_FUNCTIONAL_STATE(NewState));
423
424 if (NewState != DISABLE)
\ I2C_AcknowledgeConfig:
\ 00000000 0029 CMP R1,#+0
\ 00000002 0188 LDRH R1,[R0, #+0]
\ 00000004 03D0 BEQ.N ??I2C_AcknowledgeConfig_0
425 {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -