no-OS
Loading...
Searching...
No Matches
adg1712.h File Reference

Header file of ADG1712/ADG2712 Driver. More...

#include <stdint.h>
#include <stdbool.h>
#include "no_os_gpio.h"
Include dependency graph for adg1712.h:

Classes

struct  adg1712_dev
 
struct  adg1712_init_param
 

Enumerations

enum  adg1712_chip_id {
  ID_ADG1712 ,
  ID_ADG2712
}
 
enum  adg1712_switch {
  ADG1712_SW1 ,
  ADG1712_SW2 ,
  ADG1712_SW3 ,
  ADG1712_SW4
}
 

Functions

int adg1712_set_switch_state (struct adg1712_dev *dev, enum adg1712_switch sw, bool enable)
 Set the state of a specific switch.
 
int adg1712_get_switch_state (struct adg1712_dev *dev, enum adg1712_switch sw, bool *enable)
 Get the current state of a specific switch.
 
int adg1712_init (struct adg1712_dev **device, struct adg1712_init_param *init_param)
 Initialize the ADG1712 device.
 
int adg1712_remove (struct adg1712_dev *dev)
 Free resources allocated by adg1712_init().
 

Detailed Description

Header file of ADG1712/ADG2712 Driver.

Author
Antoniu Miclaus (anton.nosp@m.iu.m.nosp@m.iclau.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2025(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Enumeration Type Documentation

◆ adg1712_chip_id

Enumerator
ID_ADG1712 
ID_ADG2712 

◆ adg1712_switch

Enumerator
ADG1712_SW1 
ADG1712_SW2 
ADG1712_SW3 
ADG1712_SW4 

Function Documentation

◆ adg1712_get_switch_state()

int adg1712_get_switch_state ( struct adg1712_dev * dev,
enum adg1712_switch sw,
bool * enable )

Get the current state of a specific switch.

Get the current state of a specific switch.

Parameters
dev- The device structure.
sw- The switch to read (ADG1712_SW1 to ADG1712_SW4).
enable- Pointer to store the current state (true if enabled).
Returns
0 in case of success, negative error code otherwise.

◆ adg1712_init()

int adg1712_init ( struct adg1712_dev ** device,
struct adg1712_init_param * init_param )

Initialize the ADG1712 device.

Initialize the ADG1712 device.

Parameters
device- Pointer to the device structure pointer.
init_param- Pointer to the initialization parameters.
Returns
0 in case of success, negative error code otherwise.

◆ adg1712_remove()

int adg1712_remove ( struct adg1712_dev * dev)

Free resources allocated by adg1712_init().

Free resources allocated by adg1712_init().

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adg1712_set_switch_state()

int adg1712_set_switch_state ( struct adg1712_dev * dev,
enum adg1712_switch sw,
bool enable )

Set the state of a specific switch.

Set the state of a specific switch.

Parameters
dev- The device structure.
sw- The switch to control (ADG1712_SW1 to ADG1712_SW4).
enable- true to enable the switch, false to disable.
Returns
0 in case of success, negative error code otherwise.