Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux×Ö·ûÉ豸Çý¶¯Ñ§Ï°

 ½ñÌìѧϰÁËÔÚlinux2.6ƽ̨Ï嵀 char drvier £¬ÔÚlinuxÏÂÍƼöʹÓõÄÊÇcdev½á¹¹ÌåÀ´ÊµÏÖ¶ÔcharacterÉ豸µÄÃèÊö£¬´úÂëÈçÏÂ
/*This module is desired for sunplusapp s3c2440_board */
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/cdev.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <linux/errno.h>
#include <mach/regs-gpio.h>
#include <mach/hardware.h>
#include <linux/platform_device.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <asm/io.h>
#include <asm/system.h>
#define DEVICE_NAME "LED_S3C2440"
struct LED_dev{
 struct cdev cdev;
 char name[10];
 /*...*/
}*LED_devp;
static dev_t LED_device_num;
static struct class *LED_class;
//struct class *LED_class;
static unsigned long LED_table[]={
 S3C2410_GPG0,
 S3C2410_GPG1,
 S3C2410_GPG2,
};
static unsigned int LED_cfg_table[]={
 S3C2410_GPG0_OUTP,
 S3C2410_GPG1_OUTP,
 S3C2410_GPG2_OUTP,
};
int LED_open(struct inode *inode, struct file *filp)
{
  /*½«É豸½á¹¹ÌåÖ¸Õ븳ֵ¸øÎļþ˽ÓÐÊý¾ÝÖ¸Õë*/
  filp->private_data = LED_devp;
  printk("Open OK\n");
  return 0;
}
/*ÎļþÊͷź¯Êý*/
int LED_release(struct inode *inode, struct file *filp)
{
 printk("Release OK\n");
  return 0;
}
static ssize_t LED_write(struct file *filp,const char __user *buf,size_t size,loff_t *f_pos)
{
  unsigned char buff = 0;
  int ret;
  int i;
  /*Óû§¿Õ¼ä->Äں˿ռä*/
  if (copy_from_user(&buff, buf, size))
    ret =  - EFAULT;
   
 printk("write:buff=0x%x,buff=0x%x,count=%d\n", buff, buf, size);
 buff-=0x30;
 for(i=0;i<3;i++)
 {
  if(i==buff)
   s3c2410_gpio_setpin(LED_table[i],1);
  else
   s3c2410_gpio_


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

¡¾×ª¡¿linuxÎļþºÍĿ¼¹ÜÀí

1¡¢LinuxÎļþϵͳÊÇ´Ó/¿ªÊ¼µÄ£»
ÔÚLinux²Ù×÷ϵͳµÄÎļþ¹ÜÀíÖУ¬ÃüÁîÐÐģʽ£¨ÔÚ¿ØÖÆ̨»òÖÕ¶ËÏ£©µÄÎļþ»òĿ¼¹ÜÀí£¬ÒªÉ漰·¾¶ÕâÒ»¸ÅÄÕâÊÇLinuxÃüÁîÐвÙ×÷µÄ×î»ù´¡µÄ»ù´¡¡£Èç¹ûÎÒÃÇÁ˽âÁË·¾¶µÄ¸ÅÄ¾Í¿ÉÒÔËæÐÄËùÓûµÄ½øÈëÈκÎĿ¼£¬½øÐÐÎÒÃÇÏëµÄ¹¤×÷¡£
Linux Îļþϵͳ£¬ÊÇÒ»¸ö³ÊÊ÷Ðνṹ£¬ÊÇ´Ó/×öΪÈë¿Ú£¬/£¨Ò²±»³ÆΪ¸ ......

¡¾×ª¡¿LinuxϵͳÌØÊâÎļþ

 Ä¿Â¼ÊÇLinuxϵͳ×éÖ¯ÎļþµÄÒ»ÖÖÌØÊâÎļþ¡£ÎªÊ¹Óû§¸üºÃµØʹÓÃĿ¼£¬ÎÒÃǽéÉÜÓйØĿ¼µÄһЩ»ù±¾¸ÅÄî¡£
£¨1£©¹¤×÷Ŀ¼ÓëÓû§Ö÷Ŀ¼
    ´ÓÂß¼­ÉϽ²£¬Óû§ÔڵǼµ½LinuxϵͳÖÐÖ®ºó£¬Ã¿Ê±Ã¿¿Ì¶¼´¦ÔÚij¸öĿ¼֮ÖУ¬´ËĿ¼±»³Æ×ö¹¤×÷Ŀ¼»òµ±Ç°Ä¿Â¼£¨Working Directory£©¡£¹¤×÷Ŀ¼ÊÇ¿ÉÒÔËæʱ¸Ä±äµÄ¡£Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ