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

s3c2440»ùÓÚlinuxµÄbuttonºÍled×Ö·ûÉ豸Çý¶¯

ÏÈÊÇÄÚºËÇý¶¯³ÌÐò£º
#include <linux/module.h>//¾ßÌåµÄÍ·ÎļþλÖÃΪ/opt/FriendlyARM/mini2440/linux-2.6.29/include/linux/*.h
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/poll.h>
#include <linux/irq.h>
#include <asm/irq.h>
#include <linux/interrupt.h>
#include <asm/uaccess.h>
#include <mach/regs-gpio.h>//¾ßÌåÍ·ÎļþλÖÃ/opt/FriendlyARM/mini2440/linux-2.6.29/arch/arm/mach-s3c2410/include/mach/*.h
#include <mach/hardware.h>
#include <linux/platform_device.h>
#include <linux/cdev.h>
#include <linux/miscdevice.h>
#include <linux/ioctl.h>
#define DEVICE_NAME "buttons"
struct button_irq_desc {
int irq;
int pin;
int pin_setting;
int number;
char *name;
};
static struct button_irq_desc button_irqs [] = {
{IRQ_EINT8 , S3C2410_GPG0 , S3C2410_GPG0_EINT8 , 0, "KEY0"},
{IRQ_EINT11, S3C2410_GPG3 , S3C2410_GPG3_EINT11 , 1, "KEY1"},
{IRQ_EINT13, S3C2410_GPG5 , S3C2410_GPG5_EINT13 , 2, "KEY2"},
{IRQ_EINT14, S3C2410_GPG6 , S3C2410_GPG6_EINT14 , 3, "KEY3"},
{IRQ_EINT15, S3C2410_GPG7 , S3C2410_GPG7_EINT15 , 4, "KEY4"},
{IRQ_EINT19, S3C2410_GPG11, S3C2410_GPG11_EINT19, 5, "KEY5"},
};
/* ÉÏÃæ³õʼ»¯³ÉÔ±ÀïµÄS3C2410_GPG0_EINT0ÔÚ/opt/FriendlyARM/mini2440/linux-2.6.29/arch /arm/mach-s3c2410/include/mach/regs-gpio.hÖж¨ÒåΪ
#define S3C2410_GPF0_EINT0 (0x02 << 0)£¬¼´ÎªÎÒÃÇÇ°Ãæ˵µÄ“10”ģʽ£¬ÆäËûµÄ¹Ü½ÅÀàËÆ¡£Õâ¸ö³õʼ»¯º¯ÊýµÄ×÷ÓþÍÊǽ«ÈçS3C2410_GPF0_EINT0µÄģʽдÈëµØַΪÈç S3C2410_GPF0µÄ¼Ä´æÆ÷À²¢½«Õâ¸ö¹Ü½ÅÉèÖóÉÖжÏģʽ£¬ÒÔ¼°Ìí¼ÓһЩÆäËûÐÅÏ¢¡£*/
static volatile char key_values [] = {'0', '0', '0', '0', '0', '0'};
//ÉùÃ÷LEDµÄ¹Ü½Å
static unsigned long led_table [] ={ S3C2410_GPB5, S3C2410_GPB6, S3C2410_GPB7, S3C2410_GPB8,};
// ÉùÃ÷LED¹Ü½ÅµÄÅäÖÃÐÅÏ¢£¬´Ë´¦µÄ S3C2410_GPB8_OUTPÓëÉÏÃæµÄS3C2410_GPF0_EINT0ÀàËÆ¡£
static unsigned int led_cfg_table [] = { S3C2410_GPB5_OUTP, S3C


Ïà¹ØÎĵµ£º

ÔÚlinuxÏÂʵÏÖweb qqµÄ×ÀÃ滯


´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ­°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......

cÊäÈëÊä³ö


¸ñʽÊä³ö:
printf(¸ñʽ¿ØÖÆ, Êä³ö±íÁÐ);
%d Ê®½øÖÆÊý  %md mΪָ¶¨µÄ¿í¶È ÈôÊý¾ÝλÊýСÓÚm,Ôò×ó¶Ë²¹ÒÔ¿Õ¸ñ;Èô´óÓÚm,Ôò°´Êµ¼ÊλÊýÊä³ö
%ld ³¤ÕûÐÍÊý¾Ý  %mld Ö¸¶¨×ֶοí¶È
%o °Ë½øÖÆÕûÊýÐÎʽ  %mo
%x Ê®Áù½øÖÆÕûÊýÐÎʽ  %mx
%u unsignedÐÍÊý¾Ý,ËüÒ²¿ÉÓÃ%o»ò%x¸ñʽÊä³ö
%c Ò»¸ö×Ö·û   ......

¡¾×ª¡¿C/C++ ±ÊÊÔ¡¢ÃæÊÔÌâÄ¿´ó»ã×Ü


1.ÇóÏÂÃ溯ÊýµÄ·µ»ØÖµ£¨Î¢Èí£©
int func(x)
{
    int countx = 0;
    while(x)
    {
          countx ++;
          x = x&(x-1);
    ......

linux ÃüÁ½õ

×î½üÔÚLinux×°oracle ÔÚÍøÉÏËÑÁ˵ã×ÊÁϺʹó¼Ò·ÖÏí
linuxÏÂÃüÁîºÍÎļþ¼°Ä¿Â¼Ãû¶¼·Ö´óСд
//²é¿´ÀúÊ·Êý¾Ý
history
history |grep mount
°´"ÉÏϼü"Ñ¡ÒÔÇ°ÇùýµÄÃüÁî
//¿½±´Îļþ
cp /usr/local/tomcat4/temp/func.class /usr/local/tomcat4/webapps/photoblog/WEB-INF/classes/framework/utils/
cp -Rf /photodataold ......

¼¸¸öСµÄLinuxϵͳ

µÚÒ»¸ö£º DSL Linux
Damn Small LinuxÊÇÒ»Ì×»ùÓÚÒµÎñ¿¨£¨50M×Ö½Ú£©¿ÉÆô¶¯¹âÅ̵ÄLinux·¢ÐС£¾¡¹ÜËüµÄ¸öÍ·Èç´Ë֮С£¬ËüŬÁ¦³ÉΪһ·Ý¿ÉÓò¢ÇÒÒ×ÓõÄ×ÀÃæ¡£Damn Small LinuxµÄ×ÀÃ漸ºõÊÇÍêÕûµÄÒ»Ì×£¬°üÀ¨xmms£¨Ö§³Ömp3ºÍmpeg£©¡¢FTP¿Í»§¶Ë¡¢»ùÓÚlinksµÄwebä¯ÀÀÆ÷¡¢µç×ÓÖƱíÈí¼þ¡¢µç×ÓÓʼþ³ÌÐò¡¢ Ó¢Óïƴд¼ì²é¡¢×Ö´¦ÀíÆ÷¡¢Èý¸ö± ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ