leddriver10 2.0.0.0
LED Driver 10 Click Driver

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

Topics

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

Functions

void leddriver10_cfg_setup (leddriver10_cfg_t *cfg)
 LED Driver 10 configuration object setup function.
 
err_t leddriver10_init (leddriver10_t *ctx, leddriver10_cfg_t *cfg)
 LED Driver 10 initialization function.
 
err_t leddriver10_set_channels (leddriver10_t *ctx, uint16_t ch_mask)
 LED Driver 10 set channels function.
 
err_t leddriver10_read_channels (leddriver10_t *ctx, uint16_t *ch_mask)
 LED Driver 10 read channels function.
 
err_t leddriver10_set_duty_cycle (leddriver10_t *ctx, float duty_cycle)
 LED Driver 10 sets PWM duty cycle.
 
err_t leddriver10_pwm_stop (leddriver10_t *ctx)
 LED Driver 10 stop PWM module.
 
err_t leddriver10_pwm_start (leddriver10_t *ctx)
 LED Driver 10 start PWM module.
 

Detailed Description

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

◆ leddriver10_cfg_setup()

void leddriver10_cfg_setup ( leddriver10_cfg_t * cfg)

LED Driver 10 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ leddriver10_init()

err_t leddriver10_init ( leddriver10_t * ctx,
leddriver10_cfg_t * cfg )

LED Driver 10 initialization function.

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

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

◆ leddriver10_pwm_start()

err_t leddriver10_pwm_start ( leddriver10_t * ctx)

LED Driver 10 start PWM module.

This function starts the PWM module output.

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

◆ leddriver10_pwm_stop()

err_t leddriver10_pwm_stop ( leddriver10_t * ctx)

LED Driver 10 stop PWM module.

This function stops the PWM module output.

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

◆ leddriver10_read_channels()

err_t leddriver10_read_channels ( leddriver10_t * ctx,
uint16_t * ch_mask )

LED Driver 10 read channels function.

This function reads the current state of all channels by using SPI serial interface.

Parameters
[in]ctx: Click context object. See leddriver10_t object definition for detailed explanation.
[out]ch_mask: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function doesn't affect the channels output state.

◆ leddriver10_set_channels()

err_t leddriver10_set_channels ( leddriver10_t * ctx,
uint16_t ch_mask )

LED Driver 10 set channels function.

This function sets all channels to desired value by using SPI serial interface.

Parameters
[in]ctx: Click context object. See leddriver10_t object definition for detailed explanation.
[in]ch_mask: Channel mask.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function affects all channel outputs.

◆ leddriver10_set_duty_cycle()

err_t leddriver10_set_duty_cycle ( leddriver10_t * ctx,
float duty_cycle )

LED Driver 10 sets PWM duty cycle.

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

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