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

Source file for the LT7182S 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 "lt7182s.h"
#include "iio_lt7182s.h"
Include dependency graph for iio_lt7182s.c:

Macros

#define LT7182S_IIO_REG_CHAN(reg, chan)
 
#define LT7182S_IIO_REG(x)
 
#define LT7182S_IIO_CHAN(x)
 

Enumerations

enum  lt7182s_iio_enable_type {
  LT7182S_IIO_OUTPUT_ENABLE ,
  LT7182S_IIO_PULSE_ENABLE ,
  LT7182S_IIO_SYNC_ENABLE
}
 
enum  lt7182s_iio_pwm_params {
  LT7182S_IIO_PWM_FREQUENCY ,
  LT7182S_IIO_PWM_PHASE
}
 
enum  lt7182s_iio_chan_type {
  LT7182S_IIO_VOUT_0_CHAN ,
  LT7182S_IIO_VOUT_1_CHAN ,
  LT7182S_IIO_VIN_0_CHAN ,
  LT7182S_IIO_VIN_1_CHAN ,
  LT7182S_IIO_IIN_0_CHAN ,
  LT7182S_IIO_IIN_1_CHAN ,
  LT7182S_IIO_IOUT_0_CHAN ,
  LT7182S_IIO_IOUT_1_CHAN ,
  LT7182S_IIO_TEMP_CHAN ,
  LT7182S_IIO_VCC_CHAN
}
 

Functions

int lt7182s_iio_init (struct lt7182s_iio_desc **iio_desc, struct lt7182s_iio_desc_init_param *init_param)
 Initializes the LT7182S IIO descriptor.
 
int lt7182s_iio_remove (struct lt7182s_iio_desc *iio_desc)
 Free resources allocated by the init function.
 

Detailed Description

Source file for the LT7182S IIO Driver.

Author
Cedric Justine Encarnacion (cedri.nosp@m.cjus.nosp@m.tine..nosp@m.enca.nosp@m.rnaci.nosp@m.on@a.nosp@m.nalog.nosp@m..com)

Copyright 2024(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ LT7182S_IIO_CHAN

#define LT7182S_IIO_CHAN ( x)
Value:
((x >> 8) & 0xFF)

◆ LT7182S_IIO_REG

#define LT7182S_IIO_REG ( x)
Value:
(x & 0xFF)

◆ LT7182S_IIO_REG_CHAN

#define LT7182S_IIO_REG_CHAN ( reg,
chan )
Value:
(reg | (chan << 8))

Enumeration Type Documentation

◆ lt7182s_iio_chan_type

Enumerator
LT7182S_IIO_VOUT_0_CHAN 
LT7182S_IIO_VOUT_1_CHAN 
LT7182S_IIO_VIN_0_CHAN 
LT7182S_IIO_VIN_1_CHAN 
LT7182S_IIO_IIN_0_CHAN 
LT7182S_IIO_IIN_1_CHAN 
LT7182S_IIO_IOUT_0_CHAN 
LT7182S_IIO_IOUT_1_CHAN 
LT7182S_IIO_TEMP_CHAN 
LT7182S_IIO_VCC_CHAN 

◆ lt7182s_iio_enable_type

Enumerator
LT7182S_IIO_OUTPUT_ENABLE 
LT7182S_IIO_PULSE_ENABLE 
LT7182S_IIO_SYNC_ENABLE 

◆ lt7182s_iio_pwm_params

Enumerator
LT7182S_IIO_PWM_FREQUENCY 
LT7182S_IIO_PWM_PHASE 

Function Documentation

◆ lt7182s_iio_init()

int lt7182s_iio_init ( struct lt7182s_iio_desc ** iio_desc,
struct lt7182s_iio_desc_init_param * init_param )

Initializes the LT7182S 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.

◆ lt7182s_iio_remove()

int lt7182s_iio_remove ( struct lt7182s_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.