c10x10rgb2  2.1.0.0
Modules | Functions
10x10 RGB 2 Click Driver

API for configuring and manipulating 10x10 RGB 2 Click driver. More...

Modules

 10x10 RGB 2 Settings
 Settings of 10x10 RGB 2 Click driver.
 
 10x10 RGB 2 MikroBUS Map
 MikroBUS pin mapping of 10x10 RGB 2 Click driver.
 

Functions

void c10x10rgb2_cfg_setup (c10x10rgb2_cfg_t *cfg)
 10x10 RGB 2 configuration object setup function. More...
 
err_t c10x10rgb2_init (c10x10rgb2_t *ctx, c10x10rgb2_cfg_t *cfg)
 10x10 RGB 2 initialization function. More...
 
err_t c10x10rgb2_default_cfg (c10x10rgb2_t *ctx)
 10x10 RGB 2 default configuration function. More...
 
err_t c10x10rgb2_write_leds (c10x10rgb2_t *ctx, c10x10rgb2_led_t *leds, uint16_t num_leds)
 10x10 RGB 2 write leds function. More...
 
err_t c10x10rgb2_write_led_matrix (c10x10rgb2_t *ctx)
 10x10 RGB 2 write led matrix function. More...
 
void c10x10rgb2_set_led_brightness (c10x10rgb2_t *ctx, uint16_t led_num, uint8_t brightness)
 10x10 RGB 2 set led brightness function. More...
 
void c10x10rgb2_set_leds_brightness (c10x10rgb2_t *ctx, uint8_t brightness)
 10x10 RGB 2 set leds brightness function. More...
 
void c10x10rgb2_set_led_color (c10x10rgb2_t *ctx, uint16_t led_num, uint32_t rgb)
 10x10 RGB 2 set led color function. More...
 
void c10x10rgb2_set_leds_color (c10x10rgb2_t *ctx, uint32_t rgb)
 10x10 RGB 2 set leds color function. More...
 
uint32_t c10x10rgb2_make_color (uint8_t red, uint8_t green, uint8_t blue, uint8_t rgb_pct)
 10x10 RGB 2 make color function. More...
 
uint32_t c10x10rgb2_color_wheel (uint8_t wheel_pos, uint8_t rgb_pct)
 10x10 RGB 2 color wheel function. More...
 
err_t c10x10rgb2_fill_screen (c10x10rgb2_t *ctx, uint32_t rgb)
 10x10 RGB 2 fill screen function. More...
 
void c10x10rgb2_set_pen (c10x10rgb2_t *ctx, uint32_t txt_rgb, uint32_t bg_rgb, uint8_t rotation)
 10x10 RGB 2 set pen function. More...
 
err_t c10x10rgb2_write_char (c10x10rgb2_t *ctx, uint8_t data_in)
 10x10 RGB 2 write char function. More...
 
err_t c10x10rgb2_write_string (c10x10rgb2_t *ctx, uint8_t *data_in, uint16_t speed_ms)
 10x10 RGB 2 write char function. More...
 
err_t c10x10rgb2_draw_picture (c10x10rgb2_t *ctx, const uint32_t *image)
 10x10 RGB 2 draw picture function. More...
 
err_t c10x10rgb2_demo_rainbow (c10x10rgb2_t *ctx, uint8_t rgb_pct, uint16_t upd_rate_ms, uint16_t upd_num)
 10x10 RGB 2 demo rainbow function. More...
 

Detailed Description

API for configuring and manipulating 10x10 RGB 2 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ c10x10rgb2_cfg_setup()

void c10x10rgb2_cfg_setup ( c10x10rgb2_cfg_t cfg)

10x10 RGB 2 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See c10x10rgb2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ c10x10rgb2_color_wheel()

uint32_t c10x10rgb2_color_wheel ( uint8_t  wheel_pos,
uint8_t  rgb_pct 
)

10x10 RGB 2 color wheel function.

This function creates a 24-bit RGB color based on the color wheel input parameters.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]wheel_pos: Color wheel position (modulo 255).
[in]rgb_pct: Percent of RGB color (1-100).
Returns
24-bit RGB color (in a format RRGGBB).
Note
None.

◆ c10x10rgb2_default_cfg()

err_t c10x10rgb2_default_cfg ( c10x10rgb2_t ctx)

10x10 RGB 2 default configuration function.

This function executes a default configuration of 10x10 RGB 2 Click board.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ c10x10rgb2_demo_rainbow()

err_t c10x10rgb2_demo_rainbow ( c10x10rgb2_t ctx,
uint8_t  rgb_pct,
uint16_t  upd_rate_ms,
uint16_t  upd_num 
)

10x10 RGB 2 demo rainbow function.

This function performs a colorfull "rainbow" demo for a desired period.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]rgb_pct: Percent of RGB color (1-100).
[in]upd_rate_ms: Screen update delay in milliseconds.
[in]upd_num: Number of screen updates.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c10x10rgb2_draw_picture()

err_t c10x10rgb2_draw_picture ( c10x10rgb2_t ctx,
const uint32_t *  image 
)

10x10 RGB 2 draw picture function.

This function draws a 10x10px picture on the screen.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]image: 10x10 image in a 24-bit RGB color format (RRGGBB).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c10x10rgb2_fill_screen()

err_t c10x10rgb2_fill_screen ( c10x10rgb2_t ctx,
uint32_t  rgb 
)

10x10 RGB 2 fill screen function.

This function fills the entire screen with the specified color.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]rgb: 24-bit RGB color (in a format RRGGBB).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c10x10rgb2_init()

err_t c10x10rgb2_init ( c10x10rgb2_t ctx,
c10x10rgb2_cfg_t cfg 
)

10x10 RGB 2 initialization function.

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

Parameters
[out]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See c10x10rgb2_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c10x10rgb2_make_color()

uint32_t c10x10rgb2_make_color ( uint8_t  red,
uint8_t  green,
uint8_t  blue,
uint8_t  rgb_pct 
)

10x10 RGB 2 make color function.

This function creates a 24-bit RGB color based on the RGB input parameters.

Parameters
[in]red: Red color byte.
[in]green: Green color byte.
[in]blue: Blue color byte.
[in]rgb_pct: Percent of RGB color (1-100).
Returns
24-bit RGB color (in a format RRGGBB).
Note
None.

◆ c10x10rgb2_set_led_brightness()

void c10x10rgb2_set_led_brightness ( c10x10rgb2_t ctx,
uint16_t  led_num,
uint8_t  brightness 
)

10x10 RGB 2 set led brightness function.

This function sets the brightness of the selected led in the led matrix.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]led_num: LED number (0 to 99).
[in]brightness: Brightness level (0 to 31).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function doesn't write the led matrix to the Click board. In order for this change to take effect you will need to call the c10x10rgb2_write_led_matrix function afterward.

◆ c10x10rgb2_set_led_color()

void c10x10rgb2_set_led_color ( c10x10rgb2_t ctx,
uint16_t  led_num,
uint32_t  rgb 
)

10x10 RGB 2 set led color function.

This function sets the color of the selected led in the led matrix.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]led_num: LED number (0 to 99).
[in]rgb: 24-bit RGB color (in a format RRGGBB).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function doesn't write the led matrix to the Click board. In order for this change to take effect you will need to call the c10x10rgb2_write_led_matrix function afterward.

◆ c10x10rgb2_set_leds_brightness()

void c10x10rgb2_set_leds_brightness ( c10x10rgb2_t ctx,
uint8_t  brightness 
)

10x10 RGB 2 set leds brightness function.

This function sets the brightness of all leds in the led matrix to the selected level.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]brightness: Brightness level (0 to 31).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function doesn't write the led matrix to the Click board. In order for this change to take effect you will need to call the c10x10rgb2_write_led_matrix function afterward.

◆ c10x10rgb2_set_leds_color()

void c10x10rgb2_set_leds_color ( c10x10rgb2_t ctx,
uint32_t  rgb 
)

10x10 RGB 2 set leds color function.

This function sets the color of all leds in the led matrix to the selected level.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]rgb: 24-bit RGB color (in a format RRGGBB).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function doesn't write the led matrix to the Click board. In order for this change to take effect you will need to call the c10x10rgb2_write_led_matrix function afterward.

◆ c10x10rgb2_set_pen()

void c10x10rgb2_set_pen ( c10x10rgb2_t ctx,
uint32_t  txt_rgb,
uint32_t  bg_rgb,
uint8_t  rotation 
)

10x10 RGB 2 set pen function.

This function sets the pen configuration for text writing.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]txt_rgb: Text 24-bit RGB level: 0xRRGGBB.
[in]bg_rgb: Background 24-bit RGB level: 0xRRGGBB.
[in]rotation: ASCII byte rotation:
  • 0x00 - Vertical 0 - Normal,
  • 0x01 - Vertical 180 - XY mirrored,
  • 0x10 - Horizontal 0 - XY exchanged, X mirrored,
  • 0x11 - Horizontal 180 - XY exchanged, Y mirrored.
Returns
None.
Note
None.

◆ c10x10rgb2_write_char()

err_t c10x10rgb2_write_char ( c10x10rgb2_t ctx,
uint8_t  data_in 
)

10x10 RGB 2 write char function.

This function writes a single ASCII character in a 8x8 font size.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]data_in: ASCII(32-122) char to write.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c10x10rgb2_write_led_matrix()

err_t c10x10rgb2_write_led_matrix ( c10x10rgb2_t ctx)

10x10 RGB 2 write led matrix function.

This function writes the led matrix data from the Click context object.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c10x10rgb2_write_leds()

err_t c10x10rgb2_write_leds ( c10x10rgb2_t ctx,
c10x10rgb2_led_t leds,
uint16_t  num_leds 
)

10x10 RGB 2 write leds function.

This function writes data to a desired number of leds starting from the LED 0 by using SPI serial interface.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]leds: LEDs data to be written. See c10x10rgb2_led_t object definition for detailed explanation.
[in]num_leds: Number of LEDs to be written (up to 100 leds).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c10x10rgb2_write_string()

err_t c10x10rgb2_write_string ( c10x10rgb2_t ctx,
uint8_t *  data_in,
uint16_t  speed_ms 
)

10x10 RGB 2 write char function.

This function writes a text string in a 8x8 font size by scrolling characters to the left side.

Parameters
[in]ctx: Click context object. See c10x10rgb2_t object definition for detailed explanation.
[in]data_in: ASCII(32-122) string to write (must end with \0).
[in]speed_ms: Screen refresh delay in milliseconds which presents a scrolling speed.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.