leddriver9 2.0.0.0
leddriver9.h File Reference

This file contains API for LED Driver 9 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  leddriver9_t
 LED Driver 9 Click context object. More...
 
struct  leddriver9_cfg_t
 LED Driver 9 Click configuration object. More...
 
struct  leddriver9_mode_reg_t
 LED Driver 9 Click mode registers. More...
 
struct  leddriver9_output_state_t
 LED Driver 9 Click LED output state registers. More...
 

Macros

#define LEDDRIVER9_REG_MODE1   0x00
 LED Driver 9 MODE1 register.
 
#define LEDDRIVER9_REG_MODE2   0x01
 LED Driver 9 MODE2 register.
 
#define LEDDRIVER9_REG_PWM0   0x02
 LED Driver 9 PWM0 register.
 
#define LEDDRIVER9_REG_PWM1   0x03
 LED Driver 9 PWM1 register.
 
#define LEDDRIVER9_REG_PWM2   0x04
 LED Driver 9 PWM2 register.
 
#define LEDDRIVER9_REG_PWM3   0x05
 LED Driver 9 PWM3 register.
 
#define LEDDRIVER9_REG_PWM4   0x06
 LED Driver 9 PWM4 register.
 
#define LEDDRIVER9_REG_PWM5   0x07
 LED Driver 9 PWM5 register.
 
#define LEDDRIVER9_REG_PWM6   0x08
 LED Driver 9 PWM6 register.
 
#define LEDDRIVER9_REG_PWM7   0x09
 LED Driver 9 PWM7 register.
 
#define LEDDRIVER9_REG_PWM8   0x0A
 LED Driver 9 PWM8 register.
 
#define LEDDRIVER9_REG_PWM9   0x0B
 LED Driver 9 PWM9 register.
 
#define LEDDRIVER9_REG_PWM10   0x0C
 LED Driver 9 PWM10 register.
 
#define LEDDRIVER9_REG_PWM11   0x0D
 LED Driver 9 PWM11 register.
 
#define LEDDRIVER9_REG_PWM12   0x0E
 LED Driver 9 PWM12 register.
 
#define LEDDRIVER9_REG_PWM13   0x0F
 LED Driver 9 PWM13 register.
 
#define LEDDRIVER9_REG_PWM14   0x10
 LED Driver 9 PWM14 register.
 
#define LEDDRIVER9_REG_PWM15   0x11
 LED Driver 9 PWM15 register.
 
#define LEDDRIVER9_REG_GRPPWM   0x12
 LED Driver 9 GRPPWM register.
 
#define LEDDRIVER9_REG_GRPFREQ   0x13
 LED Driver 9 GRPFREQ register.
 
#define LEDDRIVER9_REG_LEDOUT0   0x14
 LED Driver 9 LEDOUT0 register.
 
#define LEDDRIVER9_REG_LEDOUT1   0x15
 LED Driver 9 LEDOUT1 register.
 
#define LEDDRIVER9_REG_LEDOUT2   0x16
 LED Driver 9 LEDOUT2 register.
 
#define LEDDRIVER9_REG_LEDOUT3   0x17
 LED Driver 9 LEDOUT3 register.
 
#define LEDDRIVER9_REG_SUBADR1   0x18
 LED Driver 9 SUBADR1 register.
 
#define LEDDRIVER9_REG_SUBADR2   0x19
 LED Driver 9 SUBADR2 register.
 
#define LEDDRIVER9_REG_SUBADR3   0x1A
 LED Driver 9 SUBADR3 register.
 
#define LEDDRIVER9_REG_ALLCALLADR   0x1B
 LED Driver 9 ALLCALLADR register.
 
#define LEDDRIVER9_REG_IREF   0x1C
 LED Driver 9 IREF register.
 
#define LEDDRIVER9_REG_EFLAG1   0x1D
 LED Driver 9 EFLAG1 register.
 
#define LEDDRIVER9_REG_EFLAG2   0x1E
 LED Driver 9 EFLAG2 register.
 
#define LEDDRIVER9_SET_DEV_ADDR   0x60
 LED Driver 9 device address setting.
 
#define LEDDRIVER9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  leddriver9_return_value_t { LEDDRIVER9_OK = 0 , LEDDRIVER9_ERROR = -1 }
 LED Driver 9 Click return value data. More...
 
enum  leddriver9_channel_sel_t {
  LEDDRIVER9_CHANNEL0 = 0 , LEDDRIVER9_CHANNEL1 , LEDDRIVER9_CHANNEL2 , LEDDRIVER9_CHANNEL3 ,
  LEDDRIVER9_CHANNEL4 , LEDDRIVER9_CHANNEL5 , LEDDRIVER9_CHANNEL6 , LEDDRIVER9_CHANNEL7 ,
  LEDDRIVER9_CHANNEL8 , LEDDRIVER9_CHANNEL9 , LEDDRIVER9_CHANNEL10 , LEDDRIVER9_CHANNEL11 ,
  LEDDRIVER9_CHANNEL12 , LEDDRIVER9_CHANNEL13 , LEDDRIVER9_CHANNEL14 , LEDDRIVER9_CHANNEL15
}
 LED Driver 9 Click channel select options. More...
 
enum  leddriver9_ledout_sel_t { LEDDRIVER9_OFF = 0 , LEDDRIVER9_FULL_ON , LEDDRIVER9_INDIVIDUAL , LEDDRIVER9_GROUP }
 LED Driver 9 Click ledout select options. More...
 

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

This file contains API for LED Driver 9 Click Driver.

Enumeration Type Documentation

◆ leddriver9_channel_sel_t

LED Driver 9 Click channel select options.

Predefined enum values for ledout channels.

Enumerator
LEDDRIVER9_CHANNEL0 
LEDDRIVER9_CHANNEL1 
LEDDRIVER9_CHANNEL2 
LEDDRIVER9_CHANNEL3 
LEDDRIVER9_CHANNEL4 
LEDDRIVER9_CHANNEL5 
LEDDRIVER9_CHANNEL6 
LEDDRIVER9_CHANNEL7 
LEDDRIVER9_CHANNEL8 
LEDDRIVER9_CHANNEL9 
LEDDRIVER9_CHANNEL10 
LEDDRIVER9_CHANNEL11 
LEDDRIVER9_CHANNEL12 
LEDDRIVER9_CHANNEL13 
LEDDRIVER9_CHANNEL14 
LEDDRIVER9_CHANNEL15 

◆ leddriver9_ledout_sel_t

LED Driver 9 Click ledout select options.

Predefined enum values for ledout options.

Enumerator
LEDDRIVER9_OFF 

LED driver x is off (default power-up state).

LEDDRIVER9_FULL_ON 

LED driver x is fully on (individual brightness and group dimming/blinking not controlled).

LEDDRIVER9_INDIVIDUAL 

LED driver x is individual brightness can be controlled through its PWMx register.

LEDDRIVER9_GROUP 

Same as individual but also includes the GRPPWM registers.

◆ leddriver9_return_value_t

LED Driver 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
LEDDRIVER9_OK 
LEDDRIVER9_ERROR