leddriver16 2.1.0.0
LED Driver 16 Click Driver

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

Topics

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

Functions

void leddriver16_cfg_setup (leddriver16_cfg_t *cfg)
 LED Driver 16 configuration object setup function.
 
err_t leddriver16_init (leddriver16_t *ctx, leddriver16_cfg_t *cfg)
 LED Driver 16 initialization function.
 
err_t leddriver16_default_cfg (leddriver16_t *ctx)
 LED Driver 16 default configuration function.
 
err_t leddriver16_write_register (leddriver16_t *ctx, uint8_t reg, uint8_t data_in)
 LED Driver 16 write register function.
 
err_t leddriver16_read_register (leddriver16_t *ctx, uint8_t reg, uint8_t *data_out)
 LED Driver 16 read register function.
 
void leddriver16_disable_device (leddriver16_t *ctx)
 LED Driver 16 disable device function.
 
void leddriver16_enable_device (leddriver16_t *ctx)
 LED Driver 16 enable device function.
 
void leddriver16_disable_output (leddriver16_t *ctx)
 LED Driver 16 disable output function.
 
void leddriver16_enable_output (leddriver16_t *ctx)
 LED Driver 16 enable output function.
 
err_t leddriver16_clear_errors (leddriver16_t *ctx)
 LED Driver 16 clear errors function.
 
err_t leddriver16_set_led_state (leddriver16_t *ctx, uint16_t led_ch_mask, uint8_t state)
 LED Driver 16 set led state function.
 
err_t leddriver16_set_led_pwm (leddriver16_t *ctx, uint16_t led_ch_mask, uint8_t duty_cycle)
 LED Driver 16 set led pwm function.
 
err_t leddriver16_set_led_iref (leddriver16_t *ctx, uint16_t led_ch_mask, uint8_t iref)
 LED Driver 16 set led iref function.
 

Detailed Description

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

◆ leddriver16_cfg_setup()

void leddriver16_cfg_setup ( leddriver16_cfg_t * cfg)

LED Driver 16 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ leddriver16_clear_errors()

err_t leddriver16_clear_errors ( leddriver16_t * ctx)

LED Driver 16 clear errors function.

This function clears all error status bits in EFLAGn register and ERROR (bit 6).

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

◆ leddriver16_default_cfg()

err_t leddriver16_default_cfg ( leddriver16_t * ctx)

LED Driver 16 default configuration function.

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

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

◆ leddriver16_disable_device()

void leddriver16_disable_device ( leddriver16_t * ctx)

LED Driver 16 disable device function.

This function disables device by setting the RST pin to low logic state.

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

◆ leddriver16_disable_output()

void leddriver16_disable_output ( leddriver16_t * ctx)

LED Driver 16 disable output function.

This function disables output by setting the OE pin to high logic state.

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

◆ leddriver16_enable_device()

void leddriver16_enable_device ( leddriver16_t * ctx)

LED Driver 16 enable device function.

This function enables device by setting the RST pin to high logic state.

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

◆ leddriver16_enable_output()

void leddriver16_enable_output ( leddriver16_t * ctx)

LED Driver 16 enable output function.

This function enables output by setting the OE pin to low logic state.

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

◆ leddriver16_init()

err_t leddriver16_init ( leddriver16_t * ctx,
leddriver16_cfg_t * cfg )

LED Driver 16 initialization function.

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

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

◆ leddriver16_read_register()

err_t leddriver16_read_register ( leddriver16_t * ctx,
uint8_t reg,
uint8_t * data_out )

LED Driver 16 read register function.

This function reads data from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See leddriver16_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ leddriver16_set_led_iref()

err_t leddriver16_set_led_iref ( leddriver16_t * ctx,
uint16_t led_ch_mask,
uint8_t iref )

LED Driver 16 set led iref function.

This function sets the gain settings for output current for the specified LEDs.

Parameters
[in]ctx: Click context object. See leddriver16_t object definition for detailed explanation.
[in]led_ch_mask: LED channel mask (16-bit). See the LED channel setting macros definition.
[in]iref: Output current setting with steps of 225uA.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
Output current = iref * 225uA, which leads to range from 225uA to 57.375mA.

◆ leddriver16_set_led_pwm()

err_t leddriver16_set_led_pwm ( leddriver16_t * ctx,
uint16_t led_ch_mask,
uint8_t duty_cycle )

LED Driver 16 set led pwm function.

This function sets the PWM duty cycle for the specified LEDs.

Parameters
[in]ctx: Click context object. See leddriver16_t object definition for detailed explanation.
[in]led_ch_mask: LED channel mask (16-bit). See the LED channel setting macros definition.
[in]duty_cycle: PWM duty cycle.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
A 31.25 kHz fixed frequency signal is used for each output. Duty cycle is controlled through 255 linear steps from 00h (0 % duty cycle = LED output off) to FEh (99.2 % duty cycle = LED output at maximum brightness) and FFh (100 % duty cycle = LED output completed ON). Applicable to LEDs with output state 2 or 3.

◆ leddriver16_set_led_state()

err_t leddriver16_set_led_state ( leddriver16_t * ctx,
uint16_t led_ch_mask,
uint8_t state )

LED Driver 16 set led state function.

This function sets the output state for the specified LEDs.

Parameters
[in]ctx: Click context object. See leddriver16_t object definition for detailed explanation.
[in]led_ch_mask: LED channel mask (16-bit). See the LED channel setting macros definition.
[in]state: LED output state
  • 0 - off.
  • 1 - fully on (individual brightness and group dimming/blinking not controlled). The OE pin can be used as external dimming/blinking control in this state.
  • 2 - individual brightness can be controlled through its PWMx register (default power-up state) or PWMALL register for all LEDn outputs.
  • 3 - individual brightness and group dimming/blinking can be controlled through its PWMx register and the GRPPWM registers.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ leddriver16_write_register()

err_t leddriver16_write_register ( leddriver16_t * ctx,
uint8_t reg,
uint8_t data_in )

LED Driver 16 write register function.

This function writes data to the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See leddriver16_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.