




下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、C語(yǔ)言位域操作方法#include <avr/io.h>#ifndef _Use_AdvancedPortCommand# define _Use_AdvancedPortCommand# define PAInUse 0xff# define PBInUse 0xff# define PCInUse 0xff# define PDI
2、nUse 0xff# define PEInUse 0x00# define PFInUse 0x00# define PGInUse 0x00# define PHInUse 0
3、x00# define PIInUse 0x00# define PJInUse 0x00# define PKInUse 0x00# define PLInUse 0x00# define PMInUse
4、; 0x00# define PNInUse 0x00# define POInUse 0x00# define PPInUse 0x00# define PQInUse 0x00# define PRInUse
5、160; 0x00# define PSInUse 0x00# define PTInUse 0x00# define PUInUse 0x00# define PVInUse 0x00# define PWInUs
6、e 0x00# define PXInUse 0x00# define PYInUse 0x00# define PZInUse 0x00# define Read_PA0 (PINA<
7、<7)>>7)# define Read_PA1 (PINA<<6)>>7)# define Read_PA2 (PINA<<5)>>7)# define Read_PA3 (PINA<<4)>>7)# define Read_PA4
8、 (PINA<<3)>>7)# define Read_PA5 (PINA<<2)>>7)# define Read_PA6 (PINA<<1)>>7)# define Read_PA7 (PINA>>7)# define Read_PB0
9、 (PINB<<7)>>7)# define Read_PB1 (PINB<<6)>>7)# define Read_PB2 (PINB<<5)>>7)# define Read_PB3 (PINB<<4)>>7)# define Read_PB4
10、160; (PINB<<3)>>7)# define Read_PB5 (PINB<<2)>>7)# define Read_PB6 (PINB<<1)>>7)# define Read_PB7 (PINB>>7)# define Read_PC0
11、160; (PINC<<7)>>7)# define Read_PC1 (PINC<<6)>>7)# define Read_PC2 (PINC<<5)>>7)# define Read_PC3 (PINC<<4)>>7)# d
12、efine Read_PC4 (PINC<<3)>>7)# define Read_PC5 (PINC<<2)>>7)# define Read_PC6 (PINC<<1)>>7)# define Read_PC7 (PINC>>
13、;7)# define Read_PD0 (PIND<<7)>>7)# define Read_PD1 (PIND<<6)>>7)# define Read_PD2 (PIND<<5)>>7)# define Read_PD3 (PIND&
14、lt;<4)>>7)# define Read_PD4 (PIND<<3)>>7)# define Read_PD5 (PIND<<2)>>7)# define Read_PD6 (PIND<<1)>>7)# define Read_PD7
15、60; (PIND>>7)typedef struct BYTE_BIT unsigned Bit0:1; unsigned Bit1:1; unsigned Bit2:1; unsigned Bit3:1; unsigned Bit4:1; unsigned Bit5:1; unsigned Bit6:1; unsigned Bit7:1;PORTBIT;# define PORTA_B
16、IT (*(volatile PORTBIT *)PORTA)# define PORTB_BIT (*(volatile PORTBIT *)PORTB)# define PORTC_BIT (*(volatile PORTBIT *)PORTC)# define PORTD_BIT (*(volatile PORTBIT *)PORTD)# define DDRA_BIT (*(volatile PORTBIT *)DDRA)# define DDRB_BIT (*(volatile PORTB
17、IT *)DDRB)# define DDRC_BIT (*(volatile PORTBIT *)DDRC)# define DDRD_BIT (*(volatile PORTBIT *)DDRD)# define PORTDefine();#endif 2 第二種位操作方法 typedef union unsigned char value; struct unsigned int bit0:1; unsigned int bit1:1;
18、; unsigned int bit2:1; unsigned int bit3:1; unsigned int bit4:1; unsigned int bit5:1; unsigned int bit6:1; unsigned int bit7:1; bit_field; PORT;用法:聲明:PORT pa;位操作: pa.bit_field.bit0=pa.bit_field.bit0;/位取反 PORTA=pa.value;
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年姿態(tài)敏感器項(xiàng)目資金申請(qǐng)報(bào)告代可行性研究報(bào)告
- 營(yíng)異常名錄管理暫行辦法
- 薊州區(qū)房屋土地管理辦法
- 蚌埠市基金管理辦法細(xì)則
- 行政預(yù)算與管理暫行辦法
- 衢州市排澇泵站管理辦法
- 西寧市市民中心管理辦法
- 西藏合同制工人管理辦法
- 設(shè)備管理與保養(yǎng)管理辦法
- 評(píng)標(biāo)專家?guī)旃芾頃盒修k法
- 高中數(shù)學(xué)第三章不等式章末復(fù)習(xí)提升省公開(kāi)課一等獎(jiǎng)新課獲獎(jiǎng)?wù)n件
- 中職高教版(2023)語(yǔ)文職業(yè)模塊-第五單元:走近大國(guó)工匠(二)學(xué)習(xí)工匠事跡 領(lǐng)略工匠風(fēng)采【課件】
- 學(xué)校保潔服務(wù)投標(biāo)方案(技術(shù)方案)
- 2025年度礦山尾礦綜合利用項(xiàng)目合作協(xié)議3篇
- 《旅游經(jīng)濟(jì)學(xué)》課程教學(xué)大綱
- 急性腎衰應(yīng)急預(yù)案
- 《水利工程設(shè)計(jì)變更管理暫行辦法》知識(shí)培訓(xùn)
- 盆腔炎中醫(yī)課件
- 中國(guó)急性缺血性腦卒中早期血管內(nèi)介入診療指南
- CQI-23模塑系統(tǒng)評(píng)估審核表-中英文
評(píng)論
0/150
提交評(píng)論