Go to the documentation of this file.
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
40 #include "drv_spi_master.h"
53 #define OLEDSWITCH_MAP_MIKROBUS( cfg, mikrobus ) \
54 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
55 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
56 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
57 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
58 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
59 cfg.cd = MIKROBUS( mikrobus, MIKROBUS_PWM )
66 #define OLEDSWITCH_RETVAL uint8_t
68 #define OLEDSWITCH_OK 0x00
69 #define OLEDSWITCH_INIT_ERROR 0xFF
76 #define OLEDSWITCH_15_CONTRAST_FOR_COLOR_A_1 0x81
77 #define OLEDSWITCH_15_CONTRAST_FOR_COLOR_A_2 0x19
78 #define OLEDSWITCH_15_CONTRAST_FOR_COLOR_B_1 0x82
79 #define OLEDSWITCH_15_CONTRAST_FOR_COLOR_B_2 0x14
80 #define OLEDSWITCH_15_CONTRAST_FOR_COLOR_C_1 0x83
81 #define OLEDSWITCH_15_CONTRAST_FOR_COLOR_C_2 0x24
83 #define OLEDSWITCH_30_CONTRAST_FOR_COLOR_A_1 0x81
84 #define OLEDSWITCH_30_CONTRAST_FOR_COLOR_A_2 0x15
85 #define OLEDSWITCH_30_CONTRAST_FOR_COLOR_B_1 0x82
86 #define OLEDSWITCH_30_CONTRAST_FOR_COLOR_B_2 0x1A
87 #define OLEDSWITCH_30_CONTRAST_FOR_COLOR_C_1 0x83
88 #define OLEDSWITCH_30_CONTRAST_FOR_COLOR_C_2 0x17
90 #define OLEDSWITCH_MASTER_CURRENT_CONTROL_1 0x87
91 #define OLEDSWITCH_MASTER_CURRENT_CONTROL_2 0x0F
93 #define OLEDSWITCH_REMAP_AND_COLOR_DEPTH_SETTING_1 0xA0
94 #define OLEDSWITCH_REMAP_AND_COLOR_DEPTH_SETTING_2 0x70
96 #define OLEDSWITCH_SET_DISPLAY_START_LINE_1 0xA1
97 #define OLEDSWITCH_SET_DISPLAY_START_LINE_2 0x00
99 #define OLEDSWITCH_SET_DISPLAY_OFFSET_1 0xA2
100 #define OLEDSWITCH_SET_DISPLAY_OFFSET_2 0x10
102 #define OLEDSWITCH_NORMAL_DISPLAY 0xA4
104 #define OLEDSWITCH_MULTIPLEX_RATIO_1 0xA8
105 #define OLEDSWITCH_MULTIPLEX_RATIO_2 0x2F
107 #define OLEDSWITCH_DIM_MODE_SETTING_FOR_COLOR_A_B_C_1 0xAB
108 #define OLEDSWITCH_DIM_MODE_SETTING_FOR_COLOR_A_B_C_2 0x00
109 #define OLEDSWITCH_DIM_MODE_SETTING_FOR_COLOR_A_B_C_3 0x12
110 #define OLEDSWITCH_DIM_MODE_SETTING_FOR_COLOR_A_B_C_4 0x0C
111 #define OLEDSWITCH_DIM_MODE_SETTING_FOR_COLOR_A_B_C_5 0x14
112 #define OLEDSWITCH_DIM_MODE_SETTING_FOR_COLOR_A_B_C_6 0x12
114 #define OLEDSWITCH_MASTER_CONFIGURATION_1 0xAD
115 #define OLEDSWITCH_MASTER_CONFIGURATION_2 0x8E
117 #define OLEDSWITCH_POWER_SAVE_MODE_1 0xB0
118 #define OLEDSWITCH_POWER_SAVE_MODE_2 0x0B
120 #define OLEDSWITCH_PHASE_1_AND_2_PERIOD_ADJUSTMENT_1 0xB1
121 #define OLEDSWITCH_PHASE_1_AND_2_PERIOD_ADJUSTMENT_2 0x44
123 #define OLEDSWITCH_DISPLAY_CLOCK_DIVIDER_OSCILLATOR_FREQUENCY_1 0xB3
124 #define OLEDSWITCH_DISPLAY_CLOCK_DIVIDER_OSCILLATOR_FREQUENCY_2 0xA0
126 #define OLEDSWITCH_ENABLE_LINEAR_GRAY_SCALE 0xB9
128 #define OLEDSWITCH_PRE_CHARGE_LEVEL_1 0xBB
129 #define OLEDSWITCH_PRE_CHARGE_LEVEL_2 0x12
131 #define OLEDSWITCH_15_SET_VCOMH_1 0xBE
132 #define OLEDSWITCH_15_SET_VCOMH_2 0x28
134 #define OLEDSWITCH_30_SET_VCOMH_1 0xBE
135 #define OLEDSWITCH_30_SET_VCOMH_2 0x3E
137 #define OLEDSWITCH_DISPLAY_ON_IN_NORMAL_MODE 0xAF
144 #define OLEDSWITCH_BUFFER_SIZE_BIG 0x00
145 #define OLEDSWITCH_BUFFER_SIZE_SMALL 0x01
147 #define OLEDSWITCH_FILL_ENABLE_DISABLE 0x26
149 #define OLEDSWITCH_ROW_RANGE 0x75
151 #define OLEDSWITCH_COLUMN_RANGE 0x15
153 #define OLEDSWITCH_CLEAR_WINDOW 0x25
155 #define OLEDSWITCH_DEACTIVATE_SCROLLING 0x2E
157 #define OLEDSWITCH_ACTIVATE_SCROLLING 0x2F
159 #define OLEDSWITCH_SCROLLING_SETUP 0x27
161 #define OLEDSWITCH_IMG_SIZE_NORMAL 6144
162 #define OLEDSWITCH_IMG_SIZE_BIG 12288
569 #endif // _OLEDSWITCH_H_
pin_name_t rst
Definition: oledswitch.h:263
void oledswitch_set_column_range(oledswitch_t *ctx, uint8_t start, uint8_t end)
Set column range function.
void oledswitch_set_multiplex_ratio(oledswitch_t *ctx)
Set multiplex ratio function.
#define OLEDSWITCH_RETVAL
Definition: oledswitch.h:66
void oledswitch_set_phase_period_adjustment(oledswitch_t *ctx)
Set phase period adjustment function.
Coordinate structure.
Definition: oledswitch.h:195
void oledswitch_demo_scrolling_setup(oledswitch_t *ctx)
Demo scroling setup function.
uint8_t column_end
Definition: oledswitch.h:198
void oledswitch_reg_write(oledswitch_t *ctx, uint8_t *write_buf, uint8_t len)
Register write function.
spi_master_t spi
Definition: oledswitch.h:239
void oledswitch_display_clock_divider_oscillator_frequency(oledswitch_t *ctx)
Display clock divider oscillator frequency function.
void oledswitch_pre_charge_level(oledswitch_t *ctx)
Set pre-charge level function.
uint8_t a
Definition: oledswitch.h:220
uint8_t g
Definition: oledswitch.h:210
void oledswitch_clear_window(oledswitch_t *ctx)
Clear window function.
void oledswitch_set_row_range(oledswitch_t *ctx, uint8_t start, uint8_t end)
Set row range function.
spi_master_mode_t spi_mode
Definition: oledswitch.h:269
void oledswitch_set_dim_mode(oledswitch_t *ctx)
Set dim mode function.
uint8_t r
Definition: oledswitch.h:209
uint8_t c
Definition: oledswitch.h:222
pin_name_t miso
Definition: oledswitch.h:256
OLEDSWITCH_RETVAL oledswitch_init(oledswitch_t *ctx, oledswitch_cfg_t *cfg)
Initialization function.
void oledswitch_set_display_offset(oledswitch_t *ctx)
Set display offset function.
void oledswitch_set_contrast(oledswitch_t *ctx)
Set contrast function.
void oledswitch_set_vcomh(oledswitch_t *ctx)
Set vcomh function.
Contrast structure.
Definition: oledswitch.h:218
digital_out_t cs
Definition: oledswitch.h:235
void oledswitch_cfg_setup(oledswitch_cfg_t *cfg)
Config Object Initialization function.
uint8_t column_start
Definition: oledswitch.h:197
void oledswitch_software_reset(oledswitch_t *ctx)
Software reset function.
oledswitch_coordinate_t coordinate
Definition: oledswitch.h:242
Click ctx object definition.
Definition: oledswitch.h:229
void oledswitch_set_master_current(oledswitch_t *ctx)
Set master current function.
void oledswitch_display_normal_mode(oledswitch_t *ctx)
Display normal mode function.
void oledswitch_set_master_config(oledswitch_t *ctx)
Set master config function.
pin_name_t sck
Definition: oledswitch.h:258
void oledswitch_default_cfg(oledswitch_t *ctx, uint8_t buffer_size)
Click Default Configuration function.
uint8_t row_end
Definition: oledswitch.h:200
pin_name_t cd
Definition: oledswitch.h:264
oledswitch_color_t color
Definition: oledswitch.h:245
void oledswitch_set_display_start_line(oledswitch_t *ctx)
Set display start line function.
void oledswitch_digital_write_pwm(oledswitch_t *ctx, uint8_t signal)
Digital write pwm function.
pin_name_t mosi
Definition: oledswitch.h:257
void oledswitch_activate_scrolling(oledswitch_t *ctx)
Activate scrolling function.
uint8_t row_start
Definition: oledswitch.h:199
void oledswitch_deactivate_scrolling(oledswitch_t *ctx)
Deactivate scrolling function.
digital_out_t cd
Definition: oledswitch.h:234
uint8_t b
Definition: oledswitch.h:221
spi_master_chip_select_polarity_t cs_polarity
Definition: oledswitch.h:270
uint8_t b
Definition: oledswitch.h:211
uint32_t spi_speed
Definition: oledswitch.h:268
void oledswitch_digital_write_rst(oledswitch_t *ctx, uint8_t signal)
Digital write reset function.
void oledswitch_draw_image(oledswitch_t *ctx, const uint8_t *image_buf, uint16_t image_size)
Register write function.
void oledswitch_set_normal_display(oledswitch_t *ctx)
Set normal display function.
void oledswitch_set_remap_color_depth(oledswitch_t *ctx)
Set remap color depth function.
void oledswitch_set_power_save_mode(oledswitch_t *ctx)
Set power save mode function.
Color structure.
Definition: oledswitch.h:207
Click configuration structure definition.
Definition: oledswitch.h:252
pin_name_t cs
Definition: oledswitch.h:259
void oledswitch_enable_linear_gray_scale(oledswitch_t *ctx)
Enable linear gray scale function.
oledswitch_contrast_t contrast
Definition: oledswitch.h:243
pin_name_t chip_select
Definition: oledswitch.h:240
digital_out_t rst
Definition: oledswitch.h:233
oledswitch_scroll_t scroll
Definition: oledswitch.h:244