ledring2 2.1.0.0
LED Ring 2 Click Driver

API for configuring and manipulating LED Ring 2 Click driver. More...

Topics

 LED Ring 2 Registers List
 List of registers of LED Ring 2 Click driver.
 
 LED Ring 2 Registers Settings
 Settings for registers of LED Ring 2 Click driver.
 
 LED Ring 2 MikroBUS Map
 MikroBUS pin mapping of LED Ring 2 Click driver.
 

Functions

void ledring2_cfg_setup (ledring2_cfg_t *cfg)
 LED Ring 2 configuration object setup function.
 
err_t ledring2_init (ledring2_t *ctx, ledring2_cfg_t *cfg)
 LED Ring 2 initialization function.
 
err_t ledring2_default_cfg (ledring2_t *ctx)
 LED Ring 2 default configuration function.
 
err_t ledring2_set_slave_address (ledring2_t *ctx, uint8_t slave_address)
 Set I2C Slave address.
 
err_t ledring2_write_reg (ledring2_t *ctx, uint8_t led_group, uint16_t reg, uint8_t *data_in, uint8_t len)
 LED Ring 2 write register function.
 
err_t ledring2_read_reg (ledring2_t *ctx, uint8_t led_group, uint16_t reg, uint8_t *data_out, uint8_t len)
 LED Ring 2 read registe function.
 
void ledring2_set_vsync (ledring2_t *ctx)
 LED Ring 2 read registe function.
 
err_t ledring2_enable (ledring2_t *ctx)
 LED Ring 2 enable function.
 
err_t ledring2_disable (ledring2_t *ctx)
 LED Ring 2 disable function.
 
err_t ledring2_set_all_led_state (ledring2_t *ctx, ledring2_led_state_t led_state)
 LED Ring 2 set all LED state function.
 
err_t ledring2_set_led_pos_state (ledring2_t *ctx, uint8_t led_pos, ledring2_led_state_t led_state)
 LED Ring 2 set LED state function.
 
err_t ledring2_set_led_brightness (ledring2_t *ctx, uint8_t led_pos, uint16_t led_brightness)
 LED Ring 2 set LED brightness function.
 

Detailed Description

API for configuring and manipulating LED Ring 2 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ ledring2_cfg_setup()

void ledring2_cfg_setup ( ledring2_cfg_t * cfg)

LED Ring 2 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ledring2_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ledring2_default_cfg()

err_t ledring2_default_cfg ( ledring2_t * ctx)

LED Ring 2 default configuration function.

This function executes a default configuration of LED Ring 2 click board.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ledring2_disable()

err_t ledring2_disable ( ledring2_t * ctx)

LED Ring 2 disable function.

This function disable the LP5862, 2×18 LED Matrix Driver With 8-Bit Analog and 8-/16-Bit PWM Dimming on the LED Ring 2 Click board™.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledring2_enable()

err_t ledring2_enable ( ledring2_t * ctx)

LED Ring 2 enable function.

This function enable the LP5862, 2×18 LED Matrix Driver With 8-Bit Analog and 8-/16-Bit PWM Dimming on the LED Ring 2 Click board™.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledring2_init()

err_t ledring2_init ( ledring2_t * ctx,
ledring2_cfg_t * cfg )

LED Ring 2 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See ledring2_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See ledring2_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledring2_read_reg()

err_t ledring2_read_reg ( ledring2_t * ctx,
uint8_t led_group,
uint16_t reg,
uint8_t * data_out,
uint8_t len )

LED Ring 2 read registe function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface of the LP5862 2×18 LED Matrix Driver With 8-Bit Analog and 8-/16-Bit PWM Dimming on the LED Ring 2 Click board™.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
[in]led_group:
  • 0x40 (LEDRING2_LED_GROUP_U1_LED_1_18) - LED1 : LED18,
  • 0x44 (LEDRING2_LED_GROUP_U2_LED_19_36) - LED19 : LED36,
  • 0x46 (LEDRING2_LED_GROUP_U3_LED_37_54) - LED37 : LED54.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledring2_set_all_led_state()

err_t ledring2_set_all_led_state ( ledring2_t * ctx,
ledring2_led_state_t led_state )

LED Ring 2 set all LED state function.

This function sets the state of all LEDs of the LP5862 2×18 LED Matrix Driver With 8-Bit Analog and 8-/16-Bit PWM Dimming on the LED Ring 2 Click board™.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
[in]led_state: LED state. See ledring2_led_state_t definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledring2_set_led_brightness()

err_t ledring2_set_led_brightness ( ledring2_t * ctx,
uint8_t led_pos,
uint16_t led_brightness )

LED Ring 2 set LED brightness function.

This function sets the desired LED brightness depending on the LED position selection of the LP5862 2×18 LED Matrix Driver With 8-Bit Analog and 8-/16-Bit PWM Dimming on the LED Ring 2 Click board™.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
[in]led_pos: LED position from 1 to 54.
[in]led_brightness: LED brightness. See ledring2_led_state_t definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledring2_set_led_pos_state()

err_t ledring2_set_led_pos_state ( ledring2_t * ctx,
uint8_t led_pos,
ledring2_led_state_t led_state )

LED Ring 2 set LED state function.

This function sets the desired LED state depending on the LED position selection of the LP5862 2×18 LED Matrix Driver With 8-Bit Analog and 8-/16-Bit PWM Dimming on the LED Ring 2 Click board™.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
[in]led_pos: LED position from 1 to 54.
[in]led_state: LED state. See ledring2_led_state_t definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledring2_set_slave_address()

err_t ledring2_set_slave_address ( ledring2_t * ctx,
uint8_t slave_address )

Set I2C Slave address.

Sets I2C address of the subordinate I2C device to slave_address which is targeted by read and write operations.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
[in]slave_addressSpecified I2C slave address:
  • 0x40 (LEDRING2_LED_GROUP_U1_LED_1_18) - LED1 : LED18,
  • 0x44 (LEDRING2_LED_GROUP_U2_LED_19_36) - LED19 : LED36,
  • 0x46 (LEDRING2_LED_GROUP_U3_LED_37_54) - LED37 : LED54.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ledring2_set_vsync()

void ledring2_set_vsync ( ledring2_t * ctx)

LED Ring 2 read registe function.

This function set synchronizes signal pulse for display mode 2 and mode 3 of the LP5862 2×18 LED Matrix Driver With 8-Bit Analog and 8-/16-Bit PWM Dimming on the LED Ring 2 Click board™.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ ledring2_write_reg()

err_t ledring2_write_reg ( ledring2_t * ctx,
uint8_t led_group,
uint16_t reg,
uint8_t * data_in,
uint8_t len )

LED Ring 2 write register function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface of the LP5862 2×18 LED Matrix Driver With 8-Bit Analog and 8-/16-Bit PWM Dimming on the LED Ring 2 Click board™.

Parameters
[in]ctx: Click context object. See ledring2_t object definition for detailed explanation.
[in]led_group:
  • 0x40 (LEDRING2_LED_GROUP_U1_LED_1_18) - LED1 : LED18,
  • 0x44 (LEDRING2_LED_GROUP_U2_LED_19_36) - LED19 : LED36,
  • 0x46 (LEDRING2_LED_GROUP_U3_LED_37_54) - LED37 : LED54.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.