zoukankan      html  css  js  c++  java
  • emWin使用外部SRAM的方法

    转载请注明地址:http://blog.csdn.net/zsy2020314/article/details/9313093

         我用的是stm32,加了1MB的外部SRAM,在使用emWin的时候,将一部分内存分配给emWin使用。其实方法很简单,传入SRAM数据总线地址即可,数据位宽我采用16bit,因为使用的SRAM是16bit的,这样做比较合适。如果是在ARM9及以上的平台上使用,依葫芦画瓢的把DDRAM的物理地址传入emWin即可,不过地址位宽一般是32位的,大小由自己决定。

    [cpp] view plaincopy
     
    1. /********************************************************************* 
    2. *                SEGGER Microcontroller GmbH & Co. KG                * 
    3. *        Solutions for real time microcontroller applications        * 
    4. ********************************************************************** 
    5. *                                                                    * 
    6. *        (c) 1996 - 2013  SEGGER Microcontroller GmbH & Co. KG       * 
    7. *                                                                    * 
    8. *        Internet: www.segger.com    Support:  support@segger.com    * 
    9. *                                                                    * 
    10. ********************************************************************** 
    11.  
    12.  
    13. ** emWin V5.18 - Graphical user interface for embedded applications ** 
    14. All  Intellectual Property rights  in the Software belongs to  SEGGER. 
    15. emWin is protected by  international copyright laws.  Knowledge of the 
    16. source code may not be used to write a similar product.  This file may 
    17. only be used in accordance with the following terms: 
    18.  
    19.  
    20. The software has been licensed to  NXP Semiconductors USA, Inc.  whose 
    21. registered  office  is  situated  at 411 E. Plumeria Drive, San  Jose, 
    22. CA 95134, USA  solely for  the  purposes  of  creating  libraries  for 
    23. NXPs M0, M3/M4 and  ARM7/9 processor-based  devices,  sublicensed  and 
    24. distributed under the terms and conditions of the NXP End User License 
    25. Agreement. 
    26. Full source code is available at: www.segger.com 
    27.  
    28.  
    29. We appreciate your understanding and fairness. 
    30. ---------------------------------------------------------------------- 
    31. File        : GUIConf.c 
    32. Purpose     : Display controller initialization 
    33. ---------------------------END-OF-HEADER------------------------------ 
    34. */  
    35.   
    36.   
    37. #include "GUI.h"  
    38. #include "SRAM_Driver.h"  
    39. /********************************************************************* 
    40. * 
    41. *       Defines 
    42. * 
    43. ********************************************************************** 
    44. */  
    45. //  
    46. // Define the available number of bytes available for the GUI  
    47. //  
    [cpp] view plaincopy
     
    1. #define Bank1_SRAM3_ADDR    ((u32)0x68000000)  
    [cpp] view plaincopy
     
    1. #define GUI_NUMBYTES  (1024*700)  
    2. //  
    3. // Define the average block size  
    4. //  
    5. #define GUI_BLOCKSIZE 0x80  
    6.   
    7.   
    8. /********************************************************************* 
    9. * 
    10. *       Public code 
    11. * 
    12. ********************************************************************** 
    13. */  
    14. /********************************************************************* 
    15. * 
    16. *       GUI_X_Config 
    17. * 
    18. * Purpose: 
    19. *   Called during the initialization process in order to set up the 
    20. *   available memory for the GUI. 
    21. */  
    22. void GUI_X_Config(void) {  
    23.   //  
    24.   // 16 bit aligned memory area  
    25.   //  
    26.    volatile U16* aMemory = (volatile U16*)(Bank1_SRAM3_ADDR);  
    27.   //  
    28.   // Assign memory to emWin  
    29.   //  
    30.   GUI_ALLOC_AssignMemory((void*)aMemory, GUI_NUMBYTES);  
    31.   GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE);  
    32.   //  
    33.   // Set default font  
    34.   //  
    35.   GUI_SetDefaultFont(GUI_FONT_6X8);  
    36. }  
    37.   
    38.   
    39. /*************************** End of file ****************************/  
  • 相关阅读:
    org.apache.hadoop.hbase.MasterNotRunningException解决策略
    工作小记
    JSP_运维_JSP项目部署到server(适合0经验新手)
    ubuntu 12.04下编译安装nginx-1.9.3
    理解“属性”
    解密SVM系列(二):SVM的理论基础
    AlphaGo论文的译文,用深度神经网络和树搜索征服围棋:Mastering the game of Go with deep neural networks and tree search
    SOAPUI 測试Http 协义
    JavaScript深入系列15篇
    javascript运行机制之执行顺序详解
  • 原文地址:https://www.cnblogs.com/xidongs/p/3536861.html
Copyright © 2011-2022 走看看