leddriver18 2.1.0.0
LED Driver 18 Click Driver

API for configuring and manipulating LED Driver 18 Click driver. More...

Topics

 LED Driver 18 Registers List
 List of registers of LED Driver 18 Click driver.
 
 LED Driver 18 Registers Settings
 Settings for registers of LED Driver 18 Click driver.
 
 LED Driver 18 MikroBUS Map
 MikroBUS pin mapping of LED Driver 18 Click driver.
 

Functions

void leddriver18_cfg_setup (leddriver18_cfg_t *cfg)
 LED Driver 18 configuration object setup function.
 
err_t leddriver18_init (leddriver18_t *ctx, leddriver18_cfg_t *cfg)
 LED Driver 18 initialization function.
 
err_t leddriver18_default_cfg (leddriver18_t *ctx)
 LED Driver 18 default configuration function.
 
err_t leddriver18_generic_write (leddriver18_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 LED Driver 18 I2C writing function.
 
err_t leddriver18_generic_read (leddriver18_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 LED Driver 18 I2C reading function.
 
err_t leddriver18_set_output_pwm (uint8_t out_num, float pwm_val)
 LED Driver 18 set output channel PWM value function.
 
float leddriver18_get_output_pwm (uint8_t out_num)
 LED Driver 18 get output channel PWM value function.
 
void leddriver18_write_config (leddriver18_t *ctx)
 LED Driver 18 write config function.
 
void leddriver18_enable_output (leddriver18_t *ctx)
 LED Driver 18 enable output function.
 
void leddriver18_disable_output (leddriver18_t *ctx)
 LED Driver 18 disable output function.
 
err_t leddriver18_set_cc_output (leddriver18_t *ctx, uint8_t current_limit)
 LED Driver 18 set constant current output function.
 
err_t leddriver18_get_cc_output (leddriver18_t *ctx, uint8_t *current_limit)
 LED Driver 18 get constant current output function.
 

Detailed Description

API for configuring and manipulating LED Driver 18 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

◆ leddriver18_cfg_setup()

void leddriver18_cfg_setup ( leddriver18_cfg_t * cfg)

LED Driver 18 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ leddriver18_default_cfg()

err_t leddriver18_default_cfg ( leddriver18_t * ctx)

LED Driver 18 default configuration function.

This function executes a default configuration of LED Driver 18 click board.

Parameters
[in]ctx: Click context object. See leddriver18_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.

◆ leddriver18_disable_output()

void leddriver18_disable_output ( leddriver18_t * ctx)

LED Driver 18 disable output function.

This function is used to disable output of LED Driver 18 click board.

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

◆ leddriver18_enable_output()

void leddriver18_enable_output ( leddriver18_t * ctx)

LED Driver 18 enable output function.

This function is used to enable output of LED Driver 18 click board.

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

◆ leddriver18_generic_read()

err_t leddriver18_generic_read ( leddriver18_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

LED Driver 18 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See leddriver18_t object definition for detailed explanation.
[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.

◆ leddriver18_generic_write()

err_t leddriver18_generic_write ( leddriver18_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

LED Driver 18 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See leddriver18_t object definition for detailed explanation.
[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.

◆ leddriver18_get_cc_output()

err_t leddriver18_get_cc_output ( leddriver18_t * ctx,
uint8_t * current_limit )

LED Driver 18 get constant current output function.

This function is used to read constant current output of LED Driver 18 click board.

Parameters
[in]ctx: Click context object. See leddriver18_t object definition for detailed explanation.
[in]current_limit: Constant current value to be set.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ leddriver18_get_output_pwm()

float leddriver18_get_output_pwm ( uint8_t out_num)

LED Driver 18 get output channel PWM value function.

This function is used to get output PWM of selected channel of LED Driver 18 click board.

Parameters
[in]out_num: Selected output number.
Returns
PWM value of the selected output
Note
None.

◆ leddriver18_init()

err_t leddriver18_init ( leddriver18_t * ctx,
leddriver18_cfg_t * cfg )

LED Driver 18 initialization function.

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

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

◆ leddriver18_set_cc_output()

err_t leddriver18_set_cc_output ( leddriver18_t * ctx,
uint8_t current_limit )

LED Driver 18 set constant current output function.

This function is used to set constant current output of of LED Driver 18 click board.

Parameters
[in]ctx: Click context object. See leddriver18_t object definition for detailed explanation.
[in]current_limit: Constant current value to be set.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ leddriver18_set_output_pwm()

err_t leddriver18_set_output_pwm ( uint8_t out_num,
float pwm_val )

LED Driver 18 set output channel PWM value function.

This function is used to set output PWM of selected channel of LED Driver 18 click board.

Parameters
[in]out_num: Selected output number.
[in]pwm_val: PWM value.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
To update values after using this function you will need to call the leddriver18_write_config function.

◆ leddriver18_write_config()

void leddriver18_write_config ( leddriver18_t * ctx)

LED Driver 18 write config function.

This function is used to update output settings of LED Driver 18 click board.

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