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

Header file for admfm2000 Driver. More...

#include <stdint.h>
#include "no_os_gpio.h"
Include dependency graph for admfm2000.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  admfm2000_init_param
 
struct  admfm2000_dev
 

Macros

#define ADMFM2000_MIXER_MODE   0
 
#define ADMFM2000_DIRECT_IF_MODE   1
 
#define ADMFM2000_DSA_GPIOS   5
 
#define ADMFM2000_MODE_GPIOS   2
 
#define ADMFM2000_MAX_GAIN   0
 
#define ADMFM2000_MIN_GAIN   -31000
 
#define ADMFM2000_MAX_GAIN_RAW   31
 
#define ADMFM2000_MIN_GAIN_RAW   0
 
#define ADMFM2000_DEFAULT_GAIN   -0x20
 
#define ADMFM2000_NUM_CHANNELS   2
 

Functions

int admfm2000_init (struct admfm2000_dev **device, struct admfm2000_init_param *init_param)
 Initialize the admfm2000 device.
 
int admfm2000_remove (struct admfm2000_dev *dev)
 Free the resources allocated by admfm2000_init().
 
int admfm2000_set_dsa_raw (struct admfm2000_dev *dev, uint8_t chan, int32_t dsa_raw)
 Set the DSA GPIOs of the device.
 
int admfm2000_get_dsa_raw (struct admfm2000_dev *dev, uint8_t chan, int32_t *dsa_raw)
 Get the value of the dsa pins of the device.
 
int admfm2000_get_channel_mode (struct admfm2000_dev *dev, uint8_t mode)
 
int admfm2000_set_channel_config (struct admfm2000_dev *dev, uint8_t config)
 Set the channel configuration.
 

Detailed Description

Header file for admfm2000 Driver.

Author
Ramona Nechita (ramon.nosp@m.a.ne.nosp@m.chita.nosp@m.@ana.nosp@m.log.c.nosp@m.om)

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.

Macro Definition Documentation

◆ ADMFM2000_DEFAULT_GAIN

#define ADMFM2000_DEFAULT_GAIN   -0x20

◆ ADMFM2000_DIRECT_IF_MODE

#define ADMFM2000_DIRECT_IF_MODE   1

◆ ADMFM2000_DSA_GPIOS

#define ADMFM2000_DSA_GPIOS   5

◆ ADMFM2000_MAX_GAIN

#define ADMFM2000_MAX_GAIN   0

◆ ADMFM2000_MAX_GAIN_RAW

#define ADMFM2000_MAX_GAIN_RAW   31

◆ ADMFM2000_MIN_GAIN

#define ADMFM2000_MIN_GAIN   -31000

◆ ADMFM2000_MIN_GAIN_RAW

#define ADMFM2000_MIN_GAIN_RAW   0

◆ ADMFM2000_MIXER_MODE

#define ADMFM2000_MIXER_MODE   0

◆ ADMFM2000_MODE_GPIOS

#define ADMFM2000_MODE_GPIOS   2

◆ ADMFM2000_NUM_CHANNELS

#define ADMFM2000_NUM_CHANNELS   2

Function Documentation

◆ admfm2000_get_channel_mode()

int admfm2000_get_channel_mode ( struct admfm2000_dev * dev,
uint8_t mode )

◆ admfm2000_get_dsa_raw()

int admfm2000_get_dsa_raw ( struct admfm2000_dev * dev,
uint8_t chan,
int32_t * dsa_raw )

Get the value of the dsa pins of the device.

Parameters
dev- The device structure.
chan- The channel for which the value is read.
dsa_raw- The raw value from DSA gpios.
Returns
Returns 0 in case of success or negative error code otherwise.

◆ admfm2000_init()

int admfm2000_init ( struct admfm2000_dev ** device,
struct admfm2000_init_param * init_param )

Initialize the admfm2000 device.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ admfm2000_remove()

int admfm2000_remove ( struct admfm2000_dev * dev)

Free the resources allocated by admfm2000_init().

Parameters
dev- The device structure.
Returns
ret - Result of the remove procedure.
Here is the caller graph for this function:

◆ admfm2000_set_channel_config()

int admfm2000_set_channel_config ( struct admfm2000_dev * dev,
uint8_t config )

Set the channel configuration.

Parameters
dev- The device structure.
config- The config
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function:

◆ admfm2000_set_dsa_raw()

int admfm2000_set_dsa_raw ( struct admfm2000_dev * dev,
uint8_t chan,
int32_t dsa_raw )

Set the DSA GPIOs of the device.

Parameters
dev- The device structure.
chan- The channel for which the value is set.
dsa_raw- The raw value for GPIOs.
Returns
Returns 0 in case of success or negative error code otherwise.
Here is the caller graph for this function: