Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

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


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

LinuxÇý¶¯³ÌÐòÈëÃÅ—Hello World


LinuxÇý¶¯³ÌÐòÈëÃÅ—Hello World
À´Ô´:
ChinaUnix²©¿Í ¡¡ÈÕÆÚ£º
2009.11.19 21:17¡¡(¹²ÓÐ0
ÌõÆÀÂÛ) ÎÒÒªÆÀÂÛ
 
1¡¢ÒýÑÔ
    ¼ÇµÃÔÚѧϰVC++ºÍCÓïÑÔµÄʱºò£¬Ò»¿ªÊ¼¶¼»áÒÔÒ»¸öHELLO
WORLDµÄÀý×Ó×÷ΪÑÝʾ£¬½«Ñ§ÕßÖð½¥ÒýÈëµîÌã¬Õâ¸ö¼¸ºõ³ÉÁ˼ÆËã»ú±à³ÌÓïÑÔѧϰ±Ø¾­µÄÒ»¸öÈëÃÅ֮·¡£
  ......

ר·ÃLinuxºËÐĺڿÍÖ®Ò»Robert Love (»¹ÊÇ´óѧʱ´ú)

ÈËÎïר·Ã£ººËÐĺڿÍϵÁÐÖ®Ò»Robert Love ÿ¸öÐÇÆÚ£¬ÎÒÃǶ¼²É·ÃÒ»¸öÄں˱àдÉçÇøµÄÈË£¬ËäÈ»ÕâÑùµÄ²É·Ã»áºÜ²àÖؼ¼Êõ£¬µ«ÊÇÎÒÃǵÄÁ¢×ãµãÊÇΪÁËÈÃËùÓÐÈ˶¼ÄܽÓÊÜ¡£±¾ÖÜÎÒÃDzɷÃÁËRobert Love£¬ÏÖÔÚËûÕýÔÚά»¤“¿ÉÇÀÕ¼Äں˔µÄÉý¼¶°üºÍÆäËûһЩÊ¡£ËûʹÓÃLinuxÒѾ­7ÄêÁË£¬¶ÔÓÚÏÖÔÚµÄÄÚºËÓкܶ๱Ïס£ËùÓÐÕâЩ×îºóÓÃËû× ......

linuxÈí¼þ°ü¹ÜÀí¹¤¾ß

     ÔÚÏÖÐеÄlinux·¢²¼°æ±¾ÖУ¬Èí¼þ°ü¹ÜÀí¹¤¾ßʹÓÃ×î¶àµÄÊÇrpmºÍdpkg,µ«ÊÇÕâÁ½Õ߶¼²»Äܽâ¾öÈí¼þÖ®¼äµÄÒÀÀµ¹Øϵ£¬ËùÒÔÓÖÓÐÁËyumºÍapt£¬yumÆäʵÊǶÔrpmµÄ·â×°£¬¶øaptÊǶÔdkpgµÄ·â×°£¬Á½Õ߶¼ÔÚ·â×°µÄͬʱ£¬ºÜºÃµÄ½â¾öÁËÈí¼þÒÀÀµÎÊÌ⣬ʹÓÃÆðÀ´·Ç³£·½±ã¡£ÏÂÃæÊÇһЩÈí¼þ¹ÜÀí³£ÓõÄÃüÁ
¸üÐÂÈí¼þÁÐ±í£º ......

Linux 0.11 ϵͳµ÷ÓÃÔ­Àí


    Ò»¡¢¸ÅÊö
    ÏµÍ³µ÷ÓÃÊÇÒ»¸öÈíÖжϣ¬ÖжϺÅÊÇ0x80£¬ËüÊÇÉϲãÓ¦ÓóÌÐòÓëLinuxϵͳÄں˽øÐн»»¥Í¨ÐŵÄΨһ½Ó¿Ú¡£Í¨¹ýint 0x80£¬¾Í¿ÉʹÓÃÄÚºË×ÊÔ´¡£²»¹ý£¬Í¨³£Ó¦ÓóÌÐò¶¼ÊÇʹÓþßÓбê×¼½Ó¿Ú¶¨ÒåµÄCº¯Êý¿â¼ä½ÓµÄʹÓÃÄں˵Äϵͳµ÷Ó㬼´Ó¦ÓóÌÐòµ÷ÓÃCº¯Êý¿âÖеĺ¯Êý£¬Cº¯Êý¿âÖÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ