no-OS
iio_adpd188.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef IIO_ADPD188_H
35 #define IIO_ADPD188_H
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 
41 #include "adpd188.h"
42 #include "iio.h"
43 
44 #define ADPD1080_CHANNEL_NO 8
45 #define ADPD1080_WORD_BIT_SIZE 16
46 #define ADPD1080_BITS_PER_SAMPLE 32
47 #define ADPD1080_WORDS_PER_SAMPLE \
48  (ADPD1080_BITS_PER_SAMPLE / ADPD1080_WORD_BIT_SIZE)
49 
52 };
53 
56  uint8_t ch_mask;
57 };
58 
59 extern struct iio_device iio_adpd188_device;
60 
63 int32_t adpd188_iio_remove(struct adpd188_iio_desc *dev);
64 
65 #endif /* IIO_ADPD188_H */
66 
adpd188_iio_remove
int32_t adpd188_iio_remove(struct adpd188_iio_desc *dev)
Free mmory allocated by adpd188_iio_init().
Definition: iio_adpd188.c:551
ADPD188_PD_LED_SELECT_SLOTB_PD_SEL_MASK
#define ADPD188_PD_LED_SELECT_SLOTB_PD_SEL_MASK
Definition: adpd188.h:224
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:625
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
adpd188_iio_desc::drv_dev
struct adpd188_dev * drv_dev
Definition: iio_adpd188.h:55
ADPD188_REG_NUM_AVG
#define ADPD188_REG_NUM_AVG
Definition: adpd188.h:66
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
scan_type::sign
char sign
Definition: iio_types.h:153
ADPD188_PD_LED_SELECT_SLOTA_LED_SEL_MASK
#define ADPD188_PD_LED_SELECT_SLOTA_LED_SEL_MASK
Definition: adpd188.h:227
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:261
ADPD188_NORMAL
@ ADPD188_NORMAL
Definition: adpd188.h:540
ADPD188_REG_SAMPLE_CLK
#define ADPD188_REG_SAMPLE_CLK
Definition: adpd188.h:99
ADPD188_REG_FIFO_ACCESS
#define ADPD188_REG_FIFO_ACCESS
Definition: adpd188.h:110
adpd188_iio_desc
Definition: iio_adpd188.h:54
ADPD1080_WORDS_PER_SAMPLE
#define ADPD1080_WORDS_PER_SAMPLE
Definition: iio_adpd188.h:47
iio_desc
Definition: iio.c:204
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
adpd188.h
ADPD188 driver header file.
ADPD188_32BIT_4CHAN
@ ADPD188_32BIT_4CHAN
Definition: adpd188.h:635
NO_OS_IS_ERR_VALUE
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:50
ADPD188_PROGRAM
@ ADPD188_PROGRAM
Definition: adpd188.h:538
device
Definition: ad9361_util.h:69
ADPD188_SAMPLE_CLK_CLK32K_EN_MASK
#define ADPD188_SAMPLE_CLK_CLK32K_EN_MASK
Definition: adpd188.h:405
adpd188_slot_config::slot_id
enum adpd188_slots slot_id
Definition: adpd188.h:644
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:54
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
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:643
iio_channel::channel
int channel
Definition: iio_types.h:174
ADPD188_REG_PD_LED_SELECT
#define ADPD188_REG_PD_LED_SELECT
Definition: adpd188.h:65
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:231
iio_attribute::name
const char * name
Definition: iio_types.h:131
adpd188_iio_remove
int32_t adpd188_iio_remove(struct adpd188_iio_desc *dev)
Free mmory allocated by adpd188_iio_init().
Definition: iio_adpd188.c:551
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:205
ADPD188_PD_LED_SELECT_SLOTA_PD_SEL_POS
#define ADPD188_PD_LED_SELECT_SLOTA_PD_SEL_POS
Definition: adpd188.h:229
ADPD188_STANDBY
@ ADPD188_STANDBY
Definition: adpd188.h:536
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:167
adpd188_slot_config
Slot configuration initialization structure.
Definition: adpd188.h:642
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
adpd188_iio_scan_type
struct scan_type adpd188_iio_scan_type
Definition: iio_adpd188.c:88
ADPD188_PD_LED_SELECT_SLOTB_LED_SEL_MASK
#define ADPD188_PD_LED_SELECT_SLOTB_LED_SEL_MASK
Definition: adpd188.h:226
ADPD188_SLOTB
@ ADPD188_SLOTB
Definition: adpd188.h:618
adpd188_remove
int32_t adpd188_remove(struct adpd188_dev *dev)
Free resources allocated by adpd188_init().
Definition: adpd188.c:135
adpd188_iio_init_param
Definition: iio_adpd188.h:50
iio_adpd188_device
struct iio_device iio_adpd188_device
Definition: iio_adpd188.c:564
adpd188_init_param
Driver initialization structure.
Definition: adpd188.h:672
iio_channel::attributes
struct iio_attribute * attributes
Definition: iio_types.h:186
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:252
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
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:276
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:588
ADPD188_IIO_CHANN_DEF
#define ADPD188_IIO_CHANN_DEF(nm, ch1)
Definition: iio_adpd188.c:96
ADPD188_PD_LED_SELECT_SLOTB_PD_SEL_POS
#define ADPD188_PD_LED_SELECT_SLOTB_PD_SEL_POS
Definition: adpd188.h:228
adpd188_iio_init_param::drv_init_param
struct adpd188_init_param drv_init_param
Definition: iio_adpd188.h:51
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:461
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
adpd188_iio_desc::ch_mask
uint8_t ch_mask
Definition: iio_adpd188.h:56
scan_type
Definition: iio_types.h:151
ADPD188_PD_LED_SELECT_SLOTB_LED_SEL_POS
#define ADPD188_PD_LED_SELECT_SLOTB_LED_SEL_POS
Definition: adpd188.h:230
adpd188_dev
Driver descriptor structure.
Definition: adpd188.h:655
ADPD1080_CHANNEL_NO
#define ADPD1080_CHANNEL_NO
Definition: iio_adpd188.h:44
ADPD188_SLOTA
@ ADPD188_SLOTA
Definition: adpd188.h:616
no_os_util.h
Header file of utility functions.
ADPD188_REG_SLOTA_CH1_OFFSET
#define ADPD188_REG_SLOTA_CH1_OFFSET
Definition: adpd188.h:69
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:461
ADPD188_PD_LED_SELECT_SLOTA_PD_SEL_MASK
#define ADPD188_PD_LED_SELECT_SLOTA_PD_SEL_MASK
Definition: adpd188.h:225
iio_adpd188_device
struct iio_device iio_adpd188_device
Definition: iio_adpd188.c:564
adpd188_init
int32_t adpd188_init(struct adpd188_dev **device, struct adpd188_init_param *init_param)
Initialize the ADPD188 driver.
Definition: adpd188.c:55