no-OS
Loading...
Searching...
No Matches
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
75
90
97 int16_t ch_num;
99 bool ch_out;
105 uint32_t address;
106};
107
108#define END_ATTRIBUTES_ARRAY {.name = NULL}
109
116
123 const char *name;
125 intptr_t priv;
132 int (*show)(void *device, char *buf, uint32_t len,
133 const struct iio_ch_info *channel, intptr_t priv);
135 int (*store)(void *device, char *buf, uint32_t len,
136 const struct iio_ch_info *channel, intptr_t priv);
137};
138
143struct scan_type {
145 char sign;
147 uint8_t realbits;
149 uint8_t storagebits;
151 uint8_t shift;
154};
155
162 const char *name;
172 unsigned long address;
180 bool ch_out;
187 /* Set if the channel is differential. */
189};
190
195
200
202 /* Mask with active channels */
203 uint32_t active_mask;
204 /* Size in bytes */
205 uint32_t size;
206 /* Number of bytes per sample * number of active channels */
208 /* Number of requested samples */
209 uint32_t samples;
210 /* Buffer direction */
212 /* Buffer where data is stored */
214 /* Stores cyclic buffer specific information */
216};
217
219 void *dev;
221};
222
230 int (*enable)(void *trig);
232 int (*disable)(void *trig);
233};
234
244 uint16_t num_ch;
253 /* Numbers of bytes will be:
254 * samples * (storage_size_of_first_active_ch / 8) * nb_active_channels
255 * DEPRECATED.
256 */
257 int32_t (*read_dev)(void *dev, void *buff, uint32_t nb_samples);
258 /* Numbers of bytes will be:
259 * samples * (storage_size_of_first_active_ch / 8) * nb_active_channels
260 * DEPRECATED.
261 */
262 int32_t (*write_dev)(void *dev, void *buff, uint32_t nb_samples);
263
264 /* Bufer callbacks */
266 int32_t (*pre_enable)(void *dev, uint32_t mask);
268 int32_t (*post_disable)(void *dev);
270 int32_t (*submit)(struct iio_device_data *dev);
272 int32_t (*trigger_handler)(struct iio_device_data *dev);
273
274 /* Read device register */
275 int32_t (*debug_reg_read)(void *dev, uint32_t reg, uint32_t *readval);
276 /* Write device register */
277 int32_t (*debug_reg_write)(void *dev, uint32_t reg, uint32_t writeval);
278
279};
280
281#endif /* IIO_TYPES_H_ */
iio_chan_type
Definition iio_types.h:55
@ IIO_ANGL_VEL
Definition iio_types.h:59
@ IIO_POWER
Definition iio_types.h:73
@ 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:87
@ IIO_MOD_ROLL
Definition iio_types.h:88
@ IIO_MOD_Z
Definition iio_types.h:84
@ IIO_MOD_X
Definition iio_types.h:82
@ IIO_NO_MOD
Definition iio_types.h:81
@ IIO_MOD_PITCH
Definition iio_types.h:86
@ IIO_MOD_Y
Definition iio_types.h:83
@ IIO_MOD_TEMP_AMBIENT
Definition iio_types.h:85
iio_buffer_direction
Definition iio_types.h:191
@ IIO_DIRECTION_INPUT
Definition iio_types.h:192
@ IIO_DIRECTION_OUTPUT
Definition iio_types.h:193
iio_attribute_shared
Definition iio_types.h:110
@ IIO_SHARED_BY_ALL
Definition iio_types.h:114
@ IIO_SHARED_BY_TYPE
Definition iio_types.h:112
@ IIO_SEPARATE
Definition iio_types.h:111
@ IIO_SHARED_BY_DIR
Definition iio_types.h:113
Circular buffer library header.
Definition ad9361_util.h:63
Structure holding pointers to show and store functions.
Definition iio_types.h:121
int(* store)(void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
Definition iio_types.h:135
const char * name
Definition iio_types.h:123
enum iio_attribute_shared shared
Definition iio_types.h:130
intptr_t priv
Definition iio_types.h:125
int(* show)(void *device, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
Definition iio_types.h:132
Definition iio_types.h:201
struct no_os_circular_buffer * buf
Definition iio_types.h:213
uint32_t size
Definition iio_types.h:205
uint32_t active_mask
Definition iio_types.h:203
struct iio_cyclic_buffer_info cyclic_info
Definition iio_types.h:215
enum iio_buffer_direction dir
Definition iio_types.h:211
uint32_t bytes_per_scan
Definition iio_types.h:207
uint32_t samples
Definition iio_types.h:209
Structure holding channel attributess.
Definition iio_types.h:95
enum iio_chan_type type
Definition iio_types.h:101
int16_t ch_num
Definition iio_types.h:97
bool ch_out
Definition iio_types.h:99
bool differential
Definition iio_types.h:103
uint32_t address
Definition iio_types.h:105
IIO channel types.
Struct describing the scan type.
Definition iio_types.h:160
struct scan_type * scan_type
Definition iio_types.h:176
enum iio_chan_type ch_type
Definition iio_types.h:164
struct iio_attribute * attributes
Definition iio_types.h:178
unsigned long address
Definition iio_types.h:172
bool indexed
Definition iio_types.h:186
bool modified
Definition iio_types.h:183
bool diferential
Definition iio_types.h:188
bool ch_out
Definition iio_types.h:180
const char * name
Definition iio_types.h:162
int scan_index
Definition iio_types.h:174
int channel
Definition iio_types.h:166
int channel2
Definition iio_types.h:170
Definition iio_types.h:196
uint32_t buff_index
Definition iio_types.h:198
bool is_cyclic
Definition iio_types.h:197
Definition iio_types.h:218
struct iio_buffer * buffer
Definition iio_types.h:220
void * dev
Definition iio_types.h:219
Structure holding channels and attributes of a device.
Definition iio_types.h:239
int32_t(* pre_enable)(void *dev, uint32_t mask)
Definition iio_types.h:266
int32_t(* trigger_handler)(struct iio_device_data *dev)
Definition iio_types.h:272
int32_t(* debug_reg_read)(void *dev, uint32_t reg, uint32_t *readval)
Definition iio_types.h:275
struct iio_channel * channels
Definition iio_types.h:246
int32_t(* read_dev)(void *dev, void *buff, uint32_t nb_samples)
Definition iio_types.h:257
uint16_t num_ch
Definition iio_types.h:244
struct iio_attribute * buffer_attributes
Definition iio_types.h:252
int32_t(* post_disable)(void *dev)
Definition iio_types.h:268
int32_t(* submit)(struct iio_device_data *dev)
Definition iio_types.h:270
int32_t(* debug_reg_write)(void *dev, uint32_t reg, uint32_t writeval)
Definition iio_types.h:277
struct iio_attribute * attributes
Definition iio_types.h:248
int32_t(* write_dev)(void *dev, void *buff, uint32_t nb_samples)
Definition iio_types.h:262
struct iio_attribute * debug_attributes
Definition iio_types.h:250
struct no_os_irq_ctrl_desc * irq_desc
Definition iio_types.h:242
IIO channel modifier.
Definition iio_types.h:223
int(* enable)(void *trig)
Definition iio_types.h:230
int(* disable)(void *trig)
Definition iio_types.h:232
struct iio_attribute * attributes
Definition iio_types.h:228
bool is_synchronous
Definition iio_types.h:226
Circular buffer descriptor.
Definition no_os_circular_buffer.h:59
Definition no_os_irq.h:117
Definition iio_types.h:143
bool is_big_endian
Definition iio_types.h:153
uint8_t storagebits
Definition iio_types.h:149
char sign
Definition iio_types.h:145
uint8_t realbits
Definition iio_types.h:147
uint8_t shift
Definition iio_types.h:151