图像更改

This commit is contained in:
Glz
2024-03-03 16:20:25 +08:00
parent cbbfc278ab
commit 7afd06741b
28 changed files with 456 additions and 1442 deletions

View File

@@ -79,7 +79,7 @@ static ips200_dir_enum ips200_display_dir = IPS200_DEFAULT_DISPLAY_DIR;
static ips200_font_size_enum ips200_display_font = IPS200_DEFAULT_DISPLAY_FONT;
static uint16 ips200_x_max = 240;
static uint16 ips200_y_max = 320;
static uint16 ips200_y_max = 280;
static gpio_pin_enum ips_rst_pin = IPS200_RST_PIN_SPI;
static gpio_pin_enum ips_bl_pin = IPS200_BLk_PIN_SPI;
@@ -322,12 +322,12 @@ static void ips200_set_region(uint16 x1, uint16 y1, uint16 x2, uint16 y2)
// zf_assert(y2 < ips200_y_max);
ips200_write_command(0x2a);
ips200_write_16bit_data(x1);
ips200_write_16bit_data(x2);
ips200_write_16bit_data(x1+0);
ips200_write_16bit_data(x2+0);
ips200_write_command(0x2b);
ips200_write_16bit_data(y1);
ips200_write_16bit_data(y2);
ips200_write_16bit_data(y1+20);
ips200_write_16bit_data(y2+20);
ips200_write_command(0x2c);
}
@@ -430,19 +430,19 @@ void ips200_full(const uint16 color)
//-------------------------------------------------------------------------------------------------------------------
void ips200_set_dir(ips200_dir_enum dir)
{
ips200_display_dir = dir;
switch (ips200_display_dir) {
case IPS200_PORTAIT:
case IPS200_PORTAIT_180: {
ips200_x_max = 240;
ips200_y_max = 320;
} break;
case IPS200_CROSSWISE:
case IPS200_CROSSWISE_180: {
ips200_x_max = 320;
ips200_y_max = 240;
} break;
}
// ips200_display_dir = dir;
// switch (ips200_display_dir) {
// case IPS200_PORTAIT:
// case IPS200_PORTAIT_180: {
// ips200_x_max = 240;
// ips200_y_max = 320;
// } break;
// case IPS200_CROSSWISE:
// case IPS200_CROSSWISE_180: {
// ips200_x_max = 320;
// ips200_y_max = 240;
// } break;
// }
}
//-------------------------------------------------------------------------------------------------------------------
@@ -1046,7 +1046,7 @@ void ips200_init(ips200_type_enum type_select)
#if IPS200_USE_SOFT_SPI
soft_spi_init(&ips200_spi, 0, IPS200_SOFT_SPI_DELAY, IPS200_SCL_PIN, IPS200_SDA_PIN, SOFT_SPI_PIN_NULL, SOFT_SPI_PIN_NULL);
#else
spi_init(IPS200_SPI, SPI_MODE0, IPS200_SPI_SPEED, IPS200_SCL_PIN_SPI, IPS200_SDA_PIN_SPI, SPI_MISO_NULL, SPI_CS_NULL);
spi_init(IPS200_SPI, SPI_MODE0, IPS200_SPI_SPEED, IPS200_SCL_PIN_SPI, IPS200_SDA_PIN_SPI, SPI_MISO_NULL, PIN_NULL);
#endif
gpio_init(IPS200_DC_PIN_SPI, GPO, GPIO_LOW, GPO_PUSH_PULL);