File OledController.hpp
FileList > demo-projets > stm32 > include > OledController.hpp
Go to the source code of this file.
#include <stddef.h>
#include "I2cController.hpp"
#include "rbcx.pb.h"
#include "OledController_fonts.hpp"
Classes
Type | Name |
---|---|
struct | OLED_VERTEX |
struct | OLED_t |
Public Types
Type | Name |
---|---|
enum | OLED_COLOR |
enum | OLED_Error_t |
Public Functions
Type | Name |
---|---|
void | oledDispatch (const CoprocReq_OledReq & request) |
void | oledDrawArc (uint8_t x, uint8_t y, uint8_t radius, uint16_t start_angle, uint16_t sweep, OLED_COLOR color) |
void | oledDrawCircle (uint8_t par_x, uint8_t par_y, uint8_t par_r, OLED_COLOR color) |
void | oledDrawLine (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, OLED_COLOR color) |
void | oledDrawPixel (uint8_t x, uint8_t y, OLED_COLOR color) |
void | oledDrawRectangle (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, OLED_COLOR color) |
void | oledFill (OLED_COLOR color) |
OLED_Error_t | oledFillBuffer (uint8_t * buf, uint32_t len) |
bool | oledGetDisplayOn () Reads DisplayOn state. |
void | oledInit (const CoprocReq_OledInit & init) |
void | oledInitOld (void) |
void | oledInitStm () |
void | oledPolyline (const OLED_VERTEX * par_vertex, uint16_t par_size, OLED_COLOR color) |
void | oledSetContrast (const uint8_t value) Sets the contrast of the display. |
void | oledSetCursor (uint8_t x, uint8_t y) |
void | oledSetDisplayOn (const bool on) Set Display ON/OFF. |
bool | oledTestConnection () |
void | oledUpdateScreen (void) |
char | oledWriteChar (char ch, FontDef Font, OLED_COLOR color) |
void | oledWriteCommand (uint8_t byte) |
void | oledWriteData (uint8_t * buffer, size_t buff_size) |
char | oledWriteString (const char * str, FontDef Font, OLED_COLOR color) |
Macros
Type | Name |
---|---|
define | OLED_BUFFER_SIZE 1024 |
define | OLED_I2C_ADDR 0x3C |
Public Types Documentation
enum OLED_COLOR
enum OLED_COLOR {
Black = 0x00,
White = 0x01
};
enum OLED_Error_t
enum OLED_Error_t {
OLED_OK = 0x00,
OLED_ERR = 0x01
};
Public Functions Documentation
function oledDispatch
void oledDispatch (
const CoprocReq_OledReq & request
)
function oledDrawArc
void oledDrawArc (
uint8_t x,
uint8_t y,
uint8_t radius,
uint16_t start_angle,
uint16_t sweep,
OLED_COLOR color
)
function oledDrawCircle
void oledDrawCircle (
uint8_t par_x,
uint8_t par_y,
uint8_t par_r,
OLED_COLOR color
)
function oledDrawLine
void oledDrawLine (
uint8_t x1,
uint8_t y1,
uint8_t x2,
uint8_t y2,
OLED_COLOR color
)
function oledDrawPixel
void oledDrawPixel (
uint8_t x,
uint8_t y,
OLED_COLOR color
)
function oledDrawRectangle
void oledDrawRectangle (
uint8_t x1,
uint8_t y1,
uint8_t x2,
uint8_t y2,
OLED_COLOR color
)
function oledFill
void oledFill (
OLED_COLOR color
)
function oledFillBuffer
OLED_Error_t oledFillBuffer (
uint8_t * buf,
uint32_t len
)
function oledGetDisplayOn
Reads DisplayOn state.
bool oledGetDisplayOn ()
Returns:
0: OFF. 1: ON.
function oledInit
void oledInit (
const CoprocReq_OledInit & init
)
function oledInitOld
void oledInitOld (
void
)
function oledInitStm
void oledInitStm ()
function oledPolyline
void oledPolyline (
const OLED_VERTEX * par_vertex,
uint16_t par_size,
OLED_COLOR color
)
function oledSetContrast
Sets the contrast of the display.
void oledSetContrast (
const uint8_t value
)
Parameters:
value
contrast to set.
Note:
Contrast increases as the value increases.
Note:
RESET = 7Fh.
function oledSetCursor
void oledSetCursor (
uint8_t x,
uint8_t y
)
function oledSetDisplayOn
Set Display ON/OFF.
void oledSetDisplayOn (
const bool on
)
Parameters:
on
0 for OFF, any for ON.
function oledTestConnection
bool oledTestConnection ()
function oledUpdateScreen
void oledUpdateScreen (
void
)
function oledWriteChar
char oledWriteChar (
char ch,
FontDef Font,
OLED_COLOR color
)
function oledWriteCommand
void oledWriteCommand (
uint8_t byte
)
function oledWriteData
void oledWriteData (
uint8_t * buffer,
size_t buff_size
)
function oledWriteString
char oledWriteString (
const char * str,
FontDef Font,
OLED_COLOR color
)
Macro Definition Documentation
define OLED_BUFFER_SIZE
#define OLED_BUFFER_SIZE 1024
define OLED_I2C_ADDR
#define OLED_I2C_ADDR 0x3C
This Library was originally written by Olivier Van den Eede (4ilo) in 2016. Some refactoring was done and SPI support was added by Aleksander Alekseev (afiskon) in 2018.
https://github.com/afiskon/stm32-oled
The documentation for this class was generated from the following file demo-projets/stm32/include/OledController.hpp