c4x4rgb2 2.1.0.0
4x4 RGB 2 Click Driver

API for configuring and manipulating 4x4 RGB 2 Click driver. More...

Topics

 4x4 RGB 2 Settings
 Settings of 4x4 RGB 2 Click driver.
 
 4x4 RGB 2 MikroBUS Map
 MikroBUS pin mapping of 4x4 RGB 2 Click driver.
 

Functions

void c4x4rgb2_cfg_setup (c4x4rgb2_cfg_t *cfg)
 4x4 RGB 2 configuration object setup function.
 
err_t c4x4rgb2_init (c4x4rgb2_t *ctx, c4x4rgb2_cfg_t *cfg)
 4x4 RGB 2 initialization function.
 
err_t c4x4rgb2_default_cfg (c4x4rgb2_t *ctx)
 4x4 RGB 2 default configuration function.
 
err_t c4x4rgb2_write_leds (c4x4rgb2_t *ctx, c4x4rgb2_led_t *leds, uint8_t num_leds)
 4x4 RGB 2 write leds function.
 
err_t c4x4rgb2_write_led_matrix (c4x4rgb2_t *ctx)
 4x4 RGB 2 write led matrix function.
 
void c4x4rgb2_set_led_brightness (c4x4rgb2_t *ctx, uint8_t led_num, uint8_t brightness)
 4x4 RGB 2 set led brightness function.
 
void c4x4rgb2_set_all_leds_brightness (c4x4rgb2_t *ctx, uint8_t brightness)
 4x4 RGB 2 set all leds brightness function.
 
void c4x4rgb2_set_led_color (c4x4rgb2_t *ctx, uint8_t led_num, uint32_t rgb)
 4x4 RGB 2 set led color function.
 
void c4x4rgb2_set_all_leds_color (c4x4rgb2_t *ctx, uint32_t rgb)
 4x4 RGB 2 set all leds color function.
 

Detailed Description

API for configuring and manipulating 4x4 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

◆ c4x4rgb2_cfg_setup()

void c4x4rgb2_cfg_setup ( c4x4rgb2_cfg_t * cfg)

4x4 RGB 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ c4x4rgb2_default_cfg()

err_t c4x4rgb2_default_cfg ( c4x4rgb2_t * ctx)

4x4 RGB 2 default configuration function.

This function executes a default configuration of 4x4 RGB 2 click board.

Parameters
[in]ctx: Click context object. See c4x4rgb2_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.

◆ c4x4rgb2_init()

err_t c4x4rgb2_init ( c4x4rgb2_t * ctx,
c4x4rgb2_cfg_t * cfg )

4x4 RGB 2 initialization function.

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

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

◆ c4x4rgb2_set_all_leds_brightness()

void c4x4rgb2_set_all_leds_brightness ( c4x4rgb2_t * ctx,
uint8_t brightness )

4x4 RGB 2 set all 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 c4x4rgb2_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 c4x4rgb2_write_led_matrix function afterward.

◆ c4x4rgb2_set_all_leds_color()

void c4x4rgb2_set_all_leds_color ( c4x4rgb2_t * ctx,
uint32_t rgb )

4x4 RGB 2 set all 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 c4x4rgb2_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 c4x4rgb2_write_led_matrix function afterward.

◆ c4x4rgb2_set_led_brightness()

void c4x4rgb2_set_led_brightness ( c4x4rgb2_t * ctx,
uint8_t led_num,
uint8_t brightness )

4x4 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 c4x4rgb2_t object definition for detailed explanation.
[in]led_num: LED number (0 to 15).
[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 c4x4rgb2_write_led_matrix function afterward.

◆ c4x4rgb2_set_led_color()

void c4x4rgb2_set_led_color ( c4x4rgb2_t * ctx,
uint8_t led_num,
uint32_t rgb )

4x4 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 c4x4rgb2_t object definition for detailed explanation.
[in]led_num: LED number (0 to 15).
[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 c4x4rgb2_write_led_matrix function afterward.

◆ c4x4rgb2_write_led_matrix()

err_t c4x4rgb2_write_led_matrix ( c4x4rgb2_t * ctx)

4x4 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 c4x4rgb2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ c4x4rgb2_write_leds()

err_t c4x4rgb2_write_leds ( c4x4rgb2_t * ctx,
c4x4rgb2_led_t * leds,
uint8_t num_leds )

4x4 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 c4x4rgb2_t object definition for detailed explanation.
[in]leds: LEDs data to be written. See c4x4rgb2_led_t object definition for detailed explanation.
[in]num_leds: Number of LEDs to be written (up to 16 leds).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.