freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

pc機(jī)與單片機(jī)的通訊設(shè)計(jì)(編輯修改稿)

2024-08-18 20:21 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 ASK reg */ define INTC_EOI 0x20 /* Interrupt controller EOI reg */ define MAX_PORTS 2 /* I/O ports (DOS limit) */ static int count = 0。 static COM _list[MAX_PORTS]。 /* I/O data structure */ static COM *1。 /* Pointers for interrupt actions */ static COM *2。 static COM *_xfer。 /* Transfer interrupt data structure */ COM *ser_init0(int port,char *ibuf,int isize, char *obuf,int osize)。 void ser_close0( COM *c )。 void (_interrupt _far int_ser1)( void )。 /* Int rtn for serial I/O COM 1 */ void (_interrupt _far int_ser2)( void )。 /* Int rtn for serial I/O COM 2 */ void (_interrupt _far int_ser_sup)( void )。 /* Support int actions */ COM *ser_init( int port,int baud,int bit,int parity,int isize,int osize ) { unsigned status。 char ch。 COM *c。 char *in_buf,*out_buf。 中國(guó)最龐大的下資料庫(kù) (整理 . 版權(quán)歸原作者所有 ) 第 22 頁(yè) 共 42 頁(yè) status = _bios_serial(_COM_INIT,port,(bit | parity | _COM_STOP2| baud ))。 in_buf = malloc( isize )。 if( in_buf == NULL ) return( NULL )。 out_buf = malloc( osize )。 if( out_buf == NULL ) return( NULL )。 c = ser_init0(port,in_buf,isize,out_buf,osize )。 clean_ser(c)。 return( c )。 } void ser_close(COM *c) { int i。 if( !cready ) return。 ser_close0(c)。 free( cin_buf )。 free( cout_buf )。 } 中國(guó)最龐大的下資料庫(kù) (整理 . 版權(quán)歸原作者所有 ) 第 23 頁(yè) 共 42 頁(yè) char serline( COM *c ) { if( !cready ) return(FALSE)。 if( cin_crt 0 ) return( TRUE )。 else return( FALSE )。 } int getsers( COM *c,int len,char *str ) { char ch。 int i。 i = 0。 while( ilen ) { while( !serhit(c) ) { if(kbhit()) return( 1 )。 } ch = 0x7f amp。 getser(c)。 switch( ch ) { case 0x0d: str[i++] = 39。\039。 return( i )。 case 0x00: case 0x0a: break。 default: str[i++] = ch。 break。 中國(guó)最龐大的下資料庫(kù) (整理 . 版權(quán)歸原作者所有 ) 第 24 頁(yè) 共 42 頁(yè) } } str[i] = 39。\039。 return( len )。 } int putsers( char *str, COM *c ) { int n,i,j。 n = strlen( str )。 for( i=0。 in。 i++ ) { while( !putser( str[i],c ) )。 } return( n )。 } char putser( char outch, COM *c ) { char val。 if( !cready ) return(FALSE)。 while( !cout_mt amp。amp。 (cout_head == cout_tail) )。 if( !cout_full ) { cout_buf[cout_head++] = outch。 中國(guó)最龐大的下資料庫(kù) (整理 . 版權(quán)歸原作者所有 ) 第 25 頁(yè) 共 42 頁(yè) if( cout_head == cout_size ) cout_head = 0。 /* Reset buffer circularly */ } if( cout_head == cout_tail ) { cout_full = TRUE。 return( FALSE )。 } else cout_full = FALSE。 val = inp( SREG(LCR) )。 /* Reset DLAB for IER access */ val amp。= 0x7F。 /* Clear IER access bit */ outp(SREG(LCR),val)。 val = inp( SREG(IER) )。 if( !(val amp。 0x02) ) /* Interrupt ON ? */ { cout_mt = FALSE。 /* Not MT now */ _disable()。 /* Interrupts OFF NOW */ outp(SREG(IER),0x03)。 /* RX amp。 TX interrupts ON */ _enable()。 /* Interrupts ON again */ } return( TRUE )。 } char serhit( COM *c ) { if( !cready ) return(FALSE)。 if( !cin_mt ) return( TRUE )。 中國(guó)最龐大的下資料庫(kù) (整理 . 版權(quán)歸原作者所有 ) 第 26 頁(yè) 共 42 頁(yè) else return( FALSE )。 } int getser( COM *c ) { int ch。 if( !cready ) return(FALSE)。 if( !serhit(c) ) return( 0 )。 _disable()。 ch = 0xff amp。 cin_buf[cin_tail++]。 if( cin_tail == cin_size ) cin_tail = 0。 if( cin_tail == cin_head ) cin_mt = TRUE。 if( ch == CR ) /* Keep track of CR39。s */ cin_crt。 _enable()。 return( ch )。 } void clean_ser( COM *c ) { _disable()。 cin_head = 0。 中國(guó)最龐大的下資料庫(kù) (整理 . 版權(quán)歸原作者所有 ) 第 27 頁(yè) 共 42 頁(yè) cin_tail = 0。 cin_mt = TRUE。 cin_crt = 0。 _enable()。 } void tl_dtr( int flag,COM *c ) { char val。 if( !cready ) return。 val = inp(SREG(MCR))。 if( flag ) val |= 1。 else val amp。= ~1。 outp(SREG(MCR),val)。 } void tl_rts( int flag, COM *c ) { char val。 if( !cready ) return。 val = inp(SREG(MCR))。 中國(guó)最龐大的下資料庫(kù) (整理 . 版權(quán)歸原作者所有 ) 第 28 頁(yè) 共 42 頁(yè) if( flag ) val |= 2。 else val amp。= ~2。 outp(SREG(MCR),val)。 } COM *ser_init0(int port,char *ibuf,int isize, char *obuf,int osize) { int i。 char val。 COM *c。 while( port = MAX_PORTS ) /* Get port in range */ port。 for( i=0。 iMAX_PORTS。 i++ ) /* Select data structure */ { if( !_list[i].ready ) { c = amp。(_list[i])。 break。 } } if( i == MAX_PORTS ) /* Not found */ return( NULL )。 cin_buf = ibuf。 cin_size = isize。 cin_mt = TRUE。 cin_head = 0。 cin_tail = 0。 cin_crt = 0。 中國(guó)最龐大的下資料庫(kù) (整理 . 版權(quán)歸原作者所有 ) 第 29 頁(yè) 共 42 頁(yè) cout_buf = obuf。 cout_size = osize。 cout_full = FALSE。 cout_mt = TRUE。 cout_head = 0。 cout_tail = 0。 switch( port ) { case 0: /* Here set up for COM1 */ cready = TRUE。 c_base = COM1_BASE。 cirq_mask = COM1_IRQ_MASK。 cirq_eoi = COM1_IRQ_EOI。 cint_number = COM1_INT_NUM。 _disable()。 1 = c。 cold = _dos_getvect( cint_number )。 _dos_setvect(cint_number,int_ser1)。 break
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1