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"
72 #define ROTARYRGB_COLOR_WHITE_100 0x002F2F2Ful
73 #define ROTARYRGB_COLOR_WHITE_75 0x00232323ul
74 #define ROTARYRGB_COLOR_WHITE_50 0x00181818ul
75 #define ROTARYRGB_COLOR_WHITE_25 0x000C0C0Cul
76 #define ROTARYRGB_COLOR_RED_100 0x00002F00ul
77 #define ROTARYRGB_COLOR_RED_75 0x00002300ul
78 #define ROTARYRGB_COLOR_RED_50 0x00001800ul
79 #define ROTARYRGB_COLOR_RED_25 0x00000C00ul
80 #define ROTARYRGB_COLOR_GREEN_100 0x002F0000ul
81 #define ROTARYRGB_COLOR_GREEN_75 0x00230000ul
82 #define ROTARYRGB_COLOR_GREEN_50 0x00180000ul
83 #define ROTARYRGB_COLOR_GREEN_25 0x000C0000ul
84 #define ROTARYRGB_COLOR_BLUE_100 0x0000002Ful
85 #define ROTARYRGB_COLOR_BLUE_75 0x00000023ul
86 #define ROTARYRGB_COLOR_BLUE_50 0x00000018ul
87 #define ROTARYRGB_COLOR_BLUE_25 0x0000000Cul
88 #define ROTARYRGB_COLOR_LIGHT_BLUE_100 0x002F002Ful
89 #define ROTARYRGB_COLOR_LIGHT_BLUE_75 0x00230023ul
90 #define ROTARYRGB_COLOR_LIGHT_BLUE_50 0x00180018ul
91 #define ROTARYRGB_COLOR_LIGHT_BLUE_25 0x000C000Cul
92 #define ROTARYRGB_COLOR_YELLOW_100 0x002F2F00ul
93 #define ROTARYRGB_COLOR_YELLOW_75 0x00232300ul
94 #define ROTARYRGB_COLOR_YELLOW_50 0x00181800ul
95 #define ROTARYRGB_COLOR_YELLOW_25 0x000C0C00ul
96 #define ROTARYRGB_COLOR_PURPLE_100 0x00002F2Ful
97 #define ROTARYRGB_COLOR_PURPLE_75 0x00002323ul
98 #define ROTARYRGB_COLOR_PURPLE_50 0x00001818ul
99 #define ROTARYRGB_COLOR_PURPLE_25 0x00000C0Cul
100 #define ROTARYRGB_COLOR_OFF 0x00000000ul
106 #define ROTARYRGB_SET_LED_POS_1 1
107 #define ROTARYRGB_SET_LED_POS_2 2
108 #define ROTARYRGB_SET_LED_POS_3 3
109 #define ROTARYRGB_SET_LED_POS_4 4
110 #define ROTARYRGB_SET_LED_POS_5 5
111 #define ROTARYRGB_SET_LED_POS_6 6
112 #define ROTARYRGB_SET_LED_POS_7 7
113 #define ROTARYRGB_SET_LED_POS_8 8
114 #define ROTARYRGB_SET_LED_POS_9 9
115 #define ROTARYRGB_SET_LED_POS_10 10
116 #define ROTARYRGB_SET_LED_POS_11 11
117 #define ROTARYRGB_SET_LED_POS_12 12
118 #define ROTARYRGB_SET_LED_POS_13 13
119 #define ROTARYRGB_SET_LED_POS_14 14
120 #define ROTARYRGB_SET_LED_POS_15 15
121 #define ROTARYRGB_SET_LED_POS_16 16
139 #define ROTARYRGB_MAP_MIKROBUS( cfg, mikrobus ) \
140 cfg.enb = MIKROBUS( mikrobus, MIKROBUS_AN ); \
141 cfg.di_pin = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
142 cfg.do_pin = MIKROBUS( mikrobus, MIKROBUS_RST ); \
143 cfg.ena = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
144 cfg.sw = MIKROBUS( mikrobus, MIKROBUS_INT )
374 #endif // ROTARYRGB_H
Rotary RGB Click configuration object.
Definition: rotaryrgb.h:175
rotaryrgb_return_value_t
Rotary RGB Click return value data.
Definition: rotaryrgb.h:193
pin_name_t di_pin
Definition: rotaryrgb.h:178
void rotaryrgb_set_all_led_color(rotaryrgb_t *ctx, uint32_t led_color)
Rotary RGB set all LEDs color function.
@ ROTARYRGB_ERROR
Definition: rotaryrgb.h:195
uint8_t rotaryrgb_get_state_do_pin(rotaryrgb_t *ctx)
Rotary RGB get DO pin state function.
digital_in_t do_pin
Definition: rotaryrgb.h:160
digital_in_t enb
Definition: rotaryrgb.h:159
void rotaryrgb_di_pin_clear(rotaryrgb_t *ctx)
Rotary RGB DI pin clearing function.
pin_name_t ena
Definition: rotaryrgb.h:179
void rotaryrgb_set_all_leds_data(rotaryrgb_t *ctx, uint32_t *data_in)
Rotary RGB set all LEDs data function.
@ ROTARYRGB_OK
Definition: rotaryrgb.h:194
void(* drv_logic_t)(void)
Definition: rotaryrgb.h:149
uint8_t rotaryrgb_get_state_switch(rotaryrgb_t *ctx)
Rotary RGB get switch state function.
drv_logic_t logic_zero
Definition: rotaryrgb.h:165
err_t rotaryrgb_init(rotaryrgb_t *ctx, rotaryrgb_cfg_t *cfg)
Rotary RGB initialization function.
pin_name_t enb
Definition: rotaryrgb.h:176
err_t rotaryrgb_set_led_pos_color(rotaryrgb_t *ctx, uint8_t led_pos, uint32_t led_color)
Rotary RGB set LED position color function.
uint32_t rotaryrgb_make_color(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness)
Rotary RGB make color function.
drv_logic_t logic_one
Definition: rotaryrgb.h:184
void rotaryrgb_set_led_data(rotaryrgb_t *ctx, uint32_t data_in)
Rotary RGB set LED data function.
drv_logic_t logic_one
Definition: rotaryrgb.h:166
void rotaryrgb_set_state_di_pin(rotaryrgb_t *ctx)
Rotary RGB DI pin setting function.
uint8_t rotaryrgb_get_state_enb(rotaryrgb_t *ctx)
Rotary RGB get encoder B state function.
void rotaryrgb_cfg_setup(rotaryrgb_cfg_t *cfg, drv_logic_t logic_zero, drv_logic_t logic_one)
Rotary RGB configuration object setup function.
digital_in_t sw
Definition: rotaryrgb.h:162
digital_in_t ena
Definition: rotaryrgb.h:161
drv_logic_t logic_zero
Definition: rotaryrgb.h:183
pin_name_t sw
Definition: rotaryrgb.h:180
pin_name_t do_pin
Definition: rotaryrgb.h:177
Rotary RGB Click context object.
Definition: rotaryrgb.h:156
uint8_t rotaryrgb_get_state_ena(rotaryrgb_t *ctx)
Rotary RGB get encoder A state function.
digital_out_t di_pin
Definition: rotaryrgb.h:157