Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_spi_master.h"
60 #define C4X4RGB2_FRAME_START 0x00
61 #define C4X4RGB2_FRAME_END 0xFF
67 #define C4X4RGB2_LED_0 0
68 #define C4X4RGB2_LED_1 1
69 #define C4X4RGB2_LED_2 2
70 #define C4X4RGB2_LED_3 3
71 #define C4X4RGB2_LED_4 4
72 #define C4X4RGB2_LED_5 5
73 #define C4X4RGB2_LED_6 6
74 #define C4X4RGB2_LED_7 7
75 #define C4X4RGB2_LED_8 8
76 #define C4X4RGB2_LED_9 9
77 #define C4X4RGB2_LED_10 10
78 #define C4X4RGB2_LED_11 11
79 #define C4X4RGB2_LED_12 12
80 #define C4X4RGB2_LED_13 13
81 #define C4X4RGB2_LED_14 14
82 #define C4X4RGB2_LED_15 15
83 #define C4X4RGB2_NUM_LEDS 16
89 #define C4X4RGB2_LED_BRIGHTNESS_MIN 0
90 #define C4X4RGB2_LED_BRIGHTNESS_DEFAULT 1
91 #define C4X4RGB2_LED_BRIGHTNESS_MAX 31
92 #define C4X4RGB2_LED_BRIGHTNESS_MASK 0xE0
98 #define C4X4RGB2_COLOR_BLACK 0x000000ul
99 #define C4X4RGB2_COLOR_WHITE 0xFFFFFFul
100 #define C4X4RGB2_COLOR_RED 0xFF0000ul
101 #define C4X4RGB2_COLOR_LIME 0x00FF00ul
102 #define C4X4RGB2_COLOR_BLUE 0x0000FFul
103 #define C4X4RGB2_COLOR_YELLOW 0xFFFF00ul
104 #define C4X4RGB2_COLOR_CYAN 0x00FFFFul
105 #define C4X4RGB2_COLOR_MAGENTA 0xFF00FFul
106 #define C4X4RGB2_COLOR_SILVER 0xC0C0C0ul
107 #define C4X4RGB2_COLOR_GRAY 0x808080ul
108 #define C4X4RGB2_COLOR_MAROON 0x800000ul
109 #define C4X4RGB2_COLOR_OLIVE 0x808000ul
110 #define C4X4RGB2_COLOR_GREEN 0x008000ul
111 #define C4X4RGB2_COLOR_PURPLE 0x800080ul
112 #define C4X4RGB2_COLOR_TEAL 0x008080ul
113 #define C4X4RGB2_COLOR_NAVY 0x000080ul
114 #define C4X4RGB2_NUM_COLORS 16
115 #define C4X4RGB2_SIZE_COLOR_NAME 32
125 #define C4X4RGB2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
126 #define C4X4RGB2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
144 #define C4X4RGB2_MAP_MIKROBUS( cfg, mikrobus ) \
145 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
146 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
147 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK );
This file contains SPI specific macros, functions, etc.
@ C4X4RGB2_OK
Definition: c4x4rgb2.h:212
@ C4X4RGB2_ERROR
Definition: c4x4rgb2.h:213
c4x4rgb2_return_value_t
4x4 RGB 2 Click return value data.
Definition: c4x4rgb2.h:211
pin_name_t mosi
Definition: c4x4rgb2.h:197
4x4 RGB 2 Click context object.
Definition: c4x4rgb2.h:181
#define C4X4RGB2_NUM_LEDS
Definition: c4x4rgb2.h:83
spi_master_mode_t spi_mode
Definition: c4x4rgb2.h:202
pin_name_t miso
Definition: c4x4rgb2.h:196
uint32_t rgb
Definition: c4x4rgb2.h:158
uint32_t spi_speed
Definition: c4x4rgb2.h:201
void c4x4rgb2_set_led_brightness(c4x4rgb2_t *ctx, uint8_t led_num, uint8_t brightness)
4x4 RGB 2 set led brightness function.
4x4 RGB 2 Click RGB color object.
Definition: c4x4rgb2.h:157
4x4 RGB 2 Click configuration object.
Definition: c4x4rgb2.h:194
#define C4X4RGB2_SIZE_COLOR_NAME
Definition: c4x4rgb2.h:115
uint8_t red
Definition: c4x4rgb2.h:170
err_t c4x4rgb2_default_cfg(c4x4rgb2_t *ctx)
4x4 RGB 2 default configuration function.
err_t c4x4rgb2_init(c4x4rgb2_t *ctx, c4x4rgb2_cfg_t *cfg)
4x4 RGB 2 initialization function.
spi_master_t spi
Definition: c4x4rgb2.h:183
void c4x4rgb2_set_led_color(c4x4rgb2_t *ctx, uint8_t led_num, uint32_t rgb)
4x4 RGB 2 set led color function.
4x4 RGB 2 Click led object.
Definition: c4x4rgb2.h:168
uint8_t brightness
Definition: c4x4rgb2.h:169
void c4x4rgb2_cfg_setup(c4x4rgb2_cfg_t *cfg)
4x4 RGB 2 configuration object setup function.
uint8_t green
Definition: c4x4rgb2.h:171
err_t c4x4rgb2_write_leds(c4x4rgb2_t *ctx, c4x4rgb2_led_t *leds, uint8_t num_leds)
4x4 RGB 2 write leds function.
void c4x4rgb2_set_all_leds_brightness(c4x4rgb2_t *ctx, uint8_t brightness)
4x4 RGB 2 set all leds brightness function.
uint8_t blue
Definition: c4x4rgb2.h:172
pin_name_t sck
Definition: c4x4rgb2.h:198
err_t c4x4rgb2_write_led_matrix(c4x4rgb2_t *ctx)
4x4 RGB 2 write led matrix function.
void c4x4rgb2_set_all_leds_color(c4x4rgb2_t *ctx, uint32_t rgb)
4x4 RGB 2 set all leds color function.