no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
iio_trigger_example.c File Reference

Implementation of IIO trigger example for AD74413R project. More...

#include "common_data.h"
#include "iio_app.h"
#include "iio_ad74413r.h"
#include "no_os_util.h"
#include "parameters.h"
#include "iio_trigger.h"
Include dependency graph for iio_trigger_example.c:

Macros

#define DATA_BUFFER_SIZE   400
 
#define AD74413R_GPIO_TRIG_NAME   "ad74413r-dev0"
 

Functions

int example_main ()
 Basic example main execution.
 

Variables

uint8_t iio_data_buffer [DATA_BUFFER_SIZE *8 *sizeof(uint32_t)]
 
struct iio_trigger ad74413r_iio_trig_desc
 
struct iio_hw_trig_init_param ad74413r_gpio_trig_ip
 
struct no_os_irq_init_param ad74413r_gpio_irq_ip
 
const struct iio_hw_trig_cb_info gpio_cb_info
 

Detailed Description

Implementation of IIO trigger example for AD74413R project.

Author
Ciprian Regus (cipri.nosp@m.an.r.nosp@m.egus@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2022(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ AD74413R_GPIO_TRIG_NAME

#define AD74413R_GPIO_TRIG_NAME   "ad74413r-dev0"

◆ DATA_BUFFER_SIZE

#define DATA_BUFFER_SIZE   400

Function Documentation

◆ example_main()

int example_main ( void )

Basic example main execution.

Returns
ret - Result of the example execution. If working correctly, will execute continuously the while(1) loop and will not return.

Basic example main execution.

Returns
ret - Result of the example execution. If working correctly, will execute continuously the while(1) loop and will not return.

Basic example main execution.

Returns
ret - Result of the example execution. If working correctly, will execute continuously function iio_app_run and will not return.

Set the threshold voltage to 5V

The comparator output will be available on the GPO_A pin

Set the DAC output on channel C to 5V

Measure input current on channel D

Variable Documentation

◆ ad74413r_gpio_irq_ip

struct no_os_irq_init_param ad74413r_gpio_irq_ip
Initial value:
= {
.irq_ctrl_id = GPIO_IRQ_ID,
.platform_ops = GPIO_IRQ_OPS,
.extra = GPIO_IRQ_EXTRA,
}
#define GPIO_IRQ_EXTRA
Definition parameters.h:79
#define GPIO_IRQ_OPS
Definition parameters.h:77
#define GPIO_IRQ_ID
Definition parameters.h:42

◆ ad74413r_gpio_trig_ip

struct iio_hw_trig_init_param ad74413r_gpio_trig_ip
Initial value:
= {
.irq_trig_lvl = NO_OS_IRQ_EDGE_RISING,
.cb_info = gpio_cb_info,
}
#define AD74413R_GPIO_TRIG_NAME
Definition iio_trigger_example.c:54
const struct iio_hw_trig_cb_info gpio_cb_info
Definition iio_trigger_example.c:68
#define AD74413R_GPIO_TRIG_IRQ_ID
Definition parameters.h:72
@ NO_OS_IRQ_EDGE_RISING
Definition no_os_irq.h:73

◆ ad74413r_iio_trig_desc

struct iio_trigger ad74413r_iio_trig_desc
Initial value:
= {
.is_synchronous = true,
.enable = iio_trig_enable,
.disable = iio_trig_disable
}
int iio_trig_enable(void *trig)
Enable system interrupt which is linked to the given trigger.
Definition iio_trigger.c:104
int iio_trig_disable(void *trig)
Disable system interrupt which is linked to the given trigger.
Definition iio_trigger.c:121

◆ gpio_cb_info

const struct iio_hw_trig_cb_info gpio_cb_info
Initial value:
= {
.event = NO_OS_EVT_GPIO,
.peripheral = NO_OS_GPIO_IRQ,
}
#define AD74413R_GPIO_CB_HANDLE
Definition parameters.h:73
@ NO_OS_EVT_GPIO
Definition no_os_irq.h:54
@ NO_OS_GPIO_IRQ
Definition no_os_irq.h:78

◆ iio_data_buffer

uint8_t iio_data_buffer[DATA_BUFFER_SIZE *8 *sizeof(uint32_t)]