FaxRxBufRawdata2pc.c
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:4k
- /************************************************
- Description:
- Send the received fax raw data to PC via MAX232
- 3G 1-dimensional Data Format Recommendation T.4
- Input:
- none
- Output:
- none
- Update:
- 2006.11.02 Bryan function header create
- ************************************************/
- #include "includeH.h"
- void FaxRxBufRawdata2PCFromSoftUart(void) // send the received fax data to PC via MAX232
- {
- unsigned char ucFlashColumnAddCnt=0;
- unsigned int wGeneralCnt=0,wPageAddress=0;
- //ucGeneralCnt=2;
- SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;
- //wPageAddress=gwPageAddress;
- ZERO_ADDRESS();
- //for (gwPageAddress=1216;gwPageAddress<2559;gwPageAddress++) //Mar.2, 2007
- for (wPageAddress=cstFaxRxBufStartPage;wPageAddress<=gwPageAddress;wPageAddress++)
- {
-
- ROW_ADDRESS_LOW = wPageAddress & 0xff;
- ROW_ADDRESS_HIGH = (wPageAddress>>8) & 0xff;
- for (ucFlashColumnAddCnt = 0;ucFlashColumnAddCnt < 8;ucFlashColumnAddCnt++)
- {
- //8 * 256 == 2048 Bytes 2^4*2^8 12bit column address HighColumnAddr:0~8
- //total 8*256B+64B=2K+64B
- COLUMN_ADDRESS_HIGH=ucFlashColumnAddCnt;
- READ_256_BYTE();//read 256 Byte to aucUartRxBuf[256]
- for (wGeneralCnt=0;wGeneralCnt<256;wGeneralCnt++)//
- //modify Dec.28,2006 4*64Bytes one time
- {
- SoftUartTxOneFrame(aucUartRxBuf[wGeneralCnt]);
- if (aucUartRxBuf[wGeneralCnt] == 0xfb && aucUartRxBuf[wGeneralCnt-1] == 0x13 && aucUartRxBuf[wGeneralCnt-2] == 0xff)
- {_NOP();break;}
- }//third for
- if (aucUartRxBuf[wGeneralCnt] == 0xfb && aucUartRxBuf[wGeneralCnt-1] == 0x13 && aucUartRxBuf[wGeneralCnt-2] == 0xff)
- break;
- }//second for next 256Byte
- if (aucUartRxBuf[wGeneralCnt] == 0xfb && aucUartRxBuf[wGeneralCnt-1] == 0x13 && aucUartRxBuf[wGeneralCnt-2] == 0xff)
- break;
- }//first for next page
-
- ATcmdDelay(); // receive data delay(if not, can't receive 0x10 0x03)
- SOFTUART_PORT_DIRECTION &= ~bitSOFTUARTTX;
- }
- /*
- void FaxRxBufRawdata2PCFromUart(void) // send the received fax data to PC via MAX232
- {
- unsigned char ucFlashColumnAddCnt=0,ucGeneralCnt=0;
- //ucGeneralCnt=2;
- ZERO_ADDRESS();
- for (gwPageAddress=cstFaxRxBufStartPage;gwPageAddress<2559;gwPageAddress++)
- {
-
- ROW_ADDRESS_LOW = gwPageAddress & 0xff;
- ROW_ADDRESS_HIGH = (gwPageAddress>>8) & 0xff;
- for (ucFlashColumnAddCnt = 0;ucFlashColumnAddCnt < 8;ucFlashColumnAddCnt++)
- {
- //8 * 256 == 2048 Bytes 2^4*2^8 12bit column address HighColumnAddr:0~8
- //total 8*256B+64B=2K+64B
- COLUMN_ADDRESS_HIGH=ucFlashColumnAddCnt;
- READ_256_BYTE();//read 256 Byte to aucUartRxBuf[256]
- for (ucGeneralCnt=0;ucGeneralCnt<4;ucGeneralCnt++)//16*16Bytes send 16Bytes one time
- {
- Send64BytePageImageData(64,ucGeneralCnt);
- while(gucTxBufCnt!=0)//send over, ucTxBufCnt == 0
- {
- ;
- }
- //delay10ms();
- if (gwTxNum != 64 && TXBUF0==0xfb)
- break;
- }//third for
- if (gwTxNum != 64)
- break;
- }//second for
-
- if (gwTxNum != 64)
- break;
- }//first for next page
-
- ATcmdDelay(); // receive data delay(if not, can't receive 0x10 0x03)
- }
- */