1.在官方包的基础上修改管脚配置如下后:
const struct pio_desc hw_pio[] = { {"VSYNC", AT91C_PIN_PC(0), 0, PIO_DEFAULT, PIO_PERIPH_A}, {"HSYNC", AT91C_PIN_PC(1), 0, PIO_DEFAULT, PIO_PERIPH_A}, {"DOTCK", AT91C_PIN_PC(2), 0, PIO_DEFAULT, PIO_PERIPH_A}, {"EN", AT91C_PIN_PC(3), 0, PIO_DEFAULT, PIO_PERIPH_A}, {"D0", AT91C_PIN_PC(4), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D1", AT91C_PIN_PC(5), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D2", AT91C_PIN_PC(6), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D3", AT91C_PIN_PC(7), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D4", AT91C_PIN_PC(8), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D5", AT91C_PIN_PC(9), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D6", AT91C_PIN_PC(10), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D7", AT91C_PIN_PC(11), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D8", AT91C_PIN_PC(12), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D9", AT91C_PIN_PC(13), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D10", AT91C_PIN_PC(14), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D11", AT91C_PIN_PC(15), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D12", AT91C_PIN_PC(16), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D13", AT91C_PIN_PC(17), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D14", AT91C_PIN_PC(18), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"D15", AT91C_PIN_PC(19), 0, PIO_DEFAULT, PIO_PERIPH_B}, {"CC", AT91C_PIN_PB(9), 0, PIO_DEFAULT, PIO_PERIPH_B}, }; pio_setup(hw_pio, sizeof(hw_pio)/sizeof(struct pio_desc)); //screen contrl const struct pio_desc hw_pioe17[] = { {"LCD_POWEREN", AT91C_PIN_PE(17), 0, PIO_PULLUP, PIO_OUTPUT}, }; pio_setup(hw_pioe17, sizeof(hw_pioe17) / sizeof(struct pio_desc)); pio_set_value(AT91C_PIN_PE(17), 0);
2.修改注册表重新编译即可
[HKEY_LOCAL_MACHINE/System/GDI/ROTATION] "Angle"=dword:00 ; Video driver settings [HKEY_LOCAL_MACHINE/Drivers/Display/LCDC] ;the board does have 320x240 16 bpp color LCD "Width"=dword:140 "Height"=dword:F0 "Bpp"=dword:10 ; Bit per pixel "VRAMWidthInPixel"=dword:200 ; Frame buffer width in pixel (must be at least screen width value and also must match the 2DGE settings. keeping it aligned on 4 bytes allows not to care about the later) "VRAMHeightInPixel"=dword:200 ; Frame buffer heigth in pixel (must be at least screen height and more than twice for directdraw) "VRAMaddress"=dword:23e00000 ; Frame buffer location. Here allocate the video memory in SDRAM "VRAMBusWidth"=dword:20 ; SDRAM has a 32-bits bus width ; "VRAMaddress"=dword:300000 ; allocate the video memory in SRAM ; "VRAMBusWidth"=dword:20 ; SRAM has a 32-bits bus width ; "VRAMaddress"=dword:70000000 ; allocate the video memory in external PSRAM ; "VRAMBusWidth"=dword:10 ; external PSRAM has a 16-bits bus width "DisplayPowerClass"=multi_sz:"{EB91C7C9-8BF6-4a2d-9AB8-69724EED97D1}" "forceRGB"=dword:1 ; uncomment this line if you want to use DirectDraw, ; be careful, the color will be shifted ; "Cached"=dword:1 "UpperMargin"=dword:4 ; Value for Vertical Back Porch "LowerMargin"=dword:7 ; Value for Vertical Front Porch "LeftMargin"=dword:11 ; Value for Horizontal Back Porch "RightMargin"=dword:B ; Value for Horizontal Front Porch "Vsync"=dword:1 ; Value for Vertical Synchronization pulse width "Hsync"=dword:5 ; Value for Horizontal synchronization pulse width "PixelClock"=dword:8BC288 ; The pixel clock wanted [HKEY_LOCAL_MACHINE/system/gdi/monitors] "TOTAL MONITORS"=dword:1 [HKEY_LOCAL_MACHINE/System/GDI/Drivers] "Display"="at91sam9263ek_DDI.dll"
3.注意
可能会出现板子TFTLCD颜色显示不正常的情况,此时修改"forceRGB"=dword:1注册表项即可
----------------------------------------------------------------------------------
QQ:229425962
Email:[email protected]
----------------------------------------------------------------------------------