Skip to content

Commit 5cdf24b

Browse files
committed
Reformated MRGC-G32 config.h
1 parent fbb8875 commit 5cdf24b

2 files changed

Lines changed: 80 additions & 38 deletions

File tree

Lines changed: 77 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,72 @@
1-
// Target definition
1+
/****************************************************************************
2+
* Target definition for MyRetroGameCase's GBC/G32 *
3+
****************************************************************************/
24
#define RG_TARGET_NAME "MRGC-G32"
35

4-
// Storage
6+
7+
/****************************************************************************
8+
* Status LED *
9+
****************************************************************************/
10+
// #define RG_LED_DRIVER 1 // 1 = GPIO
11+
// #define RG_GPIO_LED GPIO_NUM_2
12+
// #define RG_GPIO_LED_INVERT // Uncomment if the LED is active LOW
13+
14+
15+
/****************************************************************************
16+
* I2C / GPIO Extender *
17+
****************************************************************************/
18+
// #define RG_I2C_GPIO_DRIVER 0 // 1 = AW9523, 2 = PCF9539, 3 = MCP23017, 4 = PCF8575
19+
#define RG_I2C_GPIO_ADDR 0x20
20+
#define RG_GPIO_I2C_SDA GPIO_NUM_21
21+
#define RG_GPIO_I2C_SCL GPIO_NUM_22
22+
23+
24+
/****************************************************************************
25+
* Storage *
26+
****************************************************************************/
527
#define RG_STORAGE_ROOT "/sd"
628
// #define RG_STORAGE_SDSPI_HOST SPI2_HOST
729
// #define RG_STORAGE_SDSPI_SPEED SDMMC_FREQ_DEFAULT
30+
// #define RG_GPIO_SDSPI_MISO GPIO_NUM_19
31+
// #define RG_GPIO_SDSPI_MOSI GPIO_NUM_23
32+
// #define RG_GPIO_SDSPI_CLK GPIO_NUM_18
33+
// #define RG_GPIO_SDSPI_CS GPIO_NUM_22
834
#define RG_STORAGE_SDMMC_HOST SDMMC_HOST_SLOT_1
935
#define RG_STORAGE_SDMMC_SPEED SDMMC_FREQ_DEFAULT
36+
// #define RG_GPIO_SDMMC_CMD GPIO_NUM_15
37+
// #define RG_GPIO_SDMMC_CLK GPIO_NUM_14
38+
// #define RG_GPIO_SDMMC_D0 GPIO_NUM_2
39+
// #define RG_GPIO_SDMMC_D1 GPIO_NUM_NC
40+
// #define RG_GPIO_SDMMC_D2 GPIO_NUM_NC
41+
// #define RG_GPIO_SDMMC_D3 GPIO_NUM_NC
1042
// #define RG_STORAGE_FLASH_PARTITION "vfs"
1143

12-
// GPIO Extender
13-
// #define RG_I2C_GPIO_DRIVER 0 // 1 = AW9523, 2 = PCF9539, 3 = MCP23017
14-
#define RG_I2C_GPIO_ADDR 0x20
1544

16-
// Audio
45+
/****************************************************************************
46+
* Audio *
47+
****************************************************************************/
1748
#define RG_AUDIO_USE_INT_DAC 0 // 0 = Disable, 1 = GPIO25, 2 = GPIO26, 3 = Both
1849
#define RG_AUDIO_USE_EXT_DAC 1 // 0 = Disable, 1 = Enable
50+
#define RG_GPIO_SND_I2S_BCK GPIO_NUM_26
51+
#define RG_GPIO_SND_I2S_WS GPIO_NUM_25
52+
#define RG_GPIO_SND_I2S_DATA GPIO_NUM_19
53+
#define RG_GPIO_SND_AMP_ENABLE GPIO_NUM_4
54+
// #define RG_GPIO_SND_AMP_ENABLE_INVERT // Uncomment if the mute = HIGH
55+
1956

20-
// Video
57+
/****************************************************************************
58+
* Video *
59+
****************************************************************************/
2160
#define RG_SCREEN_DRIVER 0 // 0 = ILI9341/ST7789
2261
#define RG_SCREEN_HOST SPI2_HOST
2362
#define RG_SCREEN_SPEED SPI_MASTER_FREQ_40M
2463
#define RG_SCREEN_BACKLIGHT 1
2564
#define RG_SCREEN_WIDTH 240
2665
#define RG_SCREEN_HEIGHT 320
2766
#define RG_SCREEN_ROTATE 0
28-
#define RG_SCREEN_VISIBLE_AREA {0, 28, 0, 68}
29-
#define RG_SCREEN_SAFE_AREA {0, 0, 0, 0}
67+
#define RG_SCREEN_VISIBLE_AREA {0, 28, 0, 68} // left, top, right, bottom
68+
#define RG_SCREEN_SAFE_AREA {0, 0, 0, 0} // left, top, right, bottom
69+
#define RG_SCREEN_PARTIAL_UPDATES 1
3070
#define RG_SCREEN_INIT() \
3171
ILI9341_CMD(0x36, 0x00); \
3272
ILI9341_CMD(0xB1, 0x00, 0x10); \
@@ -44,8 +84,18 @@
4484
#define RG_SCREEN_DEINIT() \
4585
lcd_set_backlight(0); \
4686
ILI9341_CMD(0x01);
87+
#define RG_GPIO_LCD_MISO GPIO_NUM_NC
88+
#define RG_GPIO_LCD_MOSI GPIO_NUM_23
89+
#define RG_GPIO_LCD_CLK GPIO_NUM_18
90+
#define RG_GPIO_LCD_CS GPIO_NUM_5
91+
#define RG_GPIO_LCD_DC GPIO_NUM_12
92+
#define RG_GPIO_LCD_BCKL GPIO_NUM_27
93+
// #define RG_GPIO_LCD_RST GPIO_NUM_NC
94+
4795

48-
// Input
96+
/****************************************************************************
97+
* Input *
98+
****************************************************************************/
4999
// Refer to rg_input.h to see all available RG_KEY_* and RG_GAMEPAD_*_MAP types
50100
#define RG_GAMEPAD_I2C_MAP {\
51101
{RG_KEY_UP, .num = 2, .level = 0},\
@@ -62,35 +112,27 @@
62112
{RG_KEY_OPTION, .src = RG_KEY_SELECT | RG_KEY_A},\
63113
}
64114

65-
// Battery
66-
#define RG_BATTERY_DRIVER 2
115+
116+
/****************************************************************************
117+
* Battery *
118+
****************************************************************************/
119+
#define RG_BATTERY_DRIVER 2 // 1 = ADC, 2 = MRGC
120+
// #define RG_BATTERY_ADC_UNIT ADC_UNIT_1
121+
// #define RG_BATTERY_ADC_CHANNEL ADC_CHANNEL_0
67122
#define RG_BATTERY_CALC_PERCENT(raw) (((raw) - 170) / 30.f * 100.f)
68123
#define RG_BATTERY_CALC_VOLTAGE(raw) (3 * (raw) * 3.3f / 256)
69124

70125

71-
// Status LED
72-
// #define RG_GPIO_LED GPIO_NUM_NC
73-
74-
// I2C BUS
75-
#define RG_GPIO_I2C_SDA GPIO_NUM_21
76-
#define RG_GPIO_I2C_SCL GPIO_NUM_22
77-
78-
// Display
79-
#define RG_GPIO_LCD_MISO GPIO_NUM_NC
80-
#define RG_GPIO_LCD_MOSI GPIO_NUM_23
81-
#define RG_GPIO_LCD_CLK GPIO_NUM_18
82-
#define RG_GPIO_LCD_CS GPIO_NUM_5
83-
#define RG_GPIO_LCD_DC GPIO_NUM_12
84-
#define RG_GPIO_LCD_BCKL GPIO_NUM_27
85-
// #define RG_GPIO_LCD_RST GPIO_NUM_NC
86-
87-
// External I2S DAC
88-
#define RG_GPIO_SND_I2S_BCK GPIO_NUM_26
89-
#define RG_GPIO_SND_I2S_WS GPIO_NUM_25
90-
#define RG_GPIO_SND_I2S_DATA GPIO_NUM_19
91-
#define RG_GPIO_SND_AMP_ENABLE GPIO_NUM_4
92-
93-
// Updater
126+
/****************************************************************************
127+
* Updater *
128+
****************************************************************************/
94129
#define RG_UPDATER_ENABLE 1
95130
#define RG_UPDATER_APPLICATION RG_APP_FACTORY
96131
#define RG_UPDATER_DOWNLOAD_LOCATION RG_STORAGE_ROOT "/espgbc/firmware"
132+
133+
134+
/****************************************************************************
135+
* Miscellaneous *
136+
****************************************************************************/
137+
138+
// See components/retro-go/config.h for more things you can define here!

components/retro-go/targets/odroid-go/config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
#define RG_GPIO_SDSPI_CS GPIO_NUM_22
3434
// #define RG_STORAGE_SDMMC_HOST SDMMC_HOST_SLOT_1
3535
// #define RG_STORAGE_SDMMC_SPEED SDMMC_FREQ_DEFAULT
36-
// #define RG_GPIO_SDMMC_CMD GPIO_NUM_14
37-
// #define RG_GPIO_SDMMC_CLK GPIO_NUM_21
38-
// #define RG_GPIO_SDMMC_D0 GPIO_NUM_17
36+
// #define RG_GPIO_SDMMC_CMD GPIO_NUM_15
37+
// #define RG_GPIO_SDMMC_CLK GPIO_NUM_14
38+
// #define RG_GPIO_SDMMC_D0 GPIO_NUM_2
3939
// #define RG_GPIO_SDMMC_D1 GPIO_NUM_NC
4040
// #define RG_GPIO_SDMMC_D2 GPIO_NUM_NC
4141
// #define RG_GPIO_SDMMC_D3 GPIO_NUM_NC

0 commit comments

Comments
 (0)