SoftUart.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:20k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  1. ##############################################################################
  2. #                                                                            #
  3. # IAR MSP430 C/EC++ Compiler V2.10A/W32                23/Apr/2007  18:04:12 #
  4. # Copyright 1996-2003 IAR Systems. All rights reserved.                      #
  5. #                                                                            #
  6. #    __rt_version  =  1                                                      #
  7. #    __double_size =  32                                                     #
  8. #    __reg_r4      =  free                                                   #
  9. #    __reg_r5      =  free                                                   #
  10. #    __pic         =  no                                                     #
  11. #    Source file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  12. #                     filesSoftUart.c                                       #
  13. #    Command line  =  -I "C:Program FilesIAR SystemsEmbedded Workbench    #
  14. #                     3.2430INC" -I "C:Program FilesIAR                 #
  15. #                     SystemsEmbedded Workbench 3.2430INCCLIB" -lCN     #
  16. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  17. #                     DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
  18. #                     Conexant_070423DebugList -o                         #
  19. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  20. #                     DebugObj -z2 --no_cse --no_unroll --no_inline        #
  21. #                     --no_code_motion --debug -e                            #
  22. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  23. #                     filesSoftUart.c                                       #
  24. #    List file     =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  25. #                     DebugListSoftUart.lst                                #
  26. #    Object file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  27. #                     DebugObjSoftUart.r43                                 #
  28. #                                                                            #
  29. #                                                                            #
  30. ##############################################################################
  31. E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesSoftUart.c
  32.       1          //soft UART
  33.       2          //new bryan Jan. 23, 2007
  34.       3          //
  35.       4          
  36.       5          #include "includeH.h"
  37.                                     In segment DATA16_AN, at 0x20
  38.       unsigned char const volatile __data P1IN
  39.                         P1IN:
  40.       000000                        DS8 1
  41.                                     In segment DATA16_AN, at 0x34
  42.       unsigned char const volatile __data P6IN
  43.                         P6IN:
  44.       000000                        DS8 1
  45.                                     In segment DATA16_AN, at 0x35
  46.       unsigned char volatile __data P6OUT
  47.                         P6OUT:
  48.       000000                        DS8 1
  49.       6          
  50.       7          
  51.       8          
  52.                                     In segment CODE, align 2, keep-with-next
  53.       9          unsigned char SoftUartRxOneFrame(void)
  54.                         SoftUartRxOneFrame:
  55.      10          {
  56.       000000   0A12                 PUSH.W  R10
  57.       000002   0B12                 PUSH.W  R11
  58.      11               unsigned char ucGeneralCount=0,ucSoftUartRxData=0;
  59.       000004   4B43                 MOV.B   #0x0, R11
  60.       000006   4A43                 MOV.B   #0x0, R10
  61.      12               while ((SOFTUART_PORT_IN & bitSOFTUARTRX) == bitSOFTUARTRX)//wait start bit Low
  62.                         ??SoftUartRxOneFrame_0:
  63.       000008   E2B33400             BIT.B   #0x2, &0x34
  64.       00000C   0F28                 JNC     ??SoftUartRxOneFrame_3
  65.      13               {  
  66.      14                if ((gucGeneralStatus & bitModemActive) == bitModemActive)
  67.       00000E   E2B3....             BIT.B   #0x2, &gucGeneralStatus
  68.       000012   0C2C                 JC      ??SoftUartRxOneFrame_3
  69.      15                  break;
  70.      16                if (((KEY_PORT_IN & bitKeyRingNumDec) != bitKeyRingNumDec) || 
  71.      17                  ((KEY_PORT_IN & bitKeyRingNumAdd) != bitKeyRingNumAdd) ||
  72.      18                  ((KEY_PORT_IN & bitKeyAutoMode) != bitKeyAutoMode) ||
  73.      19                  ((KEY_PORT_IN & bitKeyManualMode) != bitKeyManualMode)) //||
  74.       000014   D2B32000             BIT.B   #0x1, &0x20
  75.       000018   0928                 JNC     ??SoftUartRxOneFrame_3
  76.       00001A   E2B32000             BIT.B   #0x2, &0x20
  77.       00001E   0628                 JNC     ??SoftUartRxOneFrame_3
  78.       000020   E2B22000             BIT.B   #0x4, &0x20
  79.       000024   0328                 JNC     ??SoftUartRxOneFrame_3
  80.       000026   F2B22000             BIT.B   #0x8, &0x20
  81.       00002A   EE2F                 JC      ??SoftUartRxOneFrame_0
  82.      20                  //((KEY_PORT_IN & bitKeySendFaxSignal) != bitKeySendFaxSignal))
  83.      21                  break;
  84.      22               } 
  85.      23               if ( (SOFTUART_PORT_IN & bitSOFTUARTRX) != bitSOFTUARTRX)
  86.                         ??SoftUartRxOneFrame_3:
  87.       00002C   E2B33400             BIT.B   #0x2, &0x34
  88.       000030   362C                 JC      ??SoftUartRxOneFrame_4
  89.      24               {
  90.      25               delay1us(6);//SoftUartDelay();
  91.       000032   3C400600             MOV.W   #0x6, R12
  92.       000036   B012....             CALL    #delay1us
  93.      26               for (ucGeneralCount=0;ucGeneralCount<8;ucGeneralCount++)
  94.       00003A   4B43                 MOV.B   #0x0, R11
  95.                         ??SoftUartRxOneFrame_1:
  96.       00003C   7B92                 CMP.B   #0x8, R11
  97.       00003E   1A2C                 JC      ??SoftUartRxOneFrame_2
  98.      27               {
  99.      28                  delay1us(2);//SoftUartDelayHalf();
  100.       000040   2C43                 MOV.W   #0x2, R12
  101.       000042   B012....             CALL    #delay1us
  102.      29                  ucSoftUartRxData=ucSoftUartRxData>>1;
  103.       000046   12C3                 CLRC
  104.       000048   4A10                 RRC.B   R10
  105.      30                  if ((SOFTUART_PORT_IN & bitSOFTUARTRX) == bitSOFTUARTRX)
  106.       00004A   E2B33400             BIT.B   #0x2, &0x34
  107.       00004E   0328                 JNC     ??SoftUartRxOneFrame_5
  108.      31                    ucSoftUartRxData |= BIT7;//BIT7;//(1<<ucGeneralCount);//set   Rx bit
  109.       000050   7AD08000             BIS.B   #0x80, R10
  110.       000054   053C                 JMP     ??SoftUartRxOneFrame_6
  111.      32                  else
  112.      33                    {ucSoftUartRxData &= ~BIT7;__no_operation();__no_operation();__no_operation();}//~BIT7;//~(1<<ucGeneralCount);//set   Rx bit
  113.                         ??SoftUartRxOneFrame_5:
  114.       000056   7AC08000             BIC.B   #0x80, R10
  115.       00005A   0343                 NOP
  116.       00005C   0343                 NOP
  117.       00005E   0343                 NOP
  118.      34                  
  119.      35                  delay1us(2);//SoftUartDelayHalf();
  120.                         ??SoftUartRxOneFrame_6:
  121.       000060   2C43                 MOV.W   #0x2, R12
  122.       000062   B012....             CALL    #delay1us
  123.      36                  __no_operation();
  124.       000066   0343                 NOP
  125.      37                  __no_operation();
  126.       000068   0343                 NOP
  127.      38                  __no_operation();
  128.       00006A   0343                 NOP
  129.      39                  __no_operation();
  130.       00006C   0343                 NOP
  131.      40                  __no_operation();  
  132.       00006E   0343                 NOP
  133.      41               }
  134.       000070   5B53                 ADD.B   #0x1, R11
  135.       000072   E43F                 JMP     ??SoftUartRxOneFrame_1
  136.      42               //delay1us(6);
  137.      43               while ((SOFTUART_PORT_IN & bitSOFTUARTRX) != bitSOFTUARTRX) //wait stop bit High
  138.                         ??SoftUartRxOneFrame_2:
  139.       000074   E2B33400             BIT.B   #0x2, &0x34
  140.       000078   122C                 JC      ??SoftUartRxOneFrame_4
  141.      44               {  
  142.      45                if ((SOFTUART_PORT_IN & bitSOFTUARTRX) == bitSOFTUARTRX)
  143.       00007A   E2B33400             BIT.B   #0x2, &0x34
  144.       00007E   0F2C                 JC      ??SoftUartRxOneFrame_4
  145.      46                  break;
  146.      47                gucFrhErrorStatus=0x00;//
  147.       000080   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  148.      48                  if (gwTimeOverflowCount++ == 0xffff)
  149.       000084   1E42....             MOV.W   &gwTimeOverflowCount, R14
  150.       000088   1F43                 MOV.W   #0x1, R15
  151.       00008A   0F5E                 ADD.W   R14, R15
  152.       00008C   824F....             MOV.W   R15, &gwTimeOverflowCount
  153.       000090   3E93                 CMP.W   #0xffff, R14
  154.       000092   F023                 JNE     ??SoftUartRxOneFrame_2
  155.      49                     {gucFrhErrorStatus=0x03;gwTimeOverflowCount=0;break;}
  156.       000094   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  157.       00009A   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  158.      50               }
  159.      51               //delay1us(6);//SoftUartDelay();
  160.      52               }
  161.      53               return ucSoftUartRxData;       
  162.                         ??SoftUartRxOneFrame_4:
  163.       00009E   4C4A                 MOV.B   R10, R12
  164.       0000A0   3B41                 POP.W   R11
  165.       0000A2   3A41                 POP.W   R10
  166.       0000A4   3041                 RET
  167.      54          }
  168.      55          
  169.                                     In segment CODE, align 2, keep-with-next
  170.      56          void SoftUartTxOneFrame(unsigned char ucSoftUartTxData)
  171.                         SoftUartTxOneFrame:
  172.      57          {
  173.       000000   0A12                 PUSH.W  R10
  174.       000002   0B12                 PUSH.W  R11
  175.       000004   4A4C                 MOV.B   R12, R10
  176.      58               unsigned char ucGeneralCount=0;
  177.       000006   4B43                 MOV.B   #0x0, R11
  178.      59               __disable_interrupt();
  179.       000008   32C2                 DINT
  180.      60               SOFTUART_PORT_OUT &= ~bitSOFTUARTTX; //reset Tx bit
  181.       00000A   D2C33500             BIC.B   #0x1, &0x35
  182.      61               delay1us(7);//115 9600//57 19200//17 57600 //7 115200
  183.       00000E   3C400700             MOV.W   #0x7, R12
  184.       000012   B012....             CALL    #delay1us
  185.      62               //__no_operation();
  186.      63               //__no_operation();
  187.      64               //__no_operation();
  188.      65               //delay1us(8);
  189.      66               for (ucGeneralCount=0;ucGeneralCount<8;ucGeneralCount++)
  190.       000016   4B43                 MOV.B   #0x0, R11
  191.                         ??SoftUartTxOneFrame_0:
  192.       000018   7B92                 CMP.B   #0x8, R11
  193.       00001A   132C                 JC      ??SoftUartTxOneFrame_1
  194.      67               {
  195.      68          
  196.      69                  if ((ucSoftUartTxData & BIT0) == BIT0)
  197.       00001C   5AB3                 BIT.B   #0x1, R10
  198.       00001E   0328                 JNC     ??SoftUartTxOneFrame_2
  199.      70                    {SOFTUART_PORT_OUT |= bitSOFTUARTTX;} //set   Tx bit
  200.       000020   D2D33500             BIS.B   #0x1, &0x35
  201.       000024   053C                 JMP     ??SoftUartTxOneFrame_3
  202.      71                  else
  203.      72                    {SOFTUART_PORT_OUT &= ~bitSOFTUARTTX;__no_operation();__no_operation();__no_operation();} //reset Tx bit
  204.                         ??SoftUartTxOneFrame_2:
  205.       000026   D2C33500             BIC.B   #0x1, &0x35
  206.       00002A   0343                 NOP
  207.       00002C   0343                 NOP
  208.       00002E   0343                 NOP
  209.      73                  delay1us(6);//115 9600 //56 19200//16 57600 //6 115200
  210.                         ??SoftUartTxOneFrame_3:
  211.       000030   3C400600             MOV.W   #0x6, R12
  212.       000034   B012....             CALL    #delay1us
  213.      74                  //__no_operation();
  214.      75                  __no_operation();
  215.       000038   0343                 NOP
  216.      76                  ucSoftUartTxData=ucSoftUartTxData>>1;
  217.       00003A   12C3                 CLRC
  218.       00003C   4A10                 RRC.B   R10
  219.      77                  
  220.      78               }
  221.       00003E   5B53                 ADD.B   #0x1, R11
  222.       000040   EB3F                 JMP     ??SoftUartTxOneFrame_0
  223.      79               __no_operation();
  224.                         ??SoftUartTxOneFrame_1:
  225.       000042   0343                 NOP
  226.      80               __no_operation();
  227.       000044   0343                 NOP
  228.      81               SOFTUART_PORT_OUT |= bitSOFTUARTTX;  //set   Tx bit
  229.       000046   D2D33500             BIS.B   #0x1, &0x35
  230.      82               delay1us(7);//115 9600 //17 57600//7 115200
  231.       00004A   3C400700             MOV.W   #0x7, R12
  232.       00004E   B012....             CALL    #delay1us
  233.      83               _EINT();                             //enable interrupt   
  234.       000052   32D2                 EINT
  235.      84          }
  236.       000054   3B41                 POP.W   R11
  237.       000056   3A41                 POP.W   R10
  238.       000058   3041                 RET
  239.      85          
  240.      86          
  241.                                     In segment CODE, align 2, keep-with-next
  242.      87          void SoftUartDelay7us(void)
  243.                         SoftUartDelay7us:
  244.      88          {
  245.      89             unsigned wGeneralCount=0;
  246.       000000   0E43                 MOV.W   #0x0, R14
  247.      90             //BauRate1200 wGeneralCount<831 BauRate9600 wGeneralCount<96 BauRate115200 6 42 19200
  248.      91             for (wGeneralCount=0;wGeneralCount<4;wGeneralCount++)
  249.       000002   0E43                 MOV.W   #0x0, R14
  250.                         ??SoftUartDelay7us_0:
  251.       000004   2E92                 CMP.W   #0x4, R14
  252.       000006   032C                 JC      ??SoftUartDelay7us_1
  253.      92             {
  254.      93               __no_operation();
  255.       000008   0343                 NOP
  256.      94             }
  257.       00000A   1E53                 ADD.W   #0x1, R14
  258.       00000C   FB3F                 JMP     ??SoftUartDelay7us_0
  259.      95          
  260.      96          }
  261.                         ??SoftUartDelay7us_1:
  262.       00000E   3041                 RET
  263.      97          
  264.                                     In segment CODE, align 2, keep-with-next
  265.      98          void SoftUartDelay8p7us(void)
  266.                         SoftUartDelay8p7us:
  267.      99          {
  268.     100             unsigned wGeneralCount=0;
  269.       000000   0E43                 MOV.W   #0x0, R14
  270.     101             //BauRate1200 wGeneralCount<831 BauRate9600 wGeneralCount<96 BauRate115200 6 42 19200
  271.     102             for (wGeneralCount=0;wGeneralCount<4;wGeneralCount++)
  272.       000002   0E43                 MOV.W   #0x0, R14
  273.                         ??SoftUartDelay8p7us_0:
  274.       000004   2E92                 CMP.W   #0x4, R14
  275.       000006   042C                 JC      ??SoftUartDelay8p7us_1
  276.     103             {
  277.     104               __no_operation();
  278.       000008   0343                 NOP
  279.     105               __no_operation();
  280.       00000A   0343                 NOP
  281.     106             }
  282.       00000C   1E53                 ADD.W   #0x1, R14
  283.       00000E   FA3F                 JMP     ??SoftUartDelay8p7us_0
  284.     107          
  285.     108          }
  286.                         ??SoftUartDelay8p7us_1:
  287.       000010   3041                 RET
  288.     109          
  289.                                     In segment CODE, align 2, keep-with-next
  290.     110          void SoftUartDelay(void)
  291.                         SoftUartDelay:
  292.     111          {
  293.     112             unsigned wGeneralCount=0;
  294.       000000   0E43                 MOV.W   #0x0, R14
  295.     113             //BauRate1200 wGeneralCount<831 BauRate9600 wGeneralCount<96 BauRate115200 6 42 19200
  296.     114             for (wGeneralCount=0;wGeneralCount<96;wGeneralCount++)
  297.       000002   0E43                 MOV.W   #0x0, R14
  298.                         ??SoftUartDelay_0:
  299.       000004   3E906000             CMP.W   #0x60, R14
  300.       000008   032C                 JC      ??SoftUartDelay_1
  301.     115             {
  302.     116               __no_operation();
  303.       00000A   0343                 NOP
  304.     117             }
  305.       00000C   1E53                 ADD.W   #0x1, R14
  306.       00000E   FA3F                 JMP     ??SoftUartDelay_0
  307.     118          }   
  308.                         ??SoftUartDelay_1:
  309.       000010   3041                 RET
  310.     119          
  311.                                     In segment CODE, align 2, keep-with-next
  312.     120          void SoftUartDelayHalf(void)
  313.                         SoftUartDelayHalf:
  314.     121          {
  315.     122             unsigned wGeneralCount=0;
  316.       000000   0E43                 MOV.W   #0x0, R14
  317.     123             for (wGeneralCount=0;wGeneralCount<48;wGeneralCount++)//BauRate1200 wGeneralCount<831 BauRate9600 wGeneralCount<96
  318.       000002   0E43                 MOV.W   #0x0, R14
  319.                         ??SoftUartDelayHalf_0:
  320.       000004   3E903000             CMP.W   #0x30, R14
  321.       000008   032C                 JC      ??SoftUartDelayHalf_1
  322.     124             {
  323.     125               __no_operation();
  324.       00000A   0343                 NOP
  325.     126             }
  326.       00000C   1E53                 ADD.W   #0x1, R14
  327.       00000E   FA3F                 JMP     ??SoftUartDelayHalf_0
  328.     127          
  329.     128          }
  330.                         ??SoftUartDelayHalf_1:
  331.       000010   3041                 RET
  332.     129          
  333.                                     In segment CODE, align 2, align-sorted
  334.     130          void Delay1us(void)
  335.                         Delay1us:
  336.     131          {
  337.     132               __no_operation();
  338.       000000   0343                 NOP
  339.     133               __no_operation();
  340.       000002   0343                 NOP
  341.     134               __no_operation();
  342.       000004   0343                 NOP
  343.     135               __no_operation();
  344.       000006   0343                 NOP
  345.     136               __no_operation();
  346.       000008   0343                 NOP
  347.     137               __no_operation();
  348.       00000A   0343                 NOP
  349.     138               __no_operation();
  350.       00000C   0343                 NOP
  351.     139               __no_operation();
  352.       00000E   0343                 NOP
  353.     140          
  354.     141          } 
  355.       000010   3041                 RET
  356.    Maximum stack usage in bytes:
  357.      Function           CSTACK
  358.      --------           ------
  359.      Delay1us               2
  360.      SoftUartDelay          2
  361.      SoftUartDelay7us       2
  362.      SoftUartDelay8p7us     2
  363.      SoftUartDelayHalf      2
  364.      SoftUartRxOneFrame     6
  365.        -> delay1us          6
  366.        -> delay1us          6
  367.        -> delay1us          6
  368.      SoftUartTxOneFrame     6
  369.        -> delay1us          6
  370.        -> delay1us          6
  371.        -> delay1us          6
  372.    Segment part sizes:
  373.      Function/Label     Bytes
  374.      --------------     -----
  375.      P1IN                  1
  376.      P6IN                  1
  377.      P6OUT                 1
  378.      SoftUartRxOneFrame  166
  379.      SoftUartTxOneFrame   90
  380.      SoftUartDelay7us     16
  381.      SoftUartDelay8p7us   18
  382.      SoftUartDelay        18
  383.      SoftUartDelayHalf    18
  384.      Delay1us             18
  385.  
  386.  344 bytes in segment CODE
  387.    3 bytes in segment DATA16_AN
  388.  
  389.  344 bytes of CODE memory
  390.    0 bytes of DATA memory (+ 3 bytes shared)
  391. Errors: none
  392. Warnings: none