leddriver9 2.0.0.0
LED Driver 9 Click Driver

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

Topics

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

Functions

void leddriver9_cfg_setup (leddriver9_cfg_t *cfg)
 LED Driver 9 configuration object setup function.
 
err_t leddriver9_init (leddriver9_t *ctx, leddriver9_cfg_t *cfg)
 LED Driver 9 initialization function.
 
void leddriver9_default_cfg (leddriver9_t *ctx)
 LED Driver 9 default configuration function.
 
err_t leddriver9_generic_write (leddriver9_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 LED Driver 9 I2C writing function.
 
err_t leddriver9_generic_read (leddriver9_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 LED Driver 9 I2C reading function.
 
err_t leddriver9_mode1_reg_write (leddriver9_t *ctx, leddriver9_mode_reg_t *mode_reg)
 LED Driver 9 MODE1 reg write function.
 
err_t leddriver9_mode1_reg_read (leddriver9_t *ctx, leddriver9_mode_reg_t *mode_reg)
 LED Driver 9 MODE1 reg read function.
 
err_t leddriver9_mode2_reg_write (leddriver9_t *ctx, leddriver9_mode_reg_t *mode_reg)
 LED Driver 9 MODE2 reg write function.
 
err_t leddriver9_mode2_reg_read (leddriver9_t *ctx, leddriver9_mode_reg_t *mode_reg)
 LED Driver 9 MODE2 reg read function.
 
err_t leddriver9_ledout_state (leddriver9_t *ctx, leddriver9_output_state_t *output_state)
 LED Driver 9 LEDOUT state function.
 
err_t leddriver9_set_pwm (leddriver9_t *ctx, leddriver9_channel_sel_t ch_out, float duty_cycle)
 LED Driver 9 set PWM function.
 
err_t leddriver9_set_dimmer_pwm (leddriver9_t *ctx, float duty_cycle)
 LED Driver 9 set dimmer PWM function.
 
err_t leddriver9_set_blink_period (leddriver9_t *ctx, float period)
 LED Driver 9 set blink period function.
 
void leddriver9_hardware_reset (leddriver9_t *ctx)
 LED Driver 9 hardware reset function.
 

Detailed Description

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

◆ leddriver9_cfg_setup()

void leddriver9_cfg_setup ( leddriver9_cfg_t * cfg)

LED Driver 9 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ leddriver9_default_cfg()

void leddriver9_default_cfg ( leddriver9_t * ctx)

LED Driver 9 default configuration function.

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

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ leddriver9_generic_read()

err_t leddriver9_generic_read ( leddriver9_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

LED Driver 9 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 leddriver9_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver9_generic_write()

err_t leddriver9_generic_write ( leddriver9_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

LED Driver 9 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 leddriver9_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver9_hardware_reset()

void leddriver9_hardware_reset ( leddriver9_t * ctx)

LED Driver 9 hardware reset function.

This function performs the hardware reset on the device.

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

◆ leddriver9_init()

err_t leddriver9_init ( leddriver9_t * ctx,
leddriver9_cfg_t * cfg )

LED Driver 9 initialization function.

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

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

◆ leddriver9_ledout_state()

err_t leddriver9_ledout_state ( leddriver9_t * ctx,
leddriver9_output_state_t * output_state )

LED Driver 9 LEDOUT state function.

This function configures the LEDOUTx registers from the defined config structure.

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
[in]output_state: Output state config structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver9_mode1_reg_read()

err_t leddriver9_mode1_reg_read ( leddriver9_t * ctx,
leddriver9_mode_reg_t * mode_reg )

LED Driver 9 MODE1 reg read function.

This function acquires the data from the MODE1 register and stores the content in the defined config structure.

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
[out]mode_reg: Mode reg config structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver9_mode1_reg_write()

err_t leddriver9_mode1_reg_write ( leddriver9_t * ctx,
leddriver9_mode_reg_t * mode_reg )

LED Driver 9 MODE1 reg write function.

This function configures the MODE1 register from the defined config structure.

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
[in]mode_reg: Mode reg config structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver9_mode2_reg_read()

err_t leddriver9_mode2_reg_read ( leddriver9_t * ctx,
leddriver9_mode_reg_t * mode_reg )

LED Driver 9 MODE2 reg read function.

This function acquires the data from the MODE2 register and stores the content in the defined config structure.

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
[out]mode_reg: Mode reg config structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver9_mode2_reg_write()

err_t leddriver9_mode2_reg_write ( leddriver9_t * ctx,
leddriver9_mode_reg_t * mode_reg )

LED Driver 9 MODE2 reg write function.

This function configures the MODE2 register from the defined config structure.

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
[in]mode_reg: Mode reg config structure.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ leddriver9_set_blink_period()

err_t leddriver9_set_blink_period ( leddriver9_t * ctx,
float period )

LED Driver 9 set blink period function.

This function sets the group frequency period ( GRPFREQ ) which will result with LED blinking after the defined time.

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
[in]period: Time period in seconds.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Make sure that the ledout channel is previously configured accordingly. This feature is available only if DMBLINK bit is programmed with logic 1.

◆ leddriver9_set_dimmer_pwm()

err_t leddriver9_set_dimmer_pwm ( leddriver9_t * ctx,
float duty_cycle )

LED Driver 9 set dimmer PWM function.

This function sets the group PWM duty cycle ( GRPPWM ) which can be used for dimming already set PWM channels.

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
[in]duty_cycle: Duty cycle value ranging from 0 to 100.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Make sure that the ledout channel is previously configured accordingly. This feature is available only if DMBLINK bit is programmed with logic 0.

◆ leddriver9_set_pwm()

err_t leddriver9_set_pwm ( leddriver9_t * ctx,
leddriver9_channel_sel_t ch_out,
float duty_cycle )

LED Driver 9 set PWM function.

This function sets the PWM duty cycle on selected ledout channel.

Parameters
[in]ctx: Click context object. See leddriver9_t object definition for detailed explanation.
[in]ch_out: Channel selection.
[in]duty_cycle: Duty cycle value ranging from 0 to 100.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Make sure that the ledout channel is previously configured accordingly.