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

正文內(nèi)容

基于單片機(jī)的無線防盜系統(tǒng)畢業(yè)設(shè)-預(yù)覽頁

2025-07-13 17:38 上一頁面

下一頁面
 

【正文】 FIFO指令define REUSE_TX_PL 0xE3 // 定義重復(fù)裝載數(shù)據(jù)指令define NOP 0xFF // 保留//*************************************SPI(nRF24L01)寄存器地址****************************************************define CONFIG 0x00 // 配置收發(fā)狀態(tài),CRC校驗(yàn)?zāi)J揭约笆瞻l(fā)狀態(tài)響應(yīng)方式define EN_AA 0x01 // 自動應(yīng)答功能設(shè)置define EN_RXADDR 0x02 // 可用信道設(shè)置define SETUP_AW 0x03 // 收發(fā)地址寬度設(shè)置define SETUP_RETR 0x04 // 自動重發(fā)功能設(shè)置define RF_CH 0x05 // 工作頻率設(shè)置define RF_SETUP 0x06 // 發(fā)射速率、功耗功能設(shè)置define STATUS 0x07 // 狀態(tài)寄存器define OBSERVE_TX 0x08 // 發(fā)送監(jiān)測功能define CD 0x09 // 地址檢測define RX_ADDR_P0 0x0A // 頻道0接收數(shù)據(jù)地址define RX_ADDR_P1 0x0B // 頻道1接收數(shù)據(jù)地址define RX_ADDR_P2 0x0C // 頻道2接收數(shù)據(jù)地址define RX_ADDR_P3 0x0D // 頻道3接收數(shù)據(jù)地址define RX_ADDR_P4 0x0E // 頻道4接收數(shù)據(jù)地址define RX_ADDR_P5 0x0F // 頻道5接收數(shù)據(jù)地址define TX_ADDR 0x10 // 發(fā)送地址寄存器define RX_PW_P0 0x11 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P1 0x12 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P2 0x13 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P3 0x14 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P4 0x15 // 接收頻道0接收數(shù)據(jù)長度define RX_PW_P5 0x16 // 接收頻道0接收數(shù)據(jù)長度define FIFO_STATUS 0x17 // FIFO棧入棧出狀態(tài)寄存器設(shè)置//uchar TX_ADDRESS[TX_ADR_WIDTH]= {0x01,0x20,0x20,0x20,0x20}。 //狀態(tài)標(biāo)志sbit RX_DR =sta^6。n0。bit_ctr8。uchar39。 // capture current MISO bitSCK = 0。 //SPI使能status = SPI_RW(reg)。CSN = 1。 // CSN low, init SPI transactionstatus = SPI_RW(reg)。 // return nRF24L01 status uchar}/***********************************************************************************************************/*函數(shù):void nRF24L01_TxPacket(unsigned char * tx_buf)/*功能:發(fā)送 tx_buf中數(shù)據(jù)/**********************************************************************************************************/void nRF24L01_TxPacket(uchar * tx_buf){CE=0。CE=0。CE=1。 // chip enableCSN=1。 // 寫接收端地址 SPI_RW_Reg(WRITE_REG + EN_AA, 0x03)。 //設(shè)置0通道接收數(shù)據(jù)長度,本次設(shè)置為5字節(jié)SPI_RW_Reg(WRITE_REG + RX_PW_P1, RX_PLOAD_WIDTH)。}//*************************此部分為人體接近模塊主函數(shù)************************//*****************************************************************************includesbit led=P3^7。i4。}}void main(){uchar tx_buf[]={1,1,1}。init_NRF24L01()。delay_ms(100)。sbit RCK=P1^2。sbit ep = P1^3。 i++){_nop_()。}}}/***********74HC595驅(qū)動函數(shù)*******************/void send_HC595 (uchar wrDat){uchar i。0x80。_nop_()。_nop_()。rw = 0。send_HC595(cmd)。_nop_()。_nop_()。}/***************寫顯示數(shù)據(jù)到LCD************************/lcd_wdat(uchar dat){delay_ms(10)。send_HC595(dat)。_nop_()。_nop_()。 //delay_ms(1)。 //delay_ms(1)。 //清除LCD的顯示內(nèi)容delay_ms(1)。lcd_wdat(CH)。}}else{lcd_pos(0x40+pos2)。if(a!=0){ kk+=4。 //寫數(shù)據(jù)到指令寄存器}//*********************此部分為時(shí)間顯示部分********************************* //********************************************************** //************************************************************************** includeincludesbit ds=P1^7。define uchar unsigned chardefine uint unsigned intdefine ulong unsigned longdefine ds_BUF P0uchar miao,fen,shi,day,week,month,year。139。339。539。739。939。uchar read_ds(uchar add)。void dis_week()。rw=1。ds_BUF=DAT。}//************讀DS12C887中的數(shù)據(jù)***************************** uchar read_ds(uchar add){uchar time。rw=1。ds_BUF=0xff。cs=1。write_ds(0,0)。write_ds(7,17)。year=read_ds(9)。239。d[3]=num[year%10]。d[6]=num[month%10]。d[9]=num[day%10]。shi=read_ds(4)。t[1]=num[shi%10]。t[4]=num[fen%10]。t[7]=num[miao%10]。LCD_DIS_STR(0,12,w[week1])。dis_time()。sbit CE =P2^2。define fmq_on() fmq=0define fmq_off() fmq=1define led_on() LED=0define led_off() LED=1typedef unsigned char uchar。N39。 //本地地址 uint const RX_ADDRESS[RX_ADR_WIDTH]= {0x01,0x20,0x20,0x20,0x20}。void init_NRF24L01(void)。uint SPI_RW_Reg(uchar reg, uchar value)。//******************************************************************************************uint bdata sta。sbit CH2 =sta^1。_nop_()。 // Spi disableSCK=0。 // 寫接收端地址1 SPI_RW_Reg(WRITE_REG + EN_AA, 0x03)。 //設(shè)置0通道接收數(shù)據(jù)長度,本次設(shè)置為5字節(jié)SPI_RW_Reg(WRITE_REG + RX_PW_P1, RX_PLOAD_WIDTH)。}/****************************************************************************************************/*函數(shù):uint SPI_RW(uint uchar)/*功能:NRF24L01的SPI寫時(shí)序/****************************************************************************************************/uint SPI_RW(uint uchar){uint bit_ctr。 0x80)。 // shift next bit into MSB..SCK = 1。 // return read uchar}/****************************************************************************************************/*函數(shù):uchar SPI_Read(uchar reg)/*功能:NRF24L01的SPI時(shí)序/****************************************************************************************************/uchar SPI_Read(uchar reg){uchar reg_val。 // ..then read registervalueCSN = 1。 // CSN low, init SPI transactionstatus = SPI_RW(reg)。 // return nRF24L01 status uchar}/****************************************************************************************************//*函數(shù):uint SPI_Read_Buf(uchar reg, uchar *pBuf, uchar uchars)/*功能: 用于讀數(shù)據(jù),reg:為寄存器地址,pBuf:為待讀出數(shù)據(jù)地址,uchars:讀出數(shù)據(jù)的個(gè)數(shù) /****************************************************************************************************/uint SPI_Read_Buf(uchar reg, uchar *pBuf, uchar uchars){uint status,uchar_ctr。uchar_ctruchars。 // return nRF24L01 status uchar}/*********************************************************************************************************/*函數(shù):uint SPI_Write_Buf(uchar reg, uchar *pBuf, uchar uchars)/*功能: 用于寫數(shù)據(jù):reg為寄存器地址,pBuf:為待寫入數(shù)據(jù)地址,uchars:寫入數(shù)據(jù)的個(gè)數(shù) /*********************************************************************************************************/uint SPI_Write_Buf(uchar reg, uchar *pBuf, uchar uchars){uint status,uchar_ctr。 uchar_ctruchars。 //}/*函數(shù):unsigned char nRF24L01_RxPacket(unsigned char* rx_buf)/*功能:數(shù)據(jù)讀取后放如rx_buf接收緩沖區(qū)中/******************************************************************************************************/unsigned char nRF24L01_RxPacket(unsigned char* rx_buf0,unsigned char* rx_buf1){unsigned char revale=0。sta=SPI_Read
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1