no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
iio_types.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef IIO_TYPES_H_
34#define IIO_TYPES_H_
35
36#include <stdbool.h>
37#include <stdint.h>
39
50
74
89
96 int16_t ch_num;
98 bool ch_out;
104 uint32_t address;
105};
106
107#define END_ATTRIBUTES_ARRAY {.name = NULL}
108
115
122 const char *name;
124 intptr_t priv;
131 int (*show)(void *device, char *buf, uint32_t len,
132 const struct iio_ch_info *channel, intptr_t priv);
134 int (*store)(void *device, char *buf, uint32_t len,
135 const struct iio_ch_info *channel, intptr_t priv);
136};
137
142struct scan_type {
144 char sign;
146 uint8_t realbits;
148 uint8_t storagebits;
150 uint8_t shift;
153};
154
161 const char *name;
171 unsigned long address;
179 bool ch_out;
186 /* Set if the channel is differential. */
188};
189
194
199
201 /* Mask with active channels */
202 uint32_t active_mask;
203 /* Size in bytes */
204 uint32_t size;
205 /* Number of bytes per sample * number of active channels */
207 /* Number of requested samples */
208 uint32_t samples;
209 /* Buffer direction */
211 /* Buffer where data is stored */
213 /* Stores cyclic buffer specific information */
215};
216
218 void *dev;
220};
221
229 int (*enable)(void *trig);
231 int (*disable)(void *trig);
232};
233
243 uint16_t num_ch;
252 /* Numbers of bytes will be:
253 * samples * (storage_size_of_first_active_ch / 8) * nb_active_channels
254 * DEPRECATED.
255 */
256 int32_t (*read_dev)(void *dev, void *buff, uint32_t nb_samples);
257 /* Numbers of bytes will be:
258 * samples * (storage_size_of_first_active_ch / 8) * nb_active_channels
259 * DEPRECATED.
260 */
261 int32_t (*write_dev)(void *dev, void *buff, uint32_t nb_samples);
262
263 /* Bufer callbacks */
265 int32_t (*pre_enable)(void *dev, uint32_t mask);
267 int32_t (*post_disable)(void *dev);
269 int32_t (*submit)(struct iio_device_data *dev);
271 int32_t (*trigger_handler)(struct iio_device_data *dev);
272
273 /* Read device register */
274 int32_t (*debug_reg_read)(void *dev, uint32_t reg, uint32_t *readval);
275 /* Write device register */
276 int32_t (*debug_reg_write)(void *dev, uint32_t reg, uint32_t writeval);
277
278};
279
280#endif /* IIO_TYPES_H_ */
iio_chan_type
Definition iio_types.h:55
@ IIO_ANGL_VEL
Definition iio_types.h:59
@ IIO_TEMP
Definition iio_types.h:60
@ IIO_CURRENT
Definition iio_types.h:57
@ IIO_WEIGHT
Definition iio_types.h:72
@ IIO_ACCEL
Definition iio_types.h:62
@ IIO_DELTA_VELOCITY
Definition iio_types.h:71
@ IIO_CAPACITANCE
Definition iio_types.h:61
@ IIO_RESISTANCE
Definition iio_types.h:63
@ IIO_VELOCITY
Definition iio_types.h:66
@ IIO_INCLI
Definition iio_types.h:65
@ IIO_ANGL
Definition iio_types.h:67
@ IIO_ROT
Definition iio_types.h:68
@ IIO_COUNT
Definition iio_types.h:69
@ IIO_VOLTAGE
Definition iio_types.h:56
@ IIO_MAGN
Definition iio_types.h:64
@ IIO_ALTVOLTAGE
Definition iio_types.h:58
@ IIO_DELTA_ANGL
Definition iio_types.h:70
iio_val
Definition iio_types.h:40
@ IIO_VAL_INT_MULTIPLE
Definition iio_types.h:45
@ IIO_VAL_CHAR
Definition iio_types.h:48
@ IIO_VAL_INT_PLUS_MICRO
Definition iio_types.h:42
@ IIO_VAL_FRACTIONAL_LOG2
Definition iio_types.h:47
@ IIO_VAL_INT
Definition iio_types.h:41
@ IIO_VAL_INT_PLUS_NANO
Definition iio_types.h:43
@ IIO_VAL_FRACTIONAL
Definition iio_types.h:46
@ IIO_VAL_INT_PLUS_MICRO_DB
Definition iio_types.h:44
@ IIO_MOD_YAW
Definition iio_types.h:86
@ IIO_MOD_ROLL
Definition iio_types.h:87
@ IIO_MOD_Z
Definition iio_types.h:83
@ IIO_MOD_X
Definition iio_types.h:81
@ IIO_NO_MOD
Definition iio_types.h:80
@ IIO_MOD_PITCH
Definition iio_types.h:85
@ IIO_MOD_Y
Definition iio_types.h:82
@ IIO_MOD_TEMP_AMBIENT
Definition iio_types.h:84
iio_buffer_direction
Definition iio_types.h:190
@ IIO_DIRECTION_INPUT
Definition iio_types.h:191
@ IIO_DIRECTION_OUTPUT
Definition iio_types.h:192
iio_attribute_shared
Definition iio_types.h:109
@ IIO_SHARED_BY_ALL
Definition iio_types.h:113
@ IIO_SHARED_BY_TYPE
Definition iio_types.h:111
@ IIO_SEPARATE
Definition iio_types.h:110
@ IIO_SHARED_BY_DIR
Definition iio_types.h:112
Circular buffer library header.
Definition ad9361_util.h:63
Structure holding pointers to show and store functions.
Definition iio_types.h:120
int(* store)(void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
Definition iio_types.h:134
const char * name
Definition iio_types.h:122
enum iio_attribute_shared shared
Definition iio_types.h:129
intptr_t priv
Definition iio_types.h:124
int(* show)(void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
Definition iio_types.h:131
Definition iio_types.h:200
struct no_os_circular_buffer * buf
Definition iio_types.h:212
uint32_t size
Definition iio_types.h:204
uint32_t active_mask
Definition iio_types.h:202
struct iio_cyclic_buffer_info cyclic_info
Definition iio_types.h:214
enum iio_buffer_direction dir
Definition iio_types.h:210
uint32_t bytes_per_scan
Definition iio_types.h:206
uint32_t samples
Definition iio_types.h:208
Structure holding channel attributess.
Definition iio_types.h:94
enum iio_chan_type type
Definition iio_types.h:100
int16_t ch_num
Definition iio_types.h:96
bool ch_out
Definition iio_types.h:98
bool differential
Definition iio_types.h:102
uint32_t address
Definition iio_types.h:104
IIO channel types.
Struct describing the scan type.
Definition iio_types.h:159
struct scan_type * scan_type
Definition iio_types.h:175
enum iio_chan_type ch_type
Definition iio_types.h:163
struct iio_attribute * attributes
Definition iio_types.h:177
unsigned long address
Definition iio_types.h:171
bool indexed
Definition iio_types.h:185
bool modified
Definition iio_types.h:182
bool diferential
Definition iio_types.h:187
bool ch_out
Definition iio_types.h:179
const char * name
Definition iio_types.h:161
int scan_index
Definition iio_types.h:173
int channel
Definition iio_types.h:165
int channel2
Definition iio_types.h:169
Definition iio_types.h:195
uint32_t buff_index
Definition iio_types.h:197
bool is_cyclic
Definition iio_types.h:196
Definition iio_types.h:217
struct iio_buffer * buffer
Definition iio_types.h:219
void * dev
Definition iio_types.h:218
Structure holding channels and attributes of a device.
Definition iio_types.h:238
int32_t(* pre_enable)(void *dev, uint32_t mask)
Definition iio_types.h:265
int32_t(* trigger_handler)(struct iio_device_data *dev)
Definition iio_types.h:271
int32_t(* debug_reg_read)(void *dev, uint32_t reg, uint32_t *readval)
Definition iio_types.h:274
struct iio_channel * channels
Definition iio_types.h:245
int32_t(* read_dev)(void *dev, void *buff, uint32_t nb_samples)
Definition iio_types.h:256
uint16_t num_ch
Definition iio_types.h:243
struct iio_attribute * buffer_attributes
Definition iio_types.h:251
int32_t(* post_disable)(void *dev)
Definition iio_types.h:267
int32_t(* submit)(struct iio_device_data *dev)
Definition iio_types.h:269
int32_t(* debug_reg_write)(void *dev, uint32_t reg, uint32_t writeval)
Definition iio_types.h:276
struct iio_attribute * attributes
Definition iio_types.h:247
int32_t(* write_dev)(void *dev, void *buff, uint32_t nb_samples)
Definition iio_types.h:261
struct iio_attribute * debug_attributes
Definition iio_types.h:249
struct no_os_irq_ctrl_desc * irq_desc
Definition iio_types.h:241
IIO channel modifier.
Definition iio_types.h:222
int(* enable)(void *trig)
Definition iio_types.h:229
int(* disable)(void *trig)
Definition iio_types.h:231
struct iio_attribute * attributes
Definition iio_types.h:227
bool is_synchronous
Definition iio_types.h:225
Circular buffer descriptor.
Definition no_os_circular_buffer.h:59
Definition no_os_irq.h:117
Definition iio_types.h:142
bool is_big_endian
Definition iio_types.h:152
uint8_t storagebits
Definition iio_types.h:148
char sign
Definition iio_types.h:144
uint8_t realbits
Definition iio_types.h:146
uint8_t shift
Definition iio_types.h:150