Skip to content

Commit b9818bd

Browse files
authored
Merge pull request #186 from Ghazigq/master
add nes example
2 parents 1fd2256 + a3930d6 commit b9818bd

File tree

1,178 files changed

+462589
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,178 files changed

+462589
-5
lines changed

RealThread_STMH750-ART-Pi.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,27 @@ example_projects:
325325
- "makefile.targets"
326326
- "README.md"
327327
external_files:
328+
- package_type: Chip_Support_Packages
329+
package_vendor: RealThread
330+
package_name: STM32H7
331+
package_version: 0.1.9
332+
source_path_offset: ''
333+
target_path_offset: ''
334+
files_and_folders: []
335+
- project_name: art_pi_nes
336+
project_description: creat this peoject if user choose rt-thread project
337+
project_type: rt-thread|@full|@4.0.3
338+
builtin_files:
339+
- source_path_offset: projects/art_pi_nes
340+
target_path_offset: ''
341+
files_and_folders:
342+
- "*"
343+
- source_path_offset: ''
344+
target_path_offset: ''
345+
files_and_folders:
346+
- libraries
347+
- rt-thread
348+
external_files:
328349
- package_type: Chip_Support_Packages
329350
package_vendor: RealThread
330351
package_name: STM32H7

libraries/drivers/drv_spi_ili9488.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static void lcd_gpio_init(void)
142142
rt_pin_mode(LCD_DC_PIN, PIN_MODE_OUTPUT);
143143
rt_pin_mode(LCD_BL_PIN, PIN_MODE_OUTPUT);
144144
rt_pin_mode(LCD_RES_PIN, PIN_MODE_OUTPUT);
145-
rt_pin_write(LCD_BL_PIN, PIN_HIGH);
145+
rt_pin_write(LCD_BL_PIN, PIN_LOW);
146146
}
147147

148148
int rt_hw_spi_lcd_init(void)
@@ -206,7 +206,11 @@ int rt_hw_spi_lcd_init(void)
206206
lcd_write_data(0x80);
207207

208208
lcd_write_cmd(0x36);
209+
#ifndef LCD_HOR_SCREEN
209210
lcd_write_data(0x48);
211+
#else
212+
lcd_write_data(0x28);
213+
#endif
210214

211215
lcd_write_cmd(0x3A); //Interface Mode Control
212216
lcd_write_data(0x66);
@@ -234,13 +238,13 @@ int rt_hw_spi_lcd_init(void)
234238
lcd_write_data(0x2C);
235239
lcd_write_data(0x82);
236240

241+
lcd_fill(0, 0, LCD_WIDTH, LCD_HEIGHT, LCD_FULL_COLOR);
242+
237243
lcd_write_cmd(0x11);
238244
rt_thread_mdelay(120);
239245
lcd_write_cmd(0x29);
240246

241-
lcd_fill(0, 0, LCD_WIDTH, LCD_HEIGHT, WHITE);
242-
243-
rt_pin_write(LCD_BL_PIN, PIN_HIGH);
247+
rt_thread_mdelay(50); //delay screen update to prevent screen appears white when the default color is black
244248

245249
return RT_EOK;
246250
}

libraries/drivers/include/lcd_spi_port.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,20 @@
1212
#define __LCD_PORT_H__
1313

1414
/* rt-thread 3.5 inch screen, 320 * 480 */
15+
#define LCD_HOR_SCREEN
16+
#define LCD_FULL_COLOR BLACK
17+
18+
#ifndef LCD_FULL_COLOR
19+
#define LCD_FULL_COLOR WHITE
20+
#endif
21+
22+
#ifndef LCD_HOR_SCREEN
1523
#define LCD_WIDTH 320
1624
#define LCD_HEIGHT 480
25+
#else
26+
#define LCD_WIDTH 480
27+
#define LCD_HEIGHT 320
28+
#endif
1729
#define LCD_BITS_PER_PIXEL 24
1830
#define LCD_BYTES_PER_PIXEL (LCD_BITS_PER_PIXEL / 8)
1931
#define LCD_BUF_SIZE (LCD_WIDTH * LCD_HEIGHT * LCD_BYTES_PER_PIXEL)

projects/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ ART-Pi 开源项目如下表所示:
1414
| [art_pi_net_player](./art_pi_net_player) | 实现 MP3 音乐播放,支持本地音乐和网易云音乐 |
1515
| [lrs007_lora_radio](./lrs007_lora_radio) | 实现 LoRa Radio (SX126x\SX127x...) 单向/双向通信、抓包及shell示例 |
1616
| [lrs007_lorawan_end_device](./lrs007_lorawan_end_device) | 实现 LoRaWAN End Device 协议栈Class A\C通信及shell示例 |
17-
| [art_pi_qboot](./art_pi_qboot) | 实现程序从 `0x08000000` 跳转到 `0x90000000`,并且支持从 `download` 分区更新固件到 `app` 分区。 |
17+
| [art_pi_qboot](./art_pi_qboot) | 实现程序从 `0x08000000` 跳转到 `0x90000000`,并且支持从 `download` 分区更新固件到 `app` 分区。 |
18+
| [art_pi_nes](./art_pi_nes) | 实现 NES 模拟器及游戏试玩 |

0 commit comments

Comments
 (0)