Go to the documentation of this file.
54 #define SNEG_VOLTAGE 2
55 #define SPOS_VOLTAGE 3
56 #define SZRO_VOLTAGE 4
59 #define SNEG_CURRENT 7
60 #define SPOS_CURRENT 8
61 #define SZRO_CURRENT 9
62 #define NOMINAL_VOLTAGE 10
63 #define VOLTAGE_SCALE 11
64 #define CURRENT_SCALE 12
65 #define I_CONSEL_ENABLE 13
66 #define DIP_THRESHOLD 14
67 #define DIP_HYSTERESIS 15
68 #define SWELL_THRESHOLD 16
69 #define SWELL_HYSTERESIS 17
70 #define INTERP_THRESHOLD 18
71 #define INTERP_HYSTERESIS 19
72 #define RVC_THRESHOLD 20
73 #define RVC_HYSTERESIS 21
74 #define MSV_CARRIER_FREQUENCY 22
75 #define MSV_RECORDING_LENGTH 23
76 #define MSV_THRESHOLD 24
77 #define SAMPLING_FREQUENCY 25
79 #define V_CONSEL_AVAILABLE 27
80 #define FLICKER_MODEL 28
81 #define FLICKER_MODEL_AVAILABLE 29
82 #define NOMINAL_FREQUENCY 30
83 #define NOMINAL_FREQUENCY_AVAILABLE 31
84 #define PROCESS_DATA 32
85 #define FW_VERSION_NR 33
90 #define CHAN_HARMONICS 2
91 #define CHAN_INTER_HARMONICS 3
96 #define CHAN_VOLTAGE_UNDER_DEV 8
97 #define CHAN_VOLTAGE_OVER_DEV 9
98 #define CHAN_VOLTAGE_PINST 10
99 #define CHAN_VOLTAGE_PST 11
100 #define CHAN_VOLTAGE_PLT 12
103 #define RESAMPLED_WAVEFORM_FULL_SCALE 18196
float msvCarrierFrequency
Definition: pqlib_example.h:114
float msvThreshold
Definition: pqlib_example.h:113
float dipThreshold
Definition: pqlib_example.h:105
int write_pqm_attr(void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t attr_id)
Write a pqm device attribute.
Definition: iio_pqm.c:213
#define ATTR_U2
Definition: iio_pqm.h:52
#define NOMINAL_FREQUENCY
Definition: iio_pqm.h:82
#define NOMINAL_FREQUENCY_AVAILABLE
Definition: iio_pqm.h:83
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
#define MSV_THRESHOLD
Definition: iio_pqm.h:76
#define SZRO_VOLTAGE
Definition: iio_pqm.h:56
#define PQM_DEVICE_ATTR_NUMBER
Definition: common_data.h:69
Struct describing the scan type.
Definition: iio_types.h:168
#define PQM_VOLTAGE_CHANNEL(_idx, _scan_idx, _name)
Definition: iio_pqm.c:44
char sign
Definition: iio_types.h:153
struct iio_attribute current_pqm_attributes[]
Definition: iio_pqm.c:649
volatile bool configChanged
Definition: iio_pqm.c:62
int read_pqm_attr(void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t attr_id)
Read a pqm device attribute.
Definition: iio_pqm.c:105
void * dev
Definition: iio_types.h:227
float pqm_global_attr[PQM_DEVICE_ATTR_NUMBER]
Definition: common_data.h:106
struct iio_device pqm_iio_descriptor
Definition: iio_pqm.c:904
#define CHAN_VOLTAGE_UNDER_DEV
Definition: iio_pqm.h:96
Structure holding channel attributess.
Definition: iio_types.h:103
#define CHAN_VOLTAGE_PINST
Definition: iio_pqm.h:98
#define RESAMPLED_WAVEFORM_FULL_SCALE
Definition: iio_pqm.h:103
float rvcHysteresis
Definition: pqlib_example.h:112
uint32_t bytes_per_scan
Definition: iio_types.h:215
#define PQM_CURRENT_CHANNEL(_idx, _scan_idx, _name)
Definition: iio_pqm.c:51
Definition: common_data.h:104
#define TOTAL_PQM_CHANNELS
Definition: common_data.h:66
int32_t read_samples(struct iio_device_data *dev_data)
function for reading samples from the device.
Definition: iio_pqm.c:529
Definition: ad9361_util.h:69
float intrpHysteresis
Definition: pqlib_example.h:110
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
struct no_os_circular_buffer * no_os_cb_desc
Definition: pqlib_example.h:154
#define CHAN_OFFSET
Definition: iio_pqm.h:93
int32_t pqm_trigger_handler(struct iio_device_data *dev_data)
Handles trigger: reads one data-set and writes it to the buffer.
Definition: iio_pqm.c:548
struct iio_attribute global_pqm_attributes[]
Definition: iio_pqm.c:695
#define FLICKER_MODEL
Definition: iio_pqm.h:80
#define CURRENT_SCALE
Definition: iio_pqm.h:64
#define VOLTAGE_CH_NUMBER
Definition: common_data.h:67
#define PQLIB_MAX_INTER_HARMONICS
Definition: pqlib_example.h:57
float swellThreshold
Definition: pqlib_example.h:107
uint32_t active_ch
Definition: common_data.h:108
float intrpThreshold
Definition: pqlib_example.h:109
uint32_t pqm_ch_attr[TOTAL_PQM_CHANNELS][MAX_CH_ATTRS]
Definition: common_data.h:107
#define SAMPLING_FREQUENCY
Definition: iio_pqm.h:77
float rvcThreshold
Definition: pqlib_example.h:111
int read_ch_attr(void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t attr_id)
Read a channel attribute.
Definition: iio_pqm.c:330
float currentScale
Definition: pqlib_example.h:117
uint32_t ext_buff_len
Definition: common_data.h:109
#define V_CONSEL_AVAILABLE
Definition: iio_pqm.h:79
const char * name
Definition: iio_types.h:131
struct scan_type pqm_scan_type
Definition: iio_pqm.c:889
uint32_t size
Definition: iio_types.h:213
#define CHAN_VOLTAGE_OVER_DEV
Definition: iio_pqm.h:97
#define MSV_CARRIER_FREQUENCY
Definition: iio_pqm.h:74
#define RVC_HYSTERESIS
Definition: iio_pqm.h:73
volatile bool configChanged
Definition: iio_pqm.c:62
#define CHAN_VOLTAGE_PST
Definition: iio_pqm.h:99
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
float convert_rms_type(ADI_AFE_RMS_TYPE mag, float scale)
Converts ADI_AFE_RMS_TYPE to voltage/current magnitude.
Definition: pqlib_convert.c:53
int16_t * ext_buff
Definition: common_data.h:110
#define FLICKER_MODEL_AVAILABLE
Definition: iio_pqm.h:81
#define ATTR_I0
Definition: iio_pqm.h:58
#define SZRO_CURRENT
Definition: iio_pqm.h:61
volatile bool processData
Definition: iio_pqm.c:63
struct no_os_circular_buffer * buf
Definition: iio_types.h:221
@ IIO_CURRENT
Definition: iio_types.h:66
float swellHysteresis
Definition: pqlib_example.h:108
@ IIO_VOLTAGE
Definition: iio_types.h:65
#define SWELL_THRESHOLD
Definition: iio_pqm.h:68
ADI_AFE_ANGLE_TYPE convert_angle_type(ADI_AFE_ANGLE_TYPE angleRaw)
Definition: pqlib_convert.c:45
#define SWELL_HYSTERESIS
Definition: iio_pqm.h:69
#define CHAN_SCALE
Definition: iio_pqm.h:92
#define FW_VERSION
Definition: common_data.h:58
struct iio_buffer * buffer
Definition: iio_types.h:228
#define I_CONSEL_ENABLE
Definition: iio_pqm.h:65
#define FW_VERSION_NR
Definition: iio_pqm.h:85
struct iio_attribute voltage_pqm_attributes[]
Definition: iio_pqm.c:578
PQLIB_EXAMPLE pqlibExample
Definition: pqlib_example.c:45
float convert_pct_type(ADI_PQLIB_PCT_TYPE val)
Converts ADI_PQLIB_PCT_TYPE to percentage.
Definition: pqlib_convert.c:63
struct iio_attribute * attributes
Definition: iio_types.h:186
float msvRecordingLength
Definition: pqlib_example.h:115
uint16_t num_ch
Definition: iio_types.h:252
#define RVC_THRESHOLD
Definition: iio_pqm.h:72
#define CHAN_THD
Definition: iio_pqm.h:94
int32_t update_pqm_channels(void *dev, uint32_t mask)
active pqm channels
Definition: basic_example.c:78
struct iio_device pqm_iio_descriptor
Definition: iio_pqm.c:904
enum iio_chan_type type
Definition: iio_types.h:109
#define SNEG_CURRENT
Definition: iio_pqm.h:59
#define NOMINAL_VOLTAGE
Definition: iio_pqm.h:62
#define NULL
Definition: wrapper.h:64
#define MSV_RECORDING_LENGTH
Definition: iio_pqm.h:75
#define SNEG_VOLTAGE
Definition: iio_pqm.h:54
float voltageScale
Definition: pqlib_example.h:116
int16_t ch_num
Definition: iio_types.h:105
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
int32_t close_pqm_channels(void *dev)
close all channels
Definition: basic_example.c:91
#define INTERP_THRESHOLD
Definition: iio_pqm.h:70
#define PQLIB_MAX_HARMONICS
Definition: pqlib_example.h:56
#define ATTR_I2
Definition: iio_pqm.h:57
#define V_CONSEL
Definition: iio_pqm.h:78
#define CHAN_ANGLE
Definition: iio_pqm.h:89
#define CHAN_HARMONICS
Definition: iio_pqm.h:90
#define CHAN_VOLTAGE_PLT
Definition: iio_pqm.h:100
Definition: iio_types.h:151
EXAMPLE_CONFIG exampleConfig
Definition: pqlib_example.h:150
#define CHAN_RAW
Definition: iio_pqm.h:95
#define DIP_HYSTERESIS
Definition: iio_pqm.h:67
float nominalVoltage
Definition: pqlib_example.h:118
#define CHAN_RMS
Definition: iio_pqm.h:88
Definition: iio_types.h:226
ADI_PQLIB_CYCLE_INPUT inputCycle
Definition: pqlib_example.h:147
ADI_PQLIB_OUTPUT * output
Definition: pqlib_example.h:151
#define MAX_CH_ATTRS
Definition: common_data.h:68
#define VOLTAGE_SCALE
Definition: iio_pqm.h:63
#define ATTR_U0
Definition: iio_pqm.h:53
#define INTERP_HYSTERESIS
Definition: iio_pqm.h:71
#define DIP_THRESHOLD
Definition: iio_pqm.h:66
#define SPOS_CURRENT
Definition: iio_pqm.h:60
#define PROCESS_DATA
Definition: iio_pqm.h:84
int iio_buffer_push_scan(struct iio_buffer *buffer, void *data)
Definition: iio.c:1434
volatile bool processData
Definition: iio_pqm.c:63
float dipHysteresis
Definition: pqlib_example.h:106
#define SPOS_VOLTAGE
Definition: iio_pqm.h:55
int32_t no_os_cb_read(struct no_os_circular_buffer *desc, void *data, uint32_t nb_elements)
#define CHAN_INTER_HARMONICS
Definition: iio_pqm.h:91