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

Source file for the ADP5055 Driver. More...

#include <stdlib.h>
#include <string.h>
#include "adp5055.h"
#include "no_os_alloc.h"
#include "no_os_delay.h"
#include "no_os_error.h"
Include dependency graph for adp5055.c:

Functions

int adp5055_read (struct adp5055_desc *desc, uint8_t address, uint8_t *data)
 Read data from ADP5055.
 
int adp5055_write (struct adp5055_desc *desc, uint8_t address, uint8_t data)
 Write data to ADP5055.
 
int adp5055_read_status (struct adp5055_desc *desc, uint8_t *status_val)
 Read statuses.
 
int adp5055_set_enable_mode (struct adp5055_desc *desc, enum adp5055_en_mode mode)
 Configures enabling for all individual channels by hardware and/or software.
 
int adp5055_set_dvs_auto (struct adp5055_desc *desc, bool en)
 Enables or disables dynamic voltage scaling across all channels.
 
int adp5055_set_ocp_blanking (struct adp5055_desc *desc, bool en)
 Enables or disables overcurrent protection (OCP) blanking for all channels.
 
int adp5055_set_auto_pwm_psm (struct adp5055_desc *desc, enum adp5055_channel ch, bool en)
 Enables or disables automatic PWM/PSM per channel.
 
int adp5055_set_output_discharge (struct adp5055_desc *desc, enum adp5055_channel ch, bool en)
 Enables or disables output discharge per channel.
 
int adp5055_set_enable_disable_delay (struct adp5055_desc *desc, enum adp5055_channel ch, enum adp5055_en_dly en_dly, enum adp5055_dis_dly dis_dly)
 Sets both enable and disable delay per channel.
 
int adp5055_set_vid_code (struct adp5055_desc *desc, enum adp5055_channel ch, uint8_t val)
 Sets 8-bit code of output voltage reference of a channel.
 
int adp5055_start_vout (struct adp5055_desc *desc, enum adp5055_channel ch)
 Initiates output voltage transition on specified channel when dynamic voltage scaling is enabled.
 
int adp5055_enable_channel (struct adp5055_desc *desc, enum adp5055_channel ch, bool en)
 Enables output voltage channel in software.
 
int adp5055_set_dvs_interval (struct adp5055_desc *desc, enum adp5055_channel ch, enum adp5055_dvs_intval intval)
 Sets dynamic voltage scaling interval for each channel.
 
int adp5055_set_vidx_lim (struct adp5055_desc *desc, enum adp5055_channel ch, enum adp5055_vidx_limit lim_type, uint8_t lim_val)
 Sets high or low limit for output voltage reference.
 
int adp5055_set_fast_transient (struct adp5055_desc *desc, enum adp5055_channel ch, enum adp5055_ft_th ft)
 Configures fast transient sensitivity per channel.
 
int adp5055_set_pg_channel_output (struct adp5055_desc *desc, enum adp5055_channel ch, bool en)
 Enables power good signal to external PWRGD hardware pin.
 
int adp5055_set_pg_hw_delay (struct adp5055_desc *desc, bool en)
 Enables a delay in the PWRGD hardware pin.
 
int adp5055_read_pg (struct adp5055_desc *desc, enum adp5055_channel ch, uint8_t *pg_val)
 Reads real-time power good status of specified channel.
 
int adp5055_read_latched_status (struct adp5055_desc *desc, enum adp5055_channel ch, enum adp5055_latch_status lch_status_type, uint8_t *lch_status_val)
 Reads the latched status of a specified channel.
 
int adp5055_init (struct adp5055_desc **desc, struct adp5055_init_param *init_param)
 Initialize the ADP5055 device.
 
int adp5055_remove (struct adp5055_desc *desc)
 Free the resources allocated by the adp5055_init()
 

Detailed Description

Source file for the ADP5055 Driver.

Author
Angelo Catapang (angel.nosp@m.o.ca.nosp@m.tapan.nosp@m.g@an.nosp@m.alog..nosp@m.com)

Copyright 2025(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ adp5055_enable_channel()

int adp5055_enable_channel ( struct adp5055_desc * desc,
enum adp5055_channel ch,
bool en )

Enables output voltage channel in software.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
en- Channel enable or disable
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_init()

int adp5055_init ( struct adp5055_desc ** desc,
struct adp5055_init_param * init_param )

Initialize the ADP5055 device.

Parameters
desc- ADP5055 device descriptor
init_param- Initialization parameter containing information about the ADP5055 device to be initialized.
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_read()

int adp5055_read ( struct adp5055_desc * desc,
uint8_t address,
uint8_t * data )

Read data from ADP5055.

Parameters
desc- ADP5055 device descriptor
address- 8-bit ADP5055 register address
data- Buffer with received data
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_read_latched_status()

int adp5055_read_latched_status ( struct adp5055_desc * desc,
enum adp5055_channel ch,
enum adp5055_latch_status lch_status_type,
uint8_t * lch_status_val )

Reads the latched status of a specified channel.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
lch_status_type- Selects which latch status to read
lch_status_val- Stores the latch status value of the specified channel
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_read_pg()

int adp5055_read_pg ( struct adp5055_desc * desc,
enum adp5055_channel ch,
uint8_t * pg_val )

Reads real-time power good status of specified channel.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
pg_val- Stores the value of the real-time power good status
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_read_status()

int adp5055_read_status ( struct adp5055_desc * desc,
uint8_t * status_val )

Read statuses.

Parameters
desc- ADP5055 device descriptor
status_val- Status value to be returned.
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_remove()

int adp5055_remove ( struct adp5055_desc * desc)

Free the resources allocated by the adp5055_init()

Parameters
desc- ADP5055 device descriptor
Returns
- 0 in case of succes, negative error code otherwise

◆ adp5055_set_auto_pwm_psm()

int adp5055_set_auto_pwm_psm ( struct adp5055_desc * desc,
enum adp5055_channel ch,
bool en )

Enables or disables automatic PWM/PSM per channel.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
en- If true, enables automatic PWM/PSM on specified channel
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_dvs_auto()

int adp5055_set_dvs_auto ( struct adp5055_desc * desc,
bool en )

Enables or disables dynamic voltage scaling across all channels.

Parameters
desc- ADP5055 device descriptor
en- If true, output voltage transitions only with a write to the VIDx_GO
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_dvs_interval()

int adp5055_set_dvs_interval ( struct adp5055_desc * desc,
enum adp5055_channel ch,
enum adp5055_dvs_intval intval )

Sets dynamic voltage scaling interval for each channel.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
intval- Dynamic voltage scaling interval setting
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_enable_disable_delay()

int adp5055_set_enable_disable_delay ( struct adp5055_desc * desc,
enum adp5055_channel ch,
enum adp5055_en_dly en_dly,
enum adp5055_dis_dly dis_dly )

Sets both enable and disable delay per channel.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
en_dly- Enable delay on the specified channel
dis_dly- Disable delay on the specified channel
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_enable_mode()

int adp5055_set_enable_mode ( struct adp5055_desc * desc,
enum adp5055_en_mode mode )

Configures enabling for all individual channels by hardware and/or software.

Parameters
desc- ADP5055 device descriptor
mode- Enable mode
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_fast_transient()

int adp5055_set_fast_transient ( struct adp5055_desc * desc,
enum adp5055_channel ch,
enum adp5055_ft_th ft )

Configures fast transient sensitivity per channel.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
ft- Fast transient setting
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_ocp_blanking()

int adp5055_set_ocp_blanking ( struct adp5055_desc * desc,
bool en )

Enables or disables overcurrent protection (OCP) blanking for all channels.

Parameters
desc- ADP5055 device descriptor
en- If true, enables OCP blanking
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_output_discharge()

int adp5055_set_output_discharge ( struct adp5055_desc * desc,
enum adp5055_channel ch,
bool en )

Enables or disables output discharge per channel.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
en- If true, enables output discharge on the specified channel
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_pg_channel_output()

int adp5055_set_pg_channel_output ( struct adp5055_desc * desc,
enum adp5055_channel ch,
bool en )

Enables power good signal to external PWRGD hardware pin.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
en- If true, power good signal of specified channel is outputted at external PWRGD hardware pin
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_pg_hw_delay()

int adp5055_set_pg_hw_delay ( struct adp5055_desc * desc,
bool en )

Enables a delay in the PWRGD hardware pin.

Parameters
desc- ADP5055 device descriptor
en- If false, PWRGD pin responds immediately
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_vid_code()

int adp5055_set_vid_code ( struct adp5055_desc * desc,
enum adp5055_channel ch,
uint8_t val )

Sets 8-bit code of output voltage reference of a channel.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
val- 8-bit code of output voltage reference (Vref = 408mV + (1.5mV * val))
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_set_vidx_lim()

int adp5055_set_vidx_lim ( struct adp5055_desc * desc,
enum adp5055_channel ch,
enum adp5055_vidx_limit lim_type,
uint8_t lim_val )

Sets high or low limit for output voltage reference.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
lim_type- Selects whether high or low limit is set
lim_val- 4-bit code of high / low output voltage reference limit
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_start_vout()

int adp5055_start_vout ( struct adp5055_desc * desc,
enum adp5055_channel ch )

Initiates output voltage transition on specified channel when dynamic voltage scaling is enabled.

Parameters
desc- ADP5055 device descriptor
ch- ADP5055 output channel
Returns
0 in case of succes, negative error code otherwise

◆ adp5055_write()

int adp5055_write ( struct adp5055_desc * desc,
uint8_t address,
uint8_t data )

Write data to ADP5055.

Parameters
desc- ADP5055 device descriptor
address- 8-bit ADP5055 register address
data- Data byte value to write to the ADP5055
Returns
0 in case of succes, negative error code otherwise