⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tsensor.txt

📁 stm32.rar
💻 TXT
📖 第 1 页 / 共 5 页
字号:
;;;342    
;;;343      /* Test on EV7 and clear it */
;;;344      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_RECEIVED))  /* EV7 */
000084  4629              MOV      r1,r5
000086  4620              MOV      r0,r4
000088  f7fffffe          BL       I2C_CheckEvent
00008c  2800              CMP      r0,#0
00008e  d0f9              BEQ      |L5.132|
;;;345      {
;;;346      }
;;;347      
;;;348      /* Store I2C1 received data */
;;;349      RegValue = I2C_ReceiveData(I2C1) << 8;
000090  4620              MOV      r0,r4
000092  f7fffffe          BL       I2C_ReceiveData
000096  0206              LSLS     r6,r0,#8
;;;350      
;;;351      /* Disable I2C1 acknowledgement */
;;;352      I2C_AcknowledgeConfig(I2C1, DISABLE);
000098  2100              MOVS     r1,#0
00009a  4620              MOV      r0,r4
00009c  f7fffffe          BL       I2C_AcknowledgeConfig
;;;353      
;;;354      /* Send I2C1 STOP Condition */
;;;355      I2C_GenerateSTOP(I2C1, ENABLE);
0000a0  2101              MOVS     r1,#1
0000a2  4620              MOV      r0,r4
0000a4  f7fffffe          BL       I2C_GenerateSTOP
                  |L5.168|
;;;356      
;;;357      /* Test on EV7 and clear it */
;;;358      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_RECEIVED))  /* EV7 */
0000a8  4629              MOV      r1,r5
0000aa  4620              MOV      r0,r4
0000ac  f7fffffe          BL       I2C_CheckEvent
0000b0  2800              CMP      r0,#0
0000b2  d0f9              BEQ      |L5.168|
;;;359      {
;;;360      }
;;;361      
;;;362      /* Store I2C1 received data */
;;;363      RegValue |= I2C_ReceiveData(I2C1);
0000b4  4620              MOV      r0,r4
0000b6  f7fffffe          BL       I2C_ReceiveData
0000ba  4330              ORRS     r0,r0,r6
;;;364    
;;;365      /* Return Temperature value */
;;;366      return (RegValue >> 5);
0000bc  f3c0104f          UBFX     r0,r0,#5,#16
;;;367    }
0000c0  bd70              POP      {r4-r6,pc}
;;;368    
                          ENDP

0000c2  0000              DCW      0x0000
                  |L5.196|
0000c4  40005400          DCD      0x40005400
                  |L5.200|
0000c8  00030001          DCD      0x00030001
                  |L5.204|
0000cc  00070082          DCD      0x00070082

                          AREA ||i.I2C_LM75_ConfReg_Read||, CODE, READONLY, ALIGN=2

                  I2C_LM75_ConfReg_Read PROC
;;;376    u8 I2C_LM75_ConfReg_Read(void)
;;;377    {
000000  b570              PUSH     {r4-r6,lr}
;;;378      u32 RegValue = 0;
;;;379    
;;;380      /*----- Transmission Phase -----*/
;;;381      /* Send I2C1 START condition */
;;;382      I2C_GenerateSTART(I2C1, ENABLE);
000002  4d28              LDR      r5,|L6.164|
000004  2101              MOVS     r1,#1
000006  4628              MOV      r0,r5
000008  f7fffffe          BL       I2C_GenerateSTART
00000c  4c26              LDR      r4,|L6.168|
                  |L6.14|
;;;383      
;;;384      /* Test on I2C1 EV5 and clear it */
;;;385      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT))  /* EV5 */
00000e  4628              MOV      r0,r5
000010  4621              MOV      r1,r4
000012  f7fffffe          BL       I2C_CheckEvent
000016  2800              CMP      r0,#0
000018  d0f9              BEQ      |L6.14|
;;;386      {
;;;387      }
;;;388    
;;;389      /* Send STLM75 slave address for write */
;;;390      I2C_Send7bitAddress(I2C1, LM75_Addr, I2C_Direction_Transmitter);
00001a  2200              MOVS     r2,#0
00001c  2190              MOVS     r1,#0x90
00001e  4628              MOV      r0,r5
000020  f7fffffe          BL       I2C_Send7bitAddress
000024  4e21              LDR      r6,|L6.172|
                  |L6.38|
;;;391      
;;;392      /* Test on I2C1 EV6 and clear it */
;;;393      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)) /* EV6 */
000026  4628              MOV      r0,r5
000028  4631              MOV      r1,r6
00002a  f7fffffe          BL       I2C_CheckEvent
00002e  2800              CMP      r0,#0
000030  d0f9              BEQ      |L6.38|
;;;394      {
;;;395      }
;;;396    
;;;397      /* Send the configuration register data pointer */
;;;398      I2C_SendData(I2C1, LM75_CONF_Reg);
000032  2101              MOVS     r1,#1
000034  4628              MOV      r0,r5
000036  f7fffffe          BL       I2C_SendData
00003a  4e1c              LDR      r6,|L6.172|
00003c  1cb6              ADDS     r6,r6,#2
                  |L6.62|
;;;399      
;;;400      /* Test on I2C1 EV8 and clear it */
;;;401      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)) /* EV8 */
00003e  4631              MOV      r1,r6
000040  4628              MOV      r0,r5
000042  f7fffffe          BL       I2C_CheckEvent
000046  2800              CMP      r0,#0
000048  d0f9              BEQ      |L6.62|
;;;402      {
;;;403      }
;;;404    
;;;405      /*----- Reception Phase -----*/
;;;406      /* Send Re-STRAT condition */
;;;407      I2C_GenerateSTART(I2C1, ENABLE);
00004a  2101              MOVS     r1,#1
00004c  4628              MOV      r0,r5
00004e  f7fffffe          BL       I2C_GenerateSTART
                  |L6.82|
;;;408      
;;;409      /* Test on EV5 and clear it */
;;;410      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT))  /* EV5 */
000052  4621              MOV      r1,r4
000054  4628              MOV      r0,r5
000056  f7fffffe          BL       I2C_CheckEvent
00005a  2800              CMP      r0,#0
00005c  d0f9              BEQ      |L6.82|
;;;411      {
;;;412      }
;;;413      
;;;414      /* Send STLM75 slave address for read */
;;;415      I2C_Send7bitAddress(I2C1, LM75_Addr, I2C_Direction_Receiver);
00005e  2201              MOVS     r2,#1
000060  2190              MOVS     r1,#0x90
000062  4628              MOV      r0,r5
000064  f7fffffe          BL       I2C_Send7bitAddress
000068  4c0f              LDR      r4,|L6.168|
00006a  1c64              ADDS     r4,r4,#1
                  |L6.108|
;;;416      
;;;417      /* Test on EV6 and clear it */
;;;418      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED))  /* EV6 */
00006c  4621              MOV      r1,r4
00006e  4628              MOV      r0,r5
000070  f7fffffe          BL       I2C_CheckEvent
000074  2800              CMP      r0,#0
000076  d0f9              BEQ      |L6.108|
;;;419      {
;;;420      }
;;;421    
;;;422      /* Disable I2C1 acknowledgement */
;;;423      I2C_AcknowledgeConfig(I2C1, DISABLE);
000078  2100              MOVS     r1,#0
00007a  4628              MOV      r0,r5
00007c  f7fffffe          BL       I2C_AcknowledgeConfig
;;;424      
;;;425      /* Send I2C1 STOP Condition */
;;;426      I2C_GenerateSTOP(I2C1, ENABLE);
000080  2101              MOVS     r1,#1
000082  4628              MOV      r0,r5
000084  f7fffffe          BL       I2C_GenerateSTOP
000088  4c07              LDR      r4,|L6.168|
00008a  343f              ADDS     r4,r4,#0x3f
                  |L6.140|
;;;427    
;;;428      /* Test on EV7 and clear it */
;;;429      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_RECEIVED))  /* EV7 */
00008c  4621              MOV      r1,r4
00008e  4628              MOV      r0,r5
000090  f7fffffe          BL       I2C_CheckEvent
000094  2800              CMP      r0,#0
000096  d0f9              BEQ      |L6.140|
;;;430      {
;;;431      }
;;;432      
;;;433      /* Store I2C1 received data */
;;;434      RegValue = I2C_ReceiveData(I2C1);
000098  4628              MOV      r0,r5
00009a  e8bd4070          POP      {r4-r6,lr}
00009e  f7ffbffe          B.W      I2C_ReceiveData
;;;435    
;;;436      /* Return configuration register value */
;;;437      return (RegValue);    
;;;438    }
;;;439    
                          ENDP

0000a2  0000              DCW      0x0000
                  |L6.164|
0000a4  40005400          DCD      0x40005400
                  |L6.168|
0000a8  00030001          DCD      0x00030001
                  |L6.172|
0000ac  00070082          DCD      0x00070082

                          AREA ||i.I2C_LM75_ConfReg_Write||, CODE, READONLY, ALIGN=2

                  I2C_LM75_ConfReg_Write PROC
;;;447    void I2C_LM75_ConfReg_Write(u8 RegValue)
;;;448    {
000000  b570              PUSH     {r4-r6,lr}
;;;449      /*----- Transmission Phase -----*/
;;;450      /* Send I2C1 START condition */
;;;451      I2C_GenerateSTART(I2C1, ENABLE);
000002  4d1a              LDR      r5,|L7.108|
000004  4606              MOV      r6,r0                 ;448
000006  2101              MOVS     r1,#1
000008  4628              MOV      r0,r5
00000a  f7fffffe          BL       I2C_GenerateSTART
00000e  4c18              LDR      r4,|L7.112|
                  |L7.16|
;;;452    
;;;453      /* Test on I2C1 EV5 and clear it */
;;;454      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT))  /* EV5 */
000010  4628              MOV      r0,r5
000012  4621              MOV      r1,r4
000014  f7fffffe          BL       I2C_CheckEvent
000018  2800              CMP      r0,#0
00001a  d0f9              BEQ      |L7.16|
;;;455      {
;;;456      }
;;;457      
;;;458      /* Send STLM75 slave address for write */
;;;459      I2C_Send7bitAddress(I2C1, LM75_Addr, I2C_Direction_Transmitter);
00001c  2200              MOVS     r2,#0
00001e  2190              MOVS     r1,#0x90
000020  4628              MOV      r0,r5
000022  f7fffffe          BL       I2C_Send7bitAddress
000026  4c13              LDR      r4,|L7.116|
                  |L7.40|
;;;460      
;;;461      /* Test on I2C1 EV6 and clear it */
;;;462      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)) /* EV6 */
000028  4628              MOV      r0,r5
00002a  4621              MOV      r1,r4
00002c  f7fffffe          BL       I2C_CheckEvent
000030  2800              CMP      r0,#0
000032  d0f9              BEQ      |L7.40|
;;;463      {
;;;464      }
;;;465    
;;;466      /* Send the configuration register data pointer */
;;;467      I2C_SendData(I2C1, LM75_CONF_Reg);
000034  2101              MOVS     r1,#1
000036  4628              MOV      r0,r5
000038  f7fffffe          BL       I2C_SendData
00003c  4c0d              LDR      r4,|L7.116|
00003e  1ca4              ADDS     r4,r4,#2
                  |L7.64|
;;;468      
;;;469      /* Test on I2C1 EV8 and clear it */
;;;470      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)) /* EV8 */
000040  4621              MOV      r1,r4
000042  4628              MOV      r0,r5
000044  f7fffffe          BL       I2C_CheckEvent
000048  2800              CMP      r0,#0
00004a  d0f9              BEQ      |L7.64|
;;;471      {
;;;472      }
;;;473    
;;;474      /* Send I2C1 data */
;;;475      I2C_SendData(I2C1, RegValue);
00004c  4631              MOV      r1,r6
00004e  4628              MOV      r0,r5
000050  f7fffffe          BL       I2C_SendData
                  |L7.84|
;;;476      
;;;477      /* Test on I2C1 EV8 and clear it */
;;;478      while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_TRANSMITTED)) /* EV8 */
000054  4621              MOV      r1,r4
000056  4628              MOV      r0,r5
000058  f7fffffe          BL       I2C_CheckEvent
00005c  2800              CMP      r0,#0
00005e  d0f9              BEQ      |L7.84|
;;;479      {
;;;480      }
;;;481    
;;;482      /* Send I2C1 STOP Condition */
;;;483      I2C_GenerateSTOP(I2C1, ENABLE);     
000060  4628              MOV      r0,r5
000062  e8bd4070          POP      {r4-r6,lr}
000066  2101              MOVS     r1,#1
000068  f7ffbffe          B.W      I2C_GenerateSTOP
;;;484    }
;;;485    
                          ENDP

                  |L7.108|
00006c  40005400          DCD      0x40005400
                  |L7.112|
000070  00030001          DCD      0x00030001
                  |L7.116|
000074  00070082          DCD      0x00070082

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -