S3C24XXÌåϵµÄLinux GPIO¿ØÖÆÏà¹ØAPIʵÏÖ
GPIO£¨General Purpose Input/OutputµÄËõд£©¾ÍÊÇоƬµÄÒý½Å£¬Òý½ÅÊǿɱà³ÌµÄ¿É¶ÔÒý½ÅµÄ¹¤×÷ģʽ½øÐÐÉèÖãºÊäÈëģʽ(¼ì²âÊäÈëÐźÅ)£¬Êä³öģʽ(Êä³ö0»ò1)£¬¸ß×è״̬(³£ÓÃÓÚADת»»)£¬»¹ÓнûÖ¹»òÔÊÐíÉÏÄÚ²¿ÏÂÀµç×è(ÉÏÀ£º¹Ü½Åͨ¹ýµç×è½Ó¸ßµçƽ£¬ÏÂÀ£º¹Ü½Åͨ¹ýµç×è½ÓµØ£¬Ò²¿ÉÒÔÍⲿ½ÓÉÏÀ»òÏÂÀµç×è)£¬»¹ÓйܽŸ´Óõȹ¦ÄÜ£¬¼´Í¨¹ý¶ÔÄÚ²¿¼Ä´æÆ÷µÄÉèÖÃʹÒý½Å¼È¿ÉÒÔ¹¤×÷ÔÚÒ»°ãģʽ£¬×÷ΪÆÕͨµÄGPIO¿ÚʹÓã¬Ò²¿ÉÒÔ¹¤×÷ÔÚÌØÊâģʽ£¬±ÈÈç×÷ΪÍⲿÖжÏÐźÅÊäÈëÒý½ÅµÈµÈ¡£Èç¹û²»ÉèÖÃGPIOÒý½Å£¬CPU¹¤×÷ʱÓÐÒ»¸ö³õʼ»¯Ä£Ê½£¬¿ÉÒÔ´Ódatasheet£¨Ð¾Æ¬ÊֲᣩÉÏÁ˽⡣¶ÔGPIOµÄ¿ØÖÆÊDZàдÇý¶¯³ÌÐò×î³£¼ûºÍÖØÒªµÄÒ»Ï×÷ÄÚÈÝ¡£
ÔÚLinux2.6.25Äں˴úÂëÖУ¬ÒѾÌṩÁËÕë¶ÔÈýÐÇS3C2410/S3C2440µÈоƬGPIOµÄ¿ØÖÆ£¬ÏÂÃæÀ´·Ö±ð½éÉÜÒ»°ãÈçºÎÅäÖᢹÜÀíGPIO¡£
ÏÂÃæµÄº¯ÊýÊÇÓÃÀ´¸ù¾ÝÐµĹ¦ÄÜÐèÇóÅäÖÃÒ»¸öGPIOÒý½Å£¨¶¨ÒåÔÚarch/arm/plat-s3c24xx/gpio.c£©£º
1 void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function)
2 {
3 void __iomem *base = S3C24XX_GPIO_BASE(pin);
4 unsigned long mask;
5 unsigned long con;
6 unsigned long flags;
7
8 if (pin < S3C2410_GPIO_BANKB) {
9 mask = 1 << S3C2410_GPIO_OFFSET(pin);
10 } else {
11 mask = 3 <
Ïà¹ØÎĵµ£º
×÷ΪLinuxϵijÌÐò¿ª·¢ÈËÔ±£¬´ó¼ÒÒ»¶¨¶¼Óöµ½¹ýMakefile£¬ÓÃmakeÃüÁîÀ´±àÒë×Ô¼ºÐ´µÄ³ÌÐòȷʵÊǺܷ½±ã¡£Ò»°ãÇé¿öÏ£¬´ó¼Ò¶¼ÊÇÊÖ¹¤Ð´Ò»¸ö¼òµ¥Makefile£¬Èç¹ûÒªÏëд³öÒ»¸ö·ûºÏ×ÔÓÉÈí¼þ¹ßÀýµÄMakefile¾Í²»ÄÇôÈÝÒ×ÁË¡£
¡¡¡¡ÔÚ±¾ÎÄÖУ¬½«¸ø´ó¼Ò½éÉÜÈçºÎʹÓÃautoconfºÍautomakeÁ½¸ö¹¤¾ßÀ´°ïÖúÎÒÃÇ×Ô¶¯µØÉú³É·ûºÏ×ÔÓÉÈí¼þ¹ßÀýµÄMa ......
1.date :ÏÔʾÈÕÆÚ
%:::z ʱÇø
2. cal :ÏÔʾÈÕÀú£¨ºáÅÅ£©£¬ncal£¨ÊúÅÅ£©
3. bc :µ÷ÓüÆËãÆ÷
ÓÃ/×÷³ý·¨ÔËËãʱ£¬¿ÉÏÈÓÃÖ¸Áî scale=number£¨number±íʾÏÔʾµÄСÊýµãλÊý£© ÔÙ×ö³ý·¨ÔËË㣬ʹµÃ¿ÉÒÔÏÔʾСÊýµãºó(number)λ¡££¨bcĬÈÏÖ»ÏÔʾÕûÊý£©
Í˳ö¼ÆËãÆ÷£º quit
4.[Tab] ......
¾²Ì¬º¯Êý¿âÊÇÔÚ³ÌÐòÖ´ÐÐÇ°¾Í¼ÓÈ뵽Ŀ±ê³ÌÐòÖÐÈ¥ÁË£»¶ø¹²Ïíº¯Êý¿âÔòÊÇÔÚ³ÌÐòÆô¶¯µÄʱºò¼ÓÔص½³ÌÐòÖУ¬Ëü¿ÉÒÔ±»²»Í¬µÄ³ÌÐò¹²Ïí£»¶¯Ì¬¼ÓÔغ¯Êý¿âÔò¿ÉÒÔÔÚ³ÌÐòÔËÐеÄÈκÎʱºò¶¯Ì¬µÄ¼ÓÔØ¡£
¾²Ì¬º¯Êý¿âʵ¼ÊÉϾÍÊǼòµ¥µÄÒ»¸öÆÕͨµÄÄ¿±êÎļþµÄ¼¯ºÏ£¬Ò»°ãÀ´ËµÏ°¹ßÓÓ.a”×÷ΪÎļþµÄºó׺¡£¿ÉÒÔÓÃarÕâ¸ö³ÌÐòÀ´²úÉú¾²Ì¬º¯Êý ......
ÍøÉÏÕÒÁËÏÂLinux½ø³Ì¼ä»¥³âµÄʵÏÖ£¬Á½ÖÖ·½·¨£¬semaphore ºÍ ÎļþËø¡£¸Õ¿ªÊ¼Ò²³¢ÊÔÓÃsemaphoreÀ´ÊµÏÖ£¬µ«·¢ÏÖsem_waitºÍsingalÎÞ·¨ÊµÏÖWindowsÏÂCirtSec£¬¶ø²ÉÓÃÁ˺óÕßÎļþËø£»
µ«¶ÔÓÚ¶ÁдËøÀ´ËµÊµÓÃÎļþËøʵÏÖ£¬´æÔÚÒ»¶¨µÄ²»×㣬Ëü·Ö¿ªÁ˶ÁдËø£¬¶øûÓзֿª½â¶ÁдËø£¬ÀûÓÃUnLockÀ´Í³Ò»½â¶ÁдËø£¬¶ÔÓÚÕâ½ø³Ì¼ä¶ÁдËøµÄʵÏÖ£ ......
<Ctrl><Alt><F1>
Çл»µ½µÚÒ»¸öÎı¾Öնˡ£ÔÚLinuxÏÂÄã¿ÉÒÔÓжà´ïÁù¸ö²»Í¬µÄÖնˡ£Õâ¸öÃüÁîµÄÒâ˼ÊÇ£º“ͬʱ°´×¡<Ctrl>¼üºÍ<Alt>¼ü£¬È»ºó°´<F1>¼ü£¬ÔÙÊÍ·ÅËùÓеļü”¡£
<Ctrl><Alt><Fn> (n=1..6)
Çл»µ½µÚn¸öÎı¾Öնˡ££¨ÄãÒ²¿ÉÒÔʹÓò»ÊǺܾ³£Óõ½µÄ ......