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 MATRIXRGB_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.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
74 cfg.slp = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
75 cfg.rdy = MIKROBUS( mikrobus, MIKROBUS_INT );
82#define MATRIXRGB_RETVAL uint8_t
84#define MATRIXRGB_OK 0x00
85#define MATRIXRGB_INIT_ERROR 0xFF
92#define MATRIXRGB_FONT_HORIZONTAL 0
93#define MATRIXRGB_FONT_VERTICAL 1
94#define MATRIXRGB_FONT_VERTICAL_COLUMN 2
101#define MATRIXRGB_PATTERN_1_MAP_5MM 0x00
102#define MATRIXRGB_PATTERN_1_MAP_6MM 0x01
103#define MATRIXRGB_PATTERN_2H_MAP_5MM 0x02
104#define MATRIXRGB_PATTERN_2H_MAP_6MM 0x03
105#define MATRIXRGB_PATTERN_2V_MAP_5MM 0x04
106#define MATRIXRGB_PATTERN_2V_MAP_6MM 0x05
107#define MATRIXRGB_PATTERN_3H_MAP_5MM 0x06
108#define MATRIXRGB_PATTERN_3H_MAP_6MM 0x07
109#define MATRIXRGB_PATTERN_3V_MAP_5MM 0x08
110#define MATRIXRGB_PATTERN_3V_MAP_6MM 0x09
111#define MATRIXRGB_PATTERN_4H_MAP_5MM 0x0A
112#define MATRIXRGB_PATTERN_4H_MAP_6MM 0x0B
113#define MATRIXRGB_PATTERN_4V_MAP_5MM 0x0C
114#define MATRIXRGB_PATTERN_4V_MAP_6MM 0x0D
115#define MATRIXRGB_PATTERN_4S_MAP_5MM 0x0E
116#define MATRIXRGB_PATTERN_4S_MAP_6MM 0x0F
#define MATRIXRGB_RETVAL
Definition matrixrgb.h:82
void matrixrgb_fill_screen(matrixrgb_t *ctx, uint16_t color)
Fill Screen.
void matrixrgb_device_reset(matrixrgb_t *ctx)
Hard reset of the Matrix RGB click.
void matrixrgb_generic_transfer(matrixrgb_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void matrixrgb_set_brightness(matrixrgb_t *ctx, uint8_t brightness)
Set Brightness.
void matrixrgb_set_font(matrixrgb_t *ctx, matrixrgb_font_t *font_cfg)
Set Font Function.
void matrixrgb_cfg_setup(matrixrgb_cfg_t *cfg)
Config Object Initialization function.
void matrixrgb_draw_image(matrixrgb_t *ctx, const uint8_t *device_img)
Draw Image on Panel.
uint8_t matrixrgb_write_text(matrixrgb_t *ctx, char *text, uint16_t x, uint16_t y)
Writes Text.
void matrixrgb_pattern_settings(matrixrgb_t *ctx, uint8_t pattern_type, uint16_t pattern_delay_us)
Click Pattern settings ( Default Configuration ) function.
uint8_t matrixrgb_write_pixel(matrixrgb_t *ctx, uint16_t x, uint16_t y, uint16_t color)
Write Pixel.
void matrixrgb_set_power(matrixrgb_t *ctx, uint8_t power_state)
Set Power.
uint8_t matrixrgb_device_settings(matrixrgb_t *ctx, uint8_t pattern_id)
Firmware Initialization.
MATRIXRGB_RETVAL matrixrgb_init(matrixrgb_t *ctx, matrixrgb_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition matrixrgb.h:183
uint8_t spi_mode
Definition matrixrgb.h:200
pin_name_t slp
Definition matrixrgb.h:194
spi_master_chip_select_polarity_t cs_polarity
Definition matrixrgb.h:201
pin_name_t sck
Definition matrixrgb.h:188
matrixrgb_font_t dev_font
Definition matrixrgb.h:202
pin_name_t mosi
Definition matrixrgb.h:187
uint32_t spi_speed
Definition matrixrgb.h:199
pin_name_t rdy
Definition matrixrgb.h:195
pin_name_t miso
Definition matrixrgb.h:186
pin_name_t rst
Definition matrixrgb.h:193
pin_name_t cs
Definition matrixrgb.h:189
Definition matrixrgb.h:150
uint16_t y_cord
Definition matrixrgb.h:152
uint16_t x_cord
Definition matrixrgb.h:151
Click ctx object definition.
Definition matrixrgb.h:131
uint16_t first_char
Definition matrixrgb.h:135
uint16_t color
Definition matrixrgb.h:133
uint8_t * p_font
Definition matrixrgb.h:132
uint16_t height
Definition matrixrgb.h:137
uint16_t last_char
Definition matrixrgb.h:136
uint8_t orientation
Definition matrixrgb.h:134
Definition matrixrgb.h:142
uint16_t ram_size
Definition matrixrgb.h:145
uint16_t pixel_width
Definition matrixrgb.h:143
uint16_t pixel_height
Definition matrixrgb.h:144
Definition matrixrgb.h:157
digital_out_t cs
Definition matrixrgb.h:162
uint16_t device_pattern_delay
Definition matrixrgb.h:174
spi_master_t spi
Definition matrixrgb.h:170
matrixrgb_font_t device_font
Definition matrixrgb.h:171
digital_out_t slp
Definition matrixrgb.h:161
matrixrgb_cord_t device_font_cord
Definition matrixrgb.h:173
digital_out_t rst
Definition matrixrgb.h:160
matrixrgb_pixel_t device_pixel
Definition matrixrgb.h:172
pin_name_t chip_select
Definition matrixrgb.h:175
digital_in_t rdy
Definition matrixrgb.h:166