rt-thread/bsp/stm32/stm32l475-atk-pandora/applications/lcd_sample.c

49 lines
1.0 KiB
C
Raw Normal View History

/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-08-28 WillianChan first version
*/
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#ifdef BSP_USING_SPI_LCD
#include <drv_lcd.h>
#include <rttlogo.h>
static int lcd_sample(void)
{
/* <20><><EFBFBD><EFBFBD> */
lcd_clear(WHITE);
/* <20><>ʾ RT-Thread logo */
lcd_show_image(0, 0, 240, 69, image_rttlogo);
/* <20><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>ɫ<EFBFBD><C9AB>ǰ<EFBFBD><C7B0>ɫ */
lcd_set_color(WHITE, BLACK);
/* <20><> LCD <20><><EFBFBD><EFBFBD>ʾ<EFBFBD>ַ<EFBFBD> */
lcd_show_string(10, 69, 16, "Hello, RT-Thread!");
lcd_show_string(10, 69+16, 24, "RT-Thread");
lcd_show_string(10, 69+16+24, 32, "RT-Thread");
/* <20><> LCD <20>ϻ<EFBFBD><CFBB><EFBFBD> */
lcd_draw_line(0, 69+16+24+32, 240, 69+16+24+32);
/* <20><> LCD <20>ϻ<EFBFBD>һ<EFBFBD><D2BB>ͬ<EFBFBD><CDAC>Բ */
lcd_draw_point(120, 194);
for (int i = 0; i < 46; i += 4)
{
lcd_draw_circle(120, 194, i);
}
return RT_EOK;
}
INIT_APP_EXPORT(lcd_sample);
#endif /* BSP_USING_SPI_LCD */