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

Implementation of LTC3208 Driver. More...

#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include "ltc3208.h"
#include "no_os_alloc.h"
#include "no_os_i2c.h"
#include "no_os_util.h"
#include "no_os_delay.h"
Include dependency graph for ltc3208.c:

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 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 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

Implementation 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

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 LED register's current strength.

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 LED register's current strength.

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 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.