update Fujitsu FM3 MB9BF500R project with RTGUI

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1489 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
dzzxzz 2011-06-11 09:06:12 +00:00
parent 14c2f8c039
commit fe605eed45
11 changed files with 1662 additions and 563 deletions

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<flash_device>
<exe>$TOOLKIT_DIR$\config\flashloader\Fujitsu\FlashMB9BF500.out</exe>
<page>4</page>
<block>4 0x1000</block>
<block>1 0xC000</block>
<block>3 0x10000</block>
<flash_base>0x00000000</flash_base>
<macro>$TOOLKIT_DIR$\config\flashloader\Fujitsu\FlashMB9BF50x.mac</macro>
<aggregate>1</aggregate>
<args_doc>The "--protect" argument is used to program
protection code 0x0001 in the security code area of the
flash.
Note: Writing the protection code disables JTAG access
and debug is not possible. To release security, perform
the chip erase operation using a serial writer because
the security cannot be released through JTAG pins.</args_doc>
</flash_device>

Binary file not shown.

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<flash_board>
<pass>
<loader>$TOOLKIT_DIR$\config\flashloader\Fujitsu\FlashMB9BF500.flash</loader>
</pass>
</flash_board>

View File

@ -0,0 +1,43 @@
[FILEFORMAT]
rev=1.6
[CHIP]
//Chip name
name=MB9BF500R
//What endian modes does the chip support? (littleonly, bigonly, both(default))
endiansupport=littleonly
//Does the chip support the thumb instruction set? (true(default), false)
thumbsupport=true
//Does the chip support the arm instruction set? (true(default), false)
armsupport=false
//Does the chip have an FPU coprocessor?
//(VFPv1,VFPv2,VFP9-S,None(default)
fpu=
[CORE]
//Name of the ARM processor core
name=Cortex-M3
[DDF FILE]
//Name of the ddf file
name=Fujitsu\iomb9bf506r.ddf
[XCL FILE]
//Name of the linker config file
name=
[FLASH LOADER]
name=$TOOLKIT_DIR$\config\flashloader\Fujitsu\MB9BF500.board
little=
big=
args=

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<optionMenuItem>
<tag>MB9BF500R</tag>
<display>Fujitsu MB9BF500R</display>
<data>$CUR_DIR$\MB9BF500R.i79</data>
</optionMenuItem>

View File

@ -27,6 +27,7 @@
#ifdef RT_USING_RTGUI
#include <rtgui/rtgui.h>
#include <rtgui/driver.h>
extern void rtgui_startup();
#endif
@ -35,6 +36,8 @@ static char msg_pool[2048];
void rt_init_thread_entry(void *parameter)
{
rt_device_t lcd;
rt_hw_led_init();
rt_hw_key_init();
rt_hw_adc_init();
@ -45,6 +48,12 @@ void rt_init_thread_entry(void *parameter)
rt_device_init_all();
#ifdef RT_USING_RTGUI
/* find lcd device */
lcd = rt_device_find("lcd");
/* set lcd device as rtgui graphic driver */
rtgui_graphic_set_device(lcd);
/* startup rtgui */
rtgui_startup();
#else

File diff suppressed because it is too large Load Diff

View File

@ -49,7 +49,7 @@
</option>
<option>
<name>RunToEnable</name>
<state>1</state>
<state>0</state>
</option>
<option>
<name>RunToName</name>

View File

@ -99,7 +99,7 @@
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>MB9BF506R Fujitsu MB9BF506R</state>
<state>MB9BF500R Fujitsu MB9BF500R</state>
</option>
<option>
<name>GenLowLevelInterface</name>
@ -1811,6 +1811,192 @@
</group>
<group>
<name>Rtgui</name>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\about_view.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\asc12font.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\asc16font.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\blit.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\box.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\button.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\checkbox.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\color.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\combobox.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\container.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\dc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\dc_buffer.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\dc_client.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\dc_hw.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\server\driver.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\filelist_view.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\filerw.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\font.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\font_bmp.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\font_freetype.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\font_hz_bmp.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\font_hz_file.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\framebuffer_driver.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\hz12font.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\hz16font.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\iconbox.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\image.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\image_bmp.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\image_container.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\image_hdc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\image_jpg.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\image_png.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\image_xpm.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\label.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\list_view.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\listbox.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\listctrl.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\menu.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\server\mouse.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\notebook.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\server\panel.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\pixel_driver.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\progressbar.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\radiobox.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\region.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\rtgui_object.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\rtgui_system.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\rtgui_theme.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\common\rtgui_xml.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\scrollbar.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\server\server.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\slider.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\staticline.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\textbox.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\textview.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\title.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\toplevel.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\server\topwin.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\view.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\widget.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\window.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\components\rtgui\widgets\workbench.c</name>
</file>
</group>
<group>
<name>Startup</name>

View File

@ -16,6 +16,7 @@
#include "lcd.h"
#include "font.h"
static struct rt_device_graphic_info _lcd_info;
static rt_uint8_t gui_disp_buf[GUI_LCM_YMAX/8][GUI_LCM_XMAX];
const unsigned char BIT_MASK[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
/* simple font: ' ', '0'~'9','a'~'z','A'~'Z' */
@ -24,15 +25,6 @@ extern const unsigned char FONTTYPE8_8[][8];
rt_uint32_t x;
rt_uint32_t y;
struct rtgui_lcd_device
{
struct rt_device parent;
rt_uint16_t width;
rt_uint16_t height;
void* hw_framebuffer;
};
static struct rtgui_lcd_device *lcd = RT_NULL;
void Power_Delay(void)
{
rt_uint32_t i=0x4ffff;
@ -126,19 +118,19 @@ static rt_uint8_t * rt_hw_lcd_get_framebuffer(void)
return(rt_uint8_t *)gui_disp_buf;
}
static void rt_hw_lcd_set_pixel(rtgui_color_t *c, rt_base_t x, rt_base_t y)
static void rt_hw_lcd_set_pixel(rtgui_color_t *c, int x, int y)
{
rt_uint8_t page;
page = y/8;
if (*c == black)
if (*c == rtgui_color_to_565(black))
gui_disp_buf[page][x] |= 1<<(y%8);
else
if (*c == white)
if (*c == rtgui_color_to_565(white))
gui_disp_buf[page][x] &= ~(1<<(y%8));
}
static void rt_hw_lcd_get_pixel(rtgui_color_t *c, rt_base_t x, rt_base_t y)
static void rt_hw_lcd_get_pixel(rtgui_color_t *c, int x, int y)
{
rt_uint8_t page;
page = y/8;
@ -149,7 +141,7 @@ static void rt_hw_lcd_get_pixel(rtgui_color_t *c, rt_base_t x, rt_base_t y)
*c = white;
}
static void rt_hw_lcd_draw_hline(rtgui_color_t *c, rt_base_t x1, rt_base_t x2, rt_base_t y)
static void rt_hw_lcd_draw_hline(rtgui_color_t *c, int x1, int x2, int y)
{
rt_uint8_t page;
rt_uint8_t i;
@ -157,15 +149,15 @@ static void rt_hw_lcd_draw_hline(rtgui_color_t *c, rt_base_t x1, rt_base_t x2, r
for (i=x1; i<x2; i++)
{
if (*c == black)
if (*c == rtgui_color_to_565(black))
gui_disp_buf[page][i] |= 1<<(y%8);
else
if (*c == white)
if (*c == rtgui_color_to_565(white))
gui_disp_buf[page][i] &= ~(1<<(y%8));
}
}
static void rt_hw_lcd_draw_vline(rtgui_color_t *c, rt_base_t x, rt_base_t y1, rt_base_t y2)
static void rt_hw_lcd_draw_vline(rtgui_color_t *c, int x, int y1, int y2)
{
rt_uint8_t y;
@ -175,7 +167,7 @@ static void rt_hw_lcd_draw_vline(rtgui_color_t *c, rt_base_t x, rt_base_t y1, rt
}
}
static void rt_hw_lcd_draw_raw_hline(rt_uint8_t *pixels, rt_base_t x1, rt_base_t x2, rt_base_t y)
static void rt_hw_lcd_draw_raw_hline(rt_uint8_t *pixels, int x1, int x2, int y)
{
rt_uint8_t coll;
rt_uint8_t colh;
@ -196,14 +188,8 @@ static void rt_hw_lcd_draw_raw_hline(rt_uint8_t *pixels, rt_base_t x1, rt_base_t
}
}
struct rtgui_graphic_driver _rtgui_lcd_driver =
const struct rtgui_graphic_driver_ops _lcd_driver =
{
"lcd",
1,
LCD_WIDTH,
LCD_HEIGHT,
rt_hw_lcd_update,
rt_hw_lcd_get_framebuffer,
rt_hw_lcd_set_pixel,
rt_hw_lcd_get_pixel,
rt_hw_lcd_draw_hline,
@ -436,66 +422,45 @@ void LCD_PutString(unsigned long x, unsigned long y, char *str)
static rt_err_t rt_lcd_control (rt_device_t dev, rt_uint8_t cmd, void *args)
{
switch (cmd)
{
case RT_DEVICE_CTRL_LCD_GET_WIDTH:
*((rt_uint16_t*)args) = lcd->width;
break;
case RT_DEVICE_CTRL_LCD_GET_HEIGHT:
*((rt_uint16_t*)args) = lcd->height;
break;
case RT_DEVICE_CTRL_LCD_DISPLAY_ON:
LCD_WriteCmd(Display_On);
break;
case RT_DEVICE_CTRL_LCD_DISPLAY_OFF:
LCD_WriteCmd(Display_Off);
break;
case RT_DEVICE_CTRL_LCD_PUT_STRING:
LCD_PutString(x, y, (char*)args);
break;
case RT_DEVICE_CTRL_LCD_CLEAR_SCR:
LCD_ClearSCR();
break;
}
return RT_EOK;
}
switch (cmd)
{
case RTGRAPHIC_CTRL_RECT_UPDATE:
rt_hw_lcd_update(args);
break;
case RTGRAPHIC_CTRL_POWERON:
break;
case RTGRAPHIC_CTRL_POWEROFF:
break;
case RTGRAPHIC_CTRL_GET_INFO:
rt_memcpy(args, &_lcd_info, sizeof(_lcd_info));
break;
case RTGRAPHIC_CTRL_SET_MODE:
break;
}
static rt_err_t rt_lcd_open(rt_device_t dev, rt_uint16_t oflag)
{
RT_ASSERT(dev != RT_NULL);
return RT_EOK;
}
static rt_err_t rt_lcd_close(rt_device_t dev)
{
RT_ASSERT(dev != RT_NULL);
return RT_EOK;
return RT_EOK;
}
void rt_hw_lcd_init(void)
{
lcd = (struct rtgui_lcd_device*)rt_malloc(sizeof(struct rtgui_lcd_device));
if (lcd == RT_NULL)
return; /* no memory yet */
rt_device_t lcd = rt_malloc(sizeof(struct rt_device));
if (lcd == RT_NULL) return; /* no memory yet */
/* init device structure */
lcd->parent.type = RT_Device_Class_Unknown;
lcd->parent.init = rt_lcd_init;
lcd->parent.open = rt_lcd_open;
lcd->parent.close = rt_lcd_close;
lcd->parent.control = rt_lcd_control;
lcd->parent.user_data = RT_NULL;
lcd->width = LCD_WIDTH;
lcd->height = LCD_HEIGHT;
lcd->hw_framebuffer = (void*)gui_disp_buf;
/* register touch device to RT-Thread */
rt_device_register(&(lcd->parent), "lcd", RT_DEVICE_FLAG_RDWR);
_lcd_info.bits_per_pixel = 16;
_lcd_info.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565;
_lcd_info.framebuffer = RT_NULL;
_lcd_info.width = LCD_WIDTH;
_lcd_info.height = LCD_HEIGHT;
/* init device structure */
lcd->type = RT_Device_Class_Unknown;
lcd->init = rt_lcd_init;
lcd->open = RT_NULL;
lcd->close = RT_NULL;
lcd->control = rt_lcd_control;
#ifdef RT_USING_RTGUI
/* add lcd driver into graphic driver */
rtgui_graphic_driver_add(&_rtgui_lcd_driver);
#endif
lcd->user_data = (void*)&_lcd_driver;
#endif
/* register lcd device to RT-Thread */
rt_device_register(lcd, "lcd", RT_DEVICE_FLAG_RDWR);
}

View File

@ -63,7 +63,7 @@
/* SECTION: RTGUI support */
/* using RTGUI support */
//#define RT_USING_RTGUI
#define RT_USING_RTGUI
/* name length of RTGUI object */
#define RTGUI_NAME_MAX 16