c4x4rgb2 2.1.0.0
c4x4rgb2.h File Reference

This file contains API for 4x4 RGB 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  c4x4rgb2_color_t
 4x4 RGB 2 Click RGB color object. More...
 
struct  c4x4rgb2_led_t
 4x4 RGB 2 Click led object. More...
 
struct  c4x4rgb2_t
 4x4 RGB 2 Click context object. More...
 
struct  c4x4rgb2_cfg_t
 4x4 RGB 2 Click configuration object. More...
 

Macros

#define C4X4RGB2_FRAME_START   0x00
 4x4 RGB 2 LED frame setting.
 
#define C4X4RGB2_FRAME_END   0xFF
 
#define C4X4RGB2_LED_0   0
 4x4 RGB 2 LED selection values.
 
#define C4X4RGB2_LED_1   1
 
#define C4X4RGB2_LED_2   2
 
#define C4X4RGB2_LED_3   3
 
#define C4X4RGB2_LED_4   4
 
#define C4X4RGB2_LED_5   5
 
#define C4X4RGB2_LED_6   6
 
#define C4X4RGB2_LED_7   7
 
#define C4X4RGB2_LED_8   8
 
#define C4X4RGB2_LED_9   9
 
#define C4X4RGB2_LED_10   10
 
#define C4X4RGB2_LED_11   11
 
#define C4X4RGB2_LED_12   12
 
#define C4X4RGB2_LED_13   13
 
#define C4X4RGB2_LED_14   14
 
#define C4X4RGB2_LED_15   15
 
#define C4X4RGB2_NUM_LEDS   16
 
#define C4X4RGB2_LED_BRIGHTNESS_MIN   0
 4x4 RGB 2 LED brightness setting.
 
#define C4X4RGB2_LED_BRIGHTNESS_DEFAULT   1
 
#define C4X4RGB2_LED_BRIGHTNESS_MAX   31
 
#define C4X4RGB2_LED_BRIGHTNESS_MASK   0xE0
 
#define C4X4RGB2_COLOR_BLACK   0x000000ul
 4x4 RGB 2 24-bit RGB color codes.
 
#define C4X4RGB2_COLOR_WHITE   0xFFFFFFul
 
#define C4X4RGB2_COLOR_RED   0xFF0000ul
 
#define C4X4RGB2_COLOR_LIME   0x00FF00ul
 
#define C4X4RGB2_COLOR_BLUE   0x0000FFul
 
#define C4X4RGB2_COLOR_YELLOW   0xFFFF00ul
 
#define C4X4RGB2_COLOR_CYAN   0x00FFFFul
 
#define C4X4RGB2_COLOR_MAGENTA   0xFF00FFul
 
#define C4X4RGB2_COLOR_SILVER   0xC0C0C0ul
 
#define C4X4RGB2_COLOR_GRAY   0x808080ul
 
#define C4X4RGB2_COLOR_MAROON   0x800000ul
 
#define C4X4RGB2_COLOR_OLIVE   0x808000ul
 
#define C4X4RGB2_COLOR_GREEN   0x008000ul
 
#define C4X4RGB2_COLOR_PURPLE   0x800080ul
 
#define C4X4RGB2_COLOR_TEAL   0x008080ul
 
#define C4X4RGB2_COLOR_NAVY   0x000080ul
 
#define C4X4RGB2_NUM_COLORS   16
 
#define C4X4RGB2_SIZE_COLOR_NAME   32
 
#define C4X4RGB2_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define C4X4RGB2_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define C4X4RGB2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  c4x4rgb2_return_value_t { C4X4RGB2_OK = 0 , C4X4RGB2_ERROR = -1 }
 4x4 RGB 2 Click return value data. More...
 

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

This file contains API for 4x4 RGB 2 Click Driver.

Enumeration Type Documentation

◆ c4x4rgb2_return_value_t

4x4 RGB 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
C4X4RGB2_OK 
C4X4RGB2_ERROR