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

Source file for the ADP1055 IIO Driver. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "no_os_alloc.h"
#include "no_os_error.h"
#include "no_os_units.h"
#include "no_os_util.h"
#include "adp1055.h"
#include "iio_adp1055.h"
Include dependency graph for iio_adp1055.c:

Macros

#define ADP1055_IIO_OUTPUT_CHANNEL(x)
 
#define ADP1055_IIO_OUTPUT_OUTCHAN_MASK   NO_OS_GENMASK(3, 0)
 
#define ADP1055_IIO_OUTPUT_SRCHAN_MASK   NO_OS_GENMASK(5, 4)
 
#define ADP1055_IIO_OUT_MASK   NO_OS_GENMASK(5, 0)
 
#define ADP1055_IIO_ENABLE_MASK(x)
 
#define ADP1055_IIO_FREQ_MANT(x)
 

Enumerations

enum  adp1055_iio_enable_type {
  ADP1055_IIO_OUT_ENABLE ,
  ADP1055_IIO_FEEDFORWARD_ENABLE ,
  ADP1055_IIO_PULSE_ENABLE ,
  ADP1055_IIO_FREQ_SYNC_ENABLE
}
 
enum  ADP1055_iio_input_chan_type {
  ADP1055_IIO_VIN_CHAN ,
  ADP1055_IIO_IIN_CHAN ,
  ADP1055_IIO_VOUT_CHAN ,
  ADP1055_IIO_IOUT_CHAN ,
  ADP1055_IIO_TEMP2_CHAN ,
  ADP1055_IIO_TEMP3_CHAN
}
 
enum  ADP1055_iio_output_chan_type {
  ADP1055_IIO_OUTA_CHAN = 0x6 ,
  ADP1055_IIO_OUTB_CHAN = 0x7 ,
  ADP1055_IIO_OUTC_CHAN = 0x8 ,
  ADP1055_IIO_OUTD_CHAN = 0x9 ,
  ADP1055_IIO_SR1_CHAN = 0xA ,
  ADP1055_IIO_SR2_CHAN = 0xB
}
 
enum  ADP1055_iio_vout_value_type {
  ADP1055_IIO_VOUT_COMMAND_VALUE = ADP1055_VOUT_COMMAND ,
  ADP1055_IIO_VOUT_SCALE_MONITOR_VALUE = ADP1055_VOUT_SCALE_MONITOR ,
  ADP1055_IIO_VOUT_OFFSET_VALUE = ADP1055_VOUT_CAL_OFFSET
}
 

Functions

int adp1055_iio_init (struct adp1055_iio_desc **iio_desc, struct adp1055_iio_desc_init_param *init_param)
 Initializes the ADP1050 IIO descriptor.
 
int adp1055_iio_remove (struct adp1055_iio_desc *iio_desc)
 Free resources allocated by the init function.
 

Detailed Description

Source file for the ADP1055 IIO Driver.

Author
Ivan Gil 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.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ ADP1055_IIO_ENABLE_MASK

#define ADP1055_IIO_ENABLE_MASK ( x)
Value:
#define NO_OS_BIT(x)
Definition no_os_util.h:23

◆ ADP1055_IIO_FREQ_MANT

#define ADP1055_IIO_FREQ_MANT ( x)
Value:
((x) > 48 && (x) < 64 ? -4 : \
(x) > 64 && (x) < 128 ? -3 : \
(x) > 128 && (x) < 256 ? -2 : \
(x) > 256 && (x) < 510 ? -1 : 0)

◆ ADP1055_IIO_OUT_MASK

#define ADP1055_IIO_OUT_MASK   NO_OS_GENMASK(5, 0)

◆ ADP1055_IIO_OUTPUT_CHANNEL

#define ADP1055_IIO_OUTPUT_CHANNEL ( x)
Value:
((x) - 6)

◆ ADP1055_IIO_OUTPUT_OUTCHAN_MASK

#define ADP1055_IIO_OUTPUT_OUTCHAN_MASK   NO_OS_GENMASK(3, 0)

◆ ADP1055_IIO_OUTPUT_SRCHAN_MASK

#define ADP1055_IIO_OUTPUT_SRCHAN_MASK   NO_OS_GENMASK(5, 4)

Enumeration Type Documentation

◆ adp1055_iio_enable_type

Enumerator
ADP1055_IIO_OUT_ENABLE 
ADP1055_IIO_FEEDFORWARD_ENABLE 
ADP1055_IIO_PULSE_ENABLE 
ADP1055_IIO_FREQ_SYNC_ENABLE 

◆ ADP1055_iio_input_chan_type

Enumerator
ADP1055_IIO_VIN_CHAN 
ADP1055_IIO_IIN_CHAN 
ADP1055_IIO_VOUT_CHAN 
ADP1055_IIO_IOUT_CHAN 
ADP1055_IIO_TEMP2_CHAN 
ADP1055_IIO_TEMP3_CHAN 

◆ ADP1055_iio_output_chan_type

Enumerator
ADP1055_IIO_OUTA_CHAN 
ADP1055_IIO_OUTB_CHAN 
ADP1055_IIO_OUTC_CHAN 
ADP1055_IIO_OUTD_CHAN 
ADP1055_IIO_SR1_CHAN 
ADP1055_IIO_SR2_CHAN 

◆ ADP1055_iio_vout_value_type

Enumerator
ADP1055_IIO_VOUT_COMMAND_VALUE 
ADP1055_IIO_VOUT_SCALE_MONITOR_VALUE 
ADP1055_IIO_VOUT_OFFSET_VALUE 

Function Documentation

◆ adp1055_iio_init()

int adp1055_iio_init ( struct adp1055_iio_desc ** iio_desc,
struct adp1055_iio_desc_init_param * init_param )

Initializes the ADP1050 IIO descriptor.

Parameters
iio_desc- The iio device descriptor.
init_param- The structure that contains the device initial parameters.
Returns
0 in case of success, an error code otherwise.

◆ adp1055_iio_remove()

int adp1055_iio_remove ( struct adp1055_iio_desc * iio_desc)

Free resources allocated by the init function.

Parameters
iio_desc- The iio device descriptor.
Returns
0 in case of success, an error code otherwise.