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"
67#define EINK_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
73 cfg.dc = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
74 cfg.bsy = MIKROBUS( mikrobus, MIKROBUS_INT )
89#define EINK_DISPLAY_WIDTH 72
90#define EINK_DISPLAY_HEIGHT 172
91#define EINK_DISPLAY_RESOLUTION 3096
98#define EINK_COMMUNICATION_SPI 0
99#define EINK_COMMUNICATION_I2C 1
106#define EINK_SCREEN_COLOR_WHITE 0xFF
107#define EINK_SCREEN_COLOR_BLACK 0x00
108#define EINK_SCREEN_COLOR_LIGHT_GREY 0xAA
109#define EINK_SCREEN_COLOR_DARK_GREY 0x55
111#define EINK_FO_HORIZONTAL 0x00
112#define EINK_FO_VERTICAL 0x01
113#define EINK_FO_VERTICAL_COLUMN 0x02
120#define EINK_CMD_DRIVER_OUTPUT_CONTROL 0x01
121#define EINK_CMD_GATE_VOLTAGE_CONTROL 0x03
122#define EINK_CMD_SOURCE_VOLTAGE_CONTROL 0x04
123#define EINK_CMD_DISPLAY_CONTROL 0x07
124#define EINK_CMD_NONOVERLAP_PERIOD 0x0B
125#define EINK_CMD_GATE_SCAN_START_POSITION 0x0F
126#define EINK_CMD_DEEP_SLEEP_MODE 0x10
127#define EINK_CMD_DATA_ENTRY_MODE_SETTING 0x11
128#define EINK_CMD_SW_RESET 0x12
129#define EINK_CMD_TEMPERATURE_SENSOR_CONTROL 0x1A
130#define EINK_CMD_TEMPERATURE_LOAD 0x1D
131#define EINK_CMD_MASTER_ACTIVATION 0x20
132#define EINK_CMD_DISPLAY_UPDATE_CONTROL_1 0x21
133#define EINK_CMD_DISPLAY_UPDATE_CONTROL_2 0x22
134#define EINK_CMD_WRITE_RAM 0x24
135#define EINK_CMD_VCOM_SENSE 0x28
136#define EINK_CMD_VCOM_SENSE_DURATION 0x29
137#define EINK_CMD_VCOM_PROG_OTP 0x2A
138#define EINK_CMD_WRITE_VCOM_REGISTER 0x2C
139#define EINK_CMD_OTP_WAVEFORM_SETTINGS 0x30
140#define EINK_CMD_WRITE_LUT_REGISTER 0x32
141#define EINK_CMD_OTP_PROGRAM 0x36
142#define EINK_CMD_OTP_SELECTION 0x37
143#define EINK_CMD_SET_DUMMY_LINE_PERIOD 0x3A
144#define EINK_CMD_SET_GATE_TIME 0x3B
145#define EINK_CMD_BORDER_WAVEFORM_CONTROL 0x3C
146#define EINK_CMD_SET_RAM_X_ADDRESS_START_END_POSITION 0x44
147#define EINK_CMD_SET_RAM_Y_ADDRESS_START_END_POSITION 0x45
148#define EINK_CMD_SET_RAM_X_ADDRESS_COUNTER 0x4E
149#define EINK_CMD_SET_RAM_Y_ADDRESS_COUNTER 0x4F
150#define EINK_CMD_BOOSTER_FEEDBACK_SELECTION 0xF0
151#define EINK_CMD_TERMINATE_FRAME_READ_WRITE 0xFF
158#define EINK_DEVICE_SLAVE_ADDRESS_000 0x28
159#define EINK_DEVICE_SLAVE_ADDRESS_001 0x29
160#define EINK_DEVICE_SLAVE_ADDRESS_010 0x2A
161#define EINK_DEVICE_SLAVE_ADDRESS_011 0x2B
162#define EINK_DEVICE_SLAVE_ADDRESS_100 0x2C
163#define EINK_DEVICE_SLAVE_ADDRESS_101 0x2D
164#define EINK_DEVICE_SLAVE_ADDRESS_110 0x2E
165#define EINK_DEVICE_SLAVE_ADDRESS_111 0x2F
229#ifndef IMAGE_MODE_ONLY
#define EINK_DISPLAY_RESOLUTION
Definition eink.h:91
void eink_text(eink_t *ctx, uint8_t *text, eink_text_set_t *text_set)
Draw text on the screen.
void eink_send_cmd(eink_t *ctx, uint8_t command)
Sending a command.
void eink_set_mem_area(eink_t *ctx, eink_xy_t *xy)
Setting area in memory.
void eink_update_display(eink_t *ctx)
Update dispaly.
void eink_display_image(eink_t *ctx, const uint8_t *image_buffer)
Displays image.
void eink_set_font(eink_t *ctx, eink200inch_font_t *cfg_font)
Set text font.
void eink_start_config(eink_t *ctx)
Configuration display.
void eink_set_lut(eink_t *ctx, const uint8_t *lut, uint8_t n_bytes)
Set LUT table.
void eink_cfg_setup(eink_cfg_t *cfg)
Config Object Initialization function.
void eink_reset(eink_t *ctx)
Reset chip.
err_t eink_init(eink_t *ctx, eink_cfg_t *cfg)
Initialization function.
void eink_set_mem_pointer(eink_t *ctx, uint8_t x, uint8_t y)
Setting pointers in memory.
void eink_send_data(eink_t *ctx, uint8_t c_data)
Sending data.
void eink_fill_screen(eink_t *ctx, uint8_t color)
Function that fills the screen.
void eink_sleep_mode(eink_t *ctx)
Sleep mode.
uint16_t first_char
Definition eink.h:180
uint16_t color
Definition eink.h:178
const uint8_t * p_font
Definition eink.h:177
uint16_t height
Definition eink.h:182
uint16_t last_char
Definition eink.h:181
uint8_t orientation
Definition eink.h:179
Click configuration structure definition.
Definition eink.h:238
eink200inch_font_t font_cfg
Definition eink.h:255
pin_name_t bsy
Definition eink.h:248
spi_master_chip_select_polarity_t cs_polarity
Definition eink.h:253
pin_name_t sck
Definition eink.h:242
spi_master_mode_t spi_mode
Definition eink.h:252
pin_name_t dc
Definition eink.h:247
pin_name_t mosi
Definition eink.h:241
uint32_t spi_speed
Definition eink.h:251
pin_name_t miso
Definition eink.h:240
pin_name_t rst
Definition eink.h:246
pin_name_t cs
Definition eink.h:243
uint16_t x
Definition eink.h:188
uint16_t y
Definition eink.h:189
Click ctx object definition.
Definition eink.h:214
digital_out_t cs
Definition eink.h:216
spi_master_t spi
Definition eink.h:224
digital_out_t dc
Definition eink.h:218
eink200inch_font_t dev_font
Definition eink.h:227
eink_cordinate_t dev_cord
Definition eink.h:228
digital_in_t bsy
Definition eink.h:221
digital_out_t rst
Definition eink.h:217
pin_name_t chip_select
Definition eink.h:225
uint8_t n_char
Definition eink.h:206
uint8_t text_x
Definition eink.h:204
uint8_t text_y
Definition eink.h:205
uint8_t y_start
Definition eink.h:196
uint8_t y_end
Definition eink.h:198
uint8_t x_end
Definition eink.h:197
uint8_t x_start
Definition eink.h:195