no-OS
Loading...
Searching...
No Matches
ltc3208.h File Reference

Header file of LTC3208 Driver. More...

#include "no_os_i2c.h"
#include "no_os_gpio.h"
#include "no_os_util.h"
Include dependency graph for ltc3208.h:

Classes

struct  ltc3208_options_cfg
 
struct  ltc3208_dev
 
struct  ltc3208_init_param
 

Macros

#define __LTC3208_H__
 
#define LTC3208_REG_RED_GREEN   0x01
 
#define LTC3208_REG_BLUE_AUX   0x02
 
#define LTC3208_REG_MAIN   0x03
 
#define LTC3208_REG_SUB   0X04
 
#define LTC3208_REG_AUX_DAC_SEL   0x05
 
#define LTC3208_REG_CAM_HIGH_LOW   0x06
 
#define LTC3208_REG_OPTIONS   0x07
 
#define LTC3208_8_BIT_MASK   NO_OS_GENMASK(7,0)
 
#define LTC3208_4_BIT_HIGH_MASK   NO_OS_GENMASK(7,4)
 
#define LTC3208_4_BIT_LOW_MASK   NO_OS_GENMASK(3,0)
 
#define LTC3208_AUX4_MASK   NO_OS_GENMASK(7,6)
 
#define LTC3208_AUX3_MASK   NO_OS_GENMASK(5,4)
 
#define LTC3208_AUX2_MASK   NO_OS_GENMASK(3,2)
 
#define LTC3208_AUX1_MASK   NO_OS_GENMASK(1,0)
 
#define LTC3208_CPO_2X_BIT   NO_OS_BIT(7)
 
#define LTC3208_CPO_1P5X_BIT   NO_OS_BIT(6)
 
#define LTC3208_TEST_HOOK_1_MASK   NO_OS_BIT(5)
 
#define LTC3208_TEST_HOOK_2_MASK   NO_OS_BIT(4)
 
#define LTC3208_DROPOUT_BIT   NO_OS_BIT(3)
 
#define LTC3208_CAM_BIT   NO_OS_BIT(2)
 
#define LTC3208_RGB_BIT   NO_OS_BIT(1)
 

Enumerations

enum  dac_options {
  AUX ,
  MAIN ,
  SUB ,
  CAM
}
 
enum  reg_options {
  GREEN_RED_REG ,
  AUX_BLUE_REG ,
  MAIN_REG ,
  SUB_REG ,
  CAM_REG
}
 

Functions

int ltc3208_init (struct ltc3208_dev **device, struct ltc3208_init_param init_param)
 Initializes the LTC3208 device structure.
 
int ltc3208_remove (struct ltc3208_dev *device)
 Deallocates the resources for the device structure.
 
int ltc3208_reg_write (struct ltc3208_dev *device, uint8_t reg_addr, uint8_t reg_data)
 Writes to the selected register on the device.
 
int ltc3208_reset (struct ltc3208_dev *device)
 Resets all register of the device.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
int ltc3208_set_droupout_disable (struct ltc3208_dev *device, bool is_dropout_disable)
 Enables RGB and AUX4 dropout signals.
 
int ltc3208_set_cam_high (struct ltc3208_dev *device, bool is_cam_high_enable)
 Selects which CAM register to use.
 
int ltc3208_set_sub_enable (struct ltc3208_dev *device, bool is_sub_enable)
 Selects if RGB or SUB is controled by ENRGBS pin.
 

Detailed Description

Header file of LTC3208 Driver.

Author
Edelweise Escala (edelw.nosp@m.eise.nosp@m..esca.nosp@m.la@a.nosp@m.nalog.nosp@m..com)

Copyright 2025(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ __LTC3208_H__

#define __LTC3208_H__

◆ LTC3208_4_BIT_HIGH_MASK

#define LTC3208_4_BIT_HIGH_MASK   NO_OS_GENMASK(7,4)

◆ LTC3208_4_BIT_LOW_MASK

#define LTC3208_4_BIT_LOW_MASK   NO_OS_GENMASK(3,0)

◆ LTC3208_8_BIT_MASK

#define LTC3208_8_BIT_MASK   NO_OS_GENMASK(7,0)

◆ LTC3208_AUX1_MASK

#define LTC3208_AUX1_MASK   NO_OS_GENMASK(1,0)

◆ LTC3208_AUX2_MASK

#define LTC3208_AUX2_MASK   NO_OS_GENMASK(3,2)

◆ LTC3208_AUX3_MASK

#define LTC3208_AUX3_MASK   NO_OS_GENMASK(5,4)

◆ LTC3208_AUX4_MASK

#define LTC3208_AUX4_MASK   NO_OS_GENMASK(7,6)

◆ LTC3208_CAM_BIT

#define LTC3208_CAM_BIT   NO_OS_BIT(2)

◆ LTC3208_CPO_1P5X_BIT

#define LTC3208_CPO_1P5X_BIT   NO_OS_BIT(6)

◆ LTC3208_CPO_2X_BIT

#define LTC3208_CPO_2X_BIT   NO_OS_BIT(7)

◆ LTC3208_DROPOUT_BIT

#define LTC3208_DROPOUT_BIT   NO_OS_BIT(3)

◆ LTC3208_REG_AUX_DAC_SEL

#define LTC3208_REG_AUX_DAC_SEL   0x05

◆ LTC3208_REG_BLUE_AUX

#define LTC3208_REG_BLUE_AUX   0x02

◆ LTC3208_REG_CAM_HIGH_LOW

#define LTC3208_REG_CAM_HIGH_LOW   0x06

◆ LTC3208_REG_MAIN

#define LTC3208_REG_MAIN   0x03

◆ LTC3208_REG_OPTIONS

#define LTC3208_REG_OPTIONS   0x07

◆ LTC3208_REG_RED_GREEN

#define LTC3208_REG_RED_GREEN   0x01

◆ LTC3208_REG_SUB

#define LTC3208_REG_SUB   0X04

◆ LTC3208_RGB_BIT

#define LTC3208_RGB_BIT   NO_OS_BIT(1)

◆ LTC3208_TEST_HOOK_1_MASK

#define LTC3208_TEST_HOOK_1_MASK   NO_OS_BIT(5)

◆ LTC3208_TEST_HOOK_2_MASK

#define LTC3208_TEST_HOOK_2_MASK   NO_OS_BIT(4)

Enumeration Type Documentation

◆ dac_options

Enumerator
AUX 
MAIN 
SUB 
CAM 

◆ reg_options

Enumerator
GREEN_RED_REG 
AUX_BLUE_REG 
MAIN_REG 
SUB_REG 
CAM_REG 

Function Documentation

◆ ltc3208_init()

int ltc3208_init ( struct ltc3208_dev ** device,
struct ltc3208_init_param init_param )

Initializes the LTC3208 device structure.

Parameters
device- The device structure to initialize.
init_param- The initialization parameters.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_reg_write()

int ltc3208_reg_write ( struct ltc3208_dev * device,
uint8_t reg_addr,
uint8_t reg_data )

Writes to the selected register on the device.

Parameters
device- The device structure.
reg_addr- The register sub-address.
reg_data- The data to write into the register (8-bits wide)
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_remove()

int ltc3208_remove ( struct ltc3208_dev * device)

Deallocates the resources for the device structure.

Parameters
device- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_reset()

int ltc3208_reset ( struct ltc3208_dev * device)

Resets all register of the device.

Parameters
device- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_1p5x()

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.

Parameters
device- The device structure.
is_force_1p5x- Sets the device to use 1.5x voltage.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_4_bit_dac()

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.

Parameters
device- The device structure.
reg_selected- The enumeration value of the selected register.
current_level_high- The current level for the high bits with 16 levels
current_level_low- The current level for the low bits with 16 levels
Returns
0 in case of success, negative error code otherwise.

Sets the selected 4 bit LED register's current strength.

Parameters
device- The device structure.
reg_selected- The enumeration value of the selected register.
current_level_high- The current level for the high bits with 16 levels
current_level_low- The current level for the low bits with 16 levels
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_8_bit_dac()

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.

Parameters
device- The device structure.
reg_selected- The enumeration value of the selected register.
current_level- The current level for the LED group with 256 levels
Returns
0 in case of success, negative error code otherwise.

Sets the selected 8 bit LED register's current strength.

Parameters
device- The device structure.
reg_selected- The enumeration value of the selected register.
current_level- The current level for the LED group with 256 levels
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_all_aux_led_dac()

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.

Parameters
device- The device structure.
aux_dac_1- The enumeration value of the selected DAC for AUX 1.
aux_dac_2- The enumeration value of the selected DAC for AUX 2.
aux_dac_3- The enumeration value of the selected DAC for AUX 3.
aux_dac_4- The enumeration value of the selected DAC for AUX 4.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_aux_led_dac()

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.

Parameters
device- The device structure.
aux_dac- The enumeration value of the selected DAC for AUX.
aux_index- The auxillary led index (0..3).
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_cam_high()

int ltc3208_set_cam_high ( struct ltc3208_dev * device,
bool is_cam_high_enable )

Selects which CAM register to use.

Parameters
device- The device structure.
is_cam_high_enable- Sets the device to enable camera high current.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_cpo_2x()

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.

Parameters
device- The device structure.
is_force_2x- Signals the device to use 2x voltage.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_droupout_disable()

int ltc3208_set_droupout_disable ( struct ltc3208_dev * device,
bool is_dropout_disable )

Enables RGB and AUX4 dropout signals.

Parameters
device- The device structure.
is_dropout_disable- Sets the device to disable RGB and AUX4 dropout signals.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_set_sub_enable()

int ltc3208_set_sub_enable ( struct ltc3208_dev * device,
bool is_sub_enable )

Selects if RGB or SUB is controled by ENRGBS pin.

Parameters
device- The device structure.
is_sub_enable- Sets the device to enable SUB displays.
Returns
0 in case of success, negative error code otherwise.

◆ ltc3208_update_options()

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.

Parameters
device- The device's structure.
is_force_2x- Signals the device to use 2x voltage.
is_force_1p5x- Sets the device to use 1.5x voltage.
is_dropout_disable- Sets the device to disable RGB and AUX4 dropout signals.
is_cam_high_enable- Sets the device to enable camera high current.
is_sub_enable- Sets the device to enable SUB displays.
Returns
0 in case of success, negative error code otherwise.
Parameters
device- The device's structure.
is_force_2x- Signals the device to use 2x voltage.
is_force_1p5x- Sets the device to use 1.5x voltage.
is_dropout_disable- Sets the device to use dropout.
is_cam_high_enable- Sets the device to enable camera high current.
is_sub_enable- Sets the device to enable rgb.
Returns
0 in case of success, negative error code otherwise.