no-OS
Classes | Macros | Functions
hmc630x.c File Reference

hmc6300 and hmc6301 device driver implementation. More...

#include <errno.h>
#include <stdlib.h>
#include "hmc630x.h"
#include "no_os_delay.h"
#include "no_os_alloc.h"
Include dependency graph for hmc630x.c:

Classes

struct  hmc630x_vco
 
struct  hmc630x_dev
 

Macros

#define HMC630X_ARRAY_ADDRESS_MASK   NO_OS_GENMASK(13, 8)
 
#define HMC630X_RW_MASK   NO_OS_BIT(14)
 
#define HMC630X_ADDRESS_MASK   NO_OS_GENMASK(17, 15)
 
#define HMC6300_ADDRESS   0x6
 
#define HMC6301_ADDRESS   0x7
 
#define HMC630X_FRAME_SIZE   18
 
#define HMC6300_BITBANG_DELAY_US   1
 
#define HMC6300_SETTLING_DELAY_MS   1
 

Functions

int hmc630x_init (struct hmc630x_dev **dev, struct hmc630x_init_param *init)
 
int hmc630x_remove (struct hmc630x_dev *dev)
 
enum hmc630x_type hmc630x_type (struct hmc630x_dev *dev)
 
int hmc630x_write_row (struct hmc630x_dev *dev, uint8_t row, uint8_t val)
 
int hmc630x_read_row (struct hmc630x_dev *dev, uint8_t row, uint8_t *val)
 
int hmc630x_write_regmap (struct hmc630x_dev *dev, const uint8_t *regmap)
 
int hmc630x_write (struct hmc630x_dev *dev, uint16_t param, uint8_t value)
 
int hmc630x_read (struct hmc630x_dev *dev, uint16_t param, uint8_t *value)
 
int hmc630x_read_regmap (struct hmc630x_dev *dev, uint8_t *regmap)
 
int hmc630x_set_temp_en (struct hmc630x_dev *dev, bool enable)
 
int hmc630x_get_temp_en (struct hmc630x_dev *dev, bool *enable)
 
int hmc630x_get_temp (struct hmc630x_dev *dev, uint8_t *temp)
 
int hmc6300_set_fm_en (struct hmc630x_dev *dev, bool enable)
 
int hmc6300_get_fm_en (struct hmc630x_dev *dev, bool *enable)
 
int hmc630x_set_enable (struct hmc630x_dev *dev, bool enable)
 
int hmc630x_get_enable (struct hmc630x_dev *dev, bool *enable)
 
int hmc630x_set_if_attn (struct hmc630x_dev *dev, uint8_t attn)
 
int hmc630x_get_if_attn (struct hmc630x_dev *dev, uint8_t *attn)
 
int hmc6300_set_rf_attn (struct hmc630x_dev *dev, uint8_t attn)
 
int hmc6300_get_rf_attn (struct hmc630x_dev *dev, uint8_t *attn)
 
int hmc630x_set_vco (struct hmc630x_dev *dev, uint64_t frequency)
 
int hmc630x_get_vco (struct hmc630x_dev *dev, uint64_t *frequency)
 
int hmc630x_get_avail_vco (struct hmc630x_dev *dev, const uint64_t **avail, uint8_t *avail_num)
 
int hmc6301_set_lna_gain (struct hmc630x_dev *dev, enum hmc6301_lna_attn gain)
 
int hmc6301_get_lna_gain (struct hmc630x_dev *dev, enum hmc6301_lna_attn *gain)
 
int hmc6301_set_bb_attn (struct hmc630x_dev *dev, enum hmc6301_bb_attn attn1, enum hmc6301_bb_attn attn2)
 
int hmc6301_get_bb_attn (struct hmc630x_dev *dev, enum hmc6301_bb_attn *attn1, enum hmc6301_bb_attn *attn2)
 
int hmc6301_set_bb_attn_fine (struct hmc630x_dev *dev, enum hmc6301_bb_attn_fine attn_i, enum hmc6301_bb_attn_fine attn_q)
 
int hmc6301_get_bb_attn_fine (struct hmc630x_dev *dev, enum hmc6301_bb_attn_fine *attn_i, enum hmc6301_bb_attn_fine *attn_q)
 
int hmc6301_set_bb_lpc_hpc (struct hmc630x_dev *dev, enum hmc6301_bb_lpc lpc, enum hmc6301_bb_hpc hpc)
 
int hmc6301_get_bb_lpc_hpc (struct hmc630x_dev *dev, enum hmc6301_bb_lpc *lpc, enum hmc6301_bb_hpc *hpc)
 

Detailed Description

hmc6300 and hmc6301 device driver implementation.

Author
Darius Berghe (dariu.nosp@m.s.be.nosp@m.rghe@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2022(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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

◆ HMC6300_ADDRESS

#define HMC6300_ADDRESS   0x6

◆ HMC6300_BITBANG_DELAY_US

#define HMC6300_BITBANG_DELAY_US   1

◆ HMC6300_SETTLING_DELAY_MS

#define HMC6300_SETTLING_DELAY_MS   1

◆ HMC6301_ADDRESS

#define HMC6301_ADDRESS   0x7

◆ HMC630X_ADDRESS_MASK

#define HMC630X_ADDRESS_MASK   NO_OS_GENMASK(17, 15)

◆ HMC630X_ARRAY_ADDRESS_MASK

#define HMC630X_ARRAY_ADDRESS_MASK   NO_OS_GENMASK(13, 8)

◆ HMC630X_FRAME_SIZE

#define HMC630X_FRAME_SIZE   18

◆ HMC630X_RW_MASK

#define HMC630X_RW_MASK   NO_OS_BIT(14)

Function Documentation

◆ hmc6300_get_fm_en()

int hmc6300_get_fm_en ( struct hmc630x_dev dev,
bool enable 
)

◆ hmc6300_get_rf_attn()

int hmc6300_get_rf_attn ( struct hmc630x_dev dev,
uint8_t *  attn 
)
Here is the caller graph for this function:

◆ hmc6300_set_fm_en()

int hmc6300_set_fm_en ( struct hmc630x_dev dev,
bool  enable 
)

◆ hmc6300_set_rf_attn()

int hmc6300_set_rf_attn ( struct hmc630x_dev dev,
uint8_t  attn 
)
Here is the caller graph for this function:

◆ hmc6301_get_bb_attn()

int hmc6301_get_bb_attn ( struct hmc630x_dev dev,
enum hmc6301_bb_attn attn1,
enum hmc6301_bb_attn attn2 
)
Here is the caller graph for this function:

◆ hmc6301_get_bb_attn_fine()

int hmc6301_get_bb_attn_fine ( struct hmc630x_dev dev,
enum hmc6301_bb_attn_fine attn_i,
enum hmc6301_bb_attn_fine attn_q 
)
Here is the caller graph for this function:

◆ hmc6301_get_bb_lpc_hpc()

int hmc6301_get_bb_lpc_hpc ( struct hmc630x_dev dev,
enum hmc6301_bb_lpc lpc,
enum hmc6301_bb_hpc hpc 
)

◆ hmc6301_get_lna_gain()

int hmc6301_get_lna_gain ( struct hmc630x_dev dev,
enum hmc6301_lna_attn gain 
)
Here is the caller graph for this function:

◆ hmc6301_set_bb_attn()

int hmc6301_set_bb_attn ( struct hmc630x_dev dev,
enum hmc6301_bb_attn  attn1,
enum hmc6301_bb_attn  attn2 
)
Here is the caller graph for this function:

◆ hmc6301_set_bb_attn_fine()

int hmc6301_set_bb_attn_fine ( struct hmc630x_dev dev,
enum hmc6301_bb_attn_fine  attn_i,
enum hmc6301_bb_attn_fine  attn_q 
)
Here is the caller graph for this function:

◆ hmc6301_set_bb_lpc_hpc()

int hmc6301_set_bb_lpc_hpc ( struct hmc630x_dev dev,
enum hmc6301_bb_lpc  lpc,
enum hmc6301_bb_hpc  hpc 
)

◆ hmc6301_set_lna_gain()

int hmc6301_set_lna_gain ( struct hmc630x_dev dev,
enum hmc6301_lna_attn  gain 
)
Here is the caller graph for this function:

◆ hmc630x_get_avail_vco()

int hmc630x_get_avail_vco ( struct hmc630x_dev dev,
const uint64_t **  avail,
uint8_t *  avail_num 
)

◆ hmc630x_get_enable()

int hmc630x_get_enable ( struct hmc630x_dev dev,
bool enable 
)
Here is the caller graph for this function:

◆ hmc630x_get_if_attn()

int hmc630x_get_if_attn ( struct hmc630x_dev dev,
uint8_t *  attn 
)
Here is the caller graph for this function:

◆ hmc630x_get_temp()

int hmc630x_get_temp ( struct hmc630x_dev dev,
uint8_t *  temp 
)
Here is the caller graph for this function:

◆ hmc630x_get_temp_en()

int hmc630x_get_temp_en ( struct hmc630x_dev dev,
bool enable 
)

◆ hmc630x_get_vco()

int hmc630x_get_vco ( struct hmc630x_dev dev,
uint64_t *  frequency 
)
Here is the caller graph for this function:

◆ hmc630x_init()

int hmc630x_init ( struct hmc630x_dev **  dev,
struct hmc630x_init_param init 
)

◆ hmc630x_read()

int hmc630x_read ( struct hmc630x_dev dev,
uint16_t  param,
uint8_t *  value 
)
Here is the caller graph for this function:

◆ hmc630x_read_regmap()

int hmc630x_read_regmap ( struct hmc630x_dev dev,
uint8_t *  regmap 
)

◆ hmc630x_read_row()

int hmc630x_read_row ( struct hmc630x_dev dev,
uint8_t  row,
uint8_t *  val 
)
Here is the caller graph for this function:

◆ hmc630x_remove()

int hmc630x_remove ( struct hmc630x_dev dev)
Here is the caller graph for this function:

◆ hmc630x_set_enable()

int hmc630x_set_enable ( struct hmc630x_dev dev,
bool  enable 
)

◆ hmc630x_set_if_attn()

int hmc630x_set_if_attn ( struct hmc630x_dev dev,
uint8_t  attn 
)
Here is the caller graph for this function:

◆ hmc630x_set_temp_en()

int hmc630x_set_temp_en ( struct hmc630x_dev dev,
bool  enable 
)

◆ hmc630x_set_vco()

int hmc630x_set_vco ( struct hmc630x_dev dev,
uint64_t  frequency 
)

◆ hmc630x_type()

enum hmc630x_type hmc630x_type ( struct hmc630x_dev dev)

◆ hmc630x_write()

int hmc630x_write ( struct hmc630x_dev dev,
uint16_t  param,
uint8_t  value 
)
Here is the caller graph for this function:

◆ hmc630x_write_regmap()

int hmc630x_write_regmap ( struct hmc630x_dev dev,
const uint8_t *  regmap 
)

◆ hmc630x_write_row()

int hmc630x_write_row ( struct hmc630x_dev dev,
uint8_t  row,
uint8_t  val 
)
Here is the caller graph for this function: