Go to the documentation of this file.
39 #ifdef PREINIT_SUPPORTED
43 #ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
51 #include "drv_spi_master.h"
74 #define C4X4RGB2_FRAME_START 0x00
75 #define C4X4RGB2_FRAME_END 0xFF
81 #define C4X4RGB2_LED_0 0
82 #define C4X4RGB2_LED_1 1
83 #define C4X4RGB2_LED_2 2
84 #define C4X4RGB2_LED_3 3
85 #define C4X4RGB2_LED_4 4
86 #define C4X4RGB2_LED_5 5
87 #define C4X4RGB2_LED_6 6
88 #define C4X4RGB2_LED_7 7
89 #define C4X4RGB2_LED_8 8
90 #define C4X4RGB2_LED_9 9
91 #define C4X4RGB2_LED_10 10
92 #define C4X4RGB2_LED_11 11
93 #define C4X4RGB2_LED_12 12
94 #define C4X4RGB2_LED_13 13
95 #define C4X4RGB2_LED_14 14
96 #define C4X4RGB2_LED_15 15
97 #define C4X4RGB2_NUM_LEDS 16
103 #define C4X4RGB2_LED_BRIGHTNESS_MIN 0
104 #define C4X4RGB2_LED_BRIGHTNESS_DEFAULT 1
105 #define C4X4RGB2_LED_BRIGHTNESS_MAX 31
106 #define C4X4RGB2_LED_BRIGHTNESS_MASK 0xE0
112 #define C4X4RGB2_COLOR_BLACK 0x000000ul
113 #define C4X4RGB2_COLOR_WHITE 0xFFFFFFul
114 #define C4X4RGB2_COLOR_RED 0xFF0000ul
115 #define C4X4RGB2_COLOR_LIME 0x00FF00ul
116 #define C4X4RGB2_COLOR_BLUE 0x0000FFul
117 #define C4X4RGB2_COLOR_YELLOW 0xFFFF00ul
118 #define C4X4RGB2_COLOR_CYAN 0x00FFFFul
119 #define C4X4RGB2_COLOR_MAGENTA 0xFF00FFul
120 #define C4X4RGB2_COLOR_SILVER 0xC0C0C0ul
121 #define C4X4RGB2_COLOR_GRAY 0x808080ul
122 #define C4X4RGB2_COLOR_MAROON 0x800000ul
123 #define C4X4RGB2_COLOR_OLIVE 0x808000ul
124 #define C4X4RGB2_COLOR_GREEN 0x008000ul
125 #define C4X4RGB2_COLOR_PURPLE 0x800080ul
126 #define C4X4RGB2_COLOR_TEAL 0x008080ul
127 #define C4X4RGB2_COLOR_NAVY 0x000080ul
128 #define C4X4RGB2_NUM_COLORS 16
129 #define C4X4RGB2_SIZE_COLOR_NAME 32
139 #define C4X4RGB2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
140 #define C4X4RGB2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
158 #define C4X4RGB2_MAP_MIKROBUS( cfg, mikrobus ) \
159 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
160 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
161 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK );
This file contains SPI specific macros, functions, etc.
@ C4X4RGB2_OK
Definition: c4x4rgb2.h:226
@ C4X4RGB2_ERROR
Definition: c4x4rgb2.h:227
c4x4rgb2_return_value_t
4x4 RGB 2 Click return value data.
Definition: c4x4rgb2.h:225
pin_name_t mosi
Definition: c4x4rgb2.h:211
4x4 RGB 2 Click context object.
Definition: c4x4rgb2.h:195
#define C4X4RGB2_NUM_LEDS
Definition: c4x4rgb2.h:97
spi_master_mode_t spi_mode
Definition: c4x4rgb2.h:216
pin_name_t miso
Definition: c4x4rgb2.h:210
uint32_t rgb
Definition: c4x4rgb2.h:172
uint32_t spi_speed
Definition: c4x4rgb2.h:215
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:171
4x4 RGB 2 Click configuration object.
Definition: c4x4rgb2.h:208
#define C4X4RGB2_SIZE_COLOR_NAME
Definition: c4x4rgb2.h:129
uint8_t red
Definition: c4x4rgb2.h:184
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:197
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:182
uint8_t brightness
Definition: c4x4rgb2.h:183
void c4x4rgb2_cfg_setup(c4x4rgb2_cfg_t *cfg)
4x4 RGB 2 configuration object setup function.
uint8_t green
Definition: c4x4rgb2.h:185
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:186
pin_name_t sck
Definition: c4x4rgb2.h:212
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.