日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁 > 單片機(jī) > 單片機(jī)
[導(dǎo)讀]好吧,不得不承認(rèn),我使用飛思卡爾的XS128單片機(jī)已經(jīng)非常之習(xí)慣了,結(jié)果一上手atmega8,最令我反感的就是atmega8不能對(duì)IO引腳進(jìn)行操作,非要用些繁瑣的位操作。我就不,我就要像飛思卡爾那樣操作。。。于是。。。。。

好吧,不得不承認(rèn),我使用飛思卡爾的XS128單片機(jī)已經(jīng)非常之習(xí)慣了,結(jié)果一上手atmega8,最令我反感的就是atmega8不能對(duì)IO引腳進(jìn)行操作,非要用些繁瑣的位操作。我就不,我就要像飛思卡爾那樣操作。。。


于是。。。。。


把我寫的下面這個(gè)頭文件塞到winavr目錄的include/avr中,并在io.h頭文件的最后包含這個(gè)頭文件。


嘿嘿,一切變得是那么的親切與熟悉。。。。。。


/***********************************************************

* 函數(shù)庫說明:ATMEGE8

* 版本: v1.0

*

************************************************************

*注意: 無

***********************************************************/


#ifndef _BIT_

#define _BIT_

//定義一個(gè)8字節(jié)的位段 bit0~7是每個(gè)位段名稱 1代表一位 PBIT就是整個(gè)位段的名稱

typedef struct

{

unsigned bit0 : 1 ;

unsigned bit1 : 1 ;

unsigned bit2 : 1 ;

unsigned bit3 : 1 ;

unsigned bit4 : 1 ;

unsigned bit5 : 1 ;

unsigned bit6 : 1 ;

unsigned bit7 : 1 ;

}PBIT;

//強(qiáng)制轉(zhuǎn)換

#define PORTABIT (*(volatile PBIT *)0x3B)

#define DDRABIT (*(volatile PBIT *)0x3A)

#define PINABIT (*(volatile PBIT *)0x39)

#define PORTBBIT (*(volatile PBIT *)0x38)

#define DDRBBIT (*(volatile PBIT *)0x37)

#define PINBBIT (*(volatile PBIT *)0x36)

#define PORTCBIT (*(volatile PBIT *)0x35)

#define DDRCBIT (*(volatile PBIT *)0x34)

#define PINCBIT (*(volatile PBIT *)0x33)

#define PORTDBIT (*(volatile PBIT *)0x32)

#define DDRDBIT (*(volatile PBIT *)0x31)

#define PINDBIT (*(volatile PBIT *)0x30)

//繼續(xù)封裝

#define PORTA_PA0 PORTABIT.bit0

#define PORTA_PA1 PORTABIT.bit1

#define PORTA_PA2 PORTABIT.bit2

#define PORTA_PA3 PORTABIT.bit3

#define PORTA_PA4 PORTABIT.bit4

#define PORTA_PA5 PORTABIT.bit5

#define PORTA_PA6 PORTABIT.bit6

#define PORTA_PA7 PORTABIT.bit7

#define PORTB_PB0 PORTBBIT.bit0

#define PORTB_PB1 PORTBBIT.bit1

#define PORTB_PB2 PORTBBIT.bit2

#define PORTB_PB3 PORTBBIT.bit3

#define PORTB_PB4 PORTBBIT.bit4

#define PORTB_PB5 PORTBBIT.bit5

#define PORTB_PB6 PORTBBIT.bit6

#define PORTB_PB7 PORTBBIT.bit7

#define PORTC_PC0 PORTCBIT.bit0

#define PORTC_PC1 PORTCBIT.bit1

#define PORTC_PC2 PORTCBIT.bit2

#define PORTC_PC3 PORTCBIT.bit3

#define PORTC_PC4 PORTCBIT.bit4

#define PORTC_PC5 PORTCBIT.bit5

#define PORTC_PC6 PORTCBIT.bit6

#define PORTC_PC7 PORTCBIT.bit7

#define PORTD_PD0 PORTDBIT.bit0

#define PORTD_PD1 PORTDBIT.bit1

#define PORTD_PD2 PORTDBIT.bit2

#define PORTD_PD3 PORTDBIT.bit3

#define PORTD_PD4 PORTDBIT.bit4

#define PORTD_PD5 PORTDBIT.bit5

#define PORTD_PD6 PORTDBIT.bit6

#define PORTD_PD7 PORTDBIT.bit7

//**********************

#define DDRA_DDRA0 DDRABIT.bit0

#define DDRA_DDRA1 DDRABIT.bit1

#define DDRA_DDRA2 DDRABIT.bit2

#define DDRA_DDRA3 DDRABIT.bit3

#define DDRA_DDRA4 DDRABIT.bit4

#define DDRA_DDRA5 DDRABIT.bit5

#define DDRA_DDRA6 DDRABIT.bit6

#define DDRA_DDRA7 DDRABIT.bit7

#define DDRB_DDRB0 DDRBBIT.bit0

#define DDRB_DDRB1 DDRBBIT.bit1

#define DDRB_DDRB2 DDRBBIT.bit2

#define DDRB_DDRB3 DDRBBIT.bit3

#define DDRB_DDRB4 DDRBBIT.bit4

#define DDRB_DDRB5 DDRBBIT.bit5

#define DDRB_DDRB6 DDRBBIT.bit6

#define DDRB_DDRB7 DDRBBIT.bit7

#define DDRC_DDRC0 DDRCBIT.bit0

#define DDRC_DDRC1 DDRCBIT.bit1

#define DDRC_DDRC2 DDRCBIT.bit2

#define DDRC_DDRC3 DDRCBIT.bit3

#define DDRC_DDRC4 DDRCBIT.bit4

#define DDRC_DDRC5 DDRCBIT.bit5

#define DDRC_DDRC6 DDRCBIT.bit6

#define DDRC_DDRC7 DDRCBIT.bit7

#define DDRD_DDRD0 DDRDBIT.bit0

#define DDRD_DDRD1 DDRDBIT.bit1

#define DDRD_DDRD2 DDRDBIT.bit2

#define DDRD_DDRD3 DDRDBIT.bit3

#define DDRD_DDRD4 DDRDBIT.bit4

#define DDRD_DDRD5 DDRDBIT.bit5

#define DDRD_DDRD6 DDRDBIT.bit6

#define DDRD_DDRD7 DDRDBIT.bit7

//*****************

#define PINA_PA0 PINABIT.bit0

#define PINA_PA1 PINABIT.bit1

#define PINA_PA2 PINABIT.bit2

#define PINA_PA3 PINABIT.bit3

#define PINA_PA4 PINABIT.bit4

#define PINA_PA5 PINABIT.bit5

#define PINA_PA6 PINABIT.bit6

#define PINA_PA7 PINABIT.bit7

#define PINB_PB0 PINBBIT.bit0

#define PINB_PB1 PINBBIT.bit1

#define PINB_PB2 PINBBIT.bit2

#define PINB_PB3 PINBBIT.bit3

#define PINB_PB4 PINBBIT.bit4

#define PINB_PB5 PINBBIT.bit5

#define PINB_PB6 PINBBIT.bit6

#define PINB_PB7 PINBBIT.bit7

#define PINC_PC0 PINCBIT.bit0

#define PINC_PC1 PINCBIT.bit1

#define PINC_PC2 PINCBIT.bit2

#define PINC_PC3 PINCBIT.bit3

#define PINC_PC4 PINCBIT.bit4

#define PINC_PC5 PINCBIT.bit5

#define PINC_PC6 PINCBIT.bit6

#define PINC_PC7 PINCBIT.bit7

#define PIND_PD0 PINDBIT.bit0

#define PIND_PD1 PINDBIT.bit1

#define PIND_PD2 PINDBIT.bit2

#define PIND_PD3 PINDBIT.bit3

#define PIND_PD4 PINDBIT.bit4

#define PIND_PD5 PINDBIT.bit5

#define PIND_PD6 PINDBIT.bit6

#define PIND_PD7 PINDBIT.bit7

#endif


本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請(qǐng)聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請(qǐng)及時(shí)聯(lián)系本站刪除。
換一批
延伸閱讀

現(xiàn)在,對(duì)于很多駕駛者或者交通管理者而言,安全是汽車行業(yè)最關(guān)鍵的問題,整個(gè)汽車行業(yè)的目標(biāo)當(dāng)然是零受傷和零死亡人數(shù),這對(duì)世界上的任何一個(gè)汽車制造商而言都是一個(gè)令人難以置信的結(jié)果,但卻是一個(gè)積極且非常

關(guān)鍵字: 飛思卡爾 娛樂系統(tǒng)

  當(dāng)今電子產(chǎn)品如果不能具有移動(dòng)接入網(wǎng)絡(luò)的功能似乎已經(jīng)成為古董,因?yàn)樵谛畔⒒臅r(shí)代,能夠隨時(shí)獲取移動(dòng)數(shù)據(jù)已經(jīng)成為大部分人的生活必需。智能互聯(lián)設(shè)備以及數(shù)據(jù)、視頻內(nèi)容的爆發(fā)式增長引發(fā)了移動(dòng)數(shù)據(jù)傳輸需

關(guān)鍵字: 飛思卡爾 宏蜂窩 基站設(shè)備

  第一季度瑞薩電子的汽車半導(dǎo)體營業(yè)收入為7.27億美元,遙遙領(lǐng)先于其它競(jìng)爭(zhēng)對(duì)手,緊排在其后的廠商是英飛凌、意法半導(dǎo)體、飛思卡爾和恩智浦。雖然市場(chǎng)總體庫存仍然處于高位,庫存嚴(yán)重過剩,但供應(yīng)商對(duì)于

關(guān)鍵字: 飛思卡爾 汽車電子 意法半導(dǎo)體 瑞薩電子

  摘 要: 提出了一種基于Atmega8 和Stm32F101 雙處理器的投影機(jī)升降控制設(shè)計(jì)方案,介紹了其電路組成、功能以及軟件流程。其中Atmega8 負(fù)責(zé)數(shù)據(jù)采集,Stm32F101 實(shí)現(xiàn)

關(guān)鍵字: atmega8 stm32f101 uln2803a

  為期近5個(gè)月的雷士照明控制權(quán)之爭(zhēng)出人意料地以“和解”告終?!吨袊髽I(yè)報(bào)》記者獲悉,雷士照明創(chuàng)始人吳長江,與公司現(xiàn)任董事長、賽富亞洲基金創(chuàng)始合伙人閻焱以及公司戰(zhàn)略投資者

關(guān)鍵字: MCU 飛思卡爾 血糖監(jiān)測(cè)儀

  最新的市場(chǎng)數(shù)據(jù)顯示,美國LED燈泡的零售價(jià)格已經(jīng)降到8美元,而節(jié)能熒光燈的價(jià)格約為5美元,在這一價(jià)差下,消費(fèi)者選擇更為節(jié)能的LED燈的傾向性將進(jìn)一步增強(qiáng),預(yù)計(jì)到2015年,將真正迎來LED照

關(guān)鍵字: 微控制器 飛思卡爾 汽車工業(yè) 汽車芯片 傳動(dòng)系統(tǒng)

  家庭醫(yī)療中心正在獲得市場(chǎng)關(guān)注   在中國,血壓計(jì)、血糖儀、血氧儀等便攜醫(yī)療設(shè)備的家庭普及率很低。中國的糖尿病患者人口比例很高(占總?cè)丝诘?/10),但在這些糖尿病患者中,城市的血糖儀

關(guān)鍵字: 飛思卡爾 醫(yī)療設(shè)備 血壓計(jì) 血糖儀 便攜醫(yī)療

  化工行業(yè)變頻器市場(chǎng)主要來自設(shè)備配套和改造項(xiàng)目,大概各占40%,其余來自零部件和更換。   在化工行業(yè),變頻器主要用于風(fēng)機(jī)、泵類和機(jī)械調(diào)速設(shè)備中?;ば袠I(yè)分支多,生產(chǎn)過程差異大,所用的

關(guān)鍵字: 飛思卡爾 汽車安全系統(tǒng) adas 雷達(dá)發(fā)射器

  整合了單一、雙重及四重ARM Cortex-A9核心,以高達(dá)1.2 GHz的時(shí)脈運(yùn)行,飛思卡爾的i.MX 6系列兼具高效能、最佳的功率損耗、以及延展性。該系列包括五種元件:?jiǎn)魏诵牡膇.MX

關(guān)鍵字: 飛思卡爾 應(yīng)用處理器 i.mx 6 汽車資訊娛樂系統(tǒng)

  停車位太狹窄,抽身車外,遙控指揮愛車自動(dòng)入庫;夏天太熱,在打開車門前提前開啟空調(diào);交通擁堵太悶,打開人車交互系統(tǒng)聊天解悶……記者走訪車市發(fā)現(xiàn),如IPHONE等智能

關(guān)鍵字: MCU 飛思卡爾 Zigbee 意法半導(dǎo)體 智能電表 載波通信
關(guān)閉