42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_spi_master.h"
68#define OLEDC_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
73 cfg.rw = MIKROBUS( mikrobus, MIKROBUS_AN ); \
74 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
75 cfg.dc = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
76 cfg.en = MIKROBUS( mikrobus, MIKROBUS_INT );
83#define OLEDC_RETVAL uint8_t
86#define OLEDC_INIT_ERROR 0xFF
93#define OLEDC_FO_HORIZONTAL 0x00
94#define OLEDC_FO_VERTICAL 0x01
95#define OLEDC_FO_VERTICAL_COLUMN 0x02
102#define OLEDC_RMP_INC_HOR 0x00
103#define OLEDC_RMP_INC_VER 0x01
104#define OLEDC_RMP_COLOR_NOR 0x00
105#define OLEDC_RMP_COLOR_REV 0x02
106#define OLEDC_RMP_SEQ_RGB 0x00
107#define OLEDC_RMP_SEQ_BGR 0x04
108#define OLEDC_RMP_SCAN_NOR 0x00
109#define OLEDC_RMP_SCAN_REV 0x10
110#define OLEDC_RMP_SPLIT_DISABLE 0x00
111#define OLEDC_RMP_SPLIT_ENABLE 0x20
112#define OLEDC_COLOR_65K 0x00
113#define OLEDC_COLOR_262K 0x80
114#define OLEDC_IMG_HEAD 0x06
121#define OLEDC_SCREEN_WIDTH 0x60
122#define OLEDC_SCREEN_HEIGHT 0x60
123#define OLEDC_SCREEN_SIZE 0x2400
124#define OLEDC_ROW_OFF 0x00
125#define OLEDC_COL_OFF 0x10
132#define OLEDC_SET_COL_ADDRESS 0x15
133#define OLEDC_SET_ROW_ADDRESS 0x75
134#define OLEDC_WRITE_RAM 0x5C
135#define OLEDC_READ_RAM 0x5D
136#define OLEDC_SET_REMAP 0xA0
137#define OLEDC_SET_START_LINE 0xA1
138#define OLEDC_SET_OFFSET 0xA2
139#define OLEDC_MODE_OFF 0xA4
140#define OLEDC_MODE_ON 0xA5
141#define OLEDC_MODE_NORMAL 0xA6
142#define OLEDC_MODE_INVERSE 0xA7
143#define OLEDC_FUNCTION 0xAB
144#define OLEDC_SLEEP_ON 0xAE
145#define OLEDC_SLEEP_OFF 0xAF
146#define OLEDC_NOP 0xB0
147#define OLEDC_SET_RESET_PRECH 0xB1
148#define OLEDC_ENHANCEMENT 0xB2
149#define OLEDC_CLOCK_DIV 0xB3
150#define OLEDC_VSL 0xB4
151#define OLEDC_GPIO 0xB5
152#define OLEDC_SETSEC_PRECH 0xB6
153#define OLEDC_GREY_SCALE 0xB8
154#define OLEDC_LUT 0xB9
155#define OLEDC_PRECH_VOL 0xBB
156#define OLEDC_VCOMH 0xBE
157#define OLEDC_CONTRAST 0xC1
158#define OLEDC_MASTER_CONTRAST 0xC7
159#define OLEDC_MUX_RATIO 0xCA
160#define OLEDC_COMMAND_LOCK 0xFD
161#define OLEDC_SCROLL_HOR 0x96
162#define OLEDC_START_MOV 0x9E
163#define OLEDC_STOP_MOV 0x9F
166#define OLEDC_DEFAULT_MUX_RATIO 95
167#define OLEDC_DEFAULT_START_LINE 0x80
168#define OLEDC_DEFAULT_OFFSET 0x20
170#define OLEDC_DEFAULT_OLED_LOCK 0x12
171#define OLEDC_DEFAULT_CMD_LOCK 0xB1
172#define OLEDC_DEFAULT_DIVSET 0xF1
173#define OLEDC_DEFAULT_PRECHARGE 0x32
174#define OLEDC_DEFAULT_VCOMH 0x05
175#define OLEDC_DEFAULT_MASTER_CONT 0xCF
176#define OLEDC_DEFAULT_PRECHARGE_2 0x01
#define OLEDC_RETVAL
Definition oledc.h:83
void oledc_one_arg_commands(oledc_t *ctx, uint8_t command, uint8_t args)
Command Send with one argument.
void oledc_more_arg_commands(oledc_t *ctx, uint8_t command, uint8_t *args, uint16_t args_len)
Command Send with more argument.
OLEDC_RETVAL oledc_init(oledc_t *ctx, oledc_cfg_t *cfg)
Initialization function.
void oledc_fill_screen(oledc_t *ctx, uint16_t color)
Fill Screen.
void oledc_image(oledc_t *ctx, const uint8_t *img, uint8_t col_off, uint8_t row_off)
Draw BMP Image.
void oledc_reset(oledc_t *ctx)
Click Hardware Reset.
void oledc_default_cfg(oledc_t *ctx)
Click Default Configuration function.
void oledc_text(oledc_t *ctx, uint8_t *text, uint16_t x, uint16_t y)
Draw Text.
void oledc_enable(oledc_t *ctx, uint8_t state)
Click Enable/Disable.
void oledc_set_font(oledc_t *ctx, const uint8_t *font_s, uint16_t color)
Font Setup.
void oledc_rectangle(oledc_t *ctx, uint8_t col_off, uint8_t row_off, uint8_t col_end, uint8_t row_end, uint16_t color)
Draw Rectangle.
void oledc_cfg_setup(oledc_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition oledc.h:221
spi_master_chip_select_polarity_t cs_polarity
Definition oledc.h:240
pin_name_t sck
Definition oledc.h:226
spi_master_mode_t spi_mode
Definition oledc.h:239
pin_name_t dc
Definition oledc.h:233
pin_name_t mosi
Definition oledc.h:225
uint32_t spi_speed
Definition oledc.h:238
pin_name_t en
Definition oledc.h:234
pin_name_t miso
Definition oledc.h:224
pin_name_t rst
Definition oledc.h:232
pin_name_t rw
Definition oledc.h:231
pin_name_t cs
Definition oledc.h:227
Click ctx object definition.
Definition oledc.h:192
digital_out_t cs
Definition oledc.h:199
spi_master_t spi
Definition oledc.h:203
uint16_t font_first_char
Definition oledc.h:209
uint16_t y_cord
Definition oledc.h:213
digital_out_t dc
Definition oledc.h:197
uint16_t font_height
Definition oledc.h:211
digital_out_t en
Definition oledc.h:198
digital_out_t rst
Definition oledc.h:196
digital_out_t rw
Definition oledc.h:195
const uint8_t * font_obj
Definition oledc.h:206
uint16_t x_cord
Definition oledc.h:212
pin_name_t chip_select
Definition oledc.h:204
uint16_t font_color
Definition oledc.h:207
uint8_t font_orientation
Definition oledc.h:208
uint16_t font_last_char
Definition oledc.h:210