职位关键字 工作地点
工作名称 公司名称 校园招聘
中国最好的工作搜索引擎!
  回复留言  
  高分求linux串口通信程序
作者: Dong__FLy  01-01 08:00   回复  
 程序框架如下 哪位高手指点一下

#ifndef __KERNEL__

#define __KERNEL__

#endif

#ifndef MODULE

#define MODULE

#endif



#include <linux/config.h>

#include <linux/module.h>

#include <linux/errno.h>



#ifdef CONFIG_SMP

#define __SMP__

#endif



MODULE_LICENSE("GPL");



#include <asm/hardware.h>

#include <asm/irq.h>

#include <linux/delay.h>



#include <asm/uaccess.h>

#include <linux/fs.h>

#include <linux/kernel.h>

#include <linux/sched.h>

#include <linux/types.h>



//后来加的头文件

/*

#include <linux/init.h>

#include <linux/slab.h>

#include <linux/console.h>

#include <linux/serial_core.h>

#include <asm/arch/cpu_s3c2410.h>

#include <asm-arm/arch-s3c2410/S3C2410.h>



*/















#define DEBUG(str,args...)printk ("device_test:"str,##args)

int test_major = 0;



static void s3c2410uart_rx_interrupt(int irq, void *dev_id,

struct pt_regs *regs) ;

static int open_uart(struct inode *inode,struct file *file )

{



}



static int read_uart(struct file * pfile, char * data, size_t ncount , loff_t * nszie)

{



}



static int write_uart(struct file *pfile,const char *data,size_t ncount,loff_t *nsize)

{



}





static int release_uart(struct inode *inode, struct file *file)

{



}



static struct file_operations test_fops ={

owner: THIS_MODULE,

open: open_uart,

read: read_uart,

write: write_uart,

release: release_uart,

};







int cleanup_module(void)

{

unregister_chrdev(test_major,"uart");

return 0;

}







static void s3c2410uart_rx_interrupt(int irq, void *dev_id,

struct pt_regs *regs)

{





}





int init_module(void)

{

int result;

DEBUG("init module\n");



result = register_chrdev(0,"uart",&test_fops);

if(result<0)

{

DEBUG("error!");

return result;

}

if(test_major == 0)

{

test_major = result;

}



return 0;

}

  回复:高分求linux串口通信程序
作者: AlexHou1986  01-01 08:00   回复  
 我不说啥了!!!


  回复:高分求linux串口通信程序
作者: 菠萝百事通  08-03 12:25   回复  
  具体编程我不是太懂,不过给LZ一个成熟的串口通讯程序,LZ不妨对比下,看看有没有帮助把

http://www.bbww.net/SoftView/SoftView_20638.html

  回复:高分求linux串口通信程序
作者: 我来你不来  08-03 12:25   回复  
  Linux Serial Programming How-to 是必看的

还有 《Serial Programming Guide for POSIX Operating Systems》



http://loveunix.3322.org/bbs/index.php?showtopic=35896

  回复:高分求linux串口通信程序
作者: 维族2008  08-03 12:25   回复  
  http://www.loveunix.net/bbs/index.php?showtopic=35896

http://www.loveunix.net/bbs/index.php?showtopic=37917

  回复:高分求linux串口通信程序
作者: 一虎多骑  08-03 12:25   回复  
  具体编程我不是太懂

  回复:高分求linux串口通信程序
作者: aku2  08-03 12:25   回复  
  http://www.bbww.net/SoftView/SoftView_20638.html

http://loveunix.3322.org/bbs/index.php?showtopic=35896

http://www.loveunix.net/bbs/index.php?showtopic=35896

http://www.loveunix.net/bbs/index.php?showtopic=37917

标 题:
内 容:
用户名:
 游客
 
 
Copyright©2005-2007, 版权所有 WWW.JOBMET.COM
ICP证:京ICP备06019556号