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"
66#define EINK290INCH_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
68 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
69 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
70 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
72 cfg.dc = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.bsy = MIKROBUS( mikrobus, MIKROBUS_INT )
80#define EINK290INCH_OK 0
81#define EINK290INCH_ERROR -1
88#define EINK290INCH_DISPLAY_WIDTH 128
89#define EINK290INCH_DISPLAY_HEIGHT 296
90#define EINK290INCH_DISPLAY_RESOLUTIONS 4736
97#define EINK290INCH_SCREEN_COLOR_WHITE 0xFF
98#define EINK290INCH_SCREEN_COLOR_BLACK 0x00
99#define EINK290INCH_SCREEN_COLOR_LIGHT_GREY 0xAA
100#define EINK290INCH_SCREEN_COLOR_DARK_GREY 0x55
102#define EINK290INCH_FO_HORIZONTAL 0x00
103#define EINK290INCH_FO_VERTICAL 0x01
104#define EINK290INCH_FO_VERTICAL_COLUMN 0x02
111#define EINK290INCH_CMD_DRIVER_OUTPUT_CONTROL 0x01
112#define EINK290INCH_CMD_BOOSTER_SOFT_START_CONTROL 0x0C
113#define EINK290INCH_CMD_GATE_SCAN_START_POSITION 0x0F
114#define EINK290INCH_CMD_DEEP_SLEEP_MODE 0x10
115#define EINK290INCH_CMD_DATA_ENTRY_MODE_SETTING 0x11
116#define EINK290INCH_CMD_SW_RESET 0x12
117#define EINK290INCH_CMD_TEMPERATURE_SENSOR_CONTROL 0x1A
118#define EINK290INCH_CMD_MASTER_ACTIVATION 0x20
119#define EINK290INCH_CMD_DISPLAY_UPDATE_CONTROL_1 0x21
120#define EINK290INCH_CMD_DISPLAY_UPDATE_CONTROL_2 0x22
121#define EINK290INCH_CMD_WRITE_RAM 0x24
122#define EINK290INCH_CMD_WRITE_VCOM_REGISTER 0x2C
123#define EINK290INCH_CMD_WRITE_LUT_REGISTER 0x32
124#define EINK290INCH_CMD_SET_DUMMY_LINE_PERIOD 0x3A
125#define EINK290INCH_CMD_SET_GATE_TIME 0x3B
126#define EINK290INCH_CMD_BORDER_WAVEFORM_CONTROL 0x3C
127#define EINK290INCH_CMD_SET_RAM_X_ADDRESS_START_END_POSITION 0x44
128#define EINK290INCH_CMD_SET_RAM_Y_ADDRESS_START_END_POSITION 0x45
129#define EINK290INCH_CMD_SET_RAM_X_ADDRESS_COUNTER 0x4E
130#define EINK290INCH_CMD_SET_RAM_Y_ADDRESS_COUNTER 0x4F
131#define EINK290INCH_CMD_TERMINATE_FRAME_READ_WRITE 0xFF
193#ifndef IMAGE_MODE_ONLY
194 uint8_t frame[ 4736 ];
void eink290inch_update_display(eink290inch_t *ctx)
Functions for update dispaly.
void eink290inch_reset(eink290inch_t *ctx)
Function for reset chip.
void eink290inch_sleep_mode(eink290inch_t *ctx)
Function for go to sleep mode.
void eink290inch_send_cmd(eink290inch_t *ctx, uint8_t command)
Function for sending a command.
void eink290inch_set_font(eink290inch_t *ctx, eink290inch_font_t *cfg_font)
Set font function.
void eink290inch_display_image(eink290inch_t *ctx, const uint8_t *image_buffer)
Display image function.
void eink290inch_send_data(eink290inch_t *ctx, uint8_t c_data)
Function for sending data.
void eink290inch_fill_screen(eink290inch_t *ctx, uint8_t color)
Function that fills the screen.
void eink290inch_cfg_setup(eink290inch_cfg_t *cfg)
Config Object Initialization function.
void eink290inch_text(eink290inch_t *ctx, uint8_t *text, eink290inch_set_text_t *text_set)
Function for draw text on the screen.
void eink290inch_set_mem_area(eink290inch_t *ctx, eink290inch_xy_t *xy)
Function for setting area in memory.
void eink290inch_set_mem_pointer(eink290inch_t *ctx, uint16_t x, uint16_t y)
Function for setting pointers in memory.
err_t eink290inch_init(eink290inch_t *ctx, eink290inch_cfg_t *cfg)
Initialization function.
void eink290inch_start_config(eink290inch_t *ctx)
Start configuration display.
void eink290inch_set_lut(eink290inch_t *ctx, const uint8_t *lut, uint8_t lut_cnt)
Set LUT table.
Click configuration structure definition.
Definition eink290inch.h:206
pin_name_t bsy
Definition eink290inch.h:216
spi_master_chip_select_polarity_t cs_polarity
Definition eink290inch.h:221
pin_name_t sck
Definition eink290inch.h:210
spi_master_mode_t spi_mode
Definition eink290inch.h:220
pin_name_t dc
Definition eink290inch.h:215
pin_name_t mosi
Definition eink290inch.h:209
uint32_t spi_speed
Definition eink290inch.h:219
pin_name_t miso
Definition eink290inch.h:208
pin_name_t rst
Definition eink290inch.h:214
pin_name_t cs
Definition eink290inch.h:211
Definition eink290inch.h:153
uint16_t x
Definition eink290inch.h:154
uint16_t y
Definition eink290inch.h:155
Definition eink290inch.h:142
uint16_t first_char
Definition eink290inch.h:146
uint16_t color
Definition eink290inch.h:144
const uint8_t * p_font
Definition eink290inch.h:143
uint16_t height
Definition eink290inch.h:148
uint16_t last_char
Definition eink290inch.h:147
uint8_t orientation
Definition eink290inch.h:145
Definition eink290inch.h:169
uint8_t n_char
Definition eink290inch.h:170
uint16_t text_y
Definition eink290inch.h:172
uint16_t text_x
Definition eink290inch.h:171
Click ctx object definition.
Definition eink290inch.h:180
digital_out_t cs
Definition eink290inch.h:182
spi_master_t spi
Definition eink290inch.h:190
digital_out_t dc
Definition eink290inch.h:184
eink290inch_cord_t dev_cord
Definition eink290inch.h:198
digital_in_t bsy
Definition eink290inch.h:187
digital_out_t rst
Definition eink290inch.h:183
eink290inch_font_t dev_font
Definition eink290inch.h:197
pin_name_t chip_select
Definition eink290inch.h:191
Definition eink290inch.h:160
uint16_t x_start
Definition eink290inch.h:161
uint16_t y_start
Definition eink290inch.h:162
uint16_t x_end
Definition eink290inch.h:163
uint16_t y_end
Definition eink290inch.h:164