TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
tm_stm32f4_ssd1306.h
1 
30 #ifndef TM_SSD1306_H
31 #define TM_SSD1306_H 100
32 
33 /* C++ detection */
34 #ifdef __cplusplus
35 extern C {
36 #endif
37 
103 #include "stm32f4xx.h"
104 #include "defines.h"
105 #include "tm_stm32f4_i2c.h"
106 #include "tm_stm32f4_fonts.h"
107 #include "tm_stm32f4_delay.h"
108 
109 #include "stdlib.h"
110 #include "string.h"
111 
118 /* I2C settings */
119 #ifndef SSD1306_I2C
120 #define SSD1306_I2C I2C3
121 #define SSD1306_I2C_PINSPACK TM_I2C_PinsPack_1
122 #endif
123 
124 /* I2C address */
125 #ifndef SSD1306_I2C_ADDR
126 #define SSD1306_I2C_ADDR 0x78
127 /* Use defines.h for custom definitions */
128 //#define SSD1306_I2C_ADDR 0x7A
129 #endif
130 
131 /* SSD1306 settings */
132 /* SSD1306 width in pixels */
133 #ifndef SSD1306_WIDTH
134 #define SSD1306_WIDTH 128
135 #endif
136 /* SSD1306 LCD height in pixels */
137 #ifndef SSD1306_HEIGHT
138 #define SSD1306_HEIGHT 64
139 #endif
140 
154 typedef enum {
158 
176 uint8_t TM_SSD1306_Init(void);
177 
184 void TM_SSD1306_UpdateScreen(void);
185 
192 void TM_SSD1306_ToggleInvert(void);
193 
200 void TM_SSD1306_Fill(SSD1306_COLOR_t Color);
201 
210 void TM_SSD1306_DrawPixel(uint16_t x, uint16_t y, SSD1306_COLOR_t color);
211 
218 void TM_SSD1306_GotoXY(uint16_t x, uint16_t y);
219 
228 char TM_SSD1306_Putc(char ch, TM_FontDef_t* Font, SSD1306_COLOR_t color);
229 
238 char TM_SSD1306_Puts(char* str, TM_FontDef_t* Font, SSD1306_COLOR_t color);
239 
250 void TM_SSD1306_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, SSD1306_COLOR_t c);
251 
262 void TM_SSD1306_DrawRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h, SSD1306_COLOR_t c);
263 
274 void TM_SSD1306_DrawFilledRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h, SSD1306_COLOR_t c);
275 
288 void TM_SSD1306_DrawTriangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, SSD1306_COLOR_t color);
289 
299 void TM_SSD1306_DrawCircle(int16_t x0, int16_t y0, int16_t r, SSD1306_COLOR_t c);
300 
310 void TM_SSD1306_DrawFilledCircle(int16_t x0, int16_t y0, int16_t r, SSD1306_COLOR_t c);
311 
324 /* C++ detection */
325 #ifdef __cplusplus
326 }
327 #endif
328 
329 #endif
Definition: tm_stm32f4_ssd1306.h:155
Definition: tm_stm32f4_ssd1306.h:156
char TM_SSD1306_Putc(char ch, TM_FontDef_t *Font, SSD1306_COLOR_t color)
Puts character to internal RAM.
void TM_SSD1306_GotoXY(uint16_t x, uint16_t y)
Sets cursor pointer to desired location for strings.
void TM_SSD1306_DrawPixel(uint16_t x, uint16_t y, SSD1306_COLOR_t color)
Draws pixel at desired location.
void TM_SSD1306_Fill(SSD1306_COLOR_t Color)
Fills entire LCD with desired color.
void TM_SSD1306_DrawRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h, SSD1306_COLOR_t c)
Draws rectangle on LCD.
char TM_SSD1306_Puts(char *str, TM_FontDef_t *Font, SSD1306_COLOR_t color)
Puts string to internal RAM.
void TM_SSD1306_DrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, SSD1306_COLOR_t c)
Draws line on LCD.
void TM_SSD1306_DrawFilledRectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h, SSD1306_COLOR_t c)
Draws filled rectangle on LCD.
void TM_SSD1306_UpdateScreen(void)
Updates buffer from internal RAM to LCD.
void TM_SSD1306_ToggleInvert(void)
Toggles pixels invertion inside internal RAM.
SSD1306_COLOR_t
SSD1306 color enumeration.
Definition: tm_stm32f4_ssd1306.h:154
void TM_SSD1306_DrawCircle(int16_t x0, int16_t y0, int16_t r, SSD1306_COLOR_t c)
Draws circle to STM buffer.
void TM_SSD1306_DrawTriangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t x3, uint16_t y3, SSD1306_COLOR_t color)
Draws triangle on LCD.
uint8_t TM_SSD1306_Init(void)
Initializes SSD1306 LCD.
void TM_SSD1306_DrawFilledCircle(int16_t x0, int16_t y0, int16_t r, SSD1306_COLOR_t c)
Draws filled circle to STM buffer.
Font structure used on my LCD libraries.
Definition: tm_stm32f4_fonts.h:89