ʵÀý½âÎölinuxÄÚºËI2CÌåϵ½á¹¹
Ò»¡¢¸ÅÊö
̸µ½ÔÚlinuxϵͳϱàдI2CÇý¶¯£¬Ä¿Ç°Ö÷ÒªÓÐÁ½ÖÖ·½Ê½£¬Ò»ÖÖÊÇ°ÑI2CÉ豸µ±×÷Ò»¸öÆÕͨµÄ×Ö·ûÉ豸À´´¦Àí£¬ÁíÒ»ÖÖÊÇÀûÓÃlinux I2CÇý¶¯Ìåϵ½á¹¹À´Íê³É¡£ÏÂÃæ±È½ÏÏÂÕâÁ½ÖÖÇý¶¯¡£
µÚÒ»ÖÖ·½·¨µÄºÃ´¦£¨¶ÔÓ¦µÚ¶þÖÖ·½·¨µÄÁÓÊÆ£©ÓУº
¡ñ ˼·±È½ÏÖ±½Ó£¬²»ÐèÒª»¨Ê±¼äÈ¥Á˽âlinuxÄÚºËÖи´ÔÓµÄI2C×ÓϵͳµÄ²Ù×÷·½·¨¡£
µÚÒ»ÖÖ·½·¨ÎÊÌ⣨¶ÔÓ¦µÚ¶þÖÖ·½·¨µÄºÃ´¦£©ÓУº
¡ñ ÒªÇ󹤳Ìʦ²»½öÒª¶ÔI2CÉ豸µÄ²Ù×÷ÊìϤ£¬¶øÇÒÒªÊìϤI2CµÄÊÊÅäÆ÷²Ù×÷£»
¡ñ ÒªÇ󹤳Ìʦ¶ÔI2CµÄÉ豸Æ÷¼°I2CµÄÉ豸²Ù×÷·½·¨¶¼±È½ÏÊìϤ£¬×îÖØÒªµÄÊÇд³öµÄ³ÌÐò¿ÉÒÆÖ²ÐԲ
¡ñ ¶ÔÄں˵Ä×ÊÔ´ÎÞ·¨Ö±½ÓʹÓá£ÒòΪÄÚºËÌṩµÄËùÓÐI2CÉ豸Æ÷¼°É豸Çý¶¯¶¼ÊÇ»ùÓÚI2C×ÓϵͳµÄ¸ñʽ¡£I2CÊÊÅäÆ÷µÄ²Ù×÷¼òµ¥»¹ºÃ£¬Èç¹ûÓöµ½¸´ÔÓµÄI2CÊÊÅäÆ÷£¨È磺»ùÓÚPCIµÄI2CÊÊÅäÆ÷£©£¬¹¤×÷Á¿¾Í»á´óºÜ¶à¡£
±¾ÎÄÕë¶ÔµÄ¶ÔÏóÊÇÊìϤI2CÐÒ飬²¢ÇÒÏëʹÓÃlinuxÄÚºË×ÓϵͳµÄ¿ª·¢ÈËÔ±¡£
ÍøÂçºÍһЩÊé¼®ÉÏÓнéÉÜI2C×ÓϵͳµÄÔ´Âë½á¹¹¡£µ«·¢Ïֺܶ࿪·¢ÈËÔ±¿´ÁËÕâЩÎÄÕº󣬻¹ÊDz»Çå³þ×Ô¼º¾¿¾¹¸Ã×öЩʲô¡£¾¿ÆäÔÒò»¹ÊÇûŪÇå³þI2C×ÓϵͳΪÎÒÃÇ×öÁËЩʲô£¬ÒÔ¼°ÎÒÃÇÔõÑùÀûÓÃI2C×Óϵͳ¡£±¾ÎÄÊ×ÏÈÒª½â¾öÊÇÈçºÎÀûÓÃÏÖÓÐÄÚºËÖ§³ÖµÄI2CÊÊÅäÆ÷£¬Íê³É¶ÔI2CÉ豸µÄ²Ù×÷£¬È»ºóÔÙ¹ý¶Èµ½ÊÊÅäÆ÷´úÂëµÄ±àд¡£±¾ÎÄÖ÷Òª´Ó½â¾öÎÊÌâµÄ½Ç¶Èȥд£¬²»»áÉæ¼°ÌرðÏêϸµÄ´úÂë¸ú×Ù¡£
¶þ¡¢I2CÉ豸Çý¶¯³ÌÐò±àд
Ê×ÏÈÒªÃ÷È·ÊÊÅäÆ÷Çý¶¯µÄ×÷ÓÃÊÇÈÃÎÒÃÇÄܹ»Í¨¹ýËü·¢³ö·ûºÏI2C±ê×¼ÐÒéµÄʱÐò¡£
ÔÚLinuxÄÚºËÔ´´úÂëÖеÄdrivers/i2c/bussesĿ¼Ï°üº¬×ÅһЩÊÊÅäÆ÷µÄÇý¶¯¡£ÈçS3C2410µÄÇý¶¯i2c-s3c2410.c¡£µ±ÊÊÅäÆ÷¼ÓÔص½Äں˺󣬽ÓÏÂÀ´µÄ¹¤×÷¾ÍÒªÕë¶Ô¾ßÌåµÄÉ豸±àдÉ豸Çý¶¯ÁË¡£
±àдI2CÉ豸Çý¶¯Ò²ÓÐÁ½ÖÖ·½·¨¡£Ò»ÖÖÊÇÀûÓÃϵͳ¸øÎÒÃÇÌṩµÄi2c-dev.cÀ´ÊµÏÖÒ»¸öi2cÊÊÅäÆ÷µÄÉ豸Îļþ¡£È»ºóͨ¹ýÔÚÓ¦Óòã²Ù×÷i2cÊÊÅäÆ÷À´¿ØÖÆi2cÉ豸¡£ÁíÒ»ÖÖÊÇΪi2cÉ豸£¬¶ÀÁ¢±àдһ¸öÉ豸Çý¶¯¡£×¢Ò⣺ÔÚºóÒ»ÖÖÇé¿öÏ£¬ÊDz»ÐèҪʹÓÃi2c-dev.cµÄ¡£
1¡¢ÀûÓÃi2c-dev.c²Ù×÷ÊÊÅäÆ÷£¬½ø¶ø¿ØÖÆi2cÉ豸
i2c-dev.c²¢Ã»ÓÐÕë¶ÔÌض¨µÄÉ豸¶øÉè¼Æ£¬Ö»ÊÇÌṩÁËͨÓõÄread()¡¢write()ºÍioctl()µÈ½Ó¿Ú£¬Ó¦Óòã¿ÉÒÔ½èÓÃÕâЩ½Ó¿Ú·ÃÎʹҽÓÔÚÊÊÅäÆ÷É
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
1.ÒýÑÔ
¡¡¡¡C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌص㣨±»ÊÀÈ˳ÆΪ“²»³¹µ×µØÃæÏò¶ÔÏ󔣩£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚÈκÎÀàµÄÈ«¾Ö±äÁ¿ºÍº¯Êý¡£µ«ÊÇ£¬C++±Ï ......
¼ò½é
ÐéÄ⻯ ¸ÅÄîºÜÔç¾ÍÒѳöÏÖ¡£¼òµ¥À´Ëµ£¬ÐéÄ⻯¾ÍÊÇʹÓÃijЩ³ÌÐò£¬²¢Ê¹Æä¿´ÆðÀ´ÀàËÆÓÚÆäËû³ÌÐòµÄ¹ý³Ì¡£½«Õâ¸ö¸ÅÄîÓ¦Óõ½¼ÆËã»úϵͳÖпÉÒÔÈò»Í¬Óû§¿´µ½²»Í¬µÄµ¥¸öϵͳ£¨ÀýÈ磬һ̨¼ÆËã»ú¿ÉÒÔͬʱÔËÐÐ Linux ºÍ Microsoft? Windows?£©¡£Õâͨ³£³ÆΪȫÐéÄ⻯£¨full virtualization£©¡£
KVM ºÍ kvm ÔÚ±¾ÎÄÖУ¬ ......
Redhat LinuxµÄÍøÂçÅäÖ㬻ù±¾ÉÏÊÇͨ¹ýÐ޸ļ¸¸öÅäÖÃÎļþÀ´ÊµÏֵģ¬ËäȻҲ¿ÉÒÔÓÃifconfigÀ´ÉèÖÃIP£¬ÓÃrouteÀ´ÅäÖÃĬÈÏÍø¹Ø£¬ÓÃhostnameÀ´ÅäÖÃÖ÷»úÃû£¬µ«ÊÇÖØÆôºó»á¶ªÊ§¡£
Ïà¹ØµÄÅäÖÃÎļþ
/ect/hosts ÅäÖÃÖ÷»úÃûºÍIPµØÖ·µÄ¶ÔÓ¦
/etc/sysconfig/network ÅäÖÃÖ÷»úÃûºÍÍø¹Ø
  ......
ÔÚLinuxϵͳÖÐÎÒÒ»°ã²ÉÓñàÒëÔ´ÂëµÄ·½Ê½À´°²×°Apache£¬ÓÐÁ½ÖÖ·½·¨¿ÉÒÔÈÃApacheÔÚϵͳÆô¶¯Ê±×Ô¶¯Æô¶¯¡£
1. ÔÚ/etc/rc.d/rc.localÖÐÔö¼ÓÆô¶¯apacheµÄÃüÁÀýÈ磺/usr/local/httpd/bin/apachectl start
2. ½«apache×¢²áΪϵͳ·þÎñ
Ê×ÏȽ«apachectlÃüÁ±´ÖÁ/etc/rc.d/init.dĿ¼Ï£¬¸ÄÃûΪhttpd
ʹÓñà¼Æ÷´ò¿ªhttpdÎļþ ......