91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3.13MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-29
  • 語言: 其他
  • 標簽:

資源簡介

這是我做過的一個項目,前期階段的代碼,包含mcp2510+s3c2410和sja1000+89C51兩部分,有完整代碼。其中mcp2510+s3c2410采用linux2.6內核,有can總線完整可用驅動(驅動中包含SPI)及上層測試程序。sja1000+89C51部分使用c編寫的。 文檔部分包含MCP2510、sja1000芯片資料和can總線相關資料、SPI設置資料

資源截圖

代碼片段和文件信息

#include
#include
#include
#include

#include
#include
#include
#include
#include
#include
#include

#include
#include

#include
#include

#include
#include?

#include?
#include?
#include?
#include?
#include?

#include?“mcp2510_ioctl.h“
#include?“can.h“

#define?INT_DEV_NAME??“candev“
#define?INT_DEV_MAJOR?240

#define?TIME_STEP??(1000)
#define?SIG_MYINT?33

static?struct?timer_list?*int_timer=NULL;
unsigned?char?*?dbuf;
void?inttimer_register(struct?timer_list?*pdataunsigned?long?timeover);

void?can_interrupt(int?irqvoid?*dstruct?pt_regs?*regs)
{

unsigned?char?buffer;

siginfo_t?info;
struct?task_struct?*p;
info.si_signo=SIG_MYINT;
info.si_code=-1;
info.si_int=0x8;

//buffer?=?Read_2510(CANSTAT);
buffer?=?Read_2510(CANINTF);

//close?interrupt?in?mcp2510
Write_2510(CANINTE?0x00);

if((buffer&0x02)?==?0x02)
{
can_data_receive();
flag?=?0xff;?
Modify_2510(CANINTF0x020x00);
}
else?if((buffer&0x80)?==?0x80)
{
ReceiveError();
flag?=?0xff;?
Modify_2510(CANINTF0x800x00);
}
else?if((buffer&0x20)?==?0x20)
{
ErrorInterrupt();
flag?=?0xff;?
Modify_2510(CANINTF0x200x00);
}
else
{
flag=0xff;
can_data_receive();
Write_2510(CANINTF0x00);
}


????????/*clear?interrupt?register?for?EINT1*/
SRCPND?&=?(~0x00000002);????
??? INTPND?=?INTPND;
Write_2510(CANINTE?0xa2);



read_lock(&tasklist_lock);
????????for_each_task(p){
??send_sig_info(SIGWINCH&infop);
}
read_unlock(&tasklist_lock);


}
void?inttimer_timeover(unsigned?long?arg)
{
siginfo_t?info;
struct?task_struct?*p;
unsigned?char?buffer;
info.si_signo=SIG_MYINT;
info.si_code=-1;
info.si_int=0x8;



buffer?=?Read_2510(EFLG);
if(buffer>0xc0)
{
flag=0xff;
RXdata[0]=‘E‘;
RXdata[1]=‘F‘;
RXdata[2]=‘L‘;
RXdata[3]=‘G‘;
RXdata[4]=‘E‘;
RXdata[5]=‘R‘;
RXdata[6]=‘R‘;
RXdata[7]=‘O‘;
RXdata[8]=‘R‘;
read_lock(&tasklist_lock);
????????for_each_task(p){
??send_sig_info(SIGWINCH&infop);
}
read_unlock(&tasklist_lock);
}
inttimer_register(int_timerTIME_STEP);
??????
}

void?inttimer_register(struct?timer_list?*pdataunsigned?long?timeover)
{
init_timer(pdata);
pdata->expires=jiffies+timeover;
pdata->data=(unsigned?long)pdata;
pdata->function=inttimer_timeover;
add_timer(pdata);
}


int?can_open(struct?inode?*inodestruct?file?*filp)
{
MOD_INC_USE_COUNT;


????????return?0;
}
int?can_ioctl(struct?inode?*inodestruct?file?*filpunsigned?int?cmdunsigned?long?arg)
{
switch(cmd)
{
case?IOCTL_test1:printk(“============IOCTL?case??1===============\n“);
break;
case?IOCTL_test2:printk(“============IOCTL?case??2===============\n“);
break;
case?IOCTL_test3:printk(“==========

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-05-05?13:59??can總線程序\
?????文件???????34304??2010-04-22?20:42??can總線程序\CAN總線協議.doc
?????文件???????32256??2010-04-22?20:39??can總線程序\CAN總線原理.doc
?????目錄???????????0??2010-07-12?12:18??can總線程序\MCP2510\
?????文件?????1949272??2010-04-26?17:34??can總線程序\MCP2510.pdf
?????目錄???????????0??2010-07-12?12:18??can總線程序\MCP2510\2010-7-6\
?????目錄???????????0??2010-07-12?12:18??can總線程序\MCP2510\2010-7-6\test\
?????文件????????6250??2010-07-05?13:45??can總線程序\MCP2510\2010-7-6\test\can.c
?????文件????????6250??2010-07-05?13:45??can總線程序\MCP2510\2010-7-6\test\can.c~
?????文件???????10844??2010-07-05?13:04??can總線程序\MCP2510\2010-7-6\test\can.h
?????文件???????10844??2010-07-05?12:49??can總線程序\MCP2510\2010-7-6\test\can.h~
?????文件???????11164??2010-07-05?13:45??can總線程序\MCP2510\2010-7-6\test\can.o
?????文件???????14850??2010-07-05?11:46??can總線程序\MCP2510\2010-7-6\test\exam
?????文件????????1296??2010-07-05?11:46??can總線程序\MCP2510\2010-7-6\test\exam.c
?????文件????????1290??2010-07-02?11:29??can總線程序\MCP2510\2010-7-6\test\exam.c~
?????文件?????????390??2010-06-09?13:21??can總線程序\MCP2510\2010-7-6\test\Makefile
?????文件?????????146??2010-06-09?13:21??can總線程序\MCP2510\2010-7-6\test\Makefile~
?????文件????????4105??2010-06-30?20:32??can總線程序\MCP2510\2010-7-6\test\mcp2510.h
?????文件????????4105??2010-06-19?20:00??can總線程序\MCP2510\2010-7-6\test\mcp2510.h~
?????文件?????????285??2010-05-30?13:53??can總線程序\MCP2510\2010-7-6\test\mcp2510_ioctl.h
?????目錄???????????0??2010-07-12?12:18??can總線程序\MCP2510\不成功的rx0緩沖器\
?????目錄???????????0??2010-07-12?12:18??can總線程序\MCP2510\不成功的rx0緩沖器\test\
?????文件????????6248??2010-07-06?11:23??can總線程序\MCP2510\不成功的rx0緩沖器\test\can.c
?????文件????????6250??2010-07-06?11:21??can總線程序\MCP2510\不成功的rx0緩沖器\test\can.c~
?????文件???????10978??2010-07-06?12:44??can總線程序\MCP2510\不成功的rx0緩沖器\test\can.h
?????文件???????10978??2010-07-06?12:43??can總線程序\MCP2510\不成功的rx0緩沖器\test\can.h~
?????文件???????10896??2010-07-06?12:44??can總線程序\MCP2510\不成功的rx0緩沖器\test\can.o
?????文件???????15068??2010-07-06?12:13??can總線程序\MCP2510\不成功的rx0緩沖器\test\exam
?????文件????????1292??2010-07-06?12:13??can總線程序\MCP2510\不成功的rx0緩沖器\test\exam.c
?????文件????????1292??2010-07-06?12:13??can總線程序\MCP2510\不成功的rx0緩沖器\test\exam.c~
?????文件?????????390??2010-06-09?13:21??can總線程序\MCP2510\不成功的rx0緩沖器\test\Makefile
............此處省略20個文件信息

評論

共有 條評論

相關資源