35#ifdef PREINIT_SUPPORTED
39#ifdef MikroCCoreVersion
40 #if MikroCCoreVersion >= 1
45#include "drv_digital_out.h"
46#include "drv_i2c_master.h"
47#include "drv_spi_master.h"
60#define OLEDB_SSD1306_WIDTH 128
61#define OLEDB_DISPLAY_WIDTH 96
62#define OLEDB_DISPLAY_HEIGHT 39
63#define OLEDB_DISPLAY_ROWS 5
64#define OLEDB_FONT_5X7 0
65#define OLEDB_FONT_6X8 1
66#define OLEDB_DISPLAYOFF 0xAE
67#define OLEDB_SETDISPLAYCLOCKDIV 0xD5
68#define OLEDB_SETMULTIPLEX 0xA8
69#define OLEDB_SETDISPLAYOFFSET 0xD3
70#define OLEDB_SETSTARTLINE 0x40
71#define OLEDB_CHARGEPUMP 0x8D
72#define OLEDB_SETSEGMENTREMAP 0xA1
73#define OLEDB_SEGREMAP 0xA0
74#define OLEDB_COMSCANDEC 0xC8
75#define OLEDB_SETCOMPINS 0xDA
76#define OLEDB_SETCONTRAST 0x81
77#define OLEDB_SETPRECHARGE 0xD9
78#define OLEDB_SETVCOMDETECT 0xDB
79#define OLEDB_DISPLAYALLON_RESUME 0xA4
80#define OLEDB_NORMALDISPLAY 0xA6
81#define OLEDB_DISPLAYON 0xAF
82#define OLEDB_DISPLAYALLON 0xA5
83#define OLEDB_INVERTDISPLAY 0xA7
84#define OLEDB_SETLOWCOLUMN 0x00
85#define OLEDB_SETHIGHCOLUMN 0x10
86#define OLEDB_MEMORYMODE 0x20
87#define OLEDB_COLUMNADDR 0x21
88#define OLEDB_PAGEADDR 0x22
89#define OLEDB_COMSCANINC 0xC0
90#define OLEDB_EXTERNALVCC 0x01
91#define OLEDB_SWITCHCAPVCC 0x02
92#define OLEDB_ACTIVATE_SCROLL 0x2F
93#define OLEDB_DEACTIVATE_SCROLL 0x2E
94#define OLEDB_SET_VERTICAL_SCROLL_AREA 0xA3
95#define OLEDB_RIGHT_HORIZONTAL_SCROLL 0x26
96#define OLEDB_LEFT_HORIZONTAL_SCROLL 0x27
97#define OLEDB_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29
98#define OLEDB_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A
105#define OLEDB_COMMAND 0x3C
106#define OLEDB_DATA 0x3D
113#define OLEDB_MASTER_I2C 0
114#define OLEDB_MASTER_SPI 1
134#define OLEDB_INIT_ERROR 0xFF
135#define OLEDB_INVALID_DATA_MODE 0xFE
136#define OLEDB_INVALID_DRIVER_SELECTOR 0xFD
145#define OLEDB_MAP_MIKROBUS( cfg, mikrobus ) \
146 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
147 cfg.dc = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
148 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
149 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
150 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
151 cfg.sdi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
152 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
153 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
#define err_t
Definition oledb.h:126
void oledb_display_picture(oledb_t *ctx, oledb_resources_t *pic)
Display Picture function.
void oledb_send_data(oledb_t *ctx, oledb_data_t *tx_data, uint8_t data_len)
Send data function.
void oledb_write_char(oledb_t *ctx, uint8_t font, uint8_t row, uint8_t position, uint8_t data_in)
Write Char function.
void oledb_set_contrast(oledb_t *ctx, oledb_data_t value)
Contrast Setting function.
void oledb_send_cmd(oledb_t *ctx, oledb_data_t tx_cmd)
Send cmd function.
void oledb_stop_scroll(oledb_t *ctx)
Stop Scrolling function.
void oledb_scroll_right(oledb_t *ctx, oledb_data_t start_page_addr, oledb_data_t end_page_addr)
Scroll Right function.
err_t oledb_init(oledb_t *ctx, oledb_cfg_t *cfg)
Click Initialization function.
void oledb_default_cfg(oledb_t *ctx)
Click Default Configuration function.
void oledb_scroll_diag_left(oledb_t *ctx, oledb_data_t start_page_addr, oledb_data_t end_page_addr)
Scroll Diagonally Left function.
void oledb_clear_display(oledb_t *ctx)
Clear Display function.
void oledb_set_column(oledb_t *ctx, oledb_data_t col_addr)
Column Setting function.
void oledb_scroll_left(oledb_t *ctx, oledb_data_t start_page_addr, oledb_data_t end_page_addr)
Scroll Left function.
void oledb_write_string(oledb_t *ctx, uint8_t font, uint8_t row, uint8_t position, uint8_t *data_in)
Write String function.
void oledb_cfg_setup(oledb_cfg_t *cfg)
Configuration Object Setup function.
void oledb_set_page(oledb_t *ctx, oledb_data_t page_addr)
Page Setting function.
void oledb_scroll_diag_right(oledb_t *ctx, oledb_data_t start_page_addr, oledb_data_t end_page_addr)
Scroll Diagonally Right function.
uint8_t oledb_select_t
Communication type.
Definition oledb.h:173
const uint8_t oledb_resources_t
Definition oledb.h:167
struct oledb_s oledb_t
Click context object definition.
uint8_t oledb_drv_select_t
Definition oledb.h:163
uint8_t oledb_data_t
Definition oledb.h:165
void(* oledb_master_write_t)(struct oledb_s *, oledb_data_t *, uint8_t)
Definition oledb.h:169
Click configuration structure definition.
Definition oledb.h:204
pin_name_t sdi
Definition oledb.h:210
uint32_t i2c_speed
Definition oledb.h:217
oledb_select_t sel
Definition oledb.h:228
spi_master_chip_select_polarity_t cs_polarity
Definition oledb.h:221
pin_name_t sck
Definition oledb.h:209
spi_master_mode_t spi_mode
Definition oledb.h:220
pin_name_t dc
Definition oledb.h:207
uint32_t spi_speed
Definition oledb.h:219
pin_name_t scl
Definition oledb.h:211
pin_name_t miso
Definition oledb.h:213
pin_name_t sda
Definition oledb.h:212
pin_name_t rst
Definition oledb.h:206
pin_name_t cs
Definition oledb.h:208
uint8_t i2c_address
Definition oledb.h:218
Click context object definition.
Definition oledb.h:179
digital_out_t cs
Definition oledb.h:181
spi_master_t spi
Definition oledb.h:186
oledb_select_t master_sel
Definition oledb.h:196
digital_out_t dc
Definition oledb.h:183
oledb_master_write_t send
Definition oledb.h:195
i2c_master_t i2c
Definition oledb.h:187
digital_out_t rst
Definition oledb.h:182
uint8_t slave_address
Definition oledb.h:191
pin_name_t chip_select
Definition oledb.h:192