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

正文內(nèi)容

第四章c51程序設(shè)計(jì)-2實(shí)例-資料下載頁(yè)

2025-08-01 13:32本頁(yè)面
  

【正文】 else if((ID_num%2)==1) { ID_num_send=(ID_num+1)/2。 } ReCommand[0] = 39。*39。 //設(shè)置起始位、從機(jī)地址、終止位 ReCommand[1] = ID_num_send。 //地址 if(flag_alert_LM==1) { ReCommand[2] = 0x01。 //亮度報(bào)警信息 } else { ReCommand[2] = 0x0。 //正常 } ReCommand[3]=tm_send[1]。 //溫度值 ReCommand[4]=tm_send[0]。 ReCommand[5]=lumin_buf[2]。 ReCommand[6]=lumin_buf[1]。 ReCommand[7]=lumin_buf[0]。 ReCommand[9] = 39。39。 //結(jié)束位 if((MASTER==0)amp。amp。(SPARE==1)) { ReCommand[8]=0x0。//主燈工作 } else if((SPARE==0)amp。amp。(MASTER==1)) { ReCommand[8]=0x01。//備燈工作 } ES0R = 0 。 //關(guān)閉 UART0 接收中斷 UART0_CONTROL=T0_ENABLE。 //發(fā)送使能 for(i=0。i10。i++) { S0BUF=ReCommand[i]。 while(TI_0==0) feed_watchdog()。 TI_0=0。 } UART0_CONTROL=R0_ENABLE。//接收使能 _nop_()。_nop_()。_nop_()。_nop_()。 ES0R = 1 。 //開(kāi)放 UART0 接收中斷 } /******** Uart0 receive interrut****************/ void IntUart0Rx( void ) interrupt 4 { RI_0=0。 //清除接收標(biāo)志 if(S0BUF == 39。@39。) { Command[0]=S0BUF。 UartCount =0。 } else if (S0BUF == 39。$39。) { Command[3]=S0BUF。 UartCount =0。 } else if (UartCount 3) { UartCount++。 Command[UartCount]= S0BUF。 } else UartCount =0。 } SPI總線: ? 由同步串行外設(shè)接口 SPI構(gòu) 成的串行總線是一種三線同步總線??偩€上可以連接多個(gè)可以作為主機(jī)的微控制器 MCU及裝有 SPI接口的 I/O設(shè)備如液晶驅(qū)動(dòng)、 A/D轉(zhuǎn)換等外設(shè)。 ? SPI是全雙工的,即主機(jī)在發(fā)送的同時(shí)也可以在接收數(shù)據(jù),傳送的速率由主機(jī)編程決定;時(shí)鐘的極性和相位也是可選擇的,具體的約定由設(shè)計(jì)人員根據(jù)總線上各設(shè)備接口的功能決定。 ? SPI具有四種工作模式,取決于時(shí)鐘極性( CPOL)和時(shí)鐘相位( CPHA),使用的最為廣泛的是 SPI0和 SPI3方式。 SPI 模式 CPOL CPHA 0 0 0 1 0 1 2 1 0 3 1 1 數(shù)據(jù)在時(shí)鐘信號(hào)的上升沿鎖存,下降沿變化,高位在前,低位在后 // // // // // This file defines the pins used for the SPI device. // The SPI device is mapped to pins , but can be modified to map to // any of the available GPIO pins on the device. // ifndef SPI_DEFS define SPI_DEFS sbit MOSI = P0^0。 // Master Out / Slave In (output) sbit MISO = P0^1。 // Master In / Slave Out (input) sbit SCK = P0^2。 // Serial Clock (output) sbit NSS = P0^3。 // Slave Select (output to chip select) endif // SPI_Transfer mode 0 // Simultaneously transmits and receives one byte SPI_byte using // the SPI protocol. SCK is idlelow, and bits are latched on SCK rising. char SPI_Transfer (char SPI_byte) { unsigned char SPI_count。 // counter for SPI transaction SCK = 0。 for (SPI_count = 8。 SPI_count 0。 SPI_count) // single byte SPI loop { MOSI = SPI_byte amp。 0x80。 // put current outgoing bit on MOSI SPI_byte = SPI_byte 1。 // shift next bit into MSB SCK = 0x01。 // set SCK high SPI_byte |= MISO。 // capture current bit on MISO SCK = 0x00。 // set SCK low } return (SPI_byte)。 } // END SPI_Transfe
點(diǎn)擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1