leddriver12 2.0.0.0
leddriver12.h File Reference

This file contains API for LED Driver 12 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  leddriver12_t
 LED Driver 12 Click context object. More...
 
struct  leddriver12_cfg_t
 LED Driver 12 Click configuration object. More...
 

Macros

#define LEDDRIVER12_REG_INPUT0   0x00
 LED Driver 12 register list.
 
#define LEDDRIVER12_REG_INPUT1   0x01
 
#define LEDDRIVER12_REG_PSC0   0x02
 
#define LEDDRIVER12_REG_PWM0   0x03
 
#define LEDDRIVER12_REG_PSC1   0x04
 
#define LEDDRIVER12_REG_PWM1   0x05
 
#define LEDDRIVER12_REG_LS0   0x06
 
#define LEDDRIVER12_REG_LS1   0x07
 
#define LEDDRIVER12_REG_LS2   0x08
 
#define LEDDRIVER12_REG_LS3   0x09
 
#define LEDDRIVER12_AUTO_INCREMENT_BIT   0x10
 LED Driver 12 Control register setting.
 
#define LEDDRIVER12_LED_OFF   0x00
 LED Driver 12 LED Selector registers setting.
 
#define LEDDRIVER12_LED_ON   0x01
 
#define LEDDRIVER12_LED_PWM0   0x02
 
#define LEDDRIVER12_LED_PWM1   0x03
 
#define LEDDRIVER12_LED0   0x00
 
#define LEDDRIVER12_LED1   0x01
 
#define LEDDRIVER12_LED2   0x02
 
#define LEDDRIVER12_LED3   0x03
 
#define LEDDRIVER12_LED4   0x04
 
#define LEDDRIVER12_LED5   0x05
 
#define LEDDRIVER12_LED6   0x06
 
#define LEDDRIVER12_LED7   0x07
 
#define LEDDRIVER12_LED8   0x08
 
#define LEDDRIVER12_LED9   0x09
 
#define LEDDRIVER12_LED10   0x0A
 
#define LEDDRIVER12_LED11   0x0B
 
#define LEDDRIVER12_LED12   0x0C
 
#define LEDDRIVER12_LED13   0x0D
 
#define LEDDRIVER12_LED14   0x0E
 
#define LEDDRIVER12_LED15   0x0F
 
#define LEDDRIVER12_LED0_TO_3   0x00
 
#define LEDDRIVER12_LED4_TO_7   0x01
 
#define LEDDRIVER12_LED8_TO_11   0x02
 
#define LEDDRIVER12_LED12_TO_15   0x03
 
#define LEDDRIVER12_ALL_LEDS   0xFF
 
#define LEDDRIVER12_BLINK_PERIOD_MAX   1.68421
 LED Driver 12 PWM setting.
 
#define LEDDRIVER12_BLINK_PERIOD_MIN   0.00657
 
#define LEDDRIVER12_BLINK_PERIOD_ONE_SECOND   1.0
 
#define LEDDRIVER12_BLINK_PERIOD_HALF_SECOND   0.5
 
#define LEDDRIVER12_DUTY_CYCLE_MAX   0xFF
 
#define LEDDRIVER12_DUTY_CYCLE_HALF   0x80
 
#define LEDDRIVER12_DUTY_CYCLE_QUARTER   0x40
 
#define LEDDRIVER12_DUTY_CYCLE_MIN   0x00
 
#define LEDDRIVER12_DEV_ADDR_A2A1A0_000   0x60
 LED Driver 12 device address setting.
 
#define LEDDRIVER12_DEV_ADDR_A2A1A0_001   0x61
 
#define LEDDRIVER12_DEV_ADDR_A2A1A0_010   0x62
 
#define LEDDRIVER12_DEV_ADDR_A2A1A0_011   0x63
 
#define LEDDRIVER12_DEV_ADDR_A2A1A0_100   0x64
 
#define LEDDRIVER12_DEV_ADDR_A2A1A0_101   0x65
 
#define LEDDRIVER12_DEV_ADDR_A2A1A0_110   0x66
 
#define LEDDRIVER12_DEV_ADDR_A2A1A0_111   0x67
 
#define LEDDRIVER12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  leddriver12_return_value_t { LEDDRIVER12_OK = 0 , LEDDRIVER12_ERROR = -1 }
 LED Driver 12 Click return value data. More...
 

Functions

void leddriver12_cfg_setup (leddriver12_cfg_t *cfg)
 LED Driver 12 configuration object setup function.
 
err_t leddriver12_init (leddriver12_t *ctx, leddriver12_cfg_t *cfg)
 LED Driver 12 initialization function.
 
err_t leddriver12_default_cfg (leddriver12_t *ctx)
 LED Driver 12 default configuration function.
 
err_t leddriver12_generic_write (leddriver12_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 LED Driver 12 I2C writing function.
 
err_t leddriver12_generic_read (leddriver12_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 LED Driver 12 I2C reading function.
 
err_t leddriver12_write_register (leddriver12_t *ctx, uint8_t reg, uint8_t data_in)
 LED Driver 12 write register function.
 
err_t leddriver12_read_register (leddriver12_t *ctx, uint8_t reg, uint8_t *data_out)
 LED Driver 12 read register function.
 
void leddriver12_set_rst_pin (leddriver12_t *ctx, uint8_t state)
 LED Driver 12 set rst pin function.
 
err_t leddriver12_set_led_config (leddriver12_t *ctx, uint8_t led_number, uint8_t led_cfg)
 LED Driver 12 set led config function.
 
err_t leddriver12_set_led_port_config (leddriver12_t *ctx, uint8_t led_port_number, uint8_t led_cfg)
 LED Driver 12 set led port config function.
 
err_t leddriver12_read_input_0 (leddriver12_t *ctx, uint8_t *data_out)
 LED Driver 12 read input 0 function.
 
err_t leddriver12_read_input_1 (leddriver12_t *ctx, uint8_t *data_out)
 LED Driver 12 read input 1 function.
 
err_t leddriver12_set_blink_period_pwm_0 (leddriver12_t *ctx, float blink_period)
 LED Driver 12 set blink period pwm 0 function.
 
err_t leddriver12_set_blink_period_pwm_1 (leddriver12_t *ctx, float blink_period)
 LED Driver 12 set blink period pwm 1 function.
 
err_t leddriver12_set_duty_cycle_pwm_0 (leddriver12_t *ctx, uint8_t duty_cycle)
 LED Driver 12 set duty cycle pwm 0 function.
 
err_t leddriver12_set_duty_cycle_pwm_1 (leddriver12_t *ctx, uint8_t duty_cycle)
 LED Driver 12 set duty cycle pwm 1 function.
 

Detailed Description

This file contains API for LED Driver 12 Click Driver.

Enumeration Type Documentation

◆ leddriver12_return_value_t

LED Driver 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
LEDDRIVER12_OK 
LEDDRIVER12_ERROR