c2x2rgb
2.1.0.0
|
API for configuring and manipulating 2x2 RGB Click driver. More...
Modules | |
2x2 RGB Registers List | |
List of registers of 2x2 RGB Click driver. | |
2x2 RGB Registers Settings | |
Settings for registers of 2x2 RGB Click driver. | |
2x2 RGB MikroBUS Map | |
MikroBUS pin mapping of 2x2 RGB Click driver. | |
Functions | |
void | c2x2rgb_cfg_setup (c2x2rgb_cfg_t *cfg) |
2x2 RGB configuration object setup function. More... | |
err_t | c2x2rgb_init (c2x2rgb_t *ctx, c2x2rgb_cfg_t *cfg) |
2x2 RGB initialization function. More... | |
err_t | c2x2rgb_default_cfg (c2x2rgb_t *ctx) |
2x2 RGB default configuration function. More... | |
err_t | c2x2rgb_generic_write (c2x2rgb_t *ctx, uint8_t reg, uint8_t data_in) |
2x2 RGB I2C writing function. More... | |
err_t | c2x2rgb_generic_read (c2x2rgb_t *ctx, uint8_t reg, uint8_t *data_out) |
2x2 RGB I2C reading function. More... | |
err_t | c2x2rgb_get_device_id (c2x2rgb_t *ctx, uint8_t *vendor_id, uint8_t *device_id) |
2x2 RGB get device ID function. More... | |
err_t | c2x2rgb_get_monitor_status (c2x2rgb_t *ctx, uint8_t *sc_stat, uint8_t *be_stat, uint8_t *cool_stat, uint8_t *uv_ot_stat) |
2x2 RGB get monitor status function. More... | |
err_t | c2x2rgb_set_control (c2x2rgb_t *ctx, uint8_t en_mode, uint8_t be_en, uint8_t ce_temp, uint8_t fade_rate) |
2x2 RGB set control function. More... | |
err_t | c2x2rgb_set_normal_mode (c2x2rgb_t *ctx) |
2x2 RGB set normal mode function. More... | |
err_t | c2x2rgb_sw_reset (c2x2rgb_t *ctx) |
2x2 RGB set soft reset function. More... | |
err_t | c2x2rgb_set_rgb_led (c2x2rgb_t *ctx, uint8_t led_num, uint16_t ired, uint16_t igrn, uint16_t iblu) |
2x2 RGB set RGB LED function. More... | |
err_t | c2x2rgb_set_pg_ctrl (c2x2rgb_t *ctx, uint8_t pg_mode, uint8_t pg_time, uint8_t fade_rate) |
2x2 RGB set PG control function. More... | |
err_t | c2x2rgb_set_pg_fade (c2x2rgb_t *ctx, uint8_t pg_fade) |
2x2 RGB set PG fade function. More... | |
err_t | c2x2rgb_set_pg_rgb (c2x2rgb_t *ctx, uint8_t led_num, uint8_t pg_rgb) |
2x2 RGB set PG fade function. More... | |
err_t | c2x2rgb_set_pg_wd (c2x2rgb_t *ctx, uint8_t wd_pcr) |
2x2 RGB set pattern watchdog counter function. More... | |
API for configuring and manipulating 2x2 RGB Click driver.
void c2x2rgb_cfg_setup | ( | c2x2rgb_cfg_t * | cfg | ) |
2x2 RGB configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See c2x2rgb_cfg_t object definition for detailed explanation. |
err_t c2x2rgb_default_cfg | ( | c2x2rgb_t * | ctx | ) |
2x2 RGB default configuration function.
This function executes a default configuration of 2x2 RGB click board.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_generic_read | ( | c2x2rgb_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
2x2 RGB I2C reading function.
This function reads a data bytes from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_generic_write | ( | c2x2rgb_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
2x2 RGB I2C writing function.
This function writes a data bytes to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_get_device_id | ( | c2x2rgb_t * | ctx, |
uint8_t * | vendor_id, | ||
uint8_t * | device_id | ||
) |
2x2 RGB get device ID function.
This function reads vendor ID and device ID by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | vendor_id | : Vendor ID. |
[out] | device_id | : Device ID. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_get_monitor_status | ( | c2x2rgb_t * | ctx, |
uint8_t * | sc_stat, | ||
uint8_t * | be_stat, | ||
uint8_t * | cool_stat, | ||
uint8_t * | uv_ot_stat | ||
) |
2x2 RGB get monitor status function.
This function reads monitor status by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[out] | sc_stat | : Short-Circuit Protection Status. |
[out] | be_stat | : BrightExtend™ Dropout Status. |
[out] | cool_stat | : CoolExtend™ Die Temperature Status. |
[out] | uv_ot_stat | : VIN Under-Voltage Lockout or Over Temperature Shutdown Status. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_init | ( | c2x2rgb_t * | ctx, |
c2x2rgb_cfg_t * | cfg | ||
) |
2x2 RGB initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See c2x2rgb_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_set_control | ( | c2x2rgb_t * | ctx, |
uint8_t | en_mode, | ||
uint8_t | be_en, | ||
uint8_t | ce_temp, | ||
uint8_t | fade_rate | ||
) |
2x2 RGB set control function.
This function sets control by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | en_mode | : Enable Mode and Reset. |
[in] | be_en | : BrightExtend™ Enable. |
[in] | ce_temp | : CoolExtend™ Temperature Setting. |
[in] | fade_rate | : Fade-Rate 0 Exponential Time-Constant Setting. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_set_normal_mode | ( | c2x2rgb_t * | ctx | ) |
2x2 RGB set normal mode function.
This function sets normal mode by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_set_pg_ctrl | ( | c2x2rgb_t * | ctx, |
uint8_t | pg_mode, | ||
uint8_t | pg_time, | ||
uint8_t | fade_rate | ||
) |
2x2 RGB set PG control function.
This function sets PG control by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | pg_mode | : Pattern Generator Enable and Mode. |
[in] | pg_time | : Pattern-Slot Duration. |
[in] | fade_rate | : Fade-Rate 1 Exponential Time-Constant Setting. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_set_pg_fade | ( | c2x2rgb_t * | ctx, |
uint8_t | pg_fade | ||
) |
2x2 RGB set PG fade function.
This function sets PG fade by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | pg_fade | : Pattern-Slot. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_set_pg_rgb | ( | c2x2rgb_t * | ctx, |
uint8_t | led_num, | ||
uint8_t | pg_rgb | ||
) |
2x2 RGB set PG fade function.
This function sets PG fade by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | led_num | : LED selectino [1-4]. |
[in] | pg_rgb | : Pattern-Slot 7 RGB On/Off Selection. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_set_pg_wd | ( | c2x2rgb_t * | ctx, |
uint8_t | wd_pcr | ||
) |
2x2 RGB set pattern watchdog counter function.
This function sets pattern watchdog counter by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | wd_pcr | : pattern watchdog counter. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_set_rgb_led | ( | c2x2rgb_t * | ctx, |
uint8_t | led_num, | ||
uint16_t | ired, | ||
uint16_t | igrn, | ||
uint16_t | iblu | ||
) |
2x2 RGB set RGB LED function.
This function sets RGB LED data by using I2C serial interface.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
[in] | led_num | : LED selectino [1-4]. |
[in] | ired | : Red Current Setting for RGB. |
[in] | igrn | : Green Current Setting for RGB. |
[in] | iblu | : Blue Current Setting for RGB. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c2x2rgb_sw_reset | ( | c2x2rgb_t * | ctx | ) |
2x2 RGB set soft reset function.
This function performs the software reset of the device.
[in] | ctx | : Click context object. See c2x2rgb_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.