leddriver11 2.0.0.0
LED Driver 11 Click Driver

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

Topics

 LED Driver 11 Settings
 Settings for LED Driver 11 Click driver.
 
 LED Driver 11 MikroBUS Map
 MikroBUS pin mapping of LED Driver 11 Click driver.
 

Functions

void leddriver11_cfg_setup (leddriver11_cfg_t *cfg)
 LED Driver 11 configuration object setup function.
 
err_t leddriver11_init (leddriver11_t *ctx, leddriver11_cfg_t *cfg)
 LED Driver 11 initialization function.
 
err_t leddriver11_default_cfg (leddriver11_t *ctx)
 LED Driver 11 default configuration function.
 
err_t leddriver11_set_current (leddriver11_t *ctx, uint16_t curr)
 LED Driver 11 set current function.
 
err_t leddriver11_read_dac_memory (leddriver11_t *ctx, uint8_t *data_out)
 LED Driver 11 read DAC memory.
 
err_t leddriver11_read_an_pin_value (leddriver11_t *ctx, uint16_t *data_out)
 LED Driver 11 read AN pin value function.
 
err_t leddriver11_read_an_pin_voltage (leddriver11_t *ctx, float *data_out)
 LED Driver 11 read AN pin voltage level function.
 
err_t leddriver11_set_duty_cycle (leddriver11_t *ctx, float duty_cycle)
 LED Driver 11 sets PWM duty cycle.
 
err_t leddriver11_pwm_stop (leddriver11_t *ctx)
 LED Driver 11 stop PWM module.
 
err_t leddriver11_pwm_start (leddriver11_t *ctx)
 LED Driver 11 start PWM module.
 

Detailed Description

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

◆ leddriver11_cfg_setup()

void leddriver11_cfg_setup ( leddriver11_cfg_t * cfg)

LED Driver 11 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ leddriver11_default_cfg()

err_t leddriver11_default_cfg ( leddriver11_t * ctx)

LED Driver 11 default configuration function.

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

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

◆ leddriver11_init()

err_t leddriver11_init ( leddriver11_t * ctx,
leddriver11_cfg_t * cfg )

LED Driver 11 initialization function.

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

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

◆ leddriver11_pwm_start()

err_t leddriver11_pwm_start ( leddriver11_t * ctx)

LED Driver 11 start PWM module.

This function starts the PWM moudle output.

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

◆ leddriver11_pwm_stop()

err_t leddriver11_pwm_stop ( leddriver11_t * ctx)

LED Driver 11 stop PWM module.

This function stops the PWM moudle output.

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

◆ leddriver11_read_an_pin_value()

err_t leddriver11_read_an_pin_value ( leddriver11_t * ctx,
uint16_t * data_out )

LED Driver 11 read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See leddriver11_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver11_read_an_pin_voltage()

err_t leddriver11_read_an_pin_voltage ( leddriver11_t * ctx,
float * data_out )

LED Driver 11 read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See leddriver11_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ leddriver11_read_dac_memory()

err_t leddriver11_read_dac_memory ( leddriver11_t * ctx,
uint8_t * data_out )

LED Driver 11 read DAC memory.

This function reads all the DAC module memory.

Parameters
[in]ctx: Click context object. See leddriver11_t object definition for detailed explanation.
[out]data_out: 6 bytes buffer where the read data is being stored.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver11_set_current()

err_t leddriver11_set_current ( leddriver11_t * ctx,
uint16_t curr )

LED Driver 11 set current function.

This function sets the LEDs current via a 12-bit DAC module.

Parameters
[in]ctx: Click context object. See leddriver11_t object definition for detailed explanation.
[in]curr: 12-bit DAC value.
  • 0 - max current,
  • 0xFFF - min current.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver11_set_duty_cycle()

err_t leddriver11_set_duty_cycle ( leddriver11_t * ctx,
float duty_cycle )

LED Driver 11 sets PWM duty cycle.

This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).

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