leddriver16 2.1.0.0
leddriver16.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  leddriver16_t
 LED Driver 16 Click context object. More...
 
struct  leddriver16_cfg_t
 LED Driver 16 Click configuration object. More...
 

Macros

#define LEDDRIVER16_REG_MODE1   0x00
 LED Driver 16 registers list.
 
#define LEDDRIVER16_REG_MODE2   0x01
 
#define LEDDRIVER16_REG_LEDOUT0   0x02
 
#define LEDDRIVER16_REG_LEDOUT1   0x03
 
#define LEDDRIVER16_REG_LEDOUT2   0x04
 
#define LEDDRIVER16_REG_LEDOUT3   0x05
 
#define LEDDRIVER16_REG_GRPPWM   0x06
 
#define LEDDRIVER16_REG_GRPFREQ   0x07
 
#define LEDDRIVER16_REG_PWM0   0x08
 
#define LEDDRIVER16_REG_PWM1   0x09
 
#define LEDDRIVER16_REG_PWM2   0x0A
 
#define LEDDRIVER16_REG_PWM3   0x0B
 
#define LEDDRIVER16_REG_PWM4   0x0C
 
#define LEDDRIVER16_REG_PWM5   0x0D
 
#define LEDDRIVER16_REG_PWM6   0x0E
 
#define LEDDRIVER16_REG_PWM7   0x0F
 
#define LEDDRIVER16_REG_PWM8   0x10
 
#define LEDDRIVER16_REG_PWM9   0x11
 
#define LEDDRIVER16_REG_PWM10   0x12
 
#define LEDDRIVER16_REG_PWM11   0x13
 
#define LEDDRIVER16_REG_PWM12   0x14
 
#define LEDDRIVER16_REG_PWM13   0x15
 
#define LEDDRIVER16_REG_PWM14   0x16
 
#define LEDDRIVER16_REG_PWM15   0x17
 
#define LEDDRIVER16_REG_IREF0   0x18
 
#define LEDDRIVER16_REG_IREF1   0x19
 
#define LEDDRIVER16_REG_IREF2   0x1A
 
#define LEDDRIVER16_REG_IREF3   0x1B
 
#define LEDDRIVER16_REG_IREF4   0x1C
 
#define LEDDRIVER16_REG_IREF5   0x1D
 
#define LEDDRIVER16_REG_IREF6   0x1E
 
#define LEDDRIVER16_REG_IREF7   0x1F
 
#define LEDDRIVER16_REG_IREF8   0x20
 
#define LEDDRIVER16_REG_IREF9   0x21
 
#define LEDDRIVER16_REG_IREF10   0x22
 
#define LEDDRIVER16_REG_IREF11   0x23
 
#define LEDDRIVER16_REG_IREF12   0x24
 
#define LEDDRIVER16_REG_IREF13   0x25
 
#define LEDDRIVER16_REG_IREF14   0x26
 
#define LEDDRIVER16_REG_IREF15   0x27
 
#define LEDDRIVER16_REG_RAMP_RATE_GRP0   0x28
 
#define LEDDRIVER16_REG_STEP_TIME_GRP0   0x29
 
#define LEDDRIVER16_REG_HOLD_CNTL_GRP0   0x2A
 
#define LEDDRIVER16_REG_IREF_GRP0   0x2B
 
#define LEDDRIVER16_REG_RAMP_RATE_GRP1   0x2C
 
#define LEDDRIVER16_REG_STEP_TIME_GRP1   0x2D
 
#define LEDDRIVER16_REG_HOLD_CNTL_GRP1   0x2E
 
#define LEDDRIVER16_REG_IREF_GRP1   0x2F
 
#define LEDDRIVER16_REG_RAMP_RATE_GRP2   0x30
 
#define LEDDRIVER16_REG_STEP_TIME_GRP2   0x31
 
#define LEDDRIVER16_REG_HOLD_CNTL_GRP2   0x32
 
#define LEDDRIVER16_REG_IREF_GRP2   0x33
 
#define LEDDRIVER16_REG_RAMP_RATE_GRP3   0x34
 
#define LEDDRIVER16_REG_STEP_TIME_GRP3   0x35
 
#define LEDDRIVER16_REG_HOLD_CNTL_GRP3   0x36
 
#define LEDDRIVER16_REG_IREF_GRP3   0x37
 
#define LEDDRIVER16_REG_GRAD_MODE_SEL0   0x38
 
#define LEDDRIVER16_REG_GRAD_MODE_SEL1   0x39
 
#define LEDDRIVER16_REG_GRAD_GRP_SEL0   0x3A
 
#define LEDDRIVER16_REG_GRAD_GRP_SEL1   0x3B
 
#define LEDDRIVER16_REG_GRAD_GRP_SEL2   0x3C
 
#define LEDDRIVER16_REG_GRAD_GRP_SEL3   0x3D
 
#define LEDDRIVER16_REG_GRAD_CNTL   0x3E
 
#define LEDDRIVER16_REG_OFFSET   0x3F
 
#define LEDDRIVER16_REG_PWMALL   0x40
 
#define LEDDRIVER16_REG_IREFALL   0x41
 
#define LEDDRIVER16_REG_EFLAG0   0x42
 
#define LEDDRIVER16_REG_EFLAG1   0x43
 
#define LEDDRIVER16_REG_EFLAG2   0x44
 
#define LEDDRIVER16_REG_EFLAG3   0x45
 
#define LEDDRIVER16_MODE1_NORMAL_MODE   0x00
 LED Driver 16 MODE1 register setting.
 
#define LEDDRIVER16_MODE1_LOW_POWER_MODE   0x10
 
#define LEDDRIVER16_MODE2_OVERTEMP   0x80
 LED Driver 16 MODE2 register setting.
 
#define LEDDRIVER16_MODE2_ERROR   0x40
 
#define LEDDRIVER16_MODE2_DMBLNK   0x20
 
#define LEDDRIVER16_MODE2_CLRERR   0x10
 
#define LEDDRIVER16_MODE2_EXP_EN   0x04
 
#define LEDDRIVER16_LEDOUT_OFF   0x00
 LED Driver 16 LEDOUTx register setting.
 
#define LEDDRIVER16_LEDOUT_ON   0x01
 
#define LEDDRIVER16_LEDOUT_PWM_ALL   0x02
 
#define LEDDRIVER16_LEDOUT_PWM_GRPPWM   0x03
 
#define LEDDRIVER16_LEDOUT_MASK   0x03
 
#define LEDDRIVER16_PWM_DUTY_MIN   0x00
 LED Driver 16 PWMx register setting.
 
#define LEDDRIVER16_PWM_DUTY_MAX   0xFF
 
#define LEDDRIVER16_IREF_MIN   0x00
 LED Driver 16 IREFx register setting.
 
#define LEDDRIVER16_IREF_MAX   0xFF
 
#define LEDDRIVER16_LED_CHANNEL_0   0x0001u
 LED Driver 16 LED channel setting.
 
#define LEDDRIVER16_LED_CHANNEL_1   0x0002u
 
#define LEDDRIVER16_LED_CHANNEL_2   0x0004u
 
#define LEDDRIVER16_LED_CHANNEL_3   0x0008u
 
#define LEDDRIVER16_LED_CHANNEL_4   0x0010u
 
#define LEDDRIVER16_LED_CHANNEL_5   0x0020u
 
#define LEDDRIVER16_LED_CHANNEL_6   0x0040u
 
#define LEDDRIVER16_LED_CHANNEL_7   0x0080u
 
#define LEDDRIVER16_LED_CHANNEL_8   0x0100u
 
#define LEDDRIVER16_LED_CHANNEL_9   0x0200u
 
#define LEDDRIVER16_LED_CHANNEL_10   0x0400u
 
#define LEDDRIVER16_LED_CHANNEL_11   0x0800u
 
#define LEDDRIVER16_LED_CHANNEL_12   0x1000u
 
#define LEDDRIVER16_LED_CHANNEL_13   0x2000u
 
#define LEDDRIVER16_LED_CHANNEL_14   0x4000u
 
#define LEDDRIVER16_LED_CHANNEL_15   0x8000u
 
#define LEDDRIVER16_LED_CHANNEL_GRP0   0x000Fu
 
#define LEDDRIVER16_LED_CHANNEL_GRP1   0x00F0u
 
#define LEDDRIVER16_LED_CHANNEL_GRP2   0x0F00u
 
#define LEDDRIVER16_LED_CHANNEL_GRP3   0xF000u
 
#define LEDDRIVER16_LED_CHANNEL_ALL   0xFFFFu
 
#define LEDDRIVER16_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define LEDDRIVER16_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define LEDDRIVER16_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  leddriver16_return_value_t { LEDDRIVER16_OK = 0 , LEDDRIVER16_ERROR = -1 }
 LED Driver 16 Click return value data. More...
 

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

This file contains API for LED Driver 16 Click Driver.

Enumeration Type Documentation

◆ leddriver16_return_value_t

LED Driver 16 Click return value data.

Predefined enum values for driver return values.

Enumerator
LEDDRIVER16_OK 
LEDDRIVER16_ERROR