اطلاعیه

Collapse
No announcement yet.

emwin روی برد اموزشی.حتما امتحان کنید

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    #76
    پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

    نوشته اصلی توسط arvin2009
    پروژه کامل emWin به صورت مولتی تسک با سیستم عامل RTX را از لینک زیر دریافت کنید.مشکل ارور ها حل شد.فقط یک ارور در فایل RTX_LIB
    در خط 52 وجود دارد که بجای کامه ای که میگه تعریف نشده عدد 4 رو بگدارید.علتش رو اگه کسی میدونه بگه
    http://www.uplooder.net/cgi-bin/dl.cgi?key=c0a546d77f3dca183368c5e424a18478
    سلام
    ضمن تشکر از زحمتی که برای تهیه این پروژه کشیدین
    مطابق شکل زیر اگر بخوایم داخل یکی از task ها این شکل رو نشون بدیم باید کد خروجی GUIBuilder چطور به پروژه اضافه کنیم


    دیدگاه


      #77
      پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

      مرسی
      شما بدون سیستم عامل تونستید این عکس رو نشون بدید؟
      اگه جواب منفی است بهتر است از EMWIN اول بدون سیستم عامل استفاده کنی

      دیدگاه


        #78
        پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

        راستش من فقط 2 تا سمپلی که شما گذاشتین رو تست کردام و هنوز دارم تو فضا برا خودم میچرخم > > > >

        شما این مثال RTX رو با GUIBuilder درست کردین یا نه چون من تمام فایلهای داخل پوشه رو با GUIBuilder سعی کردام باز کنم نشد

        دیدگاه


          #79
          پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

          نه عزیز در emwin این کار به دو طریق صورت میگیرد که یکیش اون نرم افزار هست.بهتر است با دیتا شیت همراه شوی و گام به گام جلو بری.مطالب زیاد و فرار هست

          دیدگاه


            #80
            پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

            توی این آدرس یه مثال هست اگه ممکنه یه نگاه بهش بندازین
            http://www.keil.com/appnotes/docs/apnt_234.asp
            آیا امکان پورت کردن این مثال برای 1768 وجود داره؟

            دیدگاه


              #81
              پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

              من بعد این که emwin یا همون ucGUI (دوتاشون یکین) رو راه انداختم رفتم سراغ تاچ ولی متاسفانه اصلا تعریفی نداره! نه دقت داره و نه سرعت (سرعتش که اندازه uCGUI 3.90 شده)
              یه مسئله دیگه هم هنگ کردنای بی موردشه که فقط موقع استفاده از تاچ اتفاق میفته. با ADS هم این مشکلات وجود داره یا فقط ADC اینجوریه؟

              دیدگاه


                #82
                پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                نوشته اصلی توسط PLASMA
                من بعد این که emwin یا همون ucGUI (دوتاشون یکین) رو راه انداختم رفتم سراغ تاچ ولی متاسفانه اصلا تعریفی نداره! نه دقت داره و نه سرعت (سرعتش که اندازه uCGUI 3.90 شده)
                یه مسئله دیگه هم هنگ کردنای بی موردشه که فقط موقع استفاده از تاچ اتفاق میفته. با ADS هم این مشکلات وجود داره یا فقط ADC اینجوریه؟
                برای adc میکرو هست شما از ads یا مشابه استفاده کنی عالی میشه.ولی اگه از سمپلی که من گداشتم استفاده میکنی باید عوض کنی

                دیدگاه


                  #83
                  پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                  نوشته اصلی توسط mahdi421
                  توی این آدرس یه مثال هست اگه ممکنه یه نگاه بهش بندازین
                  http://www.keil.com/appnotes/docs/apnt_234.asp
                  آیا امکان پورت کردن این مثال برای 1768 وجود داره؟
                  من یک نگاه سطی کردم فکر نمیکنم مشکلی داشته باشه فقط شما باید ال سی دی و تاچ رو روش بسته به مداری که داری تغیرش بدی یا فایل مین و فایل بعدیش رو بیاری رو سمپلی که گداشتم اجراش کنی

                  دیدگاه


                    #84
                    پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                    راستی آقا آروین، من یه چیزی فهمیدم و اونم اینه که خود emWin درایور تاچ آنالوگ رو داره :wow: مثل این که فقط ما باید خروجی تاچ رو یه بار بخونیم (بدون محاسبه x و y) و بعد به ام وین بدیم!
                    بعدش با یه بار کالیبره کردن خودش مختصاتو حساب میکنه!
                    البته من دنبال ADS هم هستم.(خوشبختانه تو نسخه 5.24 این آیسی به صورت داخلی پشتیبانی میشه)


                    فقط حیف که سورس ام وین پولیه... وگرنه میشد خیلی بیشتر باهاش کار کرد و توابعی رو بهش اضافه کرد(گرچه سورسش خیلی پیچیدس)


                    تا پس فردا بهتون خبر میدم.

                    دیدگاه


                      #85
                      پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                      راستی لایبرری تاچ من برای LCD 3.2 هست ولی برای من 2.8. تائیر داره؟

                      دیدگاه


                        #86
                        پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                        تو BSP 1788 همه چیز برای تاچ بود.

                        برای بالا رفتن سرعت رفرش باید این کدو در فایل HWConf.c بذارید (البته بگم که این کد هارو از HWConf LPC1788 کپی کردم و خودم ننوشتم)
                        روشی که از تایمر استفاده کرده بود جلوی emwin رو میگرفت و باعث هنگ کردنش میشد ولی این روش رو خود فیلیپس استفاده کرده و سرعت LCD فقط 111000 پیکسل افت کرد.
                        نیازی به ADS هم نیست (البته برای دقت بیشتر پیشنهاد میشه)
                        اگه قبلا تابع Main رو برای تاچ دستکاری کردین پاکش کنید.
                        بعد این قسمت رو در قسمت defines کپی کنید
                        [code=c]
                        #define TOUCH_TIMER_INTERVAL 10
                        [/code]
                        بعد این رو جایگزین سیس تیک خودتون کنید.
                        [code=c]
                        void SysTick_Handler(void) {
                        static int TouchCnt = 0;


                        if (TouchCnt == TOUCH_TIMER_INTERVAL) {
                        TouchTask();
                        TouchCnt = 0;
                        } else {
                        TouchCnt++;
                        }
                        TimeMS++;
                        }
                        [/code]

                        دیدگاه


                          #87
                          پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                          بله با تایمر tick هم میشه و فرق زیادی نداره چون بازم موس پرش داره و دقت کافی نداره.من کلی روش پیاده کردم روی تاچ ولی بخاطر adc دقیق درنمباد.شما اگه از سیستم عامل استفاده کنی اصلا احتیاج به تایمر هم نداربی
                          فقظ کافیه تابع مربوطه رو توی یک تسک بزاری

                          دیدگاه


                            #88
                            پاسخ : پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                            نوشته اصلی توسط arvin2009
                            بله با تایمر tick هم میشه و فرق زیادی نداره چون بازم موس پرش داره و دقت کافی نداره.من کلی روش پیاده کردم روی تاچ ولی بخاطر adc دقیق درنمباد.شما اگه از سیستم عامل استفاده کنی اصلا احتیاج به تایمر هم نداربی
                            فقظ کافیه تابع مربوطه رو توی یک تسک بزاری
                            بله ولی این سرعتش بیشتره.
                            سیستم عامل هم خوبه ولی من همین الانش کمبود حافظه دارم :cry:


                            نمیدونم چرا Keil قاطی کرده و بعد هر بار بستن پروژه باید یکی دیگه بسازم وگرنه کامپایل نمیشه :sad:

                            دیدگاه


                              #89
                              پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                              راه اندازی ili9325 یا همون LCD n96

                              [/glow]
                              کافیه این فایل هارو اضافه کنید:
                              LCD_X_ILI9325.h:
                              [code=c]
                              //ILI9325 Low level communication routines//


                              #ifndef LCD_X_ELT240320_H
                              #define LCD_X_ELT240320_H
                              #endif


                              /* Includes ------------------------------------------------------------------*/
                              //ifndef WIN32


                              #include "LPC17xx.h"




                              /* LCD Interface */
                              //#define PIN_EN (1 << 19) Not used for ILI9320/5, so not defined!
                              //#define PIN_LE (1 << 20) Not used for ILI9320/5, so not defined!
                              //#define PIN_DIR (1 << 13) Not used for ILI9320/5, so not defined!
                              #define LCS 17
                              #define LRS 18
                              #define LWR 19
                              #define LRD 20
                              #define LRST 21
                              #define LCD_Offset 15
                              #define PIN_CS (1 << LCS)
                              #define PIN_RS (1 << LRS)
                              #define PIN_WR (1 << LWR)
                              #define PIN_RD (1 << LRD)
                              #define PIN_RST (1 << LRST)
                              //#define LCD_DBPort LPC_GPIO1 Not Supported but default Port is PORT1
                              //#define LCD_CPort LPC_GPIO0 Not Supported but default Port is PORT0


                              //#define LCD_EN(x) ((x) ? (LPC_GPIO2->FIOSET = PIN_EN) : (LPC_GPIO2->FIOCLR = PIN_EN)); Not used for ILI9320/5
                              //#define LCD_LE(x) ((x) ? (LPC_GPIO2->FIOSET = PIN_LE) : (LPC_GPIO2->FIOCLR = PIN_LE)); Not used for ILI9320/5
                              //#define LCD_DIR(x) ((x) ? (LPC_GPIO2->FIOSET = PIN_DIR) : (LPC_GPIO2->FIOCLR = PIN_DIR));Not used for ILI9320/5
                              #define LCD_CS_CLR LPC_GPIO0->FIOCLR = PIN_CS
                              #define LCD_RS_CLR LPC_GPIO0->FIOCLR = PIN_RS
                              #define LCD_WR_CLR LPC_GPIO0->FIOCLR = PIN_WR
                              #define LCD_RD_CLR LPC_GPIO0->FIOCLR = PIN_RD
                              #define LCD_RST_CLR LPC_GPIO0->FIOCLR = PIN_RST


                              #define LCD_CS_SET LPC_GPIO0->FIOSET = PIN_CS
                              #define LCD_RS_SET LPC_GPIO0->FIOSET = PIN_RS
                              #define LCD_WR_SET LPC_GPIO0->FIOSET = PIN_WR
                              #define LCD_RD_SET LPC_GPIO0->FIOSET = PIN_RD
                              #define LCD_RST_SET LPC_GPIO0->FIOSET = PIN_RST


                              void LCD_X_Init(void);
                              void LCD_X_Write00_16(U16 c);
                              void LCD_X_Write01_16(U16 c);
                              U16 LCD_X_Read01_16(void);
                              void LCD_X_WriteM01_16(U16 * pData, int NumWords);
                              void LCD_X_ReadM01_16(U16 * pData, int NumWords);
                              //#endif
                              [/code]
                              [/size]
                              [/size]LCD_X_ILI9325.c
                              [code=c]

                              /************************************************** *******************
                              * SEGGER Microcontroller GmbH & Co. KG *
                              * Solutions for real time microcontroller applications *
                              ************************************************** ********************
                              * *
                              * (c) 1996 - 2012 SEGGER Microcontroller GmbH & Co. KG *
                              * *
                              * Internet: www.segger.com Support: support@segger.com *
                              * *
                              ************************************************** ********************


                              ** emWin V5.16 - Graphical user interface for embedded applications **
                              All Intellectual Property rights in the Software belongs to SEGGER.
                              emWin is protected by international copyright laws. Knowledge of the
                              source code may not be used to write a similar product. This file may
                              only be used in accordance with the following terms:


                              The software has been licensed to ARM LIMITED whose registered office
                              is situated at 110 Fulbourn Road, Cambridge CB1 9NJ, England solely
                              for the purposes of creating libraries for ARM7, ARM9, Cortex-M
                              series, and Cortex-R4 processor-based devices, sublicensed and
                              distributed as part of the MDK-ARM Professional under the terms and
                              conditions of the End User License supplied with the MDK-ARM
                              Professional.
                              Full source code is available at: www.segger.com


                              We appreciate your understanding and fairness.
                              ----------------------------------------------------------------------
                              File : LCD_X_ILI9325.c
                              Purpose : Port routines for ILI9325
                              ----------------------------------------------------------------------
                              */


                              #include "GUI.h"
                              #include <LPC17xx.h>


                              #include "LCD_X_ILI9325.h"
                              /************************************************** *******************
                              *
                              * Hardware configuration
                              *
                              ************************************************** ********************
                              */




                              /************************************************** *******************
                              *
                              * Static data
                              *
                              ************************************************** ********************
                              */


                              //static unsigned short DevID; /* Device ID */




                              /************************************************** *******************
                              *
                              * Static code
                              *
                              ************************************************** *******************
                              */










                              /************************************************** *******************
                              *
                              * Exported code
                              *
                              ************************************************** *******************
                              */


                              __asm void wait()
                              {
                              nop
                              BX lr
                              }






                              void wait_ms(int count)
                              {
                              unsigned long counter = count ;
                              counter *= 10000;
                              while(counter--);
                              }


                              void wait_delay(int count)
                              {
                              while(count--);
                              }


                              //-----------------------------------------------------------------------
                              /*void tftlcd_clear(void)
                              {
                              tftlcd_fill(0xFFFFFF);


                              }*/


                              /************************************************** *******************
                              *
                              * LCD_X_Init
                              *
                              * Purpose:
                              * This routine should be called from your application program
                              * to set port pins to their initial values
                              */
                              void LCD_X_Init(void) {
                              LPC_GPIO1->FIODIR |= (0xFFFF << 15); // output
                              LPC_GPIO0->FIODIR |= (1 << LRST) | (1 << LRS) | (1 << LCS) | (1 << LWR) | (1 << LRD);
                              LPC_GPIO0->FIOSET = (1 << LRST) | (1 << LCS) | (1 << LRD);
                              LPC_GPIO0->FIOCLR = (1 << LWR);




                              // Reset LCD Chipset
                              LCD_RST_CLR;
                              wait();
                              LCD_RST_SET;
                              wait();


                              }


                              /************************************************** *******************
                              *
                              * LCD_X_Write00_16
                              *
                              * Purpose:
                              * Write to controller, with A0 = 0
                              */
                              void LCD_X_Write00_16(U16 c) {
                              LCD_CS_CLR;
                              LCD_RS_CLR;
                              LCD_RD_SET;
                              LPC_GPIO1->FIODIR |= (0xFFFF << LCD_Offset);
                              LPC_GPIO1->FIOCLR = (0xFFFF << LCD_Offset);
                              LPC_GPIO1->FIOSET = (c << LCD_Offset);
                              wait();
                              wait();
                              LCD_WR_CLR;
                              wait();
                              LCD_WR_SET;
                              LCD_CS_SET;
                              }


                              /************************************************** *******************
                              *
                              * LCD_X_Write01_16
                              *
                              * Purpose:
                              * Write to controller, with A0 = 1
                              */


                              void LCD_X_Write01_16(U16 c) {


                              LCD_CS_CLR;
                              LCD_RS_SET;
                              LPC_GPIO1->FIODIR |= (0xFFFF << LCD_Offset);
                              LPC_GPIO1->FIOCLR = (0xFFFF << LCD_Offset);
                              LPC_GPIO1->FIOSET = (c << LCD_Offset);
                              wait();
                              LCD_WR_CLR;
                              wait();
                              LCD_WR_SET;
                              LCD_CS_SET;


                              }


                              /************************************************** *******************
                              *
                              * LCD_X_Read01_16
                              *
                              * Purpose:
                              * Read from controller, with A0 = 1
                              */
                              U16 LCD_X_Read01_16(void) {
                              int id;
                              uint16_t value;

                              LCD_CS_CLR;
                              LCD_RS_SET;
                              LCD_WR_SET;
                              LCD_RD_CLR;
                              LPC_GPIO1->FIODIR &= (~(0xFFFF << LCD_Offset));
                              wait();
                              value = ((LPC_GPIO1->FIOPIN & (0xFFFF << LCD_Offset)>>15));
                              LCD_RD_SET;
                              LCD_CS_SET;

                              return value;
                              }


                              /************************************************** *******************
                              *
                              * LCD_X_WriteM01_16
                              *
                              * Purpose:
                              * Write multiple bytes to controller, with A0 = 1
                              */
                              void LCD_X_WriteM01_16(U16 * pData, int NumWords) {


                              for (; NumWords; NumWords--) {
                              LCD_X_Write01_16(*pData);pData++; }
                              }


                              /************************************************** *******************
                              *
                              * LCD_X_ReadM01_16
                              *
                              * Purpose:
                              * Read multiple bytes from controller, with A0 = 1
                              */
                              void LCD_X_ReadM01_16(U16 * pData, int NumWords) {
                              uint16_t value;


                              for (; NumWords; NumWords--)
                              {
                              LPC_GPIO1->FIODIR &= (~(0xFFFF << LCD_Offset));
                              wait();
                              LCD_CS_CLR;
                              LCD_RS_SET;
                              LCD_WR_SET;
                              LCD_RD_CLR;
                              wait();
                              *pData = ((LPC_GPIO1->FIOPIN & (0xFFFF << LCD_Offset))>>LCD_Offset);
                              pData++;
                              LCD_RD_SET;
                              LCD_CS_SET;
                              }


                              }


                              /*************************** End of file ****************************/


                              [/code]
                              LCDConf.c
                              [code=c]

                              /************************************************** **************************
                              * @file LCDConf.c
                              * @brief Display controller configuration
                              * @version 1.0
                              * @date 09. May. 2012
                              *
                              * @note
                              * Copyright (C) 2012 NXP Semiconductors(NXP), All rights reserved.
                              */


                              #include "GUI.h"
                              #include "LCD_X_ILI9325.h"


                              #ifndef _WINDOWS
                              #include "GUIDRV_FlexColor.h"
                              #endif


                              /************************************************** *******************
                              *
                              * Layer configuration
                              *
                              ************************************************** ********************
                              */
                              //
                              // Color depth
                              //
                              #define LCD_BITSPERPIXEL 18 /* Currently the values 16 and 18 are supported */
                              //
                              // Physical display size
                              //
                              #define XSIZE_PHYS 320
                              #define YSIZE_PHYS 240
                              #define GUI_TOUCH_AD_TOP 877
                              #define GUI_TOUCH_AD_BOTTOM 273
                              #define GUI_TOUCH_AD_LEFT 232
                              #define GUI_TOUCH_AD_RIGHT 918
                              //
                              // Color conversion
                              //
                              #define COLOR_CONVERSION GUICC_565


                              //
                              // Display driver
                              //
                              #define DISPLAY_DRIVER GUIDRV_FLEXCOLOR


                              //
                              // Orientation
                              //
                              //#define DISPLAY_ORIENTATION (0)
                              //#define DISPLAY_ORIENTATION (GUI_MIRROR_X)
                              //#define DISPLAY_ORIENTATION (GUI_MIRROR_Y)
                              //#define DISPLAY_ORIENTATION (GUI_MIRROR_X | GUI_MIRROR_Y)
                              #define DISPLAY_ORIENTATION (GUI_SWAP_XY)
                              //#define DISPLAY_ORIENTATION (GUI_MIRROR_X | GUI_SWAP_XY)
                              //#define DISPLAY_ORIENTATION (GUI_MIRROR_Y | GUI_SWAP_XY)
                              //#define DISPLAY_ORIENTATION (GUI_MIRROR_X | GUI_MIRROR_Y | GUI_SWAP_XY)


                              /************************************************** *******************
                              *
                              * Configuration checking
                              *
                              ************************************************** ********************
                              */
                              #ifndef VXSIZE_PHYS
                              #define VXSIZE_PHYS XSIZE_PHYS
                              #endif
                              #ifndef VYSIZE_PHYS
                              #define VYSIZE_PHYS YSIZE_PHYS
                              #endif
                              #ifndef XSIZE_PHYS
                              #error Physical X size of display is not defined!
                              #endif
                              #ifndef YSIZE_PHYS
                              #error Physical Y size of display is not defined!
                              #endif
                              #ifndef COLOR_CONVERSION
                              #error Color conversion not defined!
                              #endif
                              #ifndef DISPLAY_DRIVER
                              #error No display driver defined!
                              #endif
                              #ifndef DISPLAY_ORIENTATION
                              #define DISPLAY_ORIENTATION 0
                              #endif


                              /************************************************** *******************
                              *
                              * Static code
                              *
                              ************************************************** ********************
                              */


                              #define wr_reg(reg, data) LCD_X_Write00_16(reg); LCD_X_Write01_16(data);


                              /************************************************** *******************
                              *
                              * _InitController
                              *
                              * Purpose:
                              * Initializes the display controller
                              */
                              static void _InitController(void) {
                              #ifndef WIN32


                              GUI_X_Delay(10);
                              LCD_X_Init();
                              GUI_X_Delay(10);


                              /* Start Initial Sequence ------------------------------------------------*/
                              wr_reg(0x01, 0x0100); /* Set SS bit */
                              wr_reg(0x02, 0x0700); /* Set 1 line inversion */
                              wr_reg(0x04, 0x0000); /* Resize register */
                              wr_reg(0x08, 0x0207); /* 2 lines front, 7 back porch */
                              wr_reg(0x09, 0x0000); /* Set non-disp area refresh cyc ISC */
                              wr_reg(0x0A, 0x0000); /* FMARK function */
                              wr_reg(0x0C, 0x0000); /* RGB interface setting */
                              wr_reg(0x0D, 0x0000); /* Frame marker Position */
                              wr_reg(0x0F, 0x0000); /* RGB interface polarity */


                              /* Power On sequence -----------------------------------------------------*/
                              wr_reg(0x10, 0x0000); /* Reset Power Control 1 */
                              wr_reg(0x11, 0x0000); /* Reset Power Control 2 */
                              wr_reg(0x12, 0x0000); /* Reset Power Control 3 */
                              wr_reg(0x13, 0x0000); /* Reset Power Control 4 */
                              GUI_X_Delay(200); /* Discharge cap power voltage (200ms)*/
                              wr_reg(0x10, 0x12B0); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
                              wr_reg(0x11, 0x0007); /* DC1[2:0], DC0[2:0], VC[2:0] */
                              GUI_X_Delay(50); /* Delay 50 ms */
                              wr_reg(0x12, 0x01BD); /* VREG1OUT voltage */
                              GUI_X_Delay(50); /* Delay 50 ms */
                              wr_reg(0x13, 0x1400); /* VDV[4:0] for VCOM amplitude */
                              wr_reg(0x29, 0x000E); /* VCM[4:0] for VCOMH */
                              GUI_X_Delay(50); /* Delay 50 ms */
                              wr_reg(0x20, 0x0000); /* GRAM horizontal Address */
                              wr_reg(0x21, 0x0000); /* GRAM Vertical Address */
                              /* Adjust the Gamma Curve ------------------------------------------------*/
                              wr_reg(0x30, 0x0B0D);
                              wr_reg(0x31, 0x1923);
                              wr_reg(0x32, 0x1C26);
                              wr_reg(0x33, 0x261C);
                              wr_reg(0x34, 0x2419);
                              wr_reg(0x35, 0x0D0B);
                              wr_reg(0x36, 0x1006);
                              wr_reg(0x37, 0x0610);
                              wr_reg(0x38, 0x0706);
                              wr_reg(0x39, 0x0304);
                              wr_reg(0x3A, 0x0E05);
                              wr_reg(0x3B, 0x0E01);
                              wr_reg(0x3C, 0x010E);
                              wr_reg(0x3D, 0x050E);
                              wr_reg(0x3E, 0x0403);
                              wr_reg(0x3F, 0x0607);
                              /* Set GRAM area ---------------------------------------------------------*/
                              wr_reg(0x50, 0x0000); /* Horizontal GRAM Start Address */
                              wr_reg(0x51, (XSIZE_PHYS-1)); /* Horizontal GRAM End Address */
                              wr_reg(0x52, 0x0000); /* Vertical GRAM Start Address */
                              wr_reg(0x53, (YSIZE_PHYS-1)); /* Vertical GRAM End Address */


                              /* Set Gate Scan Line ----------------------------------------------------*/
                              wr_reg(0x60, 0x2700);
                              wr_reg(0x61, 0x0001); /* NDL,VLE, REV */
                              wr_reg(0x6A, 0x0000); /* Set scrolling line */


                              /* Partial Display Control -----------------------------------------------*/
                              wr_reg(0x80, 0x0000);
                              wr_reg(0x81, 0x0000);
                              wr_reg(0x82, 0x0000);
                              wr_reg(0x83, 0x0000);
                              wr_reg(0x84, 0x0000);
                              wr_reg(0x85, 0x0000);


                              /* Panel Control ---------------------------------------------------------*/
                              wr_reg(0x90, 0x0010);
                              wr_reg(0x92, 0x0000);
                              wr_reg(0x93, 0x0003);
                              wr_reg(0x95, 0x0110);
                              wr_reg(0x97, 0x0000);
                              wr_reg(0x98, 0x0000);
                              /* Set GRAM write direction
                              I/D=11 (Horizontal : increment, Vertical : increment) */
                              /* AM=1 (address is updated in vertical writing direction) */
                              wr_reg(0x03, 0x1038);
                              wr_reg(0x07, 0x0137); /* 262K color and display ON */
                              #endif
                              }


                              /************************************************** *******************
                              *
                              * Public code
                              *
                              ************************************************** ********************
                              */
                              /************************************************** *******************
                              *
                              * LCD_X_Config
                              *
                              * Purpose:
                              * Called during the initialization process in order to set up the
                              * display driver configuration.
                              *
                              */
                              void LCD_X_Config(void) {
                              GUI_DEVICE * pDevice;
                              GUI_PORT_API PortAPI;
                              CONFIG_FLEXCOLOR Config = {0};


                              //
                              // Set display driver and color conversion for 1st layer
                              //
                              #ifndef _WINDOWS
                              GUI_MULTIBUF_Config(80);
                              pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
                              #else
                              pDriver = GUIDRV_WIN32;
                              #endif
                              //
                              // Display driver configuration, required for Lin-driver
                              //
                              if (DISPLAY_ORIENTATION & GUI_SWAP_XY) {
                              LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
                              LCD_SetVSizeEx(0, VYSIZE_PHYS, VXSIZE_PHYS);
                              } else {
                              LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
                              LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
                              }
                              GUI_TOUCH_SetOrientation(GUI_MIRROR_X * LCD_GetMirrorX());
                              GUI_TOUCH_Calibrate(GUI_COORD_X,0,240,GUI_TOUCH_AD _TOP, GUI_TOUCH_AD_BOTTOM);
                              GUI_TOUCH_Calibrate(GUI_COORD_Y,0,320,GUI_TOUCH_AD _LEFT, GUI_TOUCH_AD_RIGHT);
                              //
                              // Function pointers for 8 bit interface
                              //
                              #ifndef _WINDOWS
                              PortAPI.pfWrite16_A0 = LCD_X_Write00_16;
                              PortAPI.pfWrite16_A1 = LCD_X_Write01_16;
                              PortAPI.pfWriteM16_A1 = LCD_X_WriteM01_16;
                              PortAPI.pfReadM16_A1 = LCD_X_ReadM01_16;


                              GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66708, GUIDRV_FLEXCOLOR_M16C0B16);


                              //
                              // Orientation
                              //


                              Config.Orientation = DISPLAY_ORIENTATION;
                              Config.NumDummyReads = 2; /* 5 dummy bytes are required when reading GRAM by SPI. 1 byte is read in LCD_X_SPI_WriteM01, so 4 bytes are left */
                              GUIDRV_FlexColor_Config(pDevice, &Config);
                              #endif
                              }


                              /************************************************** *******************
                              *
                              * LCD_X_DisplayDriver
                              *
                              * Purpose:
                              * This function is called by the display driver for several purposes.
                              * To support the according task the routine needs to be adapted to
                              * the display controller. Please note that the commands marked with
                              * 'optional' are not cogently required and should only be adapted if
                              * the display controller supports these features.
                              *
                              * Parameter:
                              * LayerIndex - Index of layer to be configured
                              * Cmd - Please refer to the details in the switch statement below
                              * pData - Pointer to a LCD_X_DATA structure
                              */
                              int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
                              int r;


                              GUI_USE_PARA(LayerIndex);
                              GUI_USE_PARA(pData);
                              switch (Cmd) {
                              //
                              // Required
                              //
                              case LCD_X_INITCONTROLLER: {
                              //
                              // Called during the initialization process in order to set up the
                              // display controller and put it into operation. If the display
                              // controller is not initialized by any external routine this needs
                              // to be adapted by the customer...
                              //
                              _InitController();

                              return 0;
                              }
                              default:
                              r = -1;
                              }
                              return r;
                              }


                              /*************************** End of file ****************************/


                              [/code]

                              دیدگاه


                                #90
                                پاسخ : emwin روی برد اموزشی.حتما امتحان کنید

                                نوشته اصلی توسط arvin2009
                                سلام.دوستان اینم پروژه emwin برای برد اموزشی.بریزید رو برد حالش رو ببرید. تشکر یادت نشه
                                پیوست شد

                                فایلهای مربوط به تاچ رو از لینک زیر بگیرید و به پروژه اضافه کنید

                                http://up.persianscript.ir/uploads/4431-touch-eca.rar




                                پروژه کامل emWin به صورت مولتی تسک با سیستم عامل RTX را از لینک زیر دریافت کنید.مشکل ارور ها حل شد.فقط یک ارور در فایل RTX_LIB
                                در خط 52 وجود دارد که بجای کامه ای که میگه تعریف نشده عدد 4 رو بگدارید.علتش رو اگه کسی میدونه بگه
                                http://www.uplooder.net/cgi-bin/dl.cgi?key=c0a546d77f3dca183368c5e424a18478
                                من توی این فایل RTX_lib.c در خط 52 کجاش رو تغییر بدم؟
                                کد:
                                U32 const os_timernum = (OS_TIMER << 16) | OS_TIMERCNT;

                                دیدگاه

                                لطفا صبر کنید...
                                X