mikrosdk interface
More...
#include <stdint.h>
Go to the source code of this file.
◆ BLUE_MAX
◆ BLUE_MIN
◆ GREEN_MAX
◆ GREEN_MIN
◆ LED3_ADD_CMD_LEN
#define LED3_ADD_CMD_LEN 2 |
Maximum length[bytes] for I2C led3 slave address + memory address (command).
◆ LED3_CMD_SHUT_DOWN
#define LED3_CMD_SHUT_DOWN 0x00 |
◆ LED3_COLOUR_BLUE
#define LED3_COLOUR_BLUE 0x40609F |
◆ LED3_COLOUR_GREEN
#define LED3_COLOUR_GREEN 0x407F80 |
◆ LED3_COLOUR_ORANGE
#define LED3_COLOUR_ORANGE 0x5F6280 |
◆ LED3_COLOUR_PURPLE
#define LED3_COLOUR_PURPLE 0x58609C |
◆ LED3_COLOUR_RED
#define LED3_COLOUR_RED 0x5F6080 |
Defines for commonly used colours.
◆ LED3_COLOUR_WHITE
#define LED3_COLOUR_WHITE 0x5F7F9F |
◆ LED3_COLOUR_YELLOW
#define LED3_COLOUR_YELLOW 0x5F7480 |
◆ LED3_CONSTANT
#define LED3_CONSTANT 0x20 |
◆ LED3_DECREMENT
#define LED3_DECREMENT 0xC0 |
◆ LED3_INCREMENT
#define LED3_INCREMENT 0xA0 |
Defines for the dimming function.
LED3_INCREMENT and LED3_DECREMENT will increase/decrease the light intensity until the specified intensity value. LED3_CONSTANT will keep the light intensity at a constant value.
◆ LED3_INTENSITY_1
#define LED3_INTENSITY_1 0x01 |
Defines for setting the light intensity of the LED (MIN = 1, MAX = 31).
The intensity could be added by using bitwise OR. E.g, for an intensity of 12, use (LED3_INTENSITY_4 | LED3_INTENSITY_8).
◆ LED3_INTENSITY_16
#define LED3_INTENSITY_16 0x10 |
◆ LED3_INTENSITY_2
#define LED3_INTENSITY_2 0x02 |
◆ LED3_INTENSITY_4
#define LED3_INTENSITY_4 0x04 |
◆ LED3_INTENSITY_8
#define LED3_INTENSITY_8 0x08 |
◆ LED3_INTENSITY_MAX
#define LED3_INTENSITY_MAX 0x1F |
◆ LED3_TIMER_128ms
#define LED3_TIMER_128ms 0xE0 |
◆ LED3_TIMER_16ms
#define LED3_TIMER_16ms 0xE2 |
◆ LED3_TIMER_32ms
#define LED3_TIMER_32ms 0xE4 |
◆ LED3_TIMER_64ms
#define LED3_TIMER_64ms 0xE8 |
◆ LED3_TIMER_8ms
#define LED3_TIMER_8ms 0xE1 |
Time intervals for dimming function (31 total combinations available).
The time interval could be added by using bitwise OR. E.g, for a time interval of 24ms, use (LED3_TIMER_8ms | LED3_TIMER_16ms).
◆ RED_MAX
◆ RED_MIN
Minimum and maximum values allowed for each colour.
Each colour (r,g,b) is controlled by a 5-bit PWM signal, hence a total of 32768 colours is available.
◆ TX_BUF_BLUE
◆ TX_BUF_GREEN
◆ TX_BUF_RED
Defines for tx_buf array used in set_rgb and set_colour functions.
◆ led3_status
Enum (LED3 status).
Enumerator |
---|
LED3_ST_OK | |
LED3_ST_FAIL | |
◆ MIKROSDK_LED3_Initialise()
uint8_t MIKROSDK_LED3_Initialise |
( |
void |
| ) |
|
Function that initialises the I2C configuration of the LED3 click.
- Returns
- uint8_t
◆ MIKROSDK_LED3_set_colour()
uint8_t MIKROSDK_LED3_set_colour |
( |
uint32_t |
colour | ) |
|
Function that sets the LED using common colours.
- Parameters
-
colour | Defined commonly used colours. E.g, LED3_COLOUR_PURPLE. |
- Returns
- uint8_t
◆ MIKROSDK_LED3_set_dimming_and_intensity()
uint8_t MIKROSDK_LED3_set_dimming_and_intensity |
( |
uint8_t |
cmd | ) |
|
Function that sets the dimming mode (Increment, Decrement, Constant) and the light intensity.
- Parameters
-
cmd | Bitwise OR of dimming mode and light intensity. E.g, to use constant brightness with max intensity, use (LED3_CONSTANT | LED3_INTENSITY_MAX). |
- Returns
- uint8_t
◆ MIKROSDK_LED3_set_rgb()
uint8_t MIKROSDK_LED3_set_rgb |
( |
uint8_t |
red, |
|
|
uint8_t |
green, |
|
|
uint8_t |
blue |
|
) |
| |
Function that sets the rgb value individually.
- Parameters
-
red | Red colour value (MIN = 0x40, MAX = 0x5F). |
green | Green colour value (MIN = 0x60, MAX = 0x7F). |
blue | Blue colour value (MIN = 0x80, MAX = 0x9F). |
- Returns
- uint8_t
◆ MIKROSDK_LED3_set_timer()
uint8_t MIKROSDK_LED3_set_timer |
( |
uint8_t |
time | ) |
|
Function that sets the time interval for the dimming function.
- Parameters
-
time | Time interval for dimming. If set to 32ms, the LED will dim to the specified intensity at 32ms per intensity step. E.g, current intensity = 5, new intensity = 15, the total dimming sequence will take 320ms. |
- Returns
- uint8_t
◆ MIKROSDK_LED3_shut_down()
uint8_t MIKROSDK_LED3_shut_down |
( |
void |
| ) |
|
Function that turns off the LED.
- Returns
- uint8_t