Hanna
Sourcecode Batteriemanagementsystem |
Makrodefinitionen | |
#define | ILI9341_COLOR(r, g, b) Swap16((((uint16_t)b) >> 3) | ((((uint16_t)g) << 3) & 0x07E0) | ((((uint16_t)r) << 8) & 0xf800)) |
#define | ILI9341_DEFAULT_HEIGHT 240 |
#define | ILI9341_DEFAULT_WIDTH 320 |
#define | ILI9341_SWITCH_XY_HEIGHT 320 |
#define | ILI9341_SWITCH_XY_WIDTH 240 |
Typdefinitionen | |
typedef uint16_t | ili9341_color_t |
typedef int16_t | ili9341_coord_t |
Display orientation flags | |
#define | ILI9341_FLIP_X 1 |
#define | ILI9341_FLIP_Y 2 |
#define | ILI9341_SWITCH_XY 4 |
Controller primitive graphical functions | |
ili9341_color_t | ili9341_read_gram (void) |
Read a single color from the graphical memory. Mehr ... | |
void | ili9341_write_gram (ili9341_color_t color) |
Write the graphical memory with a single color pixel. Mehr ... | |
void | ili9341_set_top_left_limit (ili9341_coord_t x, ili9341_coord_t y) |
Set the display top left drawing limit. Mehr ... | |
void | ili9341_set_bottom_right_limit (ili9341_coord_t x, ili9341_coord_t y) |
Set the display bottom right drawing limit. Mehr ... | |
void | ili9341_set_limits (ili9341_coord_t start_x, ili9341_coord_t start_y, ili9341_coord_t end_x, ili9341_coord_t end_y) |
Set the full display drawing limits. Mehr ... | |
void | ili9341_set_orientation (uint8_t flags) |
Sets the orientation of the display data. Mehr ... | |
void | ili9341_copy_pixels_to_screen (const ili9341_color_t *pixels, uint32_t count) |
Copy pixels from SRAM to the screen. Mehr ... | |
void | ili9341_copy_pixels_from_screen (ili9341_color_t *pixels, uint32_t count) |
Copy pixels from the screen to a pixel buffer. Mehr ... | |
void | ili9341_duplicate_pixel (const ili9341_color_t color, uint32_t count) |
Set a given number of pixels to the same color. Mehr ... | |
Controller and display initialization and management | |
void | ili9341_init (void) |
Initialise the controller. Mehr ... | |
See common_ili9341_qs
This is the low level component driver for the ILI9341 display controller. It provides basic functions for initializing, writing and reading the controller. In addition to hardware control and use of the LCD controller internal functions.
Before writing data to the display call ili9341_init() which will set up the physical interface and the display. A configuration file conf_ili9341.h is needed to define which interface to use, pin connections and communication speed.
An example conf_ili9341.h file for the XMEGA could look like:
This component driver depends on the following modules:
#define ILI9341_COLOR | ( | r, | |
g, | |||
b | |||
) | Swap16((((uint16_t)b) >> 3) | ((((uint16_t)g) << 3) & 0x07E0) | ((((uint16_t)r) << 8) & 0xf800)) |
#define ILI9341_DEFAULT_HEIGHT 240 |
#define ILI9341_DEFAULT_WIDTH 320 |
#define ILI9341_FLIP_X 1 |
Bit mask for flipping X for ili9341_set_orientation()
#define ILI9341_FLIP_Y 2 |
Bit mask for flipping Y for ili9341_set_orientation()
#define ILI9341_SWITCH_XY 4 |
Bit mask for swapping X and Y for ili9341_set_orientation()
#define ILI9341_SWITCH_XY_HEIGHT 320 |
#define ILI9341_SWITCH_XY_WIDTH 240 |
typedef uint16_t ili9341_color_t |
typedef int16_t ili9341_coord_t |
void ili9341_copy_pixels_from_screen | ( | ili9341_color_t * | pixels, |
uint32_t | count | ||
) |
Copy pixels from the screen to a pixel buffer.
Use this function to copy pixels from the display to an internal SRAM buffer.
Limits have to be set prior to calling this function, e.g.:
pixels | Pointer to the pixel buffer to read to |
count | Number of pixels to read |
Definiert in Zeile 503 der Datei ili9341.c.
void ili9341_copy_pixels_to_screen | ( | const ili9341_color_t * | pixels, |
uint32_t | count | ||
) |
Copy pixels from SRAM to the screen.
Used to copy a large quantitative of data to the screen in one go.
Limits have to be set prior to calling this function, e.g.:
pixels | Pointer to the pixel data |
count | Number of pixels to copy to the screen |
Definiert in Zeile 362 der Datei ili9341.c.
void ili9341_duplicate_pixel | ( | const ili9341_color_t | color, |
uint32_t | count | ||
) |
Set a given number of pixels to the same color.
Use this function to write a certain number of pixels to the same color within a set limit.
Limits have to be set prior to calling this function, e.g.:
color | The color to write to the display |
count | The number of pixels to write with this color |
Definiert in Zeile 471 der Datei ili9341.c.
void ili9341_init | ( | void | ) |
Initialise the controller.
Used to initialize the ILI9341 display controller by setting up the hardware interface, and setting up the controller according to the manufacturer's description. It also set up the screen orientation to the default state (portrait).
Definiert in Zeile 683 der Datei ili9341.c.
ili9341_color_t ili9341_read_gram | ( | void | ) |
Read a single color from the graphical memory.
Use this function to read a color from the graphical memory of the controller.
Limits have to be set prior to calling this function, e.g.:
ili9341_color_t | The read color pixel |
Definiert in Zeile 303 der Datei ili9341.c.
void ili9341_set_bottom_right_limit | ( | ili9341_coord_t | x, |
ili9341_coord_t | y | ||
) |
Set the display bottom right drawing limit.
Use this function to set the bottom right corner of the drawing limit box.
x | The x coordinate of the bottom right corner |
y | The y coordinate of the bottom right corner |
Definiert in Zeile 260 der Datei ili9341.c.
void ili9341_set_limits | ( | ili9341_coord_t | start_x, |
ili9341_coord_t | start_y, | ||
ili9341_coord_t | end_x, | ||
ili9341_coord_t | end_y | ||
) |
Set the full display drawing limits.
Use this function to set the full drawing limit box.
start_x | The x coordinate of the top left corner |
start_y | The y coordinate of the top left corner |
end_x | The x coordinate of the bottom right corner |
end_y | The y coordinate of the bottom right corner |
Definiert in Zeile 278 der Datei ili9341.c.
void ili9341_set_orientation | ( | uint8_t | flags | ) |
Sets the orientation of the display data.
Configures the display for a given orientation, including mirroring and/or screen rotation.
flags | Orientation flags to use, see ILI9341_FLIP_X, ILI9341_FLIP_Y and ILI9341_SWITCH_XY. |
Definiert in Zeile 707 der Datei ili9341.c.
void ili9341_set_top_left_limit | ( | ili9341_coord_t | x, |
ili9341_coord_t | y | ||
) |
Set the display top left drawing limit.
Use this function to set the top left limit of the drawing limit box.
x | The x coordinate of the top left corner |
y | The y coordinate of the top left corner |
Definiert in Zeile 244 der Datei ili9341.c.
void ili9341_write_gram | ( | ili9341_color_t | color | ) |
Write the graphical memory with a single color pixel.
Use this function to write a single color pixel to the controller memory.
Limits have to be set prior to calling this function, e.g.:
color | The color pixel to write to the screen |
Definiert in Zeile 335 der Datei ili9341.c.