ǶÈëʽLinuxµÄ¼üÅÌÇý¶¯ 1£¨Í¨¹ýI2CʵÏÖ£©
CPU£ºs3c2410
OS£ºLinux Kernel 2.6.30.4
×î½ü¸Õ×öÍêµÄǶÈëʽ¼üÅ̵ÄÇý¶¯£¬ÓÉÓÚ³õ´Î½Ó´¥£¬×ܽáһϡ£
Ê×Ïȼòµ¥ËµËµÕâ¸ö¼üÅ̵ÄʵÏÖÔÀí£¬IIC×ÜÏß¹¤×÷ÔÀíû±ØÒª·Ï»°£¬s3c2410µÄÊÖ²áÖн²µÄºÜÃ÷°×¡£Ó²¼þ·½ÃæÕâ¸ö¼üÅÌͨ¹ýÒ»¸öAVRµ¥Æ¬»ú£¨ATMEGA48£©½ÓÔÚIIC×ÜÏßÉÏ£¬Ò²¾ÍÊÇ˵£¬Ö±½ÓÓëIIC×ÜÏßÁ´½ÓµÄÉ豸²¢²»ÊÇÎÒÃÇÓõļüÅÌ£¬¶øÊÇÕâ¸öµ¥Æ¬»ú£¬¼üÅ̲úÉúµÄÒ»ÇÐÊý¾ÝÓÉÕâ¸öµ¥Æ¬»ú¾¹ý¼Ó¹¤°ü×°³ÉÒ»¶¨µÄÊý¾Ý½á¹¹ÔÙ·¢¸øs3c2410¡£µ±s3c2410оƬÊÕµ½Êý¾Ýºó»áÓÉIIC¿ØÖÆÆ÷´¥·¢Ò»¸öÖжϣ¬ÔÚÖжϴ¦Àí³ÌÐòÖÐÎÒÃÇÖ»Òª½âÎöÕâ¸ö½á¹¹Ìå¾Í¿ÉÒÔÁË¡£
Èí¼þ·½Ã棬É豸Çý¶¯Êµ¼ÊÉÏ·ÖΪÁ½²ã£¬ÆäÖÐÖ®Ò»¾ÍÊÇAVRµ¥Æ¬»úµÄÇý¶¯£¬ÁíÒ»¸ö¾ÍÊǼüÅÌÇý¶¯£¬»ù±¾Á÷³ÌÈçÏ¡£ÄÚºËÆô¶¯Ê±»á×Ô¶¯µ÷ÓÃÉ豸³õʼ»¯º¯Êý£¬ÕâʱºòÎÒÃÇÐèÒª×öµÄÊÇͨ¹ýIIC×ÜÏ߸øÕâ¸öµ¥Æ¬»ú´«Ëͳõʼ»¯ÐÅÏ¢¡£·¢Ë͵ÄÊý¾ÝÒ»¹²°üÀ¨Á½²¿·Ö£¬Ç°ÕßÓÃÓÚÉèÖÃÄ¿µÄÉ豸£¨s3c2410оƬ£©µÄµØÖ·£¬Ò²¾ÍÊǸæËßAVRµ¥Æ¬»úÊÕµ½¼üÅÌ·¢À´µÄÊý¾ÝºóÓ¦¸Ã·¢¸øË£»ºóÕßÊÇʹÄܼüÅÌ£¬Èç¹û²»·¢Õâ¸öÖ¸ÁAVRÊÕµ½¼üÅÌ´«À´µÄ°´¼üÓ²¼þ±àÂëºóÖ±½Ó¶ªÆú¡££¨ÕâÀï×¢Ò⣺AVRÉÏ¿ÉÒÔͬʱ¹ÜÀí¶à¸öÉ豸£¬ÊÂʵÉÏÎҸ㵽µÄÇ°È˵Ä×ÊÁÏÒ²ÊÇÖ§³Ö¶à¸öÉ豸£¬¶øÕâÀïÎÒÃÇÖ»Óõ½ÁËÒ»¸ö¼üÅÌ£©Íê³É³õʼ»¯ºó£¬Ó²¼þ·½Ãæ¾ÍûÓÐʲôÕÏ°ÁË£¬Èç¹ûÎÒÃÇ°´ÏÂÒ»¸ö°´¼ü£¬¼üÅÌ»á°ÑÒ»¸ö8λµÄÓ²¼þ¼üÂë·¢¸øAVRµ¥Æ¬»ú¡£ÔÚAVRµ¥Æ¬»úÖÐÕâ¸ö×Ö½ÚÇ°»á±»ÔÙ¼ÓÉÏÒ»¸ö8λµÄÉ豸±àºÅ£¬È»ºóÒ»Æ𷢸øs3c2410¡£cpuÊÕµ½Êý¾Ýºó£¬»á°Ñ×Ô¼ºµÄ¹¤×÷ģʽÉèÖóÉSR£¬È»ºóµ÷ÓÃAVRµ¥Æ¬»úÇý¶¯ÖеÄi2c_mega8_slvRcvº¯Êý£¬²¢°Ñ½ÓÊÕµ½µÄºóÁ½¸ö×Ö½Ú£¨¼üÅ̵ÄÉ豸Âë+°´¼üÓ²¼þÂ룩×÷Ϊ²ÎÊý´«¸ø¸Ãº¯Êý¡£Ôڸú¯ÊýÖУ¬¼ì²âÉ豸Â룬Èç¹ûÊǼüÅÌ£¬ÄÇôµ÷ÓüüÅÌÇý¶¯³ÌÐòÖеÄmega8_kbd_rawº¯Êý£¬²¢×îÖÕÌí¼ÓÈë°´¼üµÈ´ý¶ÓÁС£µ±ÓгÌÐò´ò¿ª¼üÅÌÉ豸ÎļþµÄʱºò£¬Õâ¸ö¶ÓÁÐÖеļüÂë»á±»´«µÝ¸øÏàÓ¦µÄÓû§³ÌÐò¡£
ÏÂÃæ´úÂ벿·Ö½è¼øÁËÇ°È˵ÄÀͶ¯³É¹û£¬¾ßÌå×÷ÕßÊÇ˸㲻̫Çå³þ ... ...
Ê×ÏÈÌí¼ÓÒ»²¿·Ö½á¹¹ÌåºÍ³£Á¿¶¨Ò壺
#ifndef __I2C_TOMEGA8_H_
#define __I2C_TOMEGA8_H_
#include <linux/poll.h>
#if 0 //modified by B.Zhou
#define I2COWNER_ADDRESS (0x10>>1)
#else
#define I2COWNER_ADDRESS (0x10)
#endif
#define MEGA8_I2CADDRESS (0x60)
typedef struct __attribute__ ((packed)){
 
Ïà¹ØÎĵµ£º
ÔÚѧϰÓйØI/O×ÜÏßµÄÄÚÈÝʱ£¬×îºÃÏÈ¿´¿´Ïà¹ØµÄ֪ʶ£º´ÓPC×ÜÏßµ½ARMµÄÄÚ²¿×ÜÏß
I/O ¶Ë¿ÚºÍ I/O ÄÚ´æ
ÿÖÖÍâÉ趼ÊÇͨ¹ý¶Áд¼Ä´æÆ÷À´½øÐпØÖÆ¡£
ÔÚÓ²¼þ²ã£¬ÄÚ´æÇøºÍ I/O ÇøÓòûÓиÅÄîÉϵÄÇø±ð: ËüÃǶ¼ÊÇͨ¹ýÏòÔÚµØÖ·×ÜÏߺͿØÖÆ×ÜÏß·¢³öµçƽÐźÅÀ´½øÐзÃÎÊ£¬ÔÙͨ¹ýÊý¾Ý×ÜÏ߶ÁдÊý¾Ý¡£
ÒòΪÍâÉèÒªÓëI\O×ÜÏßÆ¥Å䣬¶ø´ó²¿·ÖÁ ......
×öÒ»¸ö×îСµÄLinux kernel
2004-04-23 15:18 pm
À´×Ô£ºLinuxÎĵµ
ÏÖÔØ£ºWww.8s8s.coM
µØÖ·£ºÎÞÃû
Linux ÄÜÓжàСÄØ ? ÿһ¸ö×ö embedded ϵͳµÄÈ˶¼°ÑС¿´³ÉµÚÒ»ÒªÎñ£¬ÆäʵÕâÊDz»¶ÔµÄ¡£Èç¹ûÎÒÃǶÔϵͳµÄºÃ»µºÍ´óС×÷ͼ£¬ËüÓ¦¸Ã³¤µÃÏñ
|
|----
|
| -----
|
| --------
| ---
|----------------------- ......
# ifconfig # ²é¿´ËùÓÐÍøÂç½Ó¿ÚµÄÊôÐÔ
# iptables -L # ²é¿´·À»ðǽÉèÖÃ
# route -n   ......
¼ÙÉèÁ½¸ö½ø³Ì£¨¸¸×Ó½ø³Ì£©¶ÔÒ»¸öÎļþ½øÐÐд²Ù×÷£¬µ«ÊÇÕâ¸öÎļþͬһʱ¼äÖ»ÄÜÓÐÒ»¸ö½ø³Ì½øÐÐд²Ù×÷¡£
//ÀûÓÃÐźÅÁ¿ÊµÏÖpv²Ù×÷
#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include < ......