no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
iio_aducm3029.h
Go to the documentation of this file.
1/***************************************************************************/
33
34#ifdef IIO_SUPPORT
35
36#ifndef IIO_ADCUM3029
37#define IIO_ADCUM3029
38
39#include "iio_types.h"
40#include "aducm3029_adc.h"
41
42#define ADUCM3029_TIMERS_NUMS 3
43#define ADUCM3029_GPIOS_NUMS 44
44
45struct iio_aducm3029_desc {
46 struct adc_desc *adc;
47 struct no_os_timer_desc *timer[ADUCM3029_TIMERS_NUMS];
48 struct no_os_pwm_desc *pwm[ADUCM3029_TIMERS_NUMS];
49 struct no_os_gpio_desc *gpio[ADUCM3029_GPIOS_NUMS];
50 uint32_t current_gpio;
51};
52
53extern struct iio_aducm3029_desc g_aducm3029_desc;
54extern struct iio_device const iio_aducm3029_desc;
55
56int get_pwm_attr(void *device, char *buf, uint32_t len,
57 const struct iio_ch_info *channel, intptr_t priv);
58int set_pwm_attr(void *device, char *buf, uint32_t len,
59 const struct iio_ch_info *channel, intptr_t priv);
60
61int get_global_attr(void *device, char *buf, uint32_t len,
62 const struct iio_ch_info *channel, intptr_t priv);
63int set_global_attr(void *device, char *buf, uint32_t len,
64 const struct iio_ch_info *channel, intptr_t priv);
65
66int get_gpio_attr(void *device, char *buf, uint32_t len,
67 const struct iio_ch_info *channel, intptr_t priv);
68int set_gpio_attr(void *device, char *buf, uint32_t len,
69 const struct iio_ch_info *channel, intptr_t priv);
70
71int32_t iio_aducm3029_adc_set_mask(struct iio_aducm3029_desc *desc,
72 uint32_t mask);
73int32_t iio_aducm3029_adc_read(struct iio_aducm3029_desc *desc, uint16_t *buff,
74 uint32_t nb_samples);
75
76enum iio_pwm_attributes {
77 PWM_ENABLE,
79 PWM_DUTY_CYCLE,
80 PWM_POLARITY_IS_HIGH
81};
82
83enum iio_gpio_attributes {
84 GPIO_ENABLE,
85 GPIO_VALUE,
86 GPIO_DIRECTION_OUTPUT,
87 GPIO_NUMBER,
88};
89
90enum global_attributes {
91 PINMUX_PORT_0,
92 PINMUX_PORT_1,
93 PINMUX_PORT_2,
94 ADC_ENABLE
95};
96
97#endif
98
99#endif //IIO_SUPPORT
#define PWM_PERIOD
Definition parameters.h:70
Interface of aducm3029_adc.c.
Header file for iio_types.
Definition ad9361_util.h:63
Structure holding channel attributess.
Definition iio_types.h:94
Structure holding channels and attributes of a device.
Definition iio_types.h:238