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"
59#define OLEDW_LCDWIDTH 96
60#define OLEDW_LCDHEIGHT 39
61#define OLEDW_DISPLAYOFF 0xAE
62#define OLEDW_SETDISPLAYCLOCKDIV 0xD5
63#define OLEDW_SETMULTIPLEX 0xA8
64#define OLEDW_SETDISPLAYOFFSET 0xD3
65#define OLEDW_SETSTARTLINE 0x40
66#define OLEDW_CHARGEPUMP 0x8D
67#define OLEDW_SETSEGMENTREMAP 0xA1
68#define OLEDW_SEGREMAP 0xA0
69#define OLEDW_COMSCANDEC 0xC8
70#define OLEDW_SETCOMPINS 0xDA
71#define OLEDW_SETCONTRAST 0x81
72#define OLEDW_SETPRECHARGE 0xD9
73#define OLEDW_SETVCOMDETECT 0xDB
74#define OLEDW_DISPLAYALLON_RESUME 0xA4
75#define OLEDW_NORMALDISPLAY 0xA6
76#define OLEDW_DISPLAYON 0xAF
77#define OLEDW_DISPLAYALLON 0xA5
78#define OLEDW_INVERTDISPLAY 0xA7
79#define OLEDW_SETLOWCOLUMN 0x00
80#define OLEDW_SETHIGHCOLUMN 0x10
81#define OLEDW_MEMORYMODE 0x20
82#define OLEDW_COLUMNADDR 0x21
83#define OLEDW_PAGEADDR 0x22
84#define OLEDW_COMSCANINC 0xC0
85#define OLEDW_EXTERNALVCC 0x1
86#define OLEDW_SWITCHCAPVCC 0x2
87#define OLEDW_ACTIVATE_SCROLL 0x2F
88#define OLEDW_DEACTIVATE_SCROLL 0x2E
89#define OLEDW_SET_VERTICAL_SCROLL_AREA 0xA3
90#define OLEDW_RIGHT_HORIZONTAL_SCROLL 0x26
91#define OLEDW_LEFT_HORIZONTAL_SCROLL 0x27
92#define OLEDW_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29
93#define OLEDW_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A
100#define OLEDW_COMMAND 0x3C
101#define OLEDW_DATA 0x3D
108#define OLEDW_MASTER_I2C 0
109#define OLEDW_MASTER_SPI 1
129#define OLEDW_INIT_ERROR 0xFF
130#define OLEDW_INVALID_DATA_MODE 0xFE
131#define OLEDW_INVALID_DRIVER_SELECTOR 0xFD
140#define OLEDW_MAP_MIKROBUS( cfg, mikrobus ) \
141 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
142 cfg.dc = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
143 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
144 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
145 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
146 cfg.sdi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
147 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
148 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
#define err_t
Definition oledw.h:121
void oledw_display_picture(oledw_t *ctx, oledw_resources_t *pic)
Display Picture function.
err_t oledw_send(oledw_t *ctx, oledw_data_t tx_data, oledw_data_mode_t data_mode)
Send function.
void oledw_scroll_left(oledw_t *ctx, oledw_data_t start_page_addr, oledw_data_t end_page_addr)
Scroll Left function.
void oledw_scroll_diag_right(oledw_t *ctx, oledw_data_t start_page_addr, oledw_data_t end_page_addr)
Scroll Diagonally Right function.
void oledw_stop_scroll(oledw_t *ctx)
Stop Scrolling function.
void oledw_default_cfg(oledw_t *ctx)
Click Default Configuration function.
void oledw_set_column(oledw_t *ctx, oledw_data_t col_addr)
Column Setting function.
void oledw_set_contrast(oledw_t *ctx, oledw_data_t value)
Contrast Setting function.
void oledw_set_page(oledw_t *ctx, oledw_data_t page_addr)
Page Setting function.
err_t oledw_init(oledw_t *ctx, oledw_cfg_t *cfg)
Click Initialization function.
void oledw_scroll_right(oledw_t *ctx, oledw_data_t start_page_addr, oledw_data_t end_page_addr)
Scroll Right function.
void oledw_cfg_setup(oledw_cfg_t *cfg)
Configuration Object Setup function.
void oledw_scroll_diag_left(oledw_t *ctx, oledw_data_t start_page_addr, oledw_data_t end_page_addr)
Scroll Diagonally Left function.
struct oledw_s oledw_t
Click context object definition.
uint8_t oledw_select_t
Communication type.
Definition oledw.h:169
uint8_t oledw_data_mode_t
Definition oledw.h:161
err_t(* oledw_master_write_t)(struct oledw_s *, oledw_data_t, oledw_data_mode_t)
Definition oledw.h:165
uint8_t oledw_data_t
Definition oledw.h:160
const uint8_t oledw_resources_t
Definition oledw.h:163
uint8_t oledw_drv_select_t
Definition oledw.h:158
Click configuration structure definition.
Definition oledw.h:200
oledw_select_t sel
Definition oledw.h:224
pin_name_t sdi
Definition oledw.h:206
uint32_t i2c_speed
Definition oledw.h:213
spi_master_chip_select_polarity_t cs_polarity
Definition oledw.h:217
pin_name_t sck
Definition oledw.h:205
spi_master_mode_t spi_mode
Definition oledw.h:216
pin_name_t dc
Definition oledw.h:203
uint32_t spi_speed
Definition oledw.h:215
pin_name_t scl
Definition oledw.h:207
pin_name_t miso
Definition oledw.h:209
pin_name_t sda
Definition oledw.h:208
pin_name_t rst
Definition oledw.h:202
pin_name_t cs
Definition oledw.h:204
uint8_t i2c_address
Definition oledw.h:214
Click context object definition.
Definition oledw.h:175
digital_out_t cs
Definition oledw.h:177
spi_master_t spi
Definition oledw.h:182
oledw_master_write_t send
Definition oledw.h:191
digital_out_t dc
Definition oledw.h:179
i2c_master_t i2c
Definition oledw.h:183
digital_out_t rst
Definition oledw.h:178
uint8_t slave_address
Definition oledw.h:187
oledw_select_t master_sel
Definition oledw.h:192
pin_name_t chip_select
Definition oledw.h:188