Skip to content

Commit 00757f5

Browse files
authored
Merge pull request #4 from StackRyan/1222-2004
[add] add initial vdevice peripherals for virtual environment.
2 parents 8b7b6cc + aabe6a7 commit 00757f5

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

vgpio.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define DBG_LVL DBG_LOG
1616
#include <rtdbg.h>
1717

18-
#ifdef PKG_USING_PIN
18+
#ifdef VDEVICE_USING_PIN
1919

2020
static void _pin_mode(struct rt_device *device, rt_base_t pin, rt_base_t mode)
2121
{

vlcd.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#define DBG_LVL DBG_LOG
1616
#include <rtdbg.h>
1717

18-
#ifdef PKG_USING_LCD
18+
#ifdef VDEVICE_USING_LCD
1919

2020
#define LCD_USING_RGB565
2121
//#define LCD_USING_RGB888
2222

23-
#define LCD_HEIGHT 360
24-
#define LCD_WIDTH 360
23+
#define LCD_HEIGHT 240
24+
#define LCD_WIDTH 240
2525

2626
#ifdef LCD_USING_RGB565
2727
#define LCD_BITS_PER_PIXEL 16
@@ -35,7 +35,7 @@
3535

3636
#define LCD_FRAMEBUFFER_SIZE (LCD_WIDTH * LCD_HEIGHT * LCD_BITS_PER_PIXEL / 8)
3737

38-
rt_uint8_t lcd_framebuffer[LCD_FRAMEBUFFER_SIZE];
38+
static rt_uint8_t lcd_framebuffer[LCD_FRAMEBUFFER_SIZE];
3939

4040
static struct rt_device_graphic_info lcd_info;
4141
static struct rt_device lcd_dev;
@@ -144,6 +144,8 @@ const static struct rt_device_ops _lcd_ops =
144144
_lcd_init,
145145
_lcd_open,
146146
_lcd_close,
147+
RT_NULL,
148+
RT_NULL,
147149
_lcd_control
148150
};
149151
#endif
@@ -168,6 +170,8 @@ int rt_hw_lcd_init(void)
168170
lcd_dev.init = _lcd_init;
169171
lcd_dev.open = _lcd_open;
170172
lcd_dev.close = _lcd_close;
173+
lcd_dev.read = RT_NULL;
174+
lcd_dev.write = RT_NULL;
171175
lcd_dev.control = _lcd_control;
172176
#endif
173177

@@ -180,4 +184,4 @@ int rt_hw_lcd_init(void)
180184
}
181185
INIT_DEVICE_EXPORT(rt_hw_lcd_init);
182186

183-
#endif /* PKG_USING_LCD */
187+
#endif /* VDEVICE_USING_LCD */

vtouch.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include "rtconfig.h"
1212

13-
#ifdef PKG_USING_TOUCH
13+
#ifdef VDEVICE_USING_TOUCH
1414

1515
#include <rtthread.h>
1616
#include <rtdevice.h>
@@ -21,8 +21,8 @@
2121
#define DBG_LVL DBG_LOG
2222
#include <rtdbg.h>
2323

24-
#define TOUCH_WIDTH 320 //resolution ratio config X
25-
#define TOUCH_HEIGHT 320 //resolution ratio config Y
24+
#define TOUCH_WIDTH 240 //resolution ratio config X
25+
#define TOUCH_HEIGHT 240 //resolution ratio config Y
2626
#define TOUCH_POINT_NUM 1 //touchpoint number
2727

2828
static struct rt_touch_device touch_device;
@@ -138,4 +138,4 @@ static int rt_hw_touch_init(void)
138138
}
139139
INIT_DEVICE_EXPORT(rt_hw_touch_init);
140140

141-
#endif /* PKG_USING_TOUCH */
141+
#endif /* VDEVICE_USING_TOUCH */

0 commit comments

Comments
 (0)