summaryrefslogtreecommitdiffstats
path: root/drivers/painter/tft_panel
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/painter/tft_panel')
-rw-r--r--drivers/painter/tft_panel/qp_tft_panel.c12
-rw-r--r--drivers/painter/tft_panel/qp_tft_panel.h10
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/painter/tft_panel/qp_tft_panel.c b/drivers/painter/tft_panel/qp_tft_panel.c
index 4a24cf9953..16dba9d6a6 100644
--- a/drivers/painter/tft_panel/qp_tft_panel.c
+++ b/drivers/painter/tft_panel/qp_tft_panel.c
@@ -12,15 +12,15 @@
// Power control
bool qp_tft_panel_power(painter_device_t device, bool power_on) {
- struct painter_driver_t * driver = (struct painter_driver_t *)device;
- struct tft_panel_dc_reset_painter_driver_vtable_t *vtable = (struct tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
+ painter_driver_t * driver = (painter_driver_t *)device;
+ tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
qp_comms_command(device, power_on ? vtable->opcodes.display_on : vtable->opcodes.display_off);
return true;
}
// Screen clear
bool qp_tft_panel_clear(painter_device_t device) {
- struct painter_driver_t *driver = (struct painter_driver_t *)device;
+ painter_driver_t *driver = (painter_driver_t *)device;
driver->driver_vtable->init(device, driver->rotation); // Re-init the LCD
return true;
}
@@ -33,8 +33,8 @@ bool qp_tft_panel_flush(painter_device_t device) {
// Viewport to draw to
bool qp_tft_panel_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) {
- struct painter_driver_t * driver = (struct painter_driver_t *)device;
- struct tft_panel_dc_reset_painter_driver_vtable_t *vtable = (struct tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
+ painter_driver_t * driver = (painter_driver_t *)device;
+ tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
// Fix up the drawing location if required
left += driver->offset_x;
@@ -80,7 +80,7 @@ bool qp_tft_panel_viewport(painter_device_t device, uint16_t left, uint16_t top,
// Stream pixel data to the current write position in GRAM
bool qp_tft_panel_pixdata(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) {
- struct painter_driver_t *driver = (struct painter_driver_t *)device;
+ painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_send(device, pixel_data, native_pixel_count * driver->native_bits_per_pixel / 8);
return true;
}
diff --git a/drivers/painter/tft_panel/qp_tft_panel.h b/drivers/painter/tft_panel/qp_tft_panel.h
index 83b8dd5406..67168645b7 100644
--- a/drivers/painter/tft_panel/qp_tft_panel.h
+++ b/drivers/painter/tft_panel/qp_tft_panel.h
@@ -12,8 +12,8 @@
// Common TFT panel implementation using D/C, and RST pins.
// Driver vtable with extras
-struct tft_panel_dc_reset_painter_driver_vtable_t {
- struct painter_driver_vtable_t base; // must be first, so it can be cast to/from the painter_driver_vtable_t* type
+typedef struct tft_panel_dc_reset_painter_driver_vtable_t {
+ painter_driver_vtable_t base; // must be first, so it can be cast to/from the painter_driver_vtable_t* type
// Number of bytes for transmitting x/y coordinates
uint8_t num_window_bytes;
@@ -29,16 +29,16 @@ struct tft_panel_dc_reset_painter_driver_vtable_t {
uint8_t set_row_address;
uint8_t enable_writes;
} opcodes;
-};
+} tft_panel_dc_reset_painter_driver_vtable_t;
// Device definition
typedef struct tft_panel_dc_reset_painter_device_t {
- struct painter_driver_t base; // must be first, so it can be cast to/from the painter_device_t* type
+ painter_driver_t base; // must be first, so it can be cast to/from the painter_device_t* type
union {
#ifdef QUANTUM_PAINTER_SPI_ENABLE
// SPI-based configurables
- struct qp_comms_spi_dc_reset_config_t spi_dc_reset_config;
+ qp_comms_spi_dc_reset_config_t spi_dc_reset_config;
#endif // QUANTUM_PAINTER_SPI_ENABLE
// TODO: I2C/parallel etc.