matrixrgb  2.0.0.0
Functions

Functions

void matrixrgb_cfg_setup (matrixrgb_cfg_t *cfg)
 Config Object Initialization function. More...
 
MATRIXRGB_RETVAL matrixrgb_init (matrixrgb_t *ctx, matrixrgb_cfg_t *cfg)
 Initialization function. More...
 
void matrixrgb_pattern_settings (matrixrgb_t *ctx, uint8_t pattern_type, uint16_t pattern_delay_us)
 Click Pattern settings ( Default Configuration ) function. More...
 
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. More...
 
void matrixrgb_device_reset (matrixrgb_t *ctx)
 Hard reset of the Matrix RGB click. More...
 
uint8_t matrixrgb_device_settings (matrixrgb_t *ctx, uint8_t pattern_id)
 Firmware Initialization. More...
 
void matrixrgb_set_power (matrixrgb_t *ctx, uint8_t power_state)
 Set Power. More...
 
void matrixrgb_set_brightness (matrixrgb_t *ctx, uint8_t brightness)
 Set Brightness. More...
 
uint8_t matrixrgb_write_pixel (matrixrgb_t *ctx, uint16_t x, uint16_t y, uint16_t color)
 Write Pixel. More...
 
void matrixrgb_fill_screen (matrixrgb_t *ctx, uint16_t color)
 Fill Screen. More...
 
void matrixrgb_draw_image (matrixrgb_t *ctx, uint8_t *device_img)
 Draw Image on Panel. More...
 
void matrixrgb_set_font (matrixrgb_t *ctx, matrixrgb_font_t *font_cfg)
 Set Font Function. More...
 
uint8_t matrixrgb_write_text (matrixrgb_t *ctx, char *text, uint16_t x, uint16_t y)
 Writes Text. More...
 

Detailed Description

Function Documentation

◆ matrixrgb_cfg_setup()

void matrixrgb_cfg_setup ( matrixrgb_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ matrixrgb_device_reset()

void matrixrgb_device_reset ( matrixrgb_t ctx)

Hard reset of the Matrix RGB click.

Parameters
ctxClick object.

Function takes 300 ms.

◆ matrixrgb_device_settings()

uint8_t matrixrgb_device_settings ( matrixrgb_t ctx,
uint8_t  pattern_id 
)

Firmware Initialization.

Parameters
ctxClick object.
pattern_idPanel Pattern ID - more info inside firmware documentation

This function mus be executed right after driver initialization.

◆ matrixrgb_draw_image()

void matrixrgb_draw_image ( matrixrgb_t ctx,
uint8_t *  device_img 
)

Draw Image on Panel.

Parameters
ctxClick object.
device_imgPointer to image array
Note
Image must be in RGB565 format LSB first.

◆ matrixrgb_fill_screen()

void matrixrgb_fill_screen ( matrixrgb_t ctx,
uint16_t  color 
)

Fill Screen.

Parameters
ctxClick object.
colorcolor screen color

◆ matrixrgb_generic_transfer()

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.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

Generic SPI transfer, for sending and receiving packages

◆ matrixrgb_init()

MATRIXRGB_RETVAL matrixrgb_init ( matrixrgb_t ctx,
matrixrgb_cfg_t cfg 
)

Initialization function.

Parameters
matrixrgbClick object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ matrixrgb_pattern_settings()

void matrixrgb_pattern_settings ( matrixrgb_t ctx,
uint8_t  pattern_type,
uint16_t  pattern_delay_us 
)

Click Pattern settings ( Default Configuration ) function.

Parameters
ctxClick object.
pattern_typePattern type of display.
pattern_delay_usChoose time for delay.

This function executes default configuration for Matrix RGB click.

◆ matrixrgb_set_brightness()

void matrixrgb_set_brightness ( matrixrgb_t ctx,
uint8_t  brightness 
)

Set Brightness.

Parameters
ctxClick object.
brightnessBrightness intensity
Warning
In case of high brightness level flickering may appears due to fact that this is software brightness implementation.

◆ matrixrgb_set_font()

void matrixrgb_set_font ( matrixrgb_t ctx,
matrixrgb_font_t font_cfg 
)

Set Font Function.

Parameters
ctxClick object.
font_cfgPointer on structure

Must be called before write text function to adjust text related properties.

◆ matrixrgb_set_power()

void matrixrgb_set_power ( matrixrgb_t ctx,
uint8_t  power_state 
)

Set Power.

Parameters
ctxClick object.
power_statePower State (0 - OFF / 1 - ON)

◆ matrixrgb_write_pixel()

uint8_t matrixrgb_write_pixel ( matrixrgb_t ctx,
uint16_t  x,
uint16_t  y,
uint16_t  color 
)

Write Pixel.

Parameters
ctxClick object.
xhorizontal position
yvertical position
colorpixel color
Returns
0 OK / 1 Error
Note
Error may appear in case of wrong X or Y positions.

◆ matrixrgb_write_text()

uint8_t matrixrgb_write_text ( matrixrgb_t ctx,
char *  text,
uint16_t  x,
uint16_t  y 
)

Writes Text.

Parameters
ctxClick object.
text
xHorizontal offset
yVertical offset
Returns
0 OK / 1 Error

Writing starts at provided offset

Note
Error may appear in case of wrong X or Y positions.