c2x4rgb
2.1.0.0
|
API for configuring and manipulating 2x4 RGB Click driver. More...
Modules | |
2x4 RGB Settings | |
Settings of 2x4 RGB Click driver. | |
2x4 RGB MikroBUS Map | |
MikroBUS pin mapping of 2x4 RGB Click driver. | |
Functions | |
void | c2x4rgb_cfg_setup (c2x4rgb_cfg_t *cfg) |
2x4 RGB configuration object setup function. More... | |
err_t | c2x4rgb_init (c2x4rgb_t *ctx, c2x4rgb_logic_t logic_zero, c2x4rgb_logic_t logic_one, c2x4rgb_cfg_t *cfg) |
2x4 RGB initialization function. More... | |
err_t | c2x4rgb_default_cfg (c2x4rgb_t *ctx) |
2x4 RGB default configuration function. More... | |
err_t | c2x4rgb_write_leds (c2x4rgb_t *ctx, c2x4rgb_led_t *leds, uint8_t num_leds) |
2x4 RGB write LEDs function. More... | |
err_t | c2x4rgb_write_led_matrix (c2x4rgb_t *ctx) |
2x4 RGB write LED matrix function. More... | |
void | c2x4rgb_set_led_intensity (c2x4rgb_t *ctx, uint8_t led_num, uint8_t brightness, uint8_t gain) |
2x4 RGB set LED intensity function. More... | |
void | c2x4rgb_set_leds_intensity (c2x4rgb_t *ctx, uint8_t brightness, uint8_t gain) |
2x4 RGB set LEDs intensity function. More... | |
void | c2x4rgb_set_led_color (c2x4rgb_t *ctx, uint8_t led_num, uint32_t rgb) |
2x4 RGB set LED color function. More... | |
void | c2x4rgb_set_leds_color (c2x4rgb_t *ctx, uint32_t rgb) |
2x4 RGB set LEDs color function. More... | |
API for configuring and manipulating 2x4 RGB Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void c2x4rgb_cfg_setup | ( | c2x4rgb_cfg_t * | cfg | ) |
2x4 RGB configuration object setup function.
This function initializes Click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See c2x4rgb_cfg_t object definition for detailed explanation. |
err_t c2x4rgb_default_cfg | ( | c2x4rgb_t * | ctx | ) |
2x4 RGB default configuration function.
This function executes a default configuration of 2x4 RGB Click board.
[in] | ctx | : Click context object. See c2x4rgb_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x4rgb_init | ( | c2x4rgb_t * | ctx, |
c2x4rgb_logic_t | logic_zero, | ||
c2x4rgb_logic_t | logic_one, | ||
c2x4rgb_cfg_t * | cfg | ||
) |
2x4 RGB initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
[out] | ctx | : Click context object. See c2x4rgb_t object definition for detailed explanation. |
[in] | logic_zero | : Function pointer for logic zero. |
[in] | logic_one | : Function pointer for logic one. |
[in] | cfg | : Click configuration structure. See c2x4rgb_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void c2x4rgb_set_led_color | ( | c2x4rgb_t * | ctx, |
uint8_t | led_num, | ||
uint32_t | rgb | ||
) |
2x4 RGB set LED color function.
This function sets the color of the selected LED in the LED matrix.
[in] | ctx | : Click context object. See c2x4rgb_t object definition for detailed explanation. |
[in] | led_num | : LED number (0 to 7). |
[in] | rgb | : 24-bit RGB color (in a format RRGGBB). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void c2x4rgb_set_led_intensity | ( | c2x4rgb_t * | ctx, |
uint8_t | led_num, | ||
uint8_t | brightness, | ||
uint8_t | gain | ||
) |
2x4 RGB set LED intensity function.
This function sets the brightness and current gain level of the selected LED in the LED matrix.
[in] | ctx | : Click context object. See c2x4rgb_t object definition for detailed explanation. |
[in] | led_num | : LED number (0 to 7). |
[in] | brightness | : Brightness level (0 to 15). |
[in] | gain | : Current gain level (0 to 15). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void c2x4rgb_set_leds_color | ( | c2x4rgb_t * | ctx, |
uint32_t | rgb | ||
) |
2x4 RGB set LEDs color function.
This function sets the color of all LEDs in the LED matrix to the selected level.
[in] | ctx | : Click context object. See c2x4rgb_t object definition for detailed explanation. |
[in] | rgb | : 24-bit RGB color (in a format RRGGBB). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void c2x4rgb_set_leds_intensity | ( | c2x4rgb_t * | ctx, |
uint8_t | brightness, | ||
uint8_t | gain | ||
) |
2x4 RGB set LEDs intensity function.
This function sets the brightness and current gain level of all LEDs in the led matrix.
[in] | ctx | : Click context object. See c2x4rgb_t object definition for detailed explanation. |
[in] | brightness | : Brightness level (0 to 15). |
[in] | gain | : Current gain level (0 to 15). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x4rgb_write_led_matrix | ( | c2x4rgb_t * | ctx | ) |
2x4 RGB write LED matrix function.
This function writes the LED matrix data from the Click context object.
[in] | ctx | : Click context object. See c2x4rgb_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x4rgb_write_leds | ( | c2x4rgb_t * | ctx, |
c2x4rgb_led_t * | leds, | ||
uint8_t | num_leds | ||
) |
2x4 RGB write LEDs function.
This function writes data to a desired number of LEDs starting from the LED 0 by using DIN pin.
[in] | ctx | : Click context object. See c2x4rgb_t object definition for detailed explanation. |
[in] | leds | : LEDs data to be written. See c2x4rgb_led_t object definition for detailed explanation. |
[in] | num_leds | : Number of LEDs to be written (up to 8 leds). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.