¡¡¡¡ÕªÒª£º
¡¡¡¡·ÖÎöºÍÌÖÂÛQt/EmbeddedµÄÖ÷Á÷°æ±¾3.xϵÁеĵײãʵÏÖ¼¼Êõ£»½áºÏ2.x°æ±¾ÏµÁкÍ3.x°æ±¾ÏµÁУ¬ÔÚÁ½ÖÖ²»Í¬µÄÓ²¼þƽ̨£¨Intel PXA255¿ª·¢ÏµÍ³Óë±ÊÕß×ÔÐÐÉè¼ÆµÄMotorola MC9328 MX1¿ª·¢ÏµÍ³£©ÉϵÄÒÆÖ²¹ý³Ì£¬ÌÖÂÛQt/EmbeddedµÄµ×²ãÉ豸½Ó¿ÚÓëÓ¦ÓÃÒÆÖ²¼¼Êõ¡£
¡¡¡¡¹Ø¼ü´Ê£º
¡¡¡¡Qt/Embedded ǶÈëʽ Linux framebuffer Çý¶¯½Ó¿Ú
¡¡¡¡ÒýÑÔ
¡¡¡¡Ëæ×ÅǶÈëʽLinuxÓ¦ÓõIJ»¶Ï·¢Õ¹£¬Ç¶Èëʽ´¦ÀíÆ÷ÔËËãÄÜÁ¦µÄ²»¶ÏÔöÇ¿£¬Ô½À´Ô½¶àµÄǶÈëʽÉ豸¿ªÊ¼²ÉÓýÏΪ¸´ÔÓµÄGUIϵͳ£¬ÊÖ³ÖÉ豸ÖеÄGUIϵͳ·¢Õ¹µÃ·Ç³£Ñ¸ËÙ¡£´«Í³µÄGUIϵͳ£¬ÈçMicrowindowsµÈ£¬ÓÉÓÚÏîÄ¿¹æÄ£½ÏС¡¢¹¦ÄܽÏΪ±¡Èõ£¬È±·¦µÈÈý·½Èí¼þ¿ª·¢µÄÖ§³ÖµÈÖî¶àÔÒò£¬ÔڱȽϸ߼¶µÄÊÖ³Ö»òÒƶ¯ÖÕ¶ËÉ豸£¨ÈçPDA¡¢Smart-Phone¡¢³µÔص¼º½ÏµÍ³£©ÖÐÓ¦ÓýÏÉÙ¡£
¡¡¡¡Qt/EmbeddedÊÇÖøÃûµÄQt¿â¿ª·¢ÉÌTrolltech¹«Ë¾¿ª·¢µÄÃæÏòǶÈëʽϵͳµÄQt°æ±¾£¬¿ª·¢ÈËÔ±¶àΪKDEÏîÄ¿µÄºËÐÄ¿ª·¢ÈËÔ±¡£Ðí¶à»ùÓÚQtµÄX Window³ÌÐò¿ÉÒԷdz£·½±ãµØÒÆÖ²µ½Qt/EmbeddedÉÏ£¬ÓëX11°æ±¾µÄQtÔÚ×î´ó³Ì¶ÈÉϽӿڼæÈÝ£¬ÑÓÐøÁËÔÚXÉϵÄÇ¿´ó¹¦ÄÜ£¬Ôڵײ㳹µ×ÞðÆúÁËX lib£¬½ö²ÉÓÃframebuffer×÷Ϊµ×²ãͼÐνӿڡ£Qt/EmbeddedÀà¿âÍêÈ«²ÉÓÃC++·â×°¡£·á¸»µÄ¿Ø¼þ×ÊÔ´ºÍ½ÏºÃµÄ¿ÉÒÆÖ²ÐÔÊÇQt/Embedded×îΪÓÅÐãµÄÒ»·½Ã棬ʹÓÃXϵĿª·¢¹¤¾ßQt Designer¿ÉÒÔÖ±½Ó¿ª·¢»ùÓÚQt/EmbeddedµÄUI£¨Óû§²Ù×÷½Ó¿Ú£©½çÃæ¡£Ô½À´Ô½¶àµÄµÚÈý·½Èí¼þ¹«Ë¾Ò²¿ªÊ¼²ÉÓÃQt/Embedded¿ª·¢Ç¶ÈëʽLinuxϵÄÓ¦ÓÃÈí¼þ¡£ÆäÖзdz£ÖøÃûµÄQt Palmtop Environment£¨Qtopia£©ÔçÆÚÊÇÒ»¸öµÚÈý·½µÄ¿ªÔ´ÏîÄ¿£¬²¢ÒѾ³É¹¦Ó¦ÓÃÓÚ¶à¿î¸ßµµPDA¡£Trolltech¹«Ë¾Õë¶ÔSmart-PhoneÖеÄÓ¦ÓÃÐèÇó£¬ÓÚ2004Äê5Ôµ׷¢²¼ÁËQtopiaµÄPhone°æ±¾¡£
¡¡¡¡1 Qt/EmbeddedµÄʵÏÖ¼¼Êõ»ù´¡·ÖÎö
¡¡¡¡ºáÏòÀ´¿´£¬ÓÉÓÚ·¢²¼µÄ°æȨÎÊÌ⣬Qt/Embedded²ÉÓÃÁ½ÖÖ·½Ê½½øÐз¢²¼£ºÔÚGPLÐÒéÏ·¢²¼µÄfree°æÓëרÃÅÕë¶ÔÉÌÒµÓ¦ÓõÄcommercial°æ±¾¡£¶þÕß³ýÁË·¢²¼·½Ê½Í⣬ÔÚÔ´ÂëÉÏûÓÐÈκÎÇø±ð¡£×ÝÏò¿´À´£¬µ±Ç°Ö÷Á÷µÄ°æ±¾ÎªQtopiaµÄ2.xϵÁÐÓë×îеÄ3.0xϵÁС£ÆäÖÐ2.0°æ±¾ÏµÍ³½Ï¶àµØÓ¦ÓÃÓÚ²ÉÓÃQtopia×÷Ϊ¸ßµµPDAÖ÷½çÃæµÄÓ¦ÓÃÖУ»3.x°æ±¾ÏµÁÐÔòÓ¦ÓÃÓÚ¹¦ÄÜÏà¶Ôµ¥Ò»£¬µ«ÐèÒª¸ß¼¶GUIͼÐÎÖ§³ÖµÄ³¡ºÏ£¬ÈçVolvo¹«Ë¾µÄÔ¶³Ì¹«½»ÐÅϢϵͳ¡£Í¼1ΪQt/EmbeddedµÄʵÏֽṹ¡£
¡¡¡¡3.x°æ±¾ÏµÁеÄQt/EmbeddedÏà¶ÔÓÚ2.x°æ±¾ÏµÍ³Ôö¼ÓÁËÐí¶àеÄÄ£¿é£¬ÈçSQLÊý¾Ý¿â²éѯģ¿éµÈ¡£¼¸ºõËùÓÐ2.x°æ±¾ÖÐÔÓеÄÀà¿â£¬ÔÚ3.x°æ±¾Öж¼µÃµ½¼«´ó³Ì¶ÈµÄÔöÇ¿¡£Õâ¾Í¼«´óµØËõ¶ÌÁËÓ¦ÓÃÈí¼þµÄ¿ª·¢Ê±¼ä£¬À©´óÁËQt/EmbeddedµÄÓ¦Ó÷¶Î§¡£
¡¡¡¡ÔÚ´úÂëÉè¼ÆÉÏ£¬Qt/EmbeddedÇÉÃîµØÀûÓÃÁËC++¶ÀÓеĻúÖÆ£¬Èç¼Ì³Ð¡¢¶à̬¡¢Ä£°åµÈ£¬¾ßÌåʵÏַdz£Áé»î¡£µ«Æäµ×²ã´úÂëÓÉÓÚ×·ÇóÓë¶àÖÖϵͳ¡¢¶àÖÖÓ²¼þµÄ¼æÈÝ£¬´úÂë²¹¶¡½Ï¶à£¬·ç¸ñÉÔÏÔ»ìÂÒ¡£
¡¡¡¡1£®1 Qt/EmbeddedµÄͼÐÎÒýÇæʵÏÖ»ù´¡
¡¡¡¡Qt/EmbeddedµÄµ×²ãͼÐÎÒýÇæ»ùÓÚframebuffer¡£FramebufferÊÇÔÚLinuxÄں˼ܹ¹°æ±¾2.2ÒÔºóÍƳöµÄ±ê×¼ÏÔʾÉ豸Çý¶¯½Ó¿Ú¡£²ÉÓÃmmapϵͳµ÷Ó㬿ÉÒÔ½«framebufferµÄÏÔʾ»º´æÓ³ÉäΪ¿ÉÁ¬Ðø·ÃÎʵÄÒ»¶ÎÄÚ´æ´¢Õë¡£ÓÉÓÚÄ¿Ç°±È½Ï¸ß¼¶µÄARMÌåϵµÄǶÈëʽCPUÖдó¶à¼¯³ÉÁËLCD¿ØÖÆÄ£¿é£¬LCD¿ØÖÆÄ£¿éÒ»°ã²ÉÓÃË«DMA¿ØÖÆÆ÷×é³ÉµÄרÓÃDMAͨµÀ¡£ÆäÖÐÒ»¸öDMA¿ÉÒÔ×Ô¶¯´ÓÒ»¸öÊý¾Ý½á¹¹¶ÓÁÐÖÐÈ¡³ö²¢×°ÈëеIJÎÊý£¬Ö±µ½Õû¸ö¶ÓÁÐÖеÄDMA²Ù×÷¶¼ÒÑÍê³ÉΪֹ¡£ÁíÍâÒ»¸öDMAÓë»Ã滺³åÇøÏà¹Ø£¬Õⲿ·ÖÓÉÁ½¸öDMA¿ØÖÆÆ÷½»ÌæÖ´ÐУ¬²¢Ã¿´Î¶¼×Ô¶¯°´ÕÕÔ¤¶¨µÄ¹æÔò¸Ä±ä²ÎÊý¡£ËäȻʹÓÃÁËË«DMA£¬µ«ÕâÁ½¸öDMA¿ØÖÆÆ÷µÄ½»ÌæʹÓöÔÓÚCPUÀ´ËµÊDz»¿É¼ûµÄ¡£CPUËù»ñµÃµÄÖ»ÊÇÓÉÁ½¸öDMA×é³ÉµÄÒ»¸ö¡°Í¨µÀ¡±¶øÒÑ¡£
¡¡¡¡FramebufferÇý¶¯³ÌÐòµÄʵÏÖ·ÖΪÁ½¸ö·½Ã棺һ·½ÃæÊǶÔLCD¼°ÆäÏà¹Ø²¿·ÖµÄ³õʼ»¯£¬°üÀ¨»ÔÚ»º³åÇøµÄ´´½¨ºÍ¶ÔDMAͨµÀµÄÉèÖã»ÁíÍâÒ»·½ÃæÊǶԻÃ滺³åÇøµÄ¶Áд£¬¾ßÌåµ½´úÂëΪread¡¢write¡¢lseekµÈϵͳµ÷Óýӿڡ£ÖÁÓÚ½«»Ã滺³åÇøµÄÄÚÈÝÊä³öµ½LCDÏÔʾÆÁÉÏ£¬ÔòÓÉÓ²¼þ×Ô¶¯Íê³É¡£¶ÔÓÚÈí¼þÀ´ËµÊÇ͸Ã÷µÄ¡£µ±¶ÔÓÚDMAͨµÀºÍ»Ã滺³åÇøÉèÖÃÍê³Éºó£¬DMA¿ªÊ¼Õý³£¹¤×÷£¬²¢½«»º³åÇøÖеÄÄÚÈݲ»¶Ï·¢Ë͵½LCDÉÏ¡£Õâ¸ö¹ý³ÌÊÇ»ùÓÚDMA¶ÔÓÚLCDµÄ²»¶Ïˢеġ£»ùÓÚ¸ÃÌØÐÔ£¬framebufferÇý¶¯³ÌÐò±ØÐ뽫»Ã滺³åÇøµÄ´æ´¢¿Õ¼ä£¨ÎïÀí¿Õ¼ä£©ÖØÐÂÓ³Éäµ½Ò»¸ö²»¼Ó¸ß»º´æºÍд»º´æµÄÐéÄâµØÖ·Çø¼äÖУ¬ÕâÑùÄܲű£Ö¤Ó¦ÓóÌÐòͨ¹ýmmap½«¸Ã»º´æÓ³Éäµ½Óû§¿Õ¼äºó£¬¶ÔÓڸûÃ滺´æµÄд²Ù×÷Äܹ»ÊµÊ±µÄÌåÏÖÔÚLCDÉÏ¡£
¡¡¡¡ÔÚQt/EmbeddedÖУ¬QscreenÀàΪ³éÏó³öµÄµ×²ãÏÔʾÉ豸»ùÀ࣬ÆäÖÐÉùÃ÷Á˶ÔÓÚÏÔʾÉ豸µÄ»ù±¾ÃèÊöºÍ²Ù×÷·½Ê½£¬Èç´ò¿ª¡¢¹Ø±Õ¡¢»ñµÃÏÔʾÄÜÁ¦¡¢´´½¨GFX²Ù×÷¶ÔÏóµÈ¡£ÁíÍâÒ»¸öÖØÒªµÄ»ùÀàÊÇQGfxÀà¡£¸ÃÀà³éÏó³ö¶ÔÓÚÏÔʾÉ豸µÄ¾ßÌå²Ù×÷½Ó¿Ú£¨Í¼ÐÎÉ豸»·¾³£©£¬ÈçÑ¡Ôñ»Ë¢¡¢»Ïß¡¢»¾ØÐΡ¢alpha²Ù×÷µÈ¡£ÒÔÉÏÁ½¸ö»ùÀàÊÇQt/EmbeddedͼÐÎÒýÇæµÄµ×²ã³éÏó¡£ÆäÖÐËùÓоßÌ庯Êý»ù±¾¶¼ÊÇÐ麯Êý£¬Qt/Embedded¶ÔÓÚ¾ßÌåµÄÏÔʾÉ豸£¬ÈçLinuxµÄframebuffer¡¢Qt Virtual Framebuffer×öµÄ³éÏó½Ó¿ÚÀàÈ«¶¼Óɴ˼̳в¢ÖØÔØ»ùÀàÖеÄÐ麯ÊýʵÏÖ¡£Í¼2ΪQt/EmbeddedÖеײãͼÐÎÒýÇæʵÏֽṹ¡£
¡¡¡¡¶ÔÓÚ»ù±¾µÄframebufferÉ豸£¬Qt/EmbeddedÓÃQlinuxFbScreenÀ´´¦Àí¡£Õë¶Ô¾ßÌåÏÔʾӲ¼þ£¨ÈçMach¿¨¡¢Voodoo¿¨£©µÄ¼ÓËÙÌØÐÔ£¬Qt/Embedded´ÓQlinuxFbScreenºÍͼÐÎÉ豸»·¾³Ä£°åÀàQgfxRaster¼Ì³Ð³öÏàÓ¦×ÓÀ࣬²¢Õë¶ÔÏàÓ¦Ó²¼þÖØÔØÏà¹ØÐ麯Êý¡£
¡¡¡¡Qt/EmbeddedÔÚÌåϵÉÏΪC/S½á¹¹£¬ÈκÎÒ»¸öQt/Embedded³ÌÐò¶¼¿ÉÒÔ×÷ΪϵͳÖÐΨһµÄÒ»¸öGUI Server´æÔÚ¡£µ±Ó¦ÓóÌÐòÊ×´ÎÒÔϵͳGUI ServerµÄ·½Ê½¼ÓÔØʱ£¬½«½¨Á¢QWSServerʵÌå¡£´Ëʱµ÷ÓÃQWSServer::openDisplay()º¯Êý´´½¨´°Ì壬ÔÚQWSServer::openDisplay£¨£©ÖжÔQWSDisplay£º£ºDataÖеÄinit()¼ÓÒÔµ÷Ó㻸ù¾ÝQgfxDriverFactoryʵÌåÖеĶ¨Ò壨QLinuxFbScreen£©ÉèÖùؼüµÄQscreenÖ¸Õëqt_screen²¢µ÷ÓÃconnect()´ò¿ªÏÔʾÉ豸£¨dev/fb0£©¡£ÔÚQWSServerÖÐËùÓжÔÓÚÏÔʾÉ豸µÄµ÷Óö¼ÓÉqt_screen·¢Æð¡£ÖÁ´ËÍê³ÉÁËQt/EmbeddedÖÐQWSServerµÄͼÐη¢ÉúÒýÇæµÄ´´½¨¡£µ±ÏµÍ³Öн¨Á¢ºÃGUI Serverºó£¬ÆäËüÐèÒªÔËÐеÄQt/Embedded³ÌÐòÔÚ¼ÓÔغó²ÉÓù²ÏíÄÚ´æ¼°ÓÐÃû¹ÜµÀµÄ½ø³ÌͨÐÅ·½Ê½£¬ÒÔͬ²½·ÃÎÊģʽ»ñµÃ¶Ô¹²Ïí×ÊÔ´framebufferÉ豸µÄ·ÃÎÊȨ¡£
xyx119 ÓÚ 2006-10-23 10:07:01·¢±í:
QTºÃÑùµÄ
syy520 ÓÚ 2006-10-22 11:13:49·¢±í:
:0)1
703416 ÓÚ 2006-09-21 11:28:25·¢±í:
ѧϰÖÐ...
MORR ÓÚ 2006-09-21 10:38:03·¢±í:
¡¡¡¡Qt/Embedded 2.xϵÁжÔÓÚÊäÈëÉ豸µÄµ×²ã½Ó¿ÚÓë3.xϵÁв»Í¬£¬´¥ÃþÆÁÉ豸ºÍ¼üÅÌÉ豸ÐèÒª¸ù¾Ý¾ßÌåµÄÇý¶¯³ÌÐò½Ó¿ÚÔÚQt/EmbeddedÖÐÉ豸ʵÏÖ¶ÔÓ¦µÄÉ豸²Ù×÷Àà¡£ÆäÖжÔÓ¦ÓÚÊó±êÀàÉ豸µÄʵÏÖλÓÚsrc/kernel/qmouse_qws.cppÖС£ÓÉÓÚ´¥ÃþÆÁÔÚʵÏÖÔÀíÉÏ´æÔÚ×ÅA/DÁ¿»¯Îó²îµÄÎÊÌ⣬Òò´ËËùÓеĴ¥ÃþÆÁ½Ó¿ÚʵÏÖÀàÐèÒª´ÓÌØÊâµÄQcalibratedMouseHandler¼Ì³Ð£¬²¢»ñµÃУÕý¹¦ÄÜ¡£
¡¡¡¡Qt/Embedded 2.xÖжÔÓÚ¼üÅÌÏìÓ¦µÄʵÏÖº¯ÊýλÓÚsrc/kernel/qkeyboard_qws.cppÖС£ÔÚqkeyboard_qws.hÖУ¬¶¨ÒåÁ˼üÅÌÀàÉ豸½Ó¿ÚµÄ»ùÀàQWSKeyboardHandler£¬ÒÆֲʱÐèÒª¸ù¾Ý¼üÅÌÇý¶¯³ÌÐò´Ó¸ÃÀàÅÉÉú³öʵÏÖÀ࣬ʵÏÖ¼üÅÌʼþ´¦Àíº¯ÊýprocessKeyEvent()£¬²¢ÔÚQWSServer::newKeyboardHandlerº¯ÊýÖÐ×¢²á×Ô¼ºµÄ¼üÅÌÀàÉ豸¼´¿É¡£ÆäÖжÔÓÚµã»÷¼üµÄ¼üÂ붨ÒåÔÚQt/EmbeddedµÄÃüÃû¿Õ¼ä----src/kernel/qnamespace.hÖС£
¡¡¡¡ÔÚij³µÔص¼º½¸¨ÖúϵͳµÄ¿ª·¢Æ½Ì¨Éè¼ÆÖУ¬²ÉÓÃÁËQt/Embedded 3.3.2°æ±¾×÷ΪÆäGUIϵͳµÄʵÏÖ·½°¸¡£Ó²¼þƽ̨²ÉÓÃ×ÔÐÐÉè¼ÆµÄÒÔMotorola MC9328 MX1ΪºËÐĵĿª·¢ÏµÍ³¡£¸Ãϵͳ²ÉÓÃCPUÄÚ²¿LCD¿ØÖÆÆ÷ºÍ240¡Á320·Ö±æÂʵÄ16 bpp TFT LCD×÷ΪÏÔʾÉ豸£¬²ÉÓÃI2C×ÜÏßÀ©Õ¹³ö16°´¼üÒÔ¼°MX1¼¯³ÉµÄASPÄ£¿éºÍµç×è´¥ÃþÆÁ¡£²Ù×÷ϵͳΪARM Linux 2.4.18¡£
¡¡¡¡Qt/Embedded 3.x°æ±¾ÏµÍ³ÖÐÓëµ×²ãÓ²¼þ½Ó¿ÚÏà¹Ø²¿·ÖµÄÔ´ÂëλÓÚsrc/embedded/Ä¿±êÖС£¸Ã²¿·Ö°üº¬ÈýÀàÉ豸µÄ½Ó¿Ú£ºframebufer¡¢Êó±êÓë¼üÅÌ¡£²ÎÕÕ¸ÃÄ¿±êÖÐÏà¹ØÉ豸µÄ¾ßÌå½Ó¿Ú´úÂ룬¸ù¾Ý×ÔÉíÓ²¼þ̨ÔöÌí½Ó¿Ú¼´¿É¡£
¡¡¡¡ÓÉÓÚϵͳLCDµÄ²íµÀÂÊΪ240¡Á320£¬ÎïÀí³ß´ç½ÏС£¬ÔÚʵÏÖÆäÓÚ¸ÃϵͳµÄframebufferÇý¶¯³ÌÐòʱ²¢Ã»Óн«Æä±¾ÉíÓëLinux×Ö·û¿ØÖÆ̨É豸¹Ò¿¿£¬Òò´Ëframebuffer²¢²»¾ß±¸TEXTģʽµÄ¹¤×÷·½Ê½¡£ÔÚÒÆÖ²Qt/Embeddedʱ£¬ÎÞÐè×÷framebufferÉ豸µÄ¹¤×÷·½Ê½×ª»»¡£ÕýÈ·ÅäÖÃÉ«²ÊÏÔʾ֧³Öºó£¬Qt/EmbeddedÄܹ»ÔÚLCDÏÔʾ³öÕýÈ·µÄͼÐΡ£ÓÉÓÚ¸Ãƽ̨µÄÏÔʾϵͳΪ×ÝÏò320ÐУ¬ÔÚÉè¼Æʱ¿¼Âǵ½È˶ÔÓÚ·ÇÊÖ³ÖÉ豸µÄÊÓ¾õÏ°¹ßΪ¿í¶È´óÓڸ߶ȵĹ۲췽ʽ£¬ÎªÁË·ûºÏÕâÖÖÏ°¹ßÐԵĹ۲췽ʽ£¬ÔÚÒÆÖ²Qt/Embeddedʱ²ÉÓÃÁËTransformedµÄÐýתͼÐÎÏÔʾ·½Ê½ÔÚÈí¼þÉÏʵÏÖÁËÏÔʾ·½ÏòµÄת»»±ä»¯¡£
¡¡¡¡Êó±êÉ豸½Ó¿ÚÕâÒ»»ùÀàQWSMouseHandlerµÄʵÏÖλÓÚsrc/embedded/qmouse_qws.cppÖС£Óë2.x°æ±¾ÏµÁв»Í¬µÄÊÇ£¬3.xÖÐËùÓеÄLinux´¥ÃþÆÁʾÀý½Ó¿Ú´úÂë¾ùʵÏÖÔÚsrc/embedded/qmouselinuxtp_qws.cppÖеÄQWSLinuxTPMouseHandlerÀàÖС£ÆäÖжÔÓÚ²»Í¬ÐͺŵĴ¥ÃþÆÁµÄ½Ó¿ÚʵÏÖ´úÂ룬²ÉÓò»Í¬µÄºê¶¨ÒåºÍÔ¤±àÒëµÄ·½Ê½½«ËüÃÇ·Ö¸ô¿ª¡£±ÊÕß»¹Í¨¹ý´ÓQWSLinuxTPMouseHandlerÖм̳Ð×ÔÉí´¥ÃþÆÁ½Ó¿ÚÀ࣬Ìæ´úÔÓеÄQWSLinuxTPMouseHandlerPrivateÀ࣬¶øÔÚQWSLinuxTPMouseHandlerÉú³É×ÔÉí´¥ÃþÆÁ½Ó¿Ú¶ÔÏóµÄ·½Ê½£¬½ÏºÃµØ½«ÒÆÖ²²¿·ÖµÄ´úÂëÓëÔÓбȽϻìÂҵĴúÂë·Ö¸ô¿ªÀ´¡£
¡¡¡¡3.xÖмüÅ̽ӿڻùÀàÃÇÓÚsrc/embedded/qkbd_qws.cppÖУ¬ÎªQWSKeyboardHandler¡£ÊµÏÖI2C×ÜÏßÀ©Õ¹³öµÄ16¼ü¼üÅ̽ӿÚÀ෽ʽÓë´¥ÃþÆÁÀàËÆ£¬´Ë´¦²»¶àÊö¡£ÐèҪעÒâµÄÊÇ£¬Qt/EmbeddedÌṩÁËʼþ¹ýÂËÆ÷£¨key event filter£©µÄ½Ó¿Ú£¬ÔÚ¼üÅ̵ã»÷ʼþ´ÓQWSServer½Ø»ñ²¢·¢Ë͵½ÏàÓ¦µÄclient֮ǰ»á¾¹ýº¯ÊýQWSServer::KeyboardFilter¡£Ôڴ˺¯ÊýÖпÉÒÔ°´ÕÕ×ÔÉíÐèÇóÉú³ÉеļüÅ̵ã»÷ʼþ£¬¶øºóÀûÓÃQWSServer::sendKeyEvent()·¢ËÍеĵã»÷ʼþµ½clientÖС£ÀûÓø÷½Ê½¿ÉÒÔ½«¸÷ÖÖ¼üÅ̵ã»÷ÎÞ·¨ÊäÈëµÄunicode×Ö·ûת»»³öÀ´£¬´Ó¶ø¿ÉÒÔÔÚ½ÏÉٵİ´¼ü¼üÅÌÉÏʵÏÖ¶àunicode×Ö·ûÊäÈë·¨¡£Qt/Embedded 3.x¼üÅ̽ӿڵÄÒÆÖ²ÓëÊó±êÉ豸½Ó¿ÚÀàËÆ£¬´Ë´¦²»¶àÊö¡£
¡¡¡¡3 ×ܽá
¡¡¡¡Ëæ×ÅǶÈëʽ´¦ÀíÆ÷ÔËËãÄÜÁ¦µÄ²»¶ÏÌá¸ß£¬¶ÔÍâÉèÖ§³ÖµÄ²»¶Ï·á¸»£¬Ç¶ÈëʽLinuxϵͳµÄÓ¦ÓÃÒ²Öð½¥Ôö¶à¡£Qt/EmbeddedÑÓÐøÁËQtÔÚ×ÀÃæϵͳµÄËùÓй¦ÄÜ£¬·á¸»µÄAPI½Ó¿ÚºÍ»ùÓÚ×é¼þµÄ±à³ÌÄ£ÐÍʹµÃǶÈëʽLinuxϵͳÖеÄÓ¦ÓóÌÐò¿ª·¢¸ü¼Ó±ã½Ý¡£ÓÉÓÚQt/Embedded±¾ÉíÃæÏò¸ß¶ËµÄÊÖ³ÖÉ豸ºÍÒƶ¯É豸£¬½«³ÉΪδÀ´Ç¶ÈëʽϵͳµÄÖ÷ÒªGUI¡£
MORR ÓÚ 2006-09-21 10:37:16·¢±í:
¡¡¡¡1.2 Qt/EmbeddedµÄʼþÇý¶¯»ù´¡
¡¡¡¡Qt/EmbeddedÖÐÓëÓû§ÊäÈëʼþÏà¹ØµÄÐźţ¬Êǽ¨Á¢ÔڶԵײãÊäÈëÉ豸µÄ½Ó¿Úµ÷ÓÃÖ®Éϵġ£Qt/EmbeddedÖеÄÊäÈëÉ豸£¬·ÖΪÊó±êÀàÓë¼üÅÌÀà¡£ÒÔ3.x°æ±¾ÏµÁÐΪÀý£¬ÆäÖÐÊó±êÉ豸µÄ³éÏó»ùÀàΪQWSMouse Handler£¬´Ó¸ÃÀàÓÖÖØÐÂÅÉÉú³öһЩ¾ßÌåµÄÊó±êÀàÉ豸µÄʵÏÖÀà¡£
¡¡¡¡ÔÚϵͳ¼ÓÔع¹ÔìQWSServerʱ£¬µ÷ÓÃQWSServer::openMouseÓëQWSServer::openKeyboardº¯Êý¡£ÕâÁ½¸öº¯Êý·Ö±ðµ÷ÓÃQmouseDriverFactory::create()ÓëQkbdDriverFactory::create()º¯Êý¡£Õâʱ»á¸ù¾ÝLinuxϵͳµÄ»·¾³±äÁ¿QWS_MOUSE_PROTOÓëQWS_KEYBOARD»ñµÃÊó±êÀàÉ豸ºÍ¼üÅÌÀàÉ豸µÄÉ豸ÀàÐͺÍÉ豸½Úµã¡£´ò¿ªÏàÓ¦É豸²¢·µ»ØÏàÓ¦É豸µÄ»ùÀà¾ä±úÖ¸Õë¸øϵͳ£¬ÏµÍ³Í¨¹ý½«¸Ã»ùÀàÖ¸ÁîÇ¿ÖÆת»»Îª¶ÔÓ¦µÄ¾ßÌå×ÓÀàÉ豸ָÕ룬»ñµÃ¶Ô¾ßÌåÊó±êÀàÉ豸ºÍ¼üÅÌÀàÉ豸µÄµ÷ÓòÙ×÷¡£
¡¡¡¡ÖµµÃ×¢ÒâµÄÊÇ£¬ËäÈ»¼¸ºõÊó±êÀàÉ豸µÄ¹¦ÄÜÉÏ»ù±¾Ò»Ö£¬µ«ÓÉÓÚ´¥ÃþÆÁºÍÊó±êµ×²ã½Ó¿Ú²¢²»Ò»Ñù£¬»áÔì³É¶ÔÉϲã½Ó¿ÚµÄ²»Ò»Ö¡£¾ÙÀýÀ´½²£¬´ÓÊó±êÇý¶¯½Ó¿ÚÖм¸ºõ²»»áµÃµ½¾ø¶ÔλÖÃÐÅÏ¢£¬Ò»°ãÖ»»á¶Áµ½Ïà¶ÔÒƶ¯Á¿¡£ÁíÍ⣬Êó±êµÄÒƶ¯ËÙ¶ÈÒ²ÐèÒª¿¼ÂÇÔÚÄÚ£¬¶ø´¥ÃþÆÁ½Ó¿ÚÔò¼¸ºõÊÇÇåһɫµÄ¾ø¶ÔλÖÃÐÅÏ¢ºÍѹÁ¦ÐÅÏ¢¡£Õë¶Ô´ËÀà²î±ð£¬Qt/Embedded½«Í¬Ò»ÀàÉ豸µÄ½Ó¿Ú²¿·ÖÒ²¸øÓèÇø±ðºÍ³éÏ󣬾ßÌåʵÏÖÔÚQmouseDriverInterfaceÀàÖС£¼üÅÌÀàÉ豸Ҳ´æÔÚÀàËÆÎÊÌ⣬ͬÑùÒýÈëÁËQkbdDriver IntefaceÀ´½â¾ö¡£¾ßÌåʵÏÖ´Ë´¦Ôݲ»¶àÊö¡£
¡¡¡¡2 Qt/EmbeddedµÄÒÆÖ²ÓëÓ¦ÓÃ
¡¡¡¡Õë¶ÔQt/EmbeddedµÄʵÏÖÌص㣬ÒÆÖ²¸ÃǶÈëʽGUIϵͳһ°ã·ÖΪÒÔϼ¸¸ö²½Ö裺
¡¡¡¡¢ÙÉè¼ÆÓ²¼þ¿ª·¢Æ½Ì¨£¬²¢ÒÆÖ²Linux²Ù×÷ϵͳ£»
¡¡¡¡¢Ú²ÉÓþ²Ì¬Á´½Ó½øLinuxÄں˵ķ½Ê½£¬¸ù¾Ý¸Ãƽ̨ÏÔʾÉ豸µÄÏÔʾÄÜÁ¦£¬¿ª·¢framebufferÇý¶¯³ÌÐò£»
¡¡¡¡¢Û¿ª·¢Õë¶Ô¸Ãƽ̨µÄÊó±êÀàÉ豸Çý¶¯³ÌÐò£¬Ò»°ãΪ´¥ÃþÆÁ»òUSBÊó±ê£»
¡¡¡¡¢Ü¿ª·¢Õë¶Ô¸Ãƽ̨µÄ¼üÅÌÀàÉ豸Çý¶¯³ÌÐò£¬Ò»°ãΪ°åÔØ°´Å¥»òUSB¼üÅÌ£¨¸Ã²¿·Ö¿ÉÑ¡£©£»
¡¡¡¡¢Ý¸ù¾ÝframebufferÇý¶¯³ÌÐò½Ó¿Ú£¬Ñ¡Ôñ²¢ÐÞ¸ÄQt/EmbeddedÖеÄQlinuxFbScreenºÍQgfxRasterÀࣻ
¡¡¡¡¢Þ¸ù¾ÝÊó±êÀàÉ豸Çý¶¯³ÌÐò£¬ÊµÏÖ¸ÃÀàÉ豸ÔÚQt/EmbeddedÖеIJÙ×÷½Ó¿Ú£»
¡¡¡¡¢ß¸ù¾Ý¼üÅÌÀàÉ豸Çý¶¯³ÌÐò£¬ÊµÏÖ¸ÃÀàÉ豸ÔÚQt/EmbeddedÖеIJÙ×÷½Ó¿Ú£¨¸Ã²¿·Ö¿ÉÑ¡£©£»
¡¡¡¡¢à¸ù¾ÝÐèҪѡÔñQt/EmbeddedµÄÅäÖÃÑ¡Ï½»²æ±àÒëQt/EmbeddedµÄ¶¯Ì¬¿â£»
¡¡¡¡¢á½»²æ±àÒëQt/EmbeddedÖеÄExample²âÊÔ³ÌÐò£¬ÔÚÄ¿±êƽ̨ÉÏÔËÐвâÊÔ¡£
¡¡¡¡FramebufferÉ豸Çý¶¯³ÌÐòÌṩ³öµÄ½Ó¿ÚÊDZê×¼µÄ£¬³ýÁË×¢ÒâendianÎÊÌâÍ⣬ÅäÖÃQt/EmbeddedʱѡÔñÏàÓ¦µÄÉ«²ÊÉî¶ÈÖ§³Ö¼´¿É£¬Òò´Ë¸Ã²¿·ÖµÄÒÆÖ²Äѵã¾ÍÔÚÓÚframebufferÇý¶¯³ÌÐòµÄʵÏÖ¡£Qt/Embedded²¿·ÖµÄQWSServer´ò¿ª/dev/ÖеÄframebufferÉ豸ºó¶Á³öÏàÓ¦µÄÏÔʾÄÜÁ¦£¨ÆÁÄ»³ß´ç¡¢ÏÔʾɫ²ÊÉî¶È£©£¬Ä£°åQgfxRaster½«¸ù¾ÝÉ«²ÊÉî¶ÈÔÚÓû§¿Õ¼äÉ豸´´½¨³öÓëÏÔʾ»º´æͬÑù´óСµÄ»º³å×÷Ϊ˫»º³å£¬²¢²ÉÓÃÕýÈ··½Ê½½øÐÐÏÔʾ¡£
¡¡¡¡2.1 ÔÚPXA255ƽ̨ÉÏÒÆÖ²ºÍÓ¦ÓÃ
¡¡¡¡ÔÚ±ÊÕß²ÎÓëÉè¼ÆµÄijSmart-Phone¿ª·¢Æ½Ì¨ÖУ¬GUIϵͳʵÏÖ·½°¸²ÉÓÃÁËQt/Embedded 2.3.7ºÍQtopia 1.7.0£¨»ùÓÚQt/Embedded 2.xϵÁеÄÊÖ³ÖÌ×¼þ£©£¬Ó²¼þƽ̨²ÉÓÃÁË»ùÓÚIntel XScale PXA255´¦ÀíÆ÷µÄǶÈëʽ¿ª·¢ÏµÍ³¡£¸Ã¿ª·¢ÏµÍ³²ÉÓÃ640¡Á480·Ö±æÂʵÄTFT LCDºÍPXA255ÄÚ²¿LCD¿ØÖÆÄ£¿é×÷ΪÏÔʾÉ豸£¬ADS7846N×÷ΪÍⲿµç×èʽ´¥ÃþÆÁ¿ØÖÆÆ÷£»ÁíÍ⣬²ÉÓÃÁËÎå·½Ïò°´¼ü×÷Ϊ°åÔؼüÅÌ¡£ÓÉÓÚ¸Ãϵͳ²ÉÓÃÁËISP1161×÷ΪUSB Host¿ØÖÆÆ÷£¬½ÏºÃµØÖ§³ÖÁËUSB½Ó¿ÚµÄ¼üÅ̺ÍÊó±ê£¬²Ù×÷ϵͳΪARM Linux 2.4.19¡£²Î¿¼Linux 2.4.19ÄÚºËĿ¼drivers/input²¿·Ö£¬¿ÉÒÔ°´ÕÕ±ê×¼ÄÚºËÖÐinput device½Ó¿ÚÉè¼ÆʵÏÖ´¥ÃþÆÁºÍ¼üÅÌ£¬ÔÚʵÏÖÁË»ùÓÚISP1161µÄEHCIÇý¶¯³ÌÐòºó£¬ÒÆÖ²±ê×¼µÄUSB½Ó¿ÚµÄÈË»ú½çÃæÉ豸Çý¶¯HIDºÍUSB¼üÅÌ¡¢Êó±êµÄÇý¶¯³ÌÐòºó£¬¿ÉÒÔ»ñµÃ¶ÔÓÚ¸ÃÀàÉ豸µÄµ÷Óýӿڡ£´Ë¹ý³Ì²»Êô±¾ÎÄÌÖÂÛ·¶³ë£¬´Ë´¦Ôݲ»¶àÊö¡£