52#define LTC3220_REG_COMMAND 0x00
53#define LTC3220_REG_START_ULED 0x01
54#define LTC3220_REG_END_ULED 0x12
55#define LTC3220_REG_BLINK_GRAD 0x13
58#define LTC3220_COMMAND_QUICK_WRITE_MASK NO_OS_BIT(0)
59#define LTC3220_COMMAND_1P5X_MASK NO_OS_BIT(1)
60#define LTC3220_COMMAND_2X_MASK NO_OS_BIT(2)
61#define LTC3220_COMMAND_SHUTDOWN NO_OS_BIT(3)
64#define LTC3220_ULED_MODE_MASK NO_OS_GENMASK(7,6)
65#define LTC3220_ULED_CURRENT_MASK NO_OS_GENMASK(5,0)
66#define LTC3220_ULED_CURRENT_MAX_STEP 64
69#define LTC3220_BLINK_LONG_MASK NO_OS_BIT(4)
70#define LTC3220_BLINK_FAST_MASK NO_OS_BIT(3)
71#define LTC3220_GRAD_SPD_MASK NO_OS_GENMASK(2,1)
72#define LTC3220_GRAD_DIRECTION_MASK NO_OS_BIT(0)
73#define LTC3220_GRAD_MAX_SPD 3
76#define LTC3220_RESET_DELAY_USEC 1
194 uint8_t current_level);
249 bool is_blink_fast,
bool is_blink_long,
bool is_grad_inc,
303 bool is_force_cpo_2x,
bool is_force_cpo_1p5x,
304 bool is_quick_write);
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
#define LTC3220_REG_END_ULED
Definition ltc3220.h:54
int ltc3220_reg_write(struct ltc3220_dev *device, uint8_t reg_addr, uint8_t reg_data)
Writes to the selected register on the device.
Definition ltc3220.c:153
int ltc3220_set_grad_speed(struct ltc3220_dev *device, uint8_t speed)
Sets the configuration of the device's speed of gradation.
Definition ltc3220.c:333
int ltc3220_set_blink_long(struct ltc3220_dev *device, bool is_long_period)
Sets the configuration for blinking mode of ULEDs.
Definition ltc3220.c:289
int ltc3220_set_shutdown(struct ltc3220_dev *device, bool is_shutdown)
Sets the device to shutdown mode, while retaining the register configurations.
Definition ltc3220.c:473
int ltc3220_set_grad_increasing(struct ltc3220_dev *device, bool is_increasing)
Sets the configuration for the device's direction of gradation.
Definition ltc3220.c:311
int ltc3220_init(struct ltc3220_dev **device, struct ltc3220_init_param init_param)
Initializes the LTC3220 device structure.
Definition ltc3220.c:55
int ltc3220_update_reg_command(struct ltc3220_dev *device, bool is_shutdown, bool is_force_cpo_2x, bool is_force_cpo_1p5x, bool is_quick_write)
Updates the configuration set on the.
Definition ltc3220.c:499
int ltc3220_update_reg_blink_grad(struct ltc3220_dev *device, bool is_blink_fast, bool is_blink_long, bool is_grad_inc, uint8_t grad_speed)
Updates the configuration set on the device's Blink/Gradation based on the config.
Definition ltc3220.c:365
int ltc3220_set_blink_fast(struct ltc3220_dev *device, bool is_fast_on)
Sets the configuration for blinking mode of ULEDs.
Definition ltc3220.c:266
ltc3220_variant
Definition ltc3220.h:78
@ LTC3220
Definition ltc3220.h:79
@ LTC3220_1
Definition ltc3220.h:80
int ltc3220_set_quick_write(struct ltc3220_dev *device, bool is_quick_write)
Sets the configuration to perform a quick write to the device.
Definition ltc3220.c:384
int ltc3220_set_cpo_1p5x(struct ltc3220_dev *device, bool is_force_cpo_1p5x)
Sets the device's charge pump to output 1.5x of operating voltage.
Definition ltc3220.c:428
int ltc3220_update_reg_uled(struct ltc3220_dev *device, uint8_t uled_number, enum ltc3220_uled_mode mode, uint8_t current_level)
Updates the configuration set on the device's ULED based on the config.
Definition ltc3220.c:229
int ltc3220_set_uled_current(struct ltc3220_dev *device, uint8_t uled_number, uint8_t current_level)
Sets the selected ULED register's current strength.
Definition ltc3220.c:200
int ltc3220_reset(struct ltc3220_dev *device)
Resets the device using the RST pin.
Definition ltc3220.c:122
int ltc3220_set_cpo_1x(struct ltc3220_dev *device, bool is_force_cpo_1x)
Sets the device's charge pump to output 1x of operating voltage.
Definition ltc3220.c:406
ltc3220_uled_mode
Definition ltc3220.h:83
@ LTC3220_MODE_GRADATION
Definition ltc3220.h:86
@ LTC3220_MODE_GPO
Definition ltc3220.h:87
@ LTC3220_MODE_NORMAL
Definition ltc3220.h:84
@ LTC3220_MODE_BLINK
Definition ltc3220.h:85
int ltc3220_set_uled_mode(struct ltc3220_dev *device, uint8_t uled_number, enum ltc3220_uled_mode mode)
Sets the selected ULED register's operating mode.
Definition ltc3220.c:174
int ltc3220_remove(struct ltc3220_dev *device)
Deallocates the resources for the device structure.
Definition ltc3220.c:91
int ltc3220_set_cpo_2x(struct ltc3220_dev *device, bool is_force_cpo_2x)
Sets the device's charge pump to output 2x of operating voltage.
Definition ltc3220.c:450
Header file of GPIO Interface.
Header file of I2C Interface.
Header file of utility functions.
Definition ad9361_util.h:63
bool is_fast_on
Definition ltc3220.h:107
bool is_long_period
Definition ltc3220.h:108
bool is_shutdown
Definition ltc3220.h:94
bool is_force_cpo_1p5x
Definition ltc3220.h:92
bool is_quick_write
Definition ltc3220.h:91
bool is_force_cpo_2x
Definition ltc3220.h:93
struct ltc3220_uled_cfg uleds[LTC3220_REG_END_ULED]
Definition ltc3220.h:126
struct no_os_gpio_desc * gpio_rst_desc
Definition ltc3220.h:123
struct no_os_i2c_desc * i2c_desc
Definition ltc3220.h:121
struct ltc3220_command_cfg command_config
Definition ltc3220.h:129
struct ltc3220_blink_cfg blink_config
Definition ltc3220.h:132
struct ltc3220_grad_cfg gradation_config
Definition ltc3220.h:135
bool is_increasing
Definition ltc3220.h:115
uint8_t speed
Definition ltc3220.h:114
struct no_os_i2c_init_param i2c_init_param
Definition ltc3220.h:139
struct no_os_gpio_init_param gpio_init_param
Definition ltc3220.h:140
uint8_t current_level
Definition ltc3220.h:101
enum ltc3220_uled_mode mode
Definition ltc3220.h:100
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52