no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
adp1055.c File Reference

Source file for the ADP1055 Driver. More...

#include "adp1055.h"
#include "no_os_error.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
Include dependency graph for adp1055.c:

Functions

int adp1055_send_command (struct adp1055_desc *desc, uint16_t command)
 Send command byte/word to ADP1055.
 
int adp1055_write (struct adp1055_desc *desc, uint16_t command, uint16_t data, uint8_t byte_num)
 
  • Write data to ADP1055

 
int adp1055_read (struct adp1055_desc *desc, uint16_t command, uint8_t *data, uint8_t byte_num)
 Read data from ADP1055.
 
int adp1055_init (struct adp1055_desc **desc, struct adp1055_init_param *init_param)
 Initialize the ADP1055 device.
 
int adp1055_remove (struct adp1055_desc *desc)
 Free the resources allocated by the adp1055_init()
 
int adp1055_read_status (struct adp1055_desc *desc, enum adp1055_status_type status, uint16_t *status_val)
 Send statuses.
 
int adp1055_read_value (struct adp1055_desc *desc, enum adp1055_value_type value, uint16_t *mant, uint8_t *exp)
 Read VIN/IIN/VOUT/TEMP2/TEMP3/DUTY_CYCLE_FREQ/POUT raw value from the ADP1055.
 
int adp1055_read_vsense (struct adp1055_desc *desc, uint16_t *vsense)
 Read Voltage Sense output raw value from the ADP1055.
 
int adp1055_vout_value (struct adp1055_desc *desc, uint16_t vout_command, uint16_t vout_max)
 Set VOUT_COMMAND and VOUT_MAX values.
 
int adp1055_vout_offset (struct adp1055_desc *desc, int16_t vout_offset)
 Set output voltage offset.
 
int adp1055_vout_tr (struct adp1055_desc *desc, uint8_t exp, uint16_t mant)
 Set ADP1055 VOUT transition rate.
 
int adp1055_vout_droop (struct adp1055_desc *desc, uint8_t exp, uint16_t mant)
 Set ADP1055 Vout Droop.
 
int adp1055_vout_scale_loop (struct adp1055_desc *desc, uint8_t exp, uint16_t mant)
 Set ADP1055 vout scale loop.
 
int adp1055_vout_scale (struct adp1055_desc *desc, uint8_t exp, uint16_t mant)
 Set ADP1055 VOUT_SCALE_MONITOR.
 
int adp1055_set_vin (struct adp1055_desc *desc, int16_t mant, int8_t exp, bool state_on)
 Set ADP1055 VIN on/off raw value for input voltage limiting.
 
int adp1055_iout_cal_gain (struct adp1055_desc *desc, int16_t mant, int8_t exp)
 Set ADP1055 IOUT calibration gain.
 
int adp1055_iout_cal_offset (struct adp1055_desc *desc, int16_t mant, int8_t exp)
 Set ADP1055 IOUT calibration offset.
 
int adp1055_normal_mode_df (struct adp1055_desc *desc, uint8_t zero, uint8_t pole, uint8_t lf, uint8_t hf)
 Set ADP1055 Normal Mode Digital Filter.
 
int adp1055_lightload_mode_df (struct adp1055_desc *desc, uint8_t zero, uint8_t pole, uint8_t lf, uint8_t hf)
 Set ADP1055 Light Load Mode Digital Filter.
 
int adp1055_singleshot_mode_df (struct adp1055_desc *desc, uint8_t zero, uint8_t pole, uint8_t lf, uint8_t hf)
 Set ADP1055 Single Shot Digital Filter.
 
int adp1055_pwm_config (struct adp1055_desc *desc, uint16_t pulse_width, uint16_t pulse_start, bool mod_en, bool mod_sign, enum adp1055_channel chan)
 PWM modulation configuration for the ADP1055.
 
int adp1055_set_pwm (struct adp1055_desc *desc, enum adp1055_channel chan, int8_t exp, uint16_t mant)
 Set PWM channel and frequency.
 
int adp1055_freq_sync (struct adp1055_desc *desc, bool pll, bool reso)
 Frequency synchronization of the PWM clock with an external clock Requires syni_desc to be initialized.
 

Detailed Description

Source file for the ADP1055 Driver.

Author
Ivangil Mercano (Ivang.nosp@m.il.m.nosp@m.ercan.nosp@m.o@an.nosp@m.alog..nosp@m.com)

Copyright 2025(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ adp1055_freq_sync()

int adp1055_freq_sync ( struct adp1055_desc * desc,
bool pll,
bool reso )

Frequency synchronization of the PWM clock with an external clock Requires syni_desc to be initialized.

Parameters
desc- ADP1055 device descriptor
pll- pll disable and enable
reso- 5ns resolution enable
Returns
0 in case of success, negative error otherwise

◆ adp1055_init()

int adp1055_init ( struct adp1055_desc ** desc,
struct adp1055_init_param * init_param )

Initialize the ADP1055 device.

Parameters
desc- ADP1055 device descriptor
init_param- Initialization parameter containing information about the ADP1055 device to be initialized.
Returns
0 in case of succes, negative error code otherwise
Here is the caller graph for this function:

◆ adp1055_iout_cal_gain()

int adp1055_iout_cal_gain ( struct adp1055_desc * desc,
int16_t mant,
int8_t exp )

Set ADP1055 IOUT calibration gain.

Parameters
desc- ADP1055 deveice descriptor
mant- Mantissa value to be transmitted, 11-bit twos compliment
exp- Exponent value to be transmitted, 5-bit twos compliment
Returns
0 in case of success, negative error otherwise

◆ adp1055_iout_cal_offset()

int adp1055_iout_cal_offset ( struct adp1055_desc * desc,
int16_t mant,
int8_t exp )

Set ADP1055 IOUT calibration offset.

Parameters
desc- ADP1055 deveice descriptor
mant- Mantissa value to be transmitted, 11-bit twos compliment
exp- Exponent value to be transmitted, 5-bit twos compliment
Returns
0 in case of success, negative error otherwise

◆ adp1055_lightload_mode_df()

int adp1055_lightload_mode_df ( struct adp1055_desc * desc,
uint8_t zero,
uint8_t pole,
uint8_t lf,
uint8_t hf )

Set ADP1055 Light Load Mode Digital Filter.

Parameters
desc- ADP1055 device descriptor
zero- light mode zero settings.
pole- light mode pole settings.
lf- light mode low filter gain settings.
hf- light mode high filter gain settings.
Returns
0 in case of success, negative error otherwise

◆ adp1055_normal_mode_df()

int adp1055_normal_mode_df ( struct adp1055_desc * desc,
uint8_t zero,
uint8_t pole,
uint8_t lf,
uint8_t hf )

Set ADP1055 Normal Mode Digital Filter.

Parameters
desc- ADP1055 device descriptor
zero- light mode zero settings.
pole- light mode pole settings.
lf- light mode low filter gain settings.
hf- light mode high filter gain settings.
Returns
0 in case of success, negative error otherwise

◆ adp1055_pwm_config()

int adp1055_pwm_config ( struct adp1055_desc * desc,
uint16_t pulse_width,
uint16_t pulse_start,
bool mod_en,
bool mod_sign,
enum adp1055_channel chan )

PWM modulation configuration for the ADP1055.

Parameters
desc- ADP1055 device descriptor
pulse_width- Width of the pulse wanted for the signal (used for calculation of the 12-bit rising and falling edge timings for the requested channels, it depends on each channel how the falling and rising edges are calculated using this value). Each LSB corresponds to a 5ns resolution.
pulse_start- Start of the pulse wanted for the signal (used for calculation of the 12-bit rising and falling edge timings for the requested channels, it depends on each channel how the falling and rising edges are calculated using this value). Each LSB corresponds to a 5ns resolution.
mod_en- boolian for modulation enable
mod_sign- bolian for modulation sign
chan- requested channel
Returns
0 in case of success, negative error otherwise
Here is the caller graph for this function:

◆ adp1055_read()

int adp1055_read ( struct adp1055_desc * desc,
uint16_t command,
uint8_t * data,
uint8_t byte_num )

Read data from ADP1055.

Parameters
desc- ADP1055 device descriptor
command- Command value
data- Buffer with received data
byte_num- Number of bytes of received data
Returns
0 if success, negative error otherwise
Here is the caller graph for this function:

◆ adp1055_read_status()

int adp1055_read_status ( struct adp1055_desc * desc,
enum adp1055_status_type status,
uint16_t * status_val )

Send statuses.

Parameters
desc- ADP1055 device descriptor
status- Status type
status_val- Status value to be returned
Returns
0 in case of success, negative error otherwise

◆ adp1055_read_value()

int adp1055_read_value ( struct adp1055_desc * desc,
enum adp1055_value_type value,
uint16_t * mant,
uint8_t * exp )

Read VIN/IIN/VOUT/TEMP2/TEMP3/DUTY_CYCLE_FREQ/POUT raw value from the ADP1055.

Parameters
desc- AP1055 device descriptor
value- value type
mant- Raw mantissa value to be received
exp- Raw exponent value to be received
Returns
0 in case of success, negative error otherwise
Here is the caller graph for this function:

◆ adp1055_read_vsense()

int adp1055_read_vsense ( struct adp1055_desc * desc,
uint16_t * vsense )

Read Voltage Sense output raw value from the ADP1055.

Parameters
desc- ADP1055 device descriptor
vsense- VS(VOUT) raw value to be received of the parallel circuit.
Returns
0 in case of succes, negative error code otherwise

◆ adp1055_remove()

int adp1055_remove ( struct adp1055_desc * desc)

Free the resources allocated by the adp1055_init()

Parameters
desc- ADP1055 device descriptor
Returns
0 in case of success, negative error otherwise
Here is the caller graph for this function:

◆ adp1055_send_command()

int adp1055_send_command ( struct adp1055_desc * desc,
uint16_t command )

Send command byte/word to ADP1055.

Parameters
desc- ADP1055 device descriptor
command- Value of the command
Returns
0 in case of sucess, negative error code otherwise
Here is the caller graph for this function:

◆ adp1055_set_pwm()

int adp1055_set_pwm ( struct adp1055_desc * desc,
enum adp1055_channel chan,
int8_t exp,
uint16_t mant )

Set PWM channel and frequency.

Parameters
desc- ADP1055 device descriptor
chan- Selected channel
exp- 5-bit twos compliment (-4 to 0)
mant- 11-bit twos compliment
Returns
0 in case of success, negative error otherwise
Here is the caller graph for this function:

◆ adp1055_set_vin()

int adp1055_set_vin ( struct adp1055_desc * desc,
int16_t mant,
int8_t exp,
bool state_on )

Set ADP1055 VIN on/off raw value for input voltage limiting.

Parameters
desc- ADP1055 device descriptor
mant- Mantissa value to be transmitted, 11 bit twos complement.
exp- Exponent value to be transmitted, 5 bit twos complement.
state_on- true - Set VIN_ON. false - Set VIN_OFF.
Returns
0 in case of succes, negative error code otherwise

◆ adp1055_singleshot_mode_df()

int adp1055_singleshot_mode_df ( struct adp1055_desc * desc,
uint8_t zero,
uint8_t pole,
uint8_t lf,
uint8_t hf )

Set ADP1055 Single Shot Digital Filter.

Parameters
desc- ADP1055 device descriptor
zero- light mode zero settings.
pole- light mode pole settings.
lf- light mode low filter gain settings.
hf- light mode high filter gain settings.
Returns
0 in case of success, negative error otherwise

◆ adp1055_vout_droop()

int adp1055_vout_droop ( struct adp1055_desc * desc,
uint8_t exp,
uint16_t mant )

Set ADP1055 Vout Droop.

Parameters
desc- ADP1055 device descriptor
exp- Exponent 5-bit two's compliment
mant- Mantissa 11-bit two's compliment
Returns
0 in case of success, negative error code otherwise

◆ adp1055_vout_offset()

int adp1055_vout_offset ( struct adp1055_desc * desc,
int16_t vout_offset )

Set output voltage offset.

Parameters
desc- ADP1055 device descriptor
vout_offset- VOUT offset value.
Returns
0 in case of succes, negative error code otherwise

◆ adp1055_vout_scale()

int adp1055_vout_scale ( struct adp1055_desc * desc,
uint8_t exp,
uint16_t mant )

Set ADP1055 VOUT_SCALE_MONITOR.

Parameters
desc- ADP1055 device descriptor
exp- Exponent - 5-bit twos complement
mant- Mantissa - 11-bit twos complement
Returns
0 in case of succes, negative error code otherwise
Here is the caller graph for this function:

◆ adp1055_vout_scale_loop()

int adp1055_vout_scale_loop ( struct adp1055_desc * desc,
uint8_t exp,
uint16_t mant )

Set ADP1055 vout scale loop.

Parameters
desc- ADP1055 device descriptor
exp- Exponent 5-bit two's compliment
mant- Mantissa 11-bit two's compliment
Returns
0 in case of success, negative error code otherwise

◆ adp1055_vout_tr()

int adp1055_vout_tr ( struct adp1055_desc * desc,
uint8_t exp,
uint16_t mant )

Set ADP1055 VOUT transition rate.

Parameters
desc- ADP1055 device descriptor
exp- Exponent - 5-bit twos complement
mant- Mantissa - 11-bit twos complement
Returns
0 in case of succes, negative error code otherwise

◆ adp1055_vout_value()

int adp1055_vout_value ( struct adp1055_desc * desc,
uint16_t vout_command,
uint16_t vout_max )

Set VOUT_COMMAND and VOUT_MAX values.

Parameters
desc- ADP1055 descriptor
vout_command- VOUT_COMMAND value
vout_max- VOUT_MAX value
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ adp1055_write()

int adp1055_write ( struct adp1055_desc * desc,
uint16_t command,
uint16_t data,
uint8_t byte_num )

  • Write data to ADP1055

Parameters
desc- ADP1055 device structure
command- Command value
data- Data value to write in ADP1055
byte_num- Number of bytes to write.
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function: