39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
75#define LCDMINI_IODIRB_BANK0 0x01
76#define LCDMINI_OLATB_BANK0 0x15
77#define LCDMINI_IOCON_BANK0 0x0A
78#define LCDMINI_ADDRESS_CODE 0x40
79#define LCDMINI_GPIO_REGISTER 0x09
97#define LCDMINI_ENABLE 0x08
98#define LCDMINI_RESET 0x04
100#define LCDMINI_OP_CODE_READ 0x01
101#define LCDMINI_OP_CODE_WRITE 0xFE
107#define LCDMINI_CLEAR 0x01
108#define LCDMINI_RETURN_HOME 0x02
109#define LCDMINI_DISPLAY_OFF_CURSOR_OFF 0x08
110#define LCDMINI_CURSOR_OFF 0x0C
111#define LCDMINI_UNDERLINE_ON 0x0E
112#define LCDMINI_BLINK_CURSOR_ON 0x0F
113#define LCDMINI_MOVE_CURSOR_LEFT 0x10
114#define LCDMINI_MOVE_CURSOR_RIGHT 0x14
115#define LCDMINI_TURN_ON 0x0A
116#define LCDMINI_TURN_OFF 0x0C
117#define LCDMINI_SHIFT_LEFT 0x18
118#define LCDMINI_SHIFT_RIGHT 0x1C
119#define LCDMINI_2_LINE_5X7 0x28
121#define LCDMINI_FIRST_ROW 0x80
122#define LCDMINI_SECOND_ROW 0xC0
123#define LCDMINI_THIRD_ROW 0x94
124#define LCDMINI_FOURTH_ROW 0xD4
131#define LCDMINI_DEF_FREQ 500
141#define LCDMINI_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
142#define LCDMINI_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
160#define LCDMINI_MAP_MIKROBUS( cfg, mikrobus ) \
161 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
162 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
163 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
164 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
165 cfg.cs2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
166 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
167 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
168 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
void lcdmini_set_contrast(lcdmini_t *ctx, uint8_t contrast_value)
Set contrast function.
void lcdmini_display_text(lcdmini_t *ctx, uint8_t row, uint8_t column, char *data_in)
LCD mini display text.
void lcdmini_send_char(lcdmini_t *ctx, uint8_t character)
LCD mini send character.
err_t lcdmini_pwm_stop(lcdmini_t *ctx)
LCD mini stop PWM module.
void lcdmini_hw_reset(lcdmini_t *ctx)
Hardware reset function.
err_t lcdmini_read_register(lcdmini_t *ctx, uint8_t reg, uint8_t *data_out)
LCD mini register data reading function.
err_t lcdmini_generic_write(lcdmini_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
LCD mini data writing function.
void lcdmini_cfg_setup(lcdmini_cfg_t *cfg)
LCD mini configuration object setup function.
err_t lcdmini_write_register(lcdmini_t *ctx, uint8_t reg, uint8_t data_in)
LCD mini register data writing function.
void lcdmini_send_cmd(lcdmini_t *ctx, uint8_t command)
LCD mini send command.
err_t lcdmini_default_cfg(lcdmini_t *ctx)
LCD mini default configuration function.
err_t lcdmini_set_duty_cycle(lcdmini_t *ctx, float duty_cycle)
LCD mini sets PWM duty cycle.
err_t lcdmini_generic_read(lcdmini_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
LCD mini data reading function.
void lcdmini_set_backlight(lcdmini_t *ctx, float backlight_value)
Set backlight function.
err_t lcdmini_init(lcdmini_t *ctx, lcdmini_cfg_t *cfg)
LCD mini initialization function.
uint8_t lcdmini_get_interrupt(lcdmini_t *ctx)
Get interrupt.
void lcdmini_display_char(lcdmini_t *ctx, uint8_t row, uint8_t column, char character)
LCD mini display character.
err_t lcdmini_pwm_start(lcdmini_t *ctx)
LCD mini start PWM module.
lcdmini_return_value_t
LCD mini Click return value data.
Definition lcdmini.h:228
@ LCDMINI_ERROR
Definition lcdmini.h:230
@ LCDMINI_OK
Definition lcdmini.h:229
This file contains SPI specific macros, functions, etc.
LCD mini Click configuration object.
Definition lcdmini.h:201
pin_name_t cs2
Definition lcdmini.h:209
spi_master_chip_select_polarity_t cs_polarity
Definition lcdmini.h:219
pin_name_t sck
Definition lcdmini.h:205
spi_master_mode_t spi_mode
Definition lcdmini.h:218
pin_name_t mosi
Definition lcdmini.h:204
uint32_t spi_speed
Definition lcdmini.h:217
uint32_t dev_pwm_freq
Definition lcdmini.h:215
pin_name_t int_pin
Definition lcdmini.h:212
pin_name_t pwm
Definition lcdmini.h:211
pin_name_t miso
Definition lcdmini.h:203
pin_name_t rst
Definition lcdmini.h:210
pin_name_t cs
Definition lcdmini.h:206
LCD mini Click context object.
Definition lcdmini.h:178
spi_master_t spi
Definition lcdmini.h:189
uint32_t pwm_freq
Definition lcdmini.h:192
digital_in_t int_pin
Definition lcdmini.h:184
digital_out_t rst
Definition lcdmini.h:181
digital_out_t cs2
Definition lcdmini.h:180
pin_name_t chip_select
Definition lcdmini.h:191
pwm_t pwm
Definition lcdmini.h:187