Skip to content

Commit

Permalink
Merge pull request #186 from Ghazigq/master
Browse files Browse the repository at this point in the history
add nes example
  • Loading branch information
Guozhanxin authored Apr 14, 2021
2 parents 1fd2256 + a3930d6 commit b9818bd
Show file tree
Hide file tree
Showing 1,178 changed files with 462,589 additions and 5 deletions.
21 changes: 21 additions & 0 deletions RealThread_STMH750-ART-Pi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,27 @@ example_projects:
- "makefile.targets"
- "README.md"
external_files:
- package_type: Chip_Support_Packages
package_vendor: RealThread
package_name: STM32H7
package_version: 0.1.9
source_path_offset: ''
target_path_offset: ''
files_and_folders: []
- project_name: art_pi_nes
project_description: creat this peoject if user choose rt-thread project
project_type: rt-thread|@full|@4.0.3
builtin_files:
- source_path_offset: projects/art_pi_nes
target_path_offset: ''
files_and_folders:
- "*"
- source_path_offset: ''
target_path_offset: ''
files_and_folders:
- libraries
- rt-thread
external_files:
- package_type: Chip_Support_Packages
package_vendor: RealThread
package_name: STM32H7
Expand Down
12 changes: 8 additions & 4 deletions libraries/drivers/drv_spi_ili9488.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void lcd_gpio_init(void)
rt_pin_mode(LCD_DC_PIN, PIN_MODE_OUTPUT);
rt_pin_mode(LCD_BL_PIN, PIN_MODE_OUTPUT);
rt_pin_mode(LCD_RES_PIN, PIN_MODE_OUTPUT);
rt_pin_write(LCD_BL_PIN, PIN_HIGH);
rt_pin_write(LCD_BL_PIN, PIN_LOW);
}

int rt_hw_spi_lcd_init(void)
Expand Down Expand Up @@ -206,7 +206,11 @@ int rt_hw_spi_lcd_init(void)
lcd_write_data(0x80);

lcd_write_cmd(0x36);
#ifndef LCD_HOR_SCREEN
lcd_write_data(0x48);
#else
lcd_write_data(0x28);
#endif

lcd_write_cmd(0x3A); //Interface Mode Control
lcd_write_data(0x66);
Expand Down Expand Up @@ -234,13 +238,13 @@ int rt_hw_spi_lcd_init(void)
lcd_write_data(0x2C);
lcd_write_data(0x82);

lcd_fill(0, 0, LCD_WIDTH, LCD_HEIGHT, LCD_FULL_COLOR);

lcd_write_cmd(0x11);
rt_thread_mdelay(120);
lcd_write_cmd(0x29);

lcd_fill(0, 0, LCD_WIDTH, LCD_HEIGHT, WHITE);

rt_pin_write(LCD_BL_PIN, PIN_HIGH);
rt_thread_mdelay(50); //delay screen update to prevent screen appears white when the default color is black

return RT_EOK;
}
Expand Down
12 changes: 12 additions & 0 deletions libraries/drivers/include/lcd_spi_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,20 @@
#define __LCD_PORT_H__

/* rt-thread 3.5 inch screen, 320 * 480 */
#define LCD_HOR_SCREEN
#define LCD_FULL_COLOR BLACK

#ifndef LCD_FULL_COLOR
#define LCD_FULL_COLOR WHITE
#endif

#ifndef LCD_HOR_SCREEN
#define LCD_WIDTH 320
#define LCD_HEIGHT 480
#else
#define LCD_WIDTH 480
#define LCD_HEIGHT 320
#endif
#define LCD_BITS_PER_PIXEL 24
#define LCD_BYTES_PER_PIXEL (LCD_BITS_PER_PIXEL / 8)
#define LCD_BUF_SIZE (LCD_WIDTH * LCD_HEIGHT * LCD_BYTES_PER_PIXEL)
Expand Down
3 changes: 2 additions & 1 deletion projects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ ART-Pi 开源项目如下表所示:
| [art_pi_net_player](./art_pi_net_player) | 实现 MP3 音乐播放,支持本地音乐和网易云音乐 |
| [lrs007_lora_radio](./lrs007_lora_radio) | 实现 LoRa Radio (SX126x\SX127x...) 单向/双向通信、抓包及shell示例 |
| [lrs007_lorawan_end_device](./lrs007_lorawan_end_device) | 实现 LoRaWAN End Device 协议栈Class A\C通信及shell示例 |
| [art_pi_qboot](./art_pi_qboot) | 实现程序从 `0x08000000` 跳转到 `0x90000000`,并且支持从 `download` 分区更新固件到 `app` 分区。 |
| [art_pi_qboot](./art_pi_qboot) | 实现程序从 `0x08000000` 跳转到 `0x90000000`,并且支持从 `download` 分区更新固件到 `app` 分区。 |
| [art_pi_nes](./art_pi_nes) | 实现 NES 模拟器及游戏试玩 |
Loading

0 comments on commit b9818bd

Please sign in to comment.