no-OS
iio_adf4368.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_ADF4368_H
34 #define IIO_ADF4368_H
35 
36 #include "iio.h"
37 
41 };
42 
45 };
46 
52 };
53 
65 };
66 
67 int adf4368_iio_init(struct adf4368_iio_dev **iio_dev,
69 
70 int adf4368_iio_remove(struct adf4368_iio_dev *desc);
71 
72 #endif /* IIO_ADF4368_H */
adf4368_iio_remove
int adf4368_iio_remove(struct adf4368_iio_dev *dev)
Free the resources allocated by adf4368_iio_init().
Definition: iio_adf4368.c:671
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
ADF4368_IIO_DEV_ATTR_SYNC_SETUP
@ ADF4368_IIO_DEV_ATTR_SYNC_SETUP
Definition: iio_adf4368.h:62
IIO_VAL_INT
@ IIO_VAL_INT
Definition: iio_types.h:50
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
adf4368_iio_dev_init_param::adf4368_dev_init
struct adf4368_init_param * adf4368_dev_init
Definition: iio_adf4368.h:44
adf4368_set_en_chan
int adf4368_set_en_chan(struct adf4368_dev *dev, uint8_t ch, bool en)
Set the output channel to enable or disable based on the passed parameter. If the parameter is differ...
Definition: adf4368.c:637
adf4368_set_sw_sync
int adf4368_set_sw_sync(struct adf4368_dev *dev, uint8_t sw_sync)
Set Software SYNC Request. Setting SW_SYNC resets the RF block. Clearing SW_SYNC makes ready for a ne...
Definition: adf4368.c:1214
IIO_SHARED_BY_TYPE
@ IIO_SHARED_BY_TYPE
Definition: iio_types.h:120
adf4368_iio_init
int adf4368_iio_init(struct adf4368_iio_dev **iio_dev, struct adf4368_iio_dev_init_param *init_param)
Initializes the ADF4368 IIO driver.
Definition: iio_adf4368.c:641
IIO_SEPARATE
@ IIO_SEPARATE
Definition: iio_types.h:119
adf4368_set_out_power
int adf4368_set_out_power(struct adf4368_dev *dev, uint8_t ch, int32_t pwr)
Set the output power register value of a channel and reset everything over to maximum supported value...
Definition: adf4368.c:580
adf4368_set_sync_setup
int adf4368_set_sync_setup(struct adf4368_dev *dev, bool en)
Set EZSYNC and Timed SYNC features' initial state. Waits for SW_SYNC toggle or SYNC pin.
Definition: adf4368.c:1118
adf4368_iio_dev
Definition: iio_adf4368.h:38
adf4368_get_cp_i
int adf4368_get_cp_i(struct adf4368_dev *dev, int32_t *reg_val)
Gets the charge pump value from the register. The value will be between 0 and 15 on 8 bits....
Definition: adf4368.c:880
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
IIO_VAL_INT_PLUS_MICRO
@ IIO_VAL_INT_PLUS_MICRO
Definition: iio_types.h:51
no_os_delay.h
Header file of Delay functions.
adf4368_get_rfout
int adf4368_get_rfout(struct adf4368_dev *dev, uint64_t *val)
Gets the user proposed output frequency.
Definition: adf4368.c:1017
ADF4368_IIO_DEV_ATTR_CP_AVAIL
@ ADF4368_IIO_DEV_ATTR_CP_AVAIL
Definition: iio_adf4368.h:57
IIO_ALTVOLTAGE
@ IIO_ALTVOLTAGE
Definition: iio_types.h:67
iio_channel::ch_type
enum iio_chan_type ch_type
Definition: iio_types.h:172
adf4368_dev::freq
uint64_t freq
Definition: adf4368.h:461
adf4368_spi_write
int adf4368_spi_write(struct adf4368_dev *dev, uint16_t reg_addr, uint8_t data)
Writes data to ADF4368 over SPI.
Definition: adf4368.c:152
adf4368_iio_dev::adf4368_dev
struct adf4368_dev * adf4368_dev
Definition: iio_adf4368.h:39
ADF4368_IIO_DEV_ATTR_DEF_REG
@ ADF4368_IIO_DEV_ATTR_DEF_REG
Definition: iio_adf4368.h:58
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
ADF4368_IIO_DEV_ATTR_SW_SYNC
@ ADF4368_IIO_DEV_ATTR_SW_SYNC
Definition: iio_adf4368.h:63
adf4368_get_sync_setup
int adf4368_get_sync_setup(struct adf4368_dev *dev, bool *en)
Gets the value of the SYNC features' powerdown bit.
Definition: adf4368.c:1188
ADF4368_IIO_CH_ATTR_OPWR
@ ADF4368_IIO_CH_ATTR_OPWR
Definition: iio_adf4368.h:50
adf4368_init
int adf4368_init(struct adf4368_dev **dev, struct adf4368_init_param *init_param)
Initializes the adf4368.
Definition: adf4368.c:1893
adf4368_set_temperature
int adf4368_set_temperature(struct adf4368_dev *dev, bool en)
Set Temperature Readback feature's initial state. This feature should be disabled after reading tempe...
Definition: adf4368.c:1254
adf4368_iio_dev_attr_id
adf4368_iio_dev_attr_id
Definition: iio_adf4368.h:54
ADF4368_IIO_DEV_ATTR_REF_DIV
@ ADF4368_IIO_DEV_ATTR_REF_DIV
Definition: iio_adf4368.h:59
IIO_SHARED_BY_ALL
@ IIO_SHARED_BY_ALL
Definition: iio_types.h:122
adf4368_dev
ADF4368 Device Descriptor.
Definition: adf4368.h:442
adf4368_iio_remove
int adf4368_iio_remove(struct adf4368_iio_dev *desc)
Free the resources allocated by adf4368_iio_init().
Definition: iio_adf4368.c:671
adf4368_dev::cp_i
uint8_t cp_i
Definition: adf4368.h:450
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
adf4368_remove
int adf4368_remove(struct adf4368_dev *dev)
Free resources allocated for ADF4368.
Definition: adf4368.c:1983
iio_attribute::name
const char * name
Definition: iio_types.h:131
adf4368_iio_dev_init_param
Definition: iio_adf4368.h:43
ADF4368_IIO_CH_ATTR_FREQ
@ ADF4368_IIO_CH_ATTR_FREQ
Definition: iio_adf4368.h:49
adf4368_get_en_ref_doubler
int adf4368_get_en_ref_doubler(struct adf4368_dev *dev, bool *en)
Gets the value the doubler if it is enabled or disable and stores it it the dev structure.
Definition: adf4368.c:751
adf4368_set_en_ref_doubler
int adf4368_set_en_ref_doubler(struct adf4368_dev *dev, bool en)
Set the reference doubler to enable or disable based on the passed parameter. If the parameter is dif...
Definition: adf4368.c:734
adf4368_set_cp_i
int adf4368_set_cp_i(struct adf4368_dev *dev, int32_t reg_val)
Set the charge pump value which will be written to the register. The value will be between 0 and 15 o...
Definition: adf4368.c:821
adf4368_spi_read
int adf4368_spi_read(struct adf4368_dev *dev, uint16_t reg_addr, uint8_t *data)
Reads data from ADF4368 over SPI.
Definition: adf4368.c:182
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
adf4368_set_rfout
int adf4368_set_rfout(struct adf4368_dev *dev, uint64_t val)
Set the desired output frequency and reset everything over to maximum supported value of 12....
Definition: adf4368.c:995
adf4368_get_temperature
int adf4368_get_temperature(struct adf4368_dev *dev, int32_t *temp)
Gets the value of the approximate die temperature.
Definition: adf4368.c:1293
iio_parse_value
int32_t iio_parse_value(char *buf, enum iio_val fmt, int32_t *val, int32_t *val2)
Definition: iio.c:630
adf4368_iio_init
int adf4368_iio_init(struct adf4368_iio_dev **iio_dev, struct adf4368_iio_dev_init_param *init_param)
Initializes the ADF4368 IIO driver.
Definition: iio_adf4368.c:641
adf4368_get_en_chan
int adf4368_get_en_chan(struct adf4368_dev *dev, uint8_t ch, bool *en)
Gets the value the output channel if it is enabled or disable.
Definition: adf4368.c:663
adf4368_get_bleed_word
int adf4368_get_bleed_word(struct adf4368_dev *dev, int32_t *word)
Gets the value of the bleed word.
Definition: adf4368.c:962
adf4368_set_ref_div
int adf4368_set_ref_div(struct adf4368_dev *dev, int32_t div)
Set the reference divider value and reset everything over to maximum supported value of 63 to the max...
Definition: adf4368.c:776
iio_format_value
int iio_format_value(char *buf, uint32_t len, enum iio_val fmt, int32_t size, int32_t *vals)
Definition: iio.c:686
adf4368_get_sw_sync
int adf4368_get_sw_sync(struct adf4368_dev *dev, uint8_t *sw_sync)
Gets the value of the SW_SYNC bit.
Definition: adf4368.c:1231
adf4368.h
Implementation of ADF4368 Driver.
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:186
adf4368_iio_ch_attr_id
adf4368_iio_ch_attr_id
Definition: iio_adf4368.h:47
adf4368_dev::phase_pol
bool phase_pol
Definition: adf4368.h:447
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
adf4368_set_bleed_word
int adf4368_set_bleed_word(struct adf4368_dev *dev, int32_t word)
Set the bleed word, which represents the value of the bleed current written to the register space.
Definition: adf4368.c:905
ADF4368_IIO_DEV_ATTR_TEMP
@ ADF4368_IIO_DEV_ATTR_TEMP
Definition: iio_adf4368.h:64
NULL
#define NULL
Definition: wrapper.h:64
adf4368_init_param
ADF4368 Initialization Parameters structure.
Definition: adf4368.h:425
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:105
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
ADF4368_IIO_CH_ATTR_PHASE
@ ADF4368_IIO_CH_ATTR_PHASE
Definition: iio_adf4368.h:51
ADF4368_IIO_DEV_ATTR_REF_FREQ
@ ADF4368_IIO_DEV_ATTR_REF_FREQ
Definition: iio_adf4368.h:61
adf4368_set_ref_clk
int adf4368_set_ref_clk(struct adf4368_dev *dev, uint64_t val)
Set the desired reference frequency and reset everything over to maximum supported value of 4GHz to t...
Definition: adf4368.c:694
ADF4368_IIO_DEV_ATTR_BLEED
@ ADF4368_IIO_DEV_ATTR_BLEED
Definition: iio_adf4368.h:55
true
@ true
Definition: ad5446.h:57
adf4368_get_default_regs
int adf4368_get_default_regs(struct adf4368_dev *dev, bool *check)
Reads and Checks the registers values equal to default values.
Definition: adf4368.c:1600
ADF4368_IIO_CH_ATTR_ENABLE
@ ADF4368_IIO_CH_ATTR_ENABLE
Definition: iio_adf4368.h:48
adf4368_set_phase
int adf4368_set_phase(struct adf4368_dev *dev, uint32_t phase_fs, bool phase_pol)
Set the phase adjustment in femto-seconds. Function choose the phase adjustment method according to I...
Definition: adf4368.c:1488
no_os_util.h
Header file of utility functions.
adf4368_get_phase
int adf4368_get_phase(struct adf4368_dev *dev, uint32_t *phase_fs, bool *phase_pol)
Get the phase adjustment in femto-seconds. Function choose the phase adjustment method according to I...
Definition: adf4368.c:1526
adf4368_iio_dev::iio_dev
struct iio_device * iio_dev
Definition: iio_adf4368.h:40
ADF4368_IIO_DEV_ATTR_REF_DB
@ ADF4368_IIO_DEV_ATTR_REF_DB
Definition: iio_adf4368.h:60
adf4368_get_out_power
int adf4368_get_out_power(struct adf4368_dev *dev, uint8_t ch, int32_t *pwr)
Gets the output power register value.
Definition: adf4368.c:607
adf4368_get_ref_clk
int adf4368_get_ref_clk(struct adf4368_dev *dev, uint64_t *val)
Gets the user proposed reference frequency.
Definition: adf4368.c:716
ADF4368_IIO_DEV_ATTR_CP
@ ADF4368_IIO_DEV_ATTR_CP
Definition: iio_adf4368.h:56
adf4368_set_default_regs
int adf4368_set_default_regs(struct adf4368_dev *dev, bool spi_4wire)
Applys a softreset, sets the SPI 4 wire mode and writes the default registers.
Definition: adf4368.c:1563
adf4368_get_ref_div
int adf4368_get_ref_div(struct adf4368_dev *dev, int32_t *div)
Gets the value the reference divider.
Definition: adf4368.c:795
iio_adf4368.h
Implementation of IIO ADF4368 Driver.