LCDView.s43
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:14k
- NAME LCDView
- RTMODEL "__double_size", "32"
- RTMODEL "__pic", "no"
- RTMODEL "__reg_r4", "free"
- RTMODEL "__reg_r5", "free"
- RTMODEL "__rt_version", "1"
- RSEG CSTACK:DATA:SORT:NOROOT(1)
- EXTERN gwTimeOverflowCount
- EXTERN gucTimeOverflowCount
- EXTERN gucGeneralStatus
- EXTERN aucViewData
- EXTERN delay1us
- FUNCTION delay1us,0202H
- EXTERN ?longjmp_r4
- EXTERN ?longjmp_r5
- EXTERN ?setjmp_r4
- EXTERN ?setjmp_r5
- PUBWEAK ?setjmp_save_r4
- PUBWEAK ?setjmp_save_r5
- PUBWEAK P4IN
- PUBWEAK P4OUT
- PUBLIC ReceiveOneViewData
- FUNCTION ReceiveOneViewData,021203H
- LOCFRAME CSTACK, 6, STACK
- PUBLIC SendOneViewData
- FUNCTION SendOneViewData,021203H
- LOCFRAME CSTACK, 6, STACK
- PUBLIC ViewCommunicationRX
- FUNCTION ViewCommunicationRX,021203H
- LOCFRAME CSTACK, 6, STACK
- PUBLIC ViewCommunicationTX
- FUNCTION ViewCommunicationTX,021203H
- LOCFRAME CSTACK, 6, STACK
-
- CFI Names cfiNames0
- CFI StackFrame CFA SP DATA
- CFI Resource PC:16, SP:16, SR:16, R4:16, R5:16, R6:16, R7:16, R8:16
- CFI Resource R9:16, R10:16, R11:16, R12:16, R13:16, R14:16, R15:16
- CFI EndNames cfiNames0
-
- CFI Common cfiCommon0 Using cfiNames0
- CFI CodeAlign 2
- CFI DataAlign 2
- CFI ReturnAddress PC CODE
- CFI CFA SP+2
- CFI PC Frame(CFA, -2)
- CFI SR Undefined
- CFI R4 SameValue
- CFI R5 SameValue
- CFI R6 SameValue
- CFI R7 SameValue
- CFI R8 SameValue
- CFI R9 SameValue
- CFI R10 SameValue
- CFI R11 SameValue
- CFI R12 Undefined
- CFI R13 Undefined
- CFI R14 Undefined
- CFI R15 Undefined
- CFI EndCommon cfiCommon0
-
- // E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesLCDView.c
- // 1 //LCD View
- // 2 //new Apr. 06, 2007
- // 3 //Author bryan
- // 4
- // 5 #include "includeH.h"
- ASEGN DATA16_AN:DATA:NOROOT,01cH
- // unsigned char const volatile __data P4IN
- P4IN:
- DS8 1
- ASEGN DATA16_AN:DATA:NOROOT,01dH
- // unsigned char volatile __data P4OUT
- P4OUT:
- DS8 1
- // 6
- // 7
- // 8
- RSEG CODE:CODE:NOROOT(1)
- // 9 void ViewCommunicationTX(unsigned char ViewTimeControlWord)
- ViewCommunicationTX:
- CFI Block cfiBlock0 Using cfiCommon0
- CFI Function ViewCommunicationTX
- // 10 {
- FUNCALL ViewCommunicationTX, SendOneViewData
- LOCFRAME CSTACK, 6, STACK
- FUNCALL ViewCommunicationTX, SendOneViewData
- LOCFRAME CSTACK, 6, STACK
- FUNCALL ViewCommunicationTX, delay1us
- LOCFRAME CSTACK, 6, STACK
- PUSH.W R10
- CFI R10 Frame(CFA, -4)
- CFI CFA SP+4
- PUSH.W R11
- CFI R11 Frame(CFA, -6)
- CFI CFA SP+6
- MOV.B R12, R10
- // 11 unsigned char ucGeneralCnt = 0;
- MOV.B #0x0, R11
- // 12 /*
- // 13 unsigned char ucYear=0xa1;
- // 14 unsigned char ucMonth=0xa2;
- // 15 unsigned char ucDate=0xa3;
- // 16 unsigned char ucHour=0xa4;
- // 17 unsigned char ucMinute=0xa5;
- // 18 unsigned char ucSecond=0xa6;
- // 19 unsigned char ucRingNum=0xa7;
- // 20 unsigned char ucIcon0=0xa8;
- // 21 unsigned char ucIcon1=0xa9;
- // 22 unsigned char ucIcon2=0xa0;
- // 23 */
- // 24 __disable_interrupt();
- DINT
- // 25 VIEW_PORT_OUT &= ~bitVIEWCLK;
- BIC.B #0x2, &0x1d
- // 26 while ((VIEW_PORT_IN & bitVIEWDATASI) == bitVIEWDATASI)//wait Low
- ??ViewCommunicationTX_0:
- BIT.B #0x1, &0x1c
- JNC ??ViewCommunicationTX_2
- // 27 {
- // 28 if (gwTimeOverflowCount++ == 0xffff)
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??ViewCommunicationTX_3
- // 29 gucTimeOverflowCount++;
- ADD.B #0x1, &gucTimeOverflowCount
- // 30 if (gucTimeOverflowCount == 10)
- ??ViewCommunicationTX_3:
- CMP.B #0xa, &gucTimeOverflowCount
- JNE ??ViewCommunicationTX_0
- // 31 {gucGeneralStatus &= ~bitSendFaxSignalOK;gucTimeOverflowCount=0;gwTimeOverflowCount=0;break;}
- BIC.B #0x10, &gucGeneralStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 32 }
- // 33 if ((VIEW_PORT_IN & bitVIEWDATASI) != bitVIEWDATASI)
- ??ViewCommunicationTX_2:
- BIT.B #0x1, &0x1c
- JC ??ViewCommunicationTX_4
- // 34 {
- // 35 SendOneViewData(ViewTimeControlWord);//00 10Bytes is effect
- MOV.B R10, R12
- CALL #SendOneViewData
- // 36 //01 4Bytes is effect RingNum Icon2-1
- // 37
- // 38 /*
- // 39 SendOneViewData(gucHour);
- // 40 SendOneViewData(gucMinute);
- // 41 SendOneViewData(gucSecond);
- // 42 SendOneViewData(gucMonth);
- // 43 SendOneViewData(gucDate);
- // 44 SendOneViewData(gucYear);
- // 45 SendOneViewData(gucViewRingNum);
- // 46 SendOneViewData(gucViewStaticStatus);
- // 47 SendOneViewData(gucViewDynamicStatus);
- // 48 SendOneViewData(gucIcon2);
- // 49 */
- // 50 for (ucGeneralCnt=0; ucGeneralCnt<10; ucGeneralCnt++)
- MOV.B #0x0, R11
- ??ViewCommunicationTX_1:
- CMP.B #0xa, R11
- JC ??ViewCommunicationTX_5
- // 51 {
- // 52 SendOneViewData(aucViewData[ucGeneralCnt]);
- MOV.B R11, R14
- AND.W #0xff, R14
- MOV.B aucViewData(R14), R12
- CALL #SendOneViewData
- // 53 }
- ADD.B #0x1, R11
- JMP ??ViewCommunicationTX_1
- // 54
- // 55 delay1us(50);
- ??ViewCommunicationTX_5:
- MOV.W #0x32, R12
- CALL #delay1us
- // 56 VIEW_PORT_OUT |= bitVIEWCLK;
- BIS.B #0x2, &0x1d
- // 57 VIEW_PORT_OUT |= bitVIEWDATASO;
- BIS.B #0x4, &0x1d
- // 58 }
- // 59 _EINT();
- ??ViewCommunicationTX_4:
- EINT
- // 60 }
- POP.W R11
- CFI R11 SameValue
- CFI CFA SP+4
- POP.W R10
- CFI R10 SameValue
- CFI CFA SP+2
- RET
- CFI EndBlock cfiBlock0
- // 61
- RSEG CODE:CODE:NOROOT(1)
- // 62 void ViewCommunicationRX(void)
- ViewCommunicationRX:
- CFI Block cfiBlock1 Using cfiCommon0
- CFI Function ViewCommunicationRX
- // 63 {
- FUNCALL ViewCommunicationRX, ReceiveOneViewData
- LOCFRAME CSTACK, 6, STACK
- FUNCALL ViewCommunicationRX, delay1us
- LOCFRAME CSTACK, 6, STACK
- PUSH.W R10
- CFI R10 Frame(CFA, -4)
- CFI CFA SP+4
- PUSH.W R11
- CFI R11 Frame(CFA, -6)
- CFI CFA SP+6
- // 64 unsigned char ucGeneralCnt = 0;
- MOV.B #0x0, R10
- // 65 __disable_interrupt();
- DINT
- // 66 while ((VIEW_PORT_IN & bitVIEWDATASI) != bitVIEWDATASI)//wait Low
- ??ViewCommunicationRX_0:
- BIT.B #0x1, &0x1c
- JC ??ViewCommunicationRX_3
- // 67 {
- // 68 //if ((gucGeneralStatus & bitModemActive) == bitModemActive)
- // 69 //break;
- // 70 if (gwTimeOverflowCount++ == 0xffff)
- MOV.W &gwTimeOverflowCount, R14
- MOV.W #0x1, R15
- ADD.W R14, R15
- MOV.W R15, &gwTimeOverflowCount
- CMP.W #0xffff, R14
- JNE ??ViewCommunicationRX_4
- // 71 gucTimeOverflowCount++;
- ADD.B #0x1, &gucTimeOverflowCount
- // 72 if (gucTimeOverflowCount == 10)
- ??ViewCommunicationRX_4:
- CMP.B #0xa, &gucTimeOverflowCount
- JNE ??ViewCommunicationRX_0
- // 73 {gucGeneralStatus &= ~bitSendFaxSignalOK;gucTimeOverflowCount=0;gwTimeOverflowCount=0;break;}
- BIC.B #0x10, &gucGeneralStatus
- MOV.B #0x0, &gucTimeOverflowCount
- MOV.W #0x0, &gwTimeOverflowCount
- // 74 }
- // 75 VIEW_PORT_OUT &= ~bitVIEWCLK;
- ??ViewCommunicationRX_3:
- BIC.B #0x2, &0x1d
- // 76 while ((VIEW_PORT_IN & bitVIEWDATASI) == bitVIEWDATASI)//wait Low
- ??ViewCommunicationRX_1:
- BIT.B #0x1, &0x1c
- JNC ??ViewCommunicationRX_5
- // 77 {
- // 78 if ((gucGeneralStatus & bitModemActive) == bitModemActive)
- BIT.B #0x2, &gucGeneralStatus
- JNC ??ViewCommunicationRX_1
- // 79 break;
- // 80 }
- // 81 if ((VIEW_PORT_IN & bitVIEWDATASI) != bitVIEWDATASI)
- ??ViewCommunicationRX_5:
- BIT.B #0x1, &0x1c
- JC ??ViewCommunicationRX_6
- // 82 {
- // 83 /*
- // 84 SendOneViewData(0x80);
- // 85 gucHour=ReceiveOneViewData();
- // 86 gucMinute=ReceiveOneViewData();
- // 87 gucSecond=ReceiveOneViewData();
- // 88 gucMonth = ReceiveOneViewData();
- // 89 gucDate = ReceiveOneViewData();
- // 90 gucYear = ReceiveOneViewData();
- // 91 gucViewRingNum=ReceiveOneViewData();
- // 92 gucViewStaticStatus=ReceiveOneViewData();
- // 93 gucViewDynamicStatus=ReceiveOneViewData();
- // 94 gucIcon2=ReceiveOneViewData();
- // 95 */
- // 96 for (ucGeneralCnt=0; ucGeneralCnt<10; ucGeneralCnt++)
- MOV.B #0x0, R10
- ??ViewCommunicationRX_2:
- CMP.B #0xa, R10
- JC ??ViewCommunicationRX_7
- // 97 {
- // 98 aucViewData[ucGeneralCnt]=ReceiveOneViewData();
- MOV.B R10, R11
- AND.W #0xff, R11
- CALL #ReceiveOneViewData
- MOV.B R12, aucViewData(R11)
- // 99 }
- ADD.B #0x1, R10
- JMP ??ViewCommunicationRX_2
- // 100 delay1us(50);
- ??ViewCommunicationRX_7:
- MOV.W #0x32, R12
- CALL #delay1us
- // 101 VIEW_PORT_OUT |= bitVIEWCLK;
- BIS.B #0x2, &0x1d
- // 102 }
- // 103
- // 104 _EINT();
- ??ViewCommunicationRX_6:
- EINT
- // 105
- // 106 }
- POP.W R11
- CFI R11 SameValue
- CFI CFA SP+4
- POP.W R10
- CFI R10 SameValue
- CFI CFA SP+2
- RET
- CFI EndBlock cfiBlock1
- // 107
- // 108
- // 109
- RSEG CODE:CODE:NOROOT(1)
- // 110 void SendOneViewData(unsigned char ucViewTxData)
- SendOneViewData:
- CFI Block cfiBlock2 Using cfiCommon0
- CFI Function SendOneViewData
- // 111 {
- FUNCALL SendOneViewData, delay1us
- LOCFRAME CSTACK, 6, STACK
- FUNCALL SendOneViewData, delay1us
- LOCFRAME CSTACK, 6, STACK
- FUNCALL SendOneViewData, delay1us
- LOCFRAME CSTACK, 6, STACK
- PUSH.W R10
- CFI R10 Frame(CFA, -4)
- CFI CFA SP+4
- PUSH.W R11
- CFI R11 Frame(CFA, -6)
- CFI CFA SP+6
- MOV.B R12, R10
- // 112 unsigned char ucGeneralCount=0;
- MOV.B #0x0, R11
- // 113 for (ucGeneralCount=0;ucGeneralCount<8;ucGeneralCount++)
- MOV.B #0x0, R11
- ??SendOneViewData_0:
- CMP.B #0x8, R11
- JC ??SendOneViewData_1
- // 114 {
- // 115 VIEW_PORT_OUT &= ~bitVIEWCLK;
- BIC.B #0x2, &0x1d
- // 116 delay1us(50);//
- MOV.W #0x32, R12
- CALL #delay1us
- // 117 if ((ucViewTxData & BIT0) == BIT0)
- BIT.B #0x1, R10
- JNC ??SendOneViewData_2
- // 118 {VIEW_PORT_OUT |= bitVIEWDATASO;} //set Tx bit
- BIS.B #0x4, &0x1d
- JMP ??SendOneViewData_3
- // 119 else
- // 120 {VIEW_PORT_OUT &= ~bitVIEWDATASO;} //reset Tx bit
- ??SendOneViewData_2:
- BIC.B #0x4, &0x1d
- // 121 ucViewTxData=ucViewTxData>>1;
- ??SendOneViewData_3:
- CLRC
- RRC.B R10
- // 122 delay1us(50);//
- MOV.W #0x32, R12
- CALL #delay1us
- // 123 VIEW_PORT_OUT |= bitVIEWCLK;
- BIS.B #0x2, &0x1d
- // 124 delay1us(100);
- MOV.W #0x64, R12
- CALL #delay1us
- // 125 VIEW_PORT_OUT &= ~bitVIEWCLK;
- BIC.B #0x2, &0x1d
- // 126
- // 127 }
- ADD.B #0x1, R11
- JMP ??SendOneViewData_0
- // 128 }
- ??SendOneViewData_1:
- POP.W R11
- CFI R11 SameValue
- CFI CFA SP+4
- POP.W R10
- CFI R10 SameValue
- CFI CFA SP+2
- RET
- CFI EndBlock cfiBlock2
- // 129
- RSEG CODE:CODE:NOROOT(1)
- // 130 unsigned char ReceiveOneViewData(void)
- ReceiveOneViewData:
- CFI Block cfiBlock3 Using cfiCommon0
- CFI Function ReceiveOneViewData
- // 131 {
- FUNCALL ReceiveOneViewData, delay1us
- LOCFRAME CSTACK, 6, STACK
- FUNCALL ReceiveOneViewData, delay1us
- LOCFRAME CSTACK, 6, STACK
- FUNCALL ReceiveOneViewData, delay1us
- LOCFRAME CSTACK, 6, STACK
- PUSH.W R10
- CFI R10 Frame(CFA, -4)
- CFI CFA SP+4
- PUSH.W R11
- CFI R11 Frame(CFA, -6)
- CFI CFA SP+6
- // 132 unsigned char ucGeneralCount=0;
- MOV.B #0x0, R11
- // 133 unsigned char ucViewRxData;
- // 134 for (ucGeneralCount=0;ucGeneralCount<8;ucGeneralCount++)
- MOV.B #0x0, R11
- ??ReceiveOneViewData_0:
- CMP.B #0x8, R11
- JC ??ReceiveOneViewData_1
- // 135 {
- // 136 ucViewRxData=ucViewRxData>>1;
- CLRC
- RRC.B R10
- // 137 VIEW_PORT_OUT &= ~bitVIEWCLK;
- BIC.B #0x2, &0x1d
- // 138 delay1us(100);
- MOV.W #0x64, R12
- CALL #delay1us
- // 139 VIEW_PORT_OUT |= bitVIEWCLK;
- BIS.B #0x2, &0x1d
- // 140 delay1us(50);
- MOV.W #0x32, R12
- CALL #delay1us
- // 141 if ((VIEW_PORT_IN & bitVIEWDATASI) == bitVIEWDATASI)
- BIT.B #0x1, &0x1c
- JNC ??ReceiveOneViewData_2
- // 142 {ucViewRxData |= BIT7;} //1
- BIS.B #0x80, R10
- JMP ??ReceiveOneViewData_3
- // 143 else
- // 144 {ucViewRxData &= ~BIT7;} //0
- ??ReceiveOneViewData_2:
- BIC.B #0x80, R10
- // 145
- // 146 delay1us(50);
- ??ReceiveOneViewData_3:
- MOV.W #0x32, R12
- CALL #delay1us
- // 147 VIEW_PORT_OUT &= ~bitVIEWCLK;
- BIC.B #0x2, &0x1d
- // 148 }
- ADD.B #0x1, R11
- JMP ??ReceiveOneViewData_0
- // 149 return ucViewRxData;
- ??ReceiveOneViewData_1:
- MOV.B R10, R12
- POP.W R11
- CFI R11 SameValue
- CFI CFA SP+4
- POP.W R10
- CFI R10 SameValue
- CFI CFA SP+2
- RET
- CFI EndBlock cfiBlock3
- // 150 }
- RSEG CODE:CODE:NOROOT(1)
- ?setjmp_save_r4:
- REQUIRE ?setjmp_r4
- REQUIRE ?longjmp_r4
- RSEG CODE:CODE:NOROOT(1)
- ?setjmp_save_r5:
- REQUIRE ?setjmp_r5
- REQUIRE ?longjmp_r5
- END
- // 151
- // 152 /*
- // 153 if ((VIEW_PORT_OUT & bitVIEWCLK) == bitVIEWCLK)
- // 154 {VIEW_PORT_OUT &= ~bitVIEWDATA;} //Reset CLOCK
- // 155 else
- // 156 {VIEW_PORT_OUT |= bitVIEWDATA;} //set CLOCK
- // 157 */
- //
- // 406 bytes in segment CODE
- // 2 bytes in segment DATA16_AN
- //
- // 406 bytes of CODE memory
- // 0 bytes of DATA memory (+ 2 bytes shared)
- //
- //Errors: none
- //Warnings: none