TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
tm_stm32f4_ili9341_button.h
1 
36 #ifndef TM_ILI9341_BUTTON_H
37 #define TM_ILI9341_BUTTON_H
38 
53 #include "stm32f4xx.h"
54 #include "stm32f4xx_rcc.h"
55 #include "stm32f4xx_gpio.h"
56 #include "defines.h"
57 #include "tm_stm32f4_i2c.h"
58 #include "tm_stm32f4_delay.h"
59 #include "tm_stm32f4_ili9341.h"
60 #include "tm_stm32f4_fonts.h"
61 #include "tm_stm32f4_stmpe811.h"
62 
63 // Maximum number of buttons available
64 #ifndef TM_ILI9341_BUTTON_MAX_BUTTONS
65 #define TM_ILI9341_BUTTON_MAX_BUTTONS 10
66 #endif
67 
68 //Button flags
69 #define TM_BUTTON_FLAG_ENABLED 0x0001 // Button is enabled - internal flag
70 #define TM_BUTTON_FLAG_NOBORDER 0x0002 // No border used in
71 #define TM_BUTTON_FLAG_IMAGE 0x0004 // Use image for background
72 #define TM_BUTTON_FLAG_NOLABEL 0x0008 // Do not display button label
73 #define TM_BUTTON_FLAG_USED 0x8000 // Button is used - internal flag
74 
91 typedef struct {
92  uint16_t x;
93  uint16_t y;
94  uint16_t width;
95  uint16_t height;
96  uint16_t background;
97  uint16_t borderColor;
98  uint16_t flags;
99  char* label;
100  TM_FontDef_t* font;
101  uint16_t color;
102  uint16_t* image;
104 
105 extern TM_ILI9341_Button_t TM_ILI9341_Buttons[TM_ILI9341_BUTTON_MAX_BUTTONS];
106 
115 extern int8_t TM_ILI9341_Button_Add(TM_ILI9341_Button_t* button);
116 
125 extern ErrorStatus TM_ILI9341_Button_Draw(uint8_t id);
126 
132 extern void TM_ILI9341_Button_DrawAll(void);
133 
140 extern void TM_ILI9341_Button_Enable(uint8_t id);
141 
148 extern void TM_ILI9341_Button_Disable(uint8_t id);
149 
155 extern void TM_ILI9341_Button_DeleteAll(void);
156 
163 extern void TM_ILI9341_Button_Delete(uint8_t id);
164 
173 extern int8_t TM_ILI9341_Button_Touch(TM_STMPE811_TouchData* TouchData);
174 
175 #endif
176 
Main structure, which is passed into TM_STMPE811_ReadTouch function.
Definition: tm_stm32f4_stmpe811.h:160
Definition: tm_stm32f4_ili9341_button.h:91
Font structure used on my LCD libraries.
Definition: tm_stm32f4_fonts.h:89