Synopsis
typedef struct {
CTL_GFX_DRIVER_t core;
CTL_SPI_DEVICE_t *dev;
void (*set_reset)(CTL_GFX_CONTROLLER_s *, int);
void (*set_window)(CTL_GFX_CONTROLLER_s *, int , int , int , int);
void (*write_register)(CTL_GFX_CONTROLLER_s *, unsigned , unsigned);
void (*write_pixels)(CTL_GFX_CONTROLLER_s *, unsigned , int);
void (*move_cursor)(CTL_GFX_CONTROLLER_s *, int , int);
void (*write_command)(CTL_GFX_CONTROLLER_s *, int);
void (*write_data_8b)(CTL_GFX_CONTROLLER_s *, int);
void (*write_data_16b)(CTL_GFX_CONTROLLER_s *, int);
void (*write_data_24b)(CTL_GFX_CONTROLLER_s *, int);
void (*set_dc)(CTL_GFX_CONTROLLER_s *, int);
unsigned char __window_trashed;
unsigned char controller_address;
unsigned char controller_caset;
unsigned char controller_paset;
unsigned char controller_ramwr;
} CTL_GFX_CONTROLLER_t;
Description
CTL_GFX_CONTROLLER_t contains the instance data for a graphics
driver that is implemented by a simple windowing, bus-interfaced
(or otherwise) graphics controller. Typical graphics controllers
provide a register-data interface that is abstracted by the
write_register and write_pixels methods, and an operating
window that is abstracted by the set_window method.
-
core
- The core graphics driver.
-
dev
- The SPI device used to control SPI-attached controllers. If the
device is attached using I2C or a parallel bus, this member must be
set to zero.
-
set_reset
- A method to control the reset signal to the controller. Many drivers
simply ignore this method and rely on the system's power-on reset or
higher-level code to reset the controller.
-
set_window
- Method to set the window that write_pixels works on.
-
move_cursor
- Method to set the cursor to within the window (if required by the
controller).
-
write_register
- Method to write data to register reg.
-
write_pixels
- Method to write pixel to graphics RAM n times.
-
write_command
- A method to write a command to the graphics controller. Graphics
controllers typically separate commands from data by a single bit
that is presented on an address line or digital control signal,
within the SPI protocol or within the I2C protocol.
-
write_data_8b
- Write 8 bits of data to the graphics controller.
-
write_data_16b
- Write 16 bits of data to the graphics controller in the byte order
appropriate for the controller.
-
write_data_24b
- Write 16 bits of data to the graphics controller in the byte order
appropriate for the controller.
-
set_dc
- Set the state of the D/C or RS signal for SPI-connected graphics
controllers. Graphics controllers that are interfaced in 8-bit SPI
mode require a separate D/C or RS signal to indicate whether the frames
transferred over the SPI bus are to be interpreted as data or commands.
For I2C, 9-bit SPI, and parallel-interfaced controllers, this member
must be zero.
-
controller_address
- Internal address for I2C-connected and SPI-connected graphics
controllers (if required).
-
__window_trashed
- Internal flag indicating whether the window is invalid
and requires initializing before writing to GRAM.
-
controller_caset
- An internal member set by the device driver that corresponds to the
"column address" command of the graphics controller.
-
controller_paset
- An internal member set by the device driver that corresponds to the
"page address" command of the graphics controller.
-
controller_ramwr
- An internal member set by the device driver that corresponds to the
"RAM write" command of the graphics controller.