Hanna
Sourcecode Batteriemanagementsystem
ili9341.h
gehe zur Dokumentation dieser Datei
1 
44 #ifndef ILI9341_H_INCLUDED
45 #define ILI9341_H_INCLUDED
46 
47 #include <board_init.h>
48 #include "port_driver.h"
49 #include <compiler.h>
50 
51 
52 /* Controller and interface configuration file */
59 #if defined(QVGA_SPI)
60 #define CONF_ILI9341_SPI QVGA_SPI
61 #elif defined(QVGA_USART_SPI)
62 #define CONF_ILI9341_USART_SPI QVGA_USART_SPI
63 #endif
64 
74 #define CONF_ILI9341_CLOCK_SPEED 8000000UL
75 
77 #define CONF_ILI9341_CS_PIN QVGA_CS
78 
80 #define CONF_ILI9341_DC_PIN QVGA_DC
81 
83 //#define CONF_ILI9341_BACKLIGHT_PIN QVGA_BACKLIGHT
84 
86 #define CONF_ILI9341_RESET_PIN QVGA_LCD_RESET
87 
88 
89 #if defined(CONF_ILI9341_USART_SPI)
90 # include <serial_interface/usart_spi.h>
91 #elif defined(CONF_ILI9341_SPI)
92 # include <spi_master.h>
93 #else
94 # error "Interface not supported by the component driver"
95 #endif
96 
97 
98 
140 #define ILI9341_COLOR(r, g, b) Swap16((((uint16_t)b) >> 3) | ((((uint16_t)g) << 3) & 0x07E0) | ((((uint16_t)r) << 8) & 0xf800))
141 
143 typedef uint16_t ili9341_color_t;
144 
147 typedef int16_t ili9341_coord_t;
148 
155 #define ILI9341_FLIP_X 1
156 
157 #define ILI9341_FLIP_Y 2
158 
159 #define ILI9341_SWITCH_XY 4
160 
164 #define ILI9341_DEFAULT_HEIGHT 240
165 
167 #define ILI9341_DEFAULT_WIDTH 320
168 
170 #define ILI9341_SWITCH_XY_HEIGHT 320
171 
173 #define ILI9341_SWITCH_XY_WIDTH 240
174 
180 
182 
184 
186 
188  ili9341_coord_t end_x, ili9341_coord_t end_y);
189 
190 void ili9341_set_orientation(uint8_t flags);
191 
193  uint32_t count);
194 
195 #if XMEGA
196 void ili9341_copy_progmem_pixels_to_screen( ili9341_color_t PROGMEM_PTR_T pixels, uint32_t count, uint8_t swap);
197 #endif
198 
199 void ili9341_copy_pixels_from_screen(ili9341_color_t *pixels, uint32_t count);
200 
201 void ili9341_duplicate_pixel(const ili9341_color_t color, uint32_t count);
202 
210 void ili9341_init(void);
211 
212 /*
213 *
214  * \brief Function to turn on the display back light
215  *
216  * Use this function to simply set the pin controlling the back light high to
217  * turn on the back light.
218  *
219  * \note It is up to the user application if other means of controlling this pin
220  * should be used, e.g. a PWM signal to be able to dim the display.
221 
222 static inline void ili9341_backlight_on(void)
223 {
224  IO_SetPinHigh(CONF_ILI9341_BACKLIGHT_PIN);
225 }
226 
227 *
228  * \brief Function to turn off the display back light
229  *
230  * Use this function to simply set the pin controlling the back light low to
231  * turn off the back light.
232 
233 static inline void ili9341_backlight_off(void)
234 {
235  IO_SetPinLow(CONF_ILI9341_BACKLIGHT_PIN);
236 }
237 */
238 
246 #endif /* ILI9341_H_INCLUDED */
void ili9341_write_gram(ili9341_color_t color)
Write the graphical memory with a single color pixel.
Definition: ili9341.c:335
Standard board header file. Diese Datei enthält die Standardparameter und Pinbelegungen für das BMS B...
Commonly used includes, types and macros.
void ili9341_set_orientation(uint8_t flags)
Sets the orientation of the display data.
Definition: ili9341.c:707
void ili9341_init(void)
Initialise the controller.
Definition: ili9341.c:683
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.
Definition: ili9341.c:278
int16_t ili9341_coord_t
Definition: ili9341.h:147
XMEGA I/O Port driver header file.
void ili9341_copy_progmem_pixels_to_screen(ili9341_color_t PROGMEM_PTR_T pixels, uint32_t count, uint8_t swap)
Copy pixels from progmem to the screen.
Definition: ili9341.c:426
void ili9341_set_top_left_limit(ili9341_coord_t x, ili9341_coord_t y)
Set the display top left drawing limit.
Definition: ili9341.c:244
void ili9341_copy_pixels_to_screen(const ili9341_color_t *pixels, uint32_t count)
Copy pixels from SRAM to the screen.
Definition: ili9341.c:362
uint16_t ili9341_color_t
Definition: ili9341.h:143
void ili9341_duplicate_pixel(const ili9341_color_t color, uint32_t count)
Set a given number of pixels to the same color.
Definition: ili9341.c:471
ili9341_color_t ili9341_read_gram(void)
Read a single color from the graphical memory.
Definition: ili9341.c:303
void ili9341_copy_pixels_from_screen(ili9341_color_t *pixels, uint32_t count)
Copy pixels from the screen to a pixel buffer.
Definition: ili9341.c:503
SPI Master driver header file.
void ili9341_set_bottom_right_limit(ili9341_coord_t x, ili9341_coord_t y)
Set the display bottom right drawing limit.
Definition: ili9341.c:260