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

Implementation of ad4692 Driver. More...

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

Functions

int ad4692_send_command (struct ad4692_desc *desc, uint32_t command, uint32_t *val)
 
int ad4692_reg_read (struct ad4692_desc *desc, uint32_t reg, uint32_t *val)
 
int ad4692_reg_write (struct ad4692_desc *desc, uint32_t reg, uint32_t val)
 
int ad4692_reg_update (struct ad4692_desc *desc, uint32_t reg, uint32_t mask, uint32_t val)
 
int ad4692_std_seq_ch (struct ad4692_desc *desc, uint16_t ch_mask, bool std, uint8_t len)
 
int ad4692_sampling_enable (struct ad4692_desc *desc, bool enable)
 
int ad4692_get_ch (struct ad4692_desc *desc, uint8_t ch, uint32_t *val)
 
int ad4692_get_temp (struct ad4692_desc *desc, uint32_t *val)
 
int ad4692_set_osc (struct ad4692_desc *desc, enum ad4692_int_osc_sel osc)
 
int ad4692_get_osc (struct ad4692_desc *desc, enum ad4692_int_osc_sel *osc)
 
int ad4692_set_ref (struct ad4692_desc *desc, enum ad4692_ref_ctrl_sel ref)
 
int ad4692_get_ref (struct ad4692_desc *desc, enum ad4692_ref_ctrl_sel *ref)
 
int ad4692_gpio_set (struct ad4692_desc *desc, enum ad4692_gpio_num index, enum ad4692_gpio_sel mode)
 
int ad4692_gpio_get_value (struct ad4692_desc *desc, enum ad4692_gpio_num index, enum no_os_gpio_values *value)
 
int ad4692_hardware_reset (struct ad4692_desc *desc)
 
int ad4692_software_reset (struct ad4692_desc *desc)
 
int ad4692_cnv_burst_period_ns (struct ad4692_desc *desc, int n_active, uint32_t *period_ns)
 
int ad4692_init (struct ad4692_desc **desc, struct ad4692_init_param *init_param)
 
int ad4692_remove (struct ad4692_desc *desc)
 

Variables

const int ad4692_int_osc_val [16]
 

Detailed Description

Implementation of ad4692 Driver.

Author
Radu Sabau (radu..nosp@m.saba.nosp@m.u@ana.nosp@m.log..nosp@m.com)

Copyright 2026(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

◆ ad4692_cnv_burst_period_ns()

int ad4692_cnv_burst_period_ns ( struct ad4692_desc * desc,
int n_active,
uint32_t * period_ns )

◆ ad4692_get_ch()

int ad4692_get_ch ( struct ad4692_desc * desc,
uint8_t ch,
uint32_t * val )
Here is the caller graph for this function:

◆ ad4692_get_osc()

int ad4692_get_osc ( struct ad4692_desc * desc,
enum ad4692_int_osc_sel * osc )

◆ ad4692_get_ref()

int ad4692_get_ref ( struct ad4692_desc * desc,
enum ad4692_ref_ctrl_sel * ref )

◆ ad4692_get_temp()

int ad4692_get_temp ( struct ad4692_desc * desc,
uint32_t * val )

◆ ad4692_gpio_get_value()

int ad4692_gpio_get_value ( struct ad4692_desc * desc,
enum ad4692_gpio_num index,
enum no_os_gpio_values * value )

◆ ad4692_gpio_set()

int ad4692_gpio_set ( struct ad4692_desc * desc,
enum ad4692_gpio_num index,
enum ad4692_gpio_sel mode )

◆ ad4692_hardware_reset()

int ad4692_hardware_reset ( struct ad4692_desc * desc)
Here is the caller graph for this function:

◆ ad4692_init()

int ad4692_init ( struct ad4692_desc ** desc,
struct ad4692_init_param * init_param )
Here is the caller graph for this function:

◆ ad4692_reg_read()

int ad4692_reg_read ( struct ad4692_desc * desc,
uint32_t reg,
uint32_t * val )
Here is the caller graph for this function:

◆ ad4692_reg_update()

int ad4692_reg_update ( struct ad4692_desc * desc,
uint32_t reg,
uint32_t mask,
uint32_t val )
Here is the caller graph for this function:

◆ ad4692_reg_write()

int ad4692_reg_write ( struct ad4692_desc * desc,
uint32_t reg,
uint32_t val )
Here is the caller graph for this function:

◆ ad4692_remove()

int ad4692_remove ( struct ad4692_desc * desc)
Here is the caller graph for this function:

◆ ad4692_sampling_enable()

int ad4692_sampling_enable ( struct ad4692_desc * desc,
bool enable )
Here is the caller graph for this function:

◆ ad4692_send_command()

int ad4692_send_command ( struct ad4692_desc * desc,
uint32_t command,
uint32_t * val )
Here is the caller graph for this function:

◆ ad4692_set_osc()

int ad4692_set_osc ( struct ad4692_desc * desc,
enum ad4692_int_osc_sel osc )
Here is the caller graph for this function:

◆ ad4692_set_ref()

int ad4692_set_ref ( struct ad4692_desc * desc,
enum ad4692_ref_ctrl_sel ref )

◆ ad4692_software_reset()

int ad4692_software_reset ( struct ad4692_desc * desc)

◆ ad4692_std_seq_ch()

int ad4692_std_seq_ch ( struct ad4692_desc * desc,
uint16_t ch_mask,
bool std,
uint8_t len )
Here is the caller graph for this function:

Variable Documentation

◆ ad4692_int_osc_val

const int ad4692_int_osc_val[16]
Initial value:
= {
[AD4692_OSC_1MHZ] = 1000000,
[AD4692_OSC_500KHZ] = 500000,
[AD4692_OSC_400KHZ] = 400000,
[AD4692_OSC_250KHZ] = 250000,
[AD4692_OSC_200KHZ] = 200000,
[AD4692_OSC_167KHZ] = 167000,
[AD4692_OSC_133KHZ] = 133000,
[AD4692_OSC_125KHZ] = 125000,
[AD4692_OSC_100KHZ] = 100000,
[AD4692_OSC_50KHZ] = 50000,
[AD4692_OSC_25KHZ] = 25000,
[AD4692_OSC_12P5KHZ] = 12500,
[AD4692_OSC_10KHZ] = 10000,
[AD4692_OSC_5KHZ] = 5000,
}
@ AD4692_OSC_500KHZ
Definition ad4692.h:153
@ AD4692_OSC_167KHZ
Definition ad4692.h:157
@ AD4692_OSC_25KHZ
Definition ad4692.h:162
@ AD4692_OSC_10KHZ
Definition ad4692.h:164
@ AD4692_OSC_2P5KHZ
Definition ad4692.h:166
@ AD4692_OSC_250KHZ
Definition ad4692.h:155
@ AD4692_OSC_125KHZ
Definition ad4692.h:159
@ AD4692_OSC_200KHZ
Definition ad4692.h:156
@ AD4692_OSC_400KHZ
Definition ad4692.h:154
@ AD4692_OSC_12P5KHZ
Definition ad4692.h:163
@ AD4692_OSC_1P25KHZ
Definition ad4692.h:167
@ AD4692_OSC_50KHZ
Definition ad4692.h:161
@ AD4692_OSC_133KHZ
Definition ad4692.h:158
@ AD4692_OSC_5KHZ
Definition ad4692.h:165
@ AD4692_OSC_1MHZ
Definition ad4692.h:152
@ AD4692_OSC_100KHZ
Definition ad4692.h:160