oled 1.0
OLED Graphics Control Library
Loading...
Searching...
No Matches
frame.h
Go to the documentation of this file.
1
18
19#ifndef FRAME_H_
20#define FRAME_H_
21
22 #ifndef F_CPU
30 #define F_CPU 12000000UL
31 #endif
32
33 #ifndef FRAME_WIDTH
43 #define FRAME_WIDTH OLED_COLUMN_SIZE
44 #endif
45
46 #ifndef FRAME_HEIGHT
56 #define FRAME_HEIGHT OLED_ROW_SIZE
57 #endif
58
59 #ifndef FRAME_SPECIFIC_BACKGROUND
71 #define FRAME_SPECIFIC_BACKGROUND
72 #endif
73
74 #ifndef FRAME_NUMBER_ENABLE_FLOATING_POINT
84 //#define FRAME_NUMBER_ENABLE_FLOATING_POINT
85
86 #ifdef _DOXYGEN_ // Used for documentation, can be ignored
87 #define FRAME_NUMBER_ENABLE_FLOATING_POINT
88 #endif
89
90 #ifndef FRAME_NUMBER_PRECISION
100 #define FRAME_NUMBER_PRECISION 2
101 #endif
102 #endif
103
104 #include <stdlib.h>
105 #include <string.h>
106 #include <avr/io.h>
107 #include <avr/pgmspace.h>
108 #include <util/delay.h>
109
110 #include "../oled.h"
111 #include "../font/font.h"
115
129
135
136 void frame_init(void);
137 void frame_draw_char(const char character, DRAWING_Position position);
138 void frame_draw_text(const char *text, DRAWING_Position position);
139 void frame_draw_number(const void* number, unsigned char length, NUMBER_Type type, NUMBER_Radix radix, DRAWING_Position position);
140 void frame_draw_number_uint(const unsigned int number, unsigned char length, NUMBER_Radix radix, DRAWING_Position position);
141 void frame_draw_number_int(const int number, unsigned char length, NUMBER_Radix radix, DRAWING_Position position);
142 void frame_draw_bar(DRAWING_Position position, DRAWING_Size size, unsigned char percent);
143 void frame_clear(void);
144
145#endif /* FRAME_H_ */
Enumeration definitions for various numerical data types.
enum NUMBER_Type_t NUMBER_Type
Alias for enum NUMBER_Type_t representing various number data types.
Definition datatypes.h:45
struct DRAWING_Size_t DRAWING_Size
Alias for enum DRAWING_Size_t representing a drawing area/size.
Definition elements.h:54
struct DRAWING_Position_t DRAWING_Position
Alias for enum DRAWING_Position_t representing a drawing point.
Definition elements.h:37
Header file for font handling and character bitmap retrieval.
void frame_draw_number_int(const int number, unsigned char length, NUMBER_Radix radix, DRAWING_Position position)
Inline helper function to draw a signed integer number on the OLED display.
Definition frame.c:384
enum FRAME_Number_Operation_t FRAME_Number_Operation
Alias for enum FRAME_Number_Operation_t representing numeric operation modes.
Definition frame.h:134
void frame_init(void)
Initializes the frame system and OLED display.
Definition frame.c:177
void frame_clear(void)
Clears the entire display frame.
Definition frame.c:435
void frame_draw_bar(DRAWING_Position position, DRAWING_Size size, unsigned char percent)
Draws a horizontal progress bar on the OLED display.
Definition frame.c:474
void frame_draw_char(const char character, DRAWING_Position position)
Renders a single character on the OLED display at a specified position.
Definition frame.c:227
void frame_draw_text(const char *text, DRAWING_Position position)
Renders a text string on the OLED display at a specified position.
Definition frame.c:206
FRAME_Number_Operation_t
Specifies the numeric operation modes for number rendering.
Definition frame.h:124
@ FRAME_Number_Operation_Signed
Definition frame.h:126
@ FRAME_Number_Operation_Decimal
Definition frame.h:125
@ FRAME_Number_Operation_Unsigned
Definition frame.h:127
void frame_draw_number_uint(const unsigned int number, unsigned char length, NUMBER_Radix radix, DRAWING_Position position)
Inline helper function to draw an unsigned integer number on the OLED display.
Definition frame.c:367
void frame_draw_number(const void *number, unsigned char length, NUMBER_Type type, NUMBER_Radix radix, DRAWING_Position position)
Renders a formatted number on the OLED display at a specified position.
Definition frame.c:279
Header file for OLED display control via hardware or software TWI/I2C.
Enumeration for numerical radix options.
enum NUMBER_Radix_t NUMBER_Radix
Alias for enum NUMBER_Radix_t representing numerical radix options.
Definition radix.h:42