⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swim.c

📁 SHARP_ARM720T_LH79524/5软件开发包_支持TFT_LCD_NAND_FLASH_ETH_USB
💻 C
字号:
/**********************************************************************
 * Copyright (c) 2002 Sharp Microelectronics of the Americas
 *
 *        All rights reserved
 *      
 * $Workfile:   swim.c  $
 * $Revision:   1.0  $
 * $Author:   ZhangJ  $
 * $Date:   Oct 20 2004 09:16:06  $
 *
 * SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
 * OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
 * AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES, 
 * SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
 *
 * SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY 
 * FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A 
 * SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
 * FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
 *
 * Project: LH79524 SWIM Example Code
 *
 * Description:
 *    This example shows how to use SWIM (Sharp Windows GUI package) 
 *
 * Notes:
 *  
 * Revision History:
 * $Log:   //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh79524/bsps/sdk79524/examples/lcd_swim/swim.c-arc  $
 * 
 *    Rev 1.0   Oct 20 2004 09:16:06   ZhangJ
 * Initial revision.
 * 
 *    Rev 1.0   Aug 27 2004 09:13:50   ZhangJ
 * Initial revision.
 * 
 * 
 *********************************************************************/

#include "abl_swim.h"
#include "abl_swim_font.h" 
#include "abl_lcd_params.h"
#include "lh79524_chip.h"
#include "lh79524_clcdc_driver.h"

/* Board specific definition */
#define SDK79524_XTAL_IN    11289600 

#define DISPLAY_WIDTH  (240)
#define DISPLAY_HEIGHT (320)
#define FRAME 0x21000000        /* LCD frame buffer address */
#define LCD_DISPLAY sharp_lq035 /* Display type */

/**********************************************************************
*
* Function: c_entry
*
* Purpose:
*   Function entry point from the startup code.
*  
* Processing:
*   
*
* Parameters:
*   None
*
* Outputs:
*   None
*
* Returns:
*   Nothing
*
* Notes:
*   None
*
**********************************************************************/
INT_32 c_entry (void)
{
    INT_32 dev_lcd;
    SWIM_WINDOW_T win1;
    SWIM_WINDOW_T win2;
    SWIM_WINDOW_T win3;
    CLCDC_SETTINGS_T lcdcfg = {(LCD_PARAM_T*)&LCD_DISPLAY, SDK79524_XTAL_IN};

    /* Open a window on the left side of the display */
    swim_window_open(&win1, DISPLAY_WIDTH, DISPLAY_HEIGHT, (UNS_16 *) FRAME,
                     0, 0, 159, 319, 1, WHITE, BLACK, DARKGRAY);

    /* Open a window on the right side of the display */
    swim_window_open(&win2, DISPLAY_WIDTH, DISPLAY_HEIGHT, (UNS_16 *) FRAME,
                     160, 0, 239, 200, 1, WHITE, BLUE, DARKGRAY);

    /* Open a window on the bottom side of the display */
    swim_window_open(&win3, DISPLAY_WIDTH, DISPLAY_HEIGHT, (UNS_16 *) FRAME,
                     160, 201, 239, 319, 1, WHITE, DARKGRAY, BLACK);

    /* Open LCD */
    if ((dev_lcd = lcd_open(LCD_BASE, (INT_32) &lcdcfg)) == 0x0)
    {
        /* Error opening the device */
        return 0;
    }
    
    /* Set LCD display pointer */
    lcd_ioctl(dev_lcd, LCD_SET_FB, (INT_32)FRAME );
    
    /* Turn on LCD */
    lcd_ioctl(dev_lcd, LCD_PW_ENABLE, 0);

    /* Output the next iteration message in the window */
    swim_put_text(&win1, " Text in window 1");

    swim_set_pen_color(&win2, RED);

    /* Output the next iteration message in the window */
    swim_put_text(&win2, " Text in window 2");

    swim_set_pen_color(&win3, GREEN);

    /* Output the next iteration message in the window */
    swim_put_text(&win3, " Text in window 3");

    swim_set_pen_color(&win3, MAGENTA);

    /* Draw a box in window */
    swim_put_box(&win3,20,20,60,60);

    return 1;
}


#ifdef __iar

void main(void)
{
	c_entry();
	while(1);
}

#endif


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -