no-OS
Loading...
Searching...
No Matches
ltc3208.h
Go to the documentation of this file.
1/***************************************************************************/
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44#ifndef __LTC3208_H__
45#define __LTC3208_H__
46
47#include "no_os_i2c.h"
48#include "no_os_gpio.h"
49#include "no_os_util.h"
50
51/* ltc3208 register addresses */
52#define LTC3208_REG_RED_GREEN 0x01
53#define LTC3208_REG_BLUE_AUX 0x02
54#define LTC3208_REG_MAIN 0x03
55#define LTC3208_REG_SUB 0X04
56#define LTC3208_REG_AUX_DAC_SEL 0x05
57#define LTC3208_REG_CAM_HIGH_LOW 0x06
58#define LTC3208_REG_OPTIONS 0x07
59
60#define LTC3208_8_BIT_MASK NO_OS_GENMASK(7,0)
61#define LTC3208_4_BIT_HIGH_MASK NO_OS_GENMASK(7,4)
62#define LTC3208_4_BIT_LOW_MASK NO_OS_GENMASK(3,0)
63
64/* aux dac select register (0x05) */
65#define LTC3208_AUX4_MASK NO_OS_GENMASK(7,6)
66#define LTC3208_AUX3_MASK NO_OS_GENMASK(5,4)
67#define LTC3208_AUX2_MASK NO_OS_GENMASK(3,2)
68#define LTC3208_AUX1_MASK NO_OS_GENMASK(1,0)
69
70/* options register (0x07) */
71#define LTC3208_CPO_2X_BIT NO_OS_BIT(7)
72#define LTC3208_CPO_1P5X_BIT NO_OS_BIT(6)
73#define LTC3208_TEST_HOOK_1_MASK NO_OS_BIT(5)
74#define LTC3208_TEST_HOOK_2_MASK NO_OS_BIT(4)
75#define LTC3208_DROPOUT_BIT NO_OS_BIT(3)
76#define LTC3208_CAM_BIT NO_OS_BIT(2)
77#define LTC3208_RGB_BIT NO_OS_BIT(1)
78
85
93
101
108
113
120int ltc3208_init(struct ltc3208_dev **device,
122
129
137int ltc3208_reg_write(struct ltc3208_dev *device, uint8_t reg_addr,
138 uint8_t reg_data);
139
145int ltc3208_reset(struct ltc3208_dev *device);
146
155 enum reg_options reg_selected,
156 uint8_t current_level);
157
167 enum reg_options reg_selected,
168 uint8_t current_level_high,
169 uint8_t current_level_low);
170
181 enum dac_options aux_dac_1,
182 enum dac_options aux_dac_2,
183 enum dac_options aux_dac_3,
184 enum dac_options aux_dac_4);
193 enum dac_options aux_dac,
194 int aux_index);
195
206int ltc3208_update_options(struct ltc3208_dev *device, bool is_force_2x,
207 bool is_force_1p5x, bool is_dropout_disable,
208 bool is_cam_high_enable, bool is_sub_enable);
209
216int ltc3208_set_cpo_2x(struct ltc3208_dev *device, bool is_force_2x);
217
224int ltc3208_set_1p5x(struct ltc3208_dev *device, bool is_force_1p5x);
225
233 bool is_dropout_disable);
234
241int ltc3208_set_cam_high(struct ltc3208_dev *device, bool is_cam_high_enable);
242
249int ltc3208_set_sub_enable(struct ltc3208_dev *device, bool is_sub_enable);
250
251
252#endif /*__LTC3208_H__*/
253
254#ifdef __cplusplus
255}
256#endif
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int ltc3208_update_options(struct ltc3208_dev *device, bool is_force_2x, bool is_force_1p5x, bool is_dropout_disable, bool is_cam_high_enable, bool is_sub_enable)
Updates the options set on the device.
Definition ltc3208.c:312
int ltc3208_reset(struct ltc3208_dev *device)
Resets all register of the device.
Definition ltc3208.c:145
int ltc3208_set_sub_enable(struct ltc3208_dev *device, bool is_sub_enable)
Selects if RGB or SUB is controled by ENRGBS pin.
Definition ltc3208.c:411
int ltc3208_set_aux_led_dac(struct ltc3208_dev *device, enum dac_options aux_dac, int aux_index)
Sets the DAC settings for a specific AUX LED.
Definition ltc3208.c:283
int ltc3208_set_8_bit_dac(struct ltc3208_dev *device, enum reg_options reg_selected, uint8_t current_level)
Sets the selected 8 bit LED register's current strength.
Definition ltc3208.c:183
int ltc3208_set_4_bit_dac(struct ltc3208_dev *device, enum reg_options reg_selected, uint8_t current_level_high, uint8_t current_level_low)
Sets the selected 4 bit LED register's current strength.
Definition ltc3208.c:214
int ltc3208_reg_write(struct ltc3208_dev *device, uint8_t reg_addr, uint8_t reg_data)
Writes to the selected register on the device.
Definition ltc3208.c:126
int ltc3208_remove(struct ltc3208_dev *device)
Deallocates the resources for the device structure.
Definition ltc3208.c:91
int ltc3208_set_cam_high(struct ltc3208_dev *device, bool is_cam_high_enable)
Selects which CAM register to use.
Definition ltc3208.c:395
int ltc3208_set_all_aux_led_dac(struct ltc3208_dev *device, enum dac_options aux_dac_1, enum dac_options aux_dac_2, enum dac_options aux_dac_3, enum dac_options aux_dac_4)
Sets the DAC settings for each AUX LED.
Definition ltc3208.c:251
int ltc3208_set_cpo_2x(struct ltc3208_dev *device, bool is_force_2x)
Sets the device's charge pump to output 2x of operating voltage.
Definition ltc3208.c:346
int ltc3208_set_1p5x(struct ltc3208_dev *device, bool is_force_1p5x)
Sets the device's charge pump to output 1.5x of operating voltage.
Definition ltc3208.c:362
int ltc3208_set_droupout_disable(struct ltc3208_dev *device, bool is_dropout_disable)
Enables RGB and AUX4 dropout signals.
Definition ltc3208.c:378
reg_options
Definition ltc3208.h:86
@ AUX_BLUE_REG
Definition ltc3208.h:88
@ CAM_REG
Definition ltc3208.h:91
@ GREEN_RED_REG
Definition ltc3208.h:87
@ SUB_REG
Definition ltc3208.h:90
@ MAIN_REG
Definition ltc3208.h:89
int ltc3208_init(struct ltc3208_dev **device, struct ltc3208_init_param init_param)
Initializes the LTC3208 device structure.
Definition ltc3208.c:55
dac_options
Definition ltc3208.h:79
@ SUB
Definition ltc3208.h:82
@ MAIN
Definition ltc3208.h:81
@ AUX
Definition ltc3208.h:80
@ CAM
Definition ltc3208.h:83
Header file of GPIO Interface.
Header file of I2C Interface.
Header file of utility functions.
Definition ad9361_util.h:63
Definition ltc3208.h:102
struct no_os_gpio_desc * gpio_enrgbs_desc
Definition ltc3208.h:105
enum dac_options aux_dac[4]
Definition ltc3208.h:103
struct no_os_i2c_desc * i2c_desc
Definition ltc3208.h:104
struct ltc3208_options_cfg options_cfg
Definition ltc3208.h:106
Definition ltc3208.h:109
struct no_os_i2c_init_param i2c_init_param
Definition ltc3208.h:110
struct no_os_gpio_init_param gpio_init_param
Definition ltc3208.h:111
Definition ltc3208.h:94
bool is_force_2x
Definition ltc3208.h:95
bool is_cam_high
Definition ltc3208.h:98
bool is_dropout_disable
Definition ltc3208.h:97
bool is_force_1p5x
Definition ltc3208.h:96
bool is_sub_enable
Definition ltc3208.h:99
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