no-OS
iio_adpd188.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef IIO_ADPD188_H
41 #define IIO_ADPD188_H
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include "adpd188.h"
48 #include "iio.h"
49 
50 #define ADPD1080_CHANNEL_NO 8
51 #define ADPD1080_WORD_BIT_SIZE 16
52 #define ADPD1080_BITS_PER_SAMPLE 32
53 #define ADPD1080_WORDS_PER_SAMPLE \
54  (ADPD1080_BITS_PER_SAMPLE / ADPD1080_WORD_BIT_SIZE)
55 
58 };
59 
62  uint8_t ch_mask;
63 };
64 
65 extern struct iio_device iio_adpd188_device;
66 
69 int32_t adpd188_iio_remove(struct adpd188_iio_desc *dev);
70 
71 #endif /* IIO_ADPD188_H */
72 
adpd188_iio_remove
int32_t adpd188_iio_remove(struct adpd188_iio_desc *dev)
Free mmory allocated by adpd188_iio_init().
Definition: iio_adpd188.c:557
ADPD188_PD_LED_SELECT_SLOTB_PD_SEL_MASK
#define ADPD188_PD_LED_SELECT_SLOTB_PD_SEL_MASK
Definition: adpd188.h:230
adpd188_adc_fsample_set
int32_t adpd188_adc_fsample_set(struct adpd188_dev *dev, uint16_t freq_hz)
Set sample frequency of the ADC.
Definition: adpd188.c:631
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:121
adpd188_iio_desc::drv_dev
struct adpd188_dev * drv_dev
Definition: iio_adpd188.h:61
ADPD188_REG_NUM_AVG
#define ADPD188_REG_NUM_AVG
Definition: adpd188.h:72
iio_channel
Struct describing the scan type.
Definition: iio_types.h:173
scan_type::sign
char sign
Definition: iio_types.h:158
ADPD188_PD_LED_SELECT_SLOTA_LED_SEL_MASK
#define ADPD188_PD_LED_SELECT_SLOTA_LED_SEL_MASK
Definition: adpd188.h:233
adpd188_mode_set
int32_t adpd188_mode_set(struct adpd188_dev *dev, enum adpd188_mode new_mode)
Set the mode of operation of the ADPD188.
Definition: adpd188.c:267
ADPD188_NORMAL
@ ADPD188_NORMAL
Definition: adpd188.h:546
ADPD188_REG_SAMPLE_CLK
#define ADPD188_REG_SAMPLE_CLK
Definition: adpd188.h:105
ADPD188_REG_FIFO_ACCESS
#define ADPD188_REG_FIFO_ACCESS
Definition: adpd188.h:116
adpd188_iio_desc
Definition: iio_adpd188.h:60
ADPD1080_WORDS_PER_SAMPLE
#define ADPD1080_WORDS_PER_SAMPLE
Definition: iio_adpd188.h:53
iio_desc
Definition: iio.c:209
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:108
adpd188.h
ADPD188 driver header file.
ADPD188_32BIT_4CHAN
@ ADPD188_32BIT_4CHAN
Definition: adpd188.h:641
NO_OS_IS_ERR_VALUE
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:56
ADPD188_PROGRAM
@ ADPD188_PROGRAM
Definition: adpd188.h:544
device
Definition: ad9361_util.h:75
ADPD188_SAMPLE_CLK_CLK32K_EN_MASK
#define ADPD188_SAMPLE_CLK_CLK32K_EN_MASK
Definition: adpd188.h:411
adpd188_slot_config::slot_id
enum adpd188_slots slot_id
Definition: adpd188.h:650
iio_adpd188.h
Header of the ADPD188 IIO driver.
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:60
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
adpd188_adc_fsample_get
int32_t adpd188_adc_fsample_get(struct adpd188_dev *dev, uint16_t *freq_hz)
Get sample frequency of the ADC.
Definition: adpd188.c:649
iio_channel::channel
int channel
Definition: iio_types.h:179
ADPD188_REG_PD_LED_SELECT
#define ADPD188_REG_PD_LED_SELECT
Definition: adpd188.h:71
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
ADPD188_PD_LED_SELECT_SLOTA_LED_SEL_POS
#define ADPD188_PD_LED_SELECT_SLOTA_LED_SEL_POS
Definition: adpd188.h:237
iio_attribute::name
const char * name
Definition: iio_types.h:136
adpd188_iio_remove
int32_t adpd188_iio_remove(struct adpd188_iio_desc *dev)
Free mmory allocated by adpd188_iio_init().
Definition: iio_adpd188.c:557
adpd188_reg_write
int32_t adpd188_reg_write(struct adpd188_dev *dev, uint8_t reg_addr, uint16_t reg_val)
Write one 16 bit register of the ADPD188.
Definition: adpd188.c:211
ADPD188_PD_LED_SELECT_SLOTA_PD_SEL_POS
#define ADPD188_PD_LED_SELECT_SLOTA_PD_SEL_POS
Definition: adpd188.h:235
ADPD188_STANDBY
@ ADPD188_STANDBY
Definition: adpd188.h:542
adpd188_reg_read
int32_t adpd188_reg_read(struct adpd188_dev *dev, uint8_t reg_addr, uint16_t *reg_val)
Read one 16 bit register of the ADPD188.
Definition: adpd188.c:173
adpd188_slot_config
Slot configuration initialization structure.
Definition: adpd188.h:648
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:134
adpd188_iio_scan_type
struct scan_type adpd188_iio_scan_type
Definition: iio_adpd188.c:94
ADPD188_PD_LED_SELECT_SLOTB_LED_SEL_MASK
#define ADPD188_PD_LED_SELECT_SLOTB_LED_SEL_MASK
Definition: adpd188.h:232
ADPD188_SLOTB
@ ADPD188_SLOTB
Definition: adpd188.h:624
adpd188_remove
int32_t adpd188_remove(struct adpd188_dev *dev)
Free resources allocated by adpd188_init().
Definition: adpd188.c:141
adpd188_iio_init_param
Definition: iio_adpd188.h:56
iio_adpd188_device
struct iio_device iio_adpd188_device
Definition: iio_adpd188.c:570
adpd188_init_param
Driver initialization structure.
Definition: adpd188.h:678
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:191
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:257
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:75
adpd188_fifo_status_get
int32_t adpd188_fifo_status_get(struct adpd188_dev *dev, uint8_t *bytes_no)
Get the number of bytes currently present in FIFO.
Definition: adpd188.c:282
adpd188_slot_setup
int32_t adpd188_slot_setup(struct adpd188_dev *dev, struct adpd188_slot_config config)
Enable slot and setup its FIFO interaction.
Definition: adpd188.c:594
ADPD188_IIO_CHANN_DEF
#define ADPD188_IIO_CHANN_DEF(nm, ch1)
Definition: iio_adpd188.c:102
ADPD188_PD_LED_SELECT_SLOTB_PD_SEL_POS
#define ADPD188_PD_LED_SELECT_SLOTB_PD_SEL_POS
Definition: adpd188.h:234
adpd188_iio_init_param::drv_init_param
struct adpd188_init_param drv_init_param
Definition: iio_adpd188.h:57
NULL
#define NULL
Definition: wrapper.h:64
adpd188_iio_init
int32_t adpd188_iio_init(struct adpd188_iio_desc **device, struct adpd188_iio_init_param *init_param)
Initialize the IIO driver and allocate memory.
Definition: iio_adpd188.c:467
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:110
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:252
adpd188_iio_desc::ch_mask
uint8_t ch_mask
Definition: iio_adpd188.h:62
scan_type
Definition: iio_types.h:156
ADPD188_PD_LED_SELECT_SLOTB_LED_SEL_POS
#define ADPD188_PD_LED_SELECT_SLOTB_LED_SEL_POS
Definition: adpd188.h:236
adpd188_dev
Driver descriptor structure.
Definition: adpd188.h:661
ADPD1080_CHANNEL_NO
#define ADPD1080_CHANNEL_NO
Definition: iio_adpd188.h:50
ADPD188_SLOTA
@ ADPD188_SLOTA
Definition: adpd188.h:622
no_os_util.h
Header file of utility functions.
ADPD188_REG_SLOTA_CH1_OFFSET
#define ADPD188_REG_SLOTA_CH1_OFFSET
Definition: adpd188.h:75
adpd188_iio_init
int32_t adpd188_iio_init(struct adpd188_iio_desc **device, struct adpd188_iio_init_param *init_param)
Initialize the IIO driver and allocate memory.
Definition: iio_adpd188.c:467
ADPD188_PD_LED_SELECT_SLOTA_PD_SEL_MASK
#define ADPD188_PD_LED_SELECT_SLOTA_PD_SEL_MASK
Definition: adpd188.h:231
iio_adpd188_device
struct iio_device iio_adpd188_device
Definition: iio_adpd188.c:570
adpd188_init
int32_t adpd188_init(struct adpd188_dev **device, struct adpd188_init_param *init_param)
Initialize the ADPD188 driver.
Definition: adpd188.c:61