Incorporate code changes from deltabeard/RP2040-GB
This commit is contained in:
@@ -50,6 +50,12 @@ extern void mk_ili9225_set_rs(bool state);
|
|||||||
*/
|
*/
|
||||||
extern void mk_ili9225_set_cs(bool state);
|
extern void mk_ili9225_set_cs(bool state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controls state of LED pin.
|
||||||
|
* \param state Set to 0 on low output, else high.
|
||||||
|
*/
|
||||||
|
extern void mk_ili9225_set_led(bool state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends data to the ILI9225 using SPI. Return only after sending data.
|
* Sends data to the ILI9225 using SPI. Return only after sending data.
|
||||||
* \param halfword Data to send.
|
* \param halfword Data to send.
|
||||||
|
|||||||
+4
-4
@@ -223,7 +223,7 @@ void core1_lcd_draw_line(const uint_fast8_t line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//mk_ili9225_set_address(line + 16, LCD_WIDTH + 30);
|
//mk_ili9225_set_address(line + 16, LCD_WIDTH + 30);
|
||||||
mk_ili9225_set_x((SCREEN_SIZE_X - 16) - line);
|
mk_ili9225_set_x(line + 16);
|
||||||
|
|
||||||
#if USE_DMA
|
#if USE_DMA
|
||||||
mk_ili9225_write_pixels_start();
|
mk_ili9225_write_pixels_start();
|
||||||
@@ -279,7 +279,7 @@ void main_core1(void)
|
|||||||
/* Set LCD window to DMG size. */
|
/* Set LCD window to DMG size. */
|
||||||
mk_ili9225_set_window(16, LCD_HEIGHT + 15,
|
mk_ili9225_set_window(16, LCD_HEIGHT + 15,
|
||||||
31, LCD_WIDTH + 30);
|
31, LCD_WIDTH + 30);
|
||||||
//mk_ili9225_set_address(16, LCD_WIDTH + 30);
|
mk_ili9225_set_address(16, LCD_WIDTH + 30);
|
||||||
//mk_ili9225_set_x(15);
|
//mk_ili9225_set_x(15);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
@@ -358,8 +358,8 @@ int main(void)
|
|||||||
{
|
{
|
||||||
/* The value for VCO set here is meant for least power
|
/* The value for VCO set here is meant for least power
|
||||||
* consumption. */
|
* consumption. */
|
||||||
const unsigned vco = 532000000; /* 266MHz/133MHz */
|
const unsigned vco = 792000000; /* 264MHz/132MHz */
|
||||||
const unsigned div1 = 2, div2 = 1;
|
const unsigned div1 = 3, div2 = 1;
|
||||||
|
|
||||||
vreg_set_voltage(VREG_VOLTAGE_1_15);
|
vreg_set_voltage(VREG_VOLTAGE_1_15);
|
||||||
sleep_ms(2);
|
sleep_ms(2);
|
||||||
|
|||||||
@@ -333,6 +333,9 @@ unsigned mk_ili9225_init(void)
|
|||||||
/* Bring ILI9225 out of reset. */
|
/* Bring ILI9225 out of reset. */
|
||||||
mk_ili9225_set_rst(1);
|
mk_ili9225_set_rst(1);
|
||||||
mk_ili9225_delay_ms(50);
|
mk_ili9225_delay_ms(50);
|
||||||
|
|
||||||
|
/* Turn backlight off initially */
|
||||||
|
mk_ili9225_set_led(0);
|
||||||
|
|
||||||
/* Initialise power registers. */
|
/* Initialise power registers. */
|
||||||
/* FIXME: This may not be required. All are initialised to 0x00,
|
/* FIXME: This may not be required. All are initialised to 0x00,
|
||||||
@@ -455,6 +458,9 @@ unsigned mk_ili9225_init(void)
|
|||||||
*/
|
*/
|
||||||
set_register(MK_ILI9225_REG_DISPLAY_CTRL, 0x1017);
|
set_register(MK_ILI9225_REG_DISPLAY_CTRL, 0x1017);
|
||||||
mk_ili9225_delay_ms(50);
|
mk_ili9225_delay_ms(50);
|
||||||
|
|
||||||
|
/* Turn on backlight */
|
||||||
|
mk_ili9225_set_led(1);
|
||||||
|
|
||||||
#if MK_ILI9225_READ_AVAILABLE
|
#if MK_ILI9225_READ_AVAILABLE
|
||||||
/* ret should be 0 if the returned ID was 0x9225. */
|
/* ret should be 0 if the returned ID was 0x9225. */
|
||||||
|
|||||||
Reference in New Issue
Block a user