(1)底層驅(qū)動程序總體設(shè)計(jì)。在linux中設(shè)備驅(qū)動程序是由一組數(shù)據(jù)結(jié)構(gòu)和函數(shù)組成的,它包含設(shè)備服務(wù)子程序(如open、read、write、close、ioctl等)、初始化函數(shù)can_init()和中斷處理程序can_interrupt()。
在linux加載can驅(qū)動時(shí)調(diào)用can_init(),向操作系統(tǒng)注冊設(shè)備,同時(shí)完成can總線波特率的設(shè)置,id過濾器的設(shè)置,清空接收和發(fā)送緩沖區(qū),開啟中斷等工作,完成初始化后,退出復(fù)位模式,進(jìn)入正常的工作模式。
廈門岳航計(jì)算機(jī)工程有限公司
聯(lián)系人:李素云
企業(yè)QQ:2851195446,2851195466
手機(jī):18965423501
座機(jī):0592-5165501
read從接收緩沖區(qū)讀取數(shù)據(jù);write向發(fā)送緩沖區(qū)寫人數(shù)據(jù);release關(guān)閉can 控制器;ioctl向can 控制器發(fā)各種操作命令,包括設(shè)置sja1000總線波特率、id過濾器等;open 打開can 控制器,并使用函數(shù)request_irq()向系統(tǒng)申請中斷,并設(shè)置中斷處理程序?yàn)閏an_interrupt(),當(dāng)sja1000內(nèi)部中斷寄存器(ir)的任意位置為1時(shí),int引腳低電平有效,調(diào)用其中斷處理函數(shù)can-interrupt(),在該函數(shù)中讀取中斷控制寄存器,判斷中斷原因(接收中斷、發(fā)送中斷、錯誤中斷、數(shù)據(jù)溢出中斷、喚醒中斷),從而調(diào)用相應(yīng)的服務(wù)子程序。
(2)sja1000讀寫邏輯分析及設(shè)計(jì)。由于sja1000的地址線和數(shù)據(jù)線是分時(shí)復(fù)用的,需要通過軟件編程模擬地址鎖存信號,以達(dá)到數(shù)據(jù)和地址的分時(shí)傳輸,因此,在程序設(shè)計(jì)中,要考慮sja1000的讀寫時(shí)序。圖4為sja1000的寫時(shí)序圖。
Allen Bradley 800H-AR 30mm Momentary Pushbutton Green
New Eaton M22-DRLY Illuminated Pushbutton Flush Mount Yellow
AEG SES10 Green START PushButton 22mm VDE 0660 AC15 DC13 10A-Uimp 4KV
AEG SES01 Red STOP PushButton 22mm VDE 0660 AC15 DC13 10A-Uimp 4KV
New Omron A165AGA1 PB Square Green SPDT ALT
New Eaton M22-D-G Green Illuminated Pushbutton Flush Mount
Omron A22LTG24A11M Pushbutton Green 24V
Cutler Hammer 10250T/91000T/E34 Green pushbutton Illuminated Indicator 120 VAC
Lot of 4 new Siemens 3SB3-602-OAA11 Pushbutton
Lot of 9 New Lovato LPC B1163 "Start" Push Button Green
Lot of 4 Telemecanique ZB2-BE101, ZB2-BE102 Push Buttons
Lot of 4 Cutler Hammer E22B1 Red Momentary
Lot of 3 Telemecanique ZB2-BE102 Green Pushbuttons w/
Lot of 3 Telemecanique ZB2-BE101 Red Pushbuttons w/
Lot of 6 Cutler-Hammer E22B Series Pushbuttons Red Green Yellow Black 3 NC 7
Idec ALW Light-up Push Button 24V LED (White),
Allen Bradley 800FP-LU2E3F4 Multi-Function Push Button
Allen Bradley 800H-QRTH10R Push Button Red Light 120VAC
Allen Bradley 800T-QTH10G Push Button Green Light 120V AC
NEW Allen Bradley 800G-LF4 Series A Hazardous Location Red Light/Push button
NEW Allen Bradley 800G-LF3 Series A Hazardous Location Green Light/Push button
NEW Allen-Bradley 800G-DLSRXL Series A Push Buttons AC 12/230V DC 12/60V
Lot of 50 New Eaton M22-XDLH-G-ETCH-X63 Green Illuminated Pushbutton Lenses
Lot of 3 Idec ABW Black Momentary Pushbuttons, 600V 10A
Idec ALW TW-DA1 Illuminated Momentary Blue Pushbutton, 5-30V, 1W Max
Idec Momentary Push Button (Black) TW-C10
New Idec White Push Button ABW211-W
IDEC HW-DA1F HW-F10 Illuminated Pushbutton Blue Momentary
Tapeswitch Edgeswitch Pressure Sensing Switch, 16"
Lot of 2 Allen-Bradley 800MR-QA24 Illuminated Push Buttons Green 1NC 24VACDCDKC10.3-018-3MGP-01VRS FWA-ECODR3-MGP-01VRS
FAS-113DG
FAS-113DG
FLOWTEC/319083-0200B
IC200GBI001
IC693CPU363
IC693CPU374
IC693MDL645
IC693MDL741
IC693PBM200
IC695CPU310
IC695ETM001
JACP-921900 CP-9200SH/SVA
MMC-BDP081PNA
MMS6312
MX-CS101-401
PCD2.M110
PCD4.M120
PCI-6111
PCI-6224
PCI-6509
RDC2
SG2K-1T
SST-PFB-CLX
TI435-CPU
Alcoswitch 164TL Illuminated Red Momentary Pushbutton, 5A 250VAC
Alcoswitch 164TL Illuminated Blue Momentary Pushbutton, 5A 250VAC
Alcoswitch 164TL Illuminated Green Momentary Pushbutton, 5A 250VAC
Alcoswitch 164TL5 Illuminated Yellow ON/OFF Pushbutton, 5A 250VAC
Alcoswitch 164TL Illuminated Yellow Momentary Pushbutton, 5A 250VAC
Alcoswitch 164TL Illuminated White Momentary Pushbutton, 5A 200VAC
New Allen Bradley 800MR-QBL24GA Ser-D Illuminated Green Momentary Pushbutton
Idec ALW29910D-S-24V Lighted Pushbutton (White)