no-OS
Loading...
Searching...
No Matches
iio_timer_trigger_example.c File Reference

Implementation of IIO timer trigger example for eval-ad7091r8-sdz project. More...

#include "iio_ad7091r8.h"
#include "common_data.h"
#include "iio_app.h"
#include "no_os_util.h"
Include dependency graph for iio_timer_trigger_example.c:

Macros

#define ADC_CHANNELS   8
 
#define IIO_DATA_BUFFER_SIZE   (400 * ADC_CHANNELS * sizeof(int32_t))
 

Functions

int example_main ()
 IIO trigger example main execution.
 

Variables

uint8_t ad7091r8_data_buffer [IIO_DATA_BUFFER_SIZE]
 
struct no_os_timer_init_param ad7091r8_timer_ip
 
struct no_os_irq_init_param ad7091r8_timer_irq_ip
 
const struct iio_hw_trig_cb_info ad7091r8_timer_cb_info
 
struct iio_hw_trig_init_param ad7091r8_timer_trig_ip
 

Detailed Description

Implementation of IIO timer trigger example for eval-ad7091r8-sdz project.

Author
Marcelo Schmitt (marce.nosp@m.lo.s.nosp@m.chmit.nosp@m.t@an.nosp@m.alog..nosp@m.com)

Copyright 2024(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

◆ ADC_CHANNELS

#define ADC_CHANNELS   8

◆ IIO_DATA_BUFFER_SIZE

#define IIO_DATA_BUFFER_SIZE   (400 * ADC_CHANNELS * sizeof(int32_t))

Function Documentation

◆ example_main()

int example_main ( void )

IIO trigger example main execution.

Basic example main execution.

Basic example main executiont.

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

IIO descriptor and initialization parameter.

IIO app.

Declaring iio_devices structure

Initializing IIO app init param.

Initializing IIO app.

Running the IIO app (use iio_info or osc in terminal).

Variable Documentation

◆ ad7091r8_data_buffer

uint8_t ad7091r8_data_buffer[IIO_DATA_BUFFER_SIZE]

◆ ad7091r8_timer_cb_info

const struct iio_hw_trig_cb_info ad7091r8_timer_cb_info
Initial value:
= {
.peripheral = NO_OS_TIM_IRQ,
.handle = AD7091R8_TIMER_CB_HANDLE,
}
@ NO_OS_EVT_TIM_ELAPSED
Definition no_os_irq.h:60
@ NO_OS_TIM_IRQ
Definition no_os_irq.h:81

◆ ad7091r8_timer_ip

struct no_os_timer_init_param ad7091r8_timer_ip
Initial value:
= {
.id = AD7091R8_TIMER_DEVICE_ID,
.freq_hz = AD7091R8_TIMER_FREQ_HZ,
.ticks_count = AD7091R8_TIMER_TICKS_COUNT,
.platform_ops = TIMER_OPS,
.extra = AD7091R8_TIMER_EXTRA,
}
#define TIMER_OPS
Definition parameters.h:84

◆ ad7091r8_timer_irq_ip

struct no_os_irq_init_param ad7091r8_timer_irq_ip
Initial value:
= {
.irq_ctrl_id = 0,
.platform_ops = TIMER_IRQ_OPS,
.extra = AD7091R8_TIMER_IRQ_EXTRA,
}
#define TIMER_IRQ_OPS
Definition parameters.h:78

◆ ad7091r8_timer_trig_ip

struct iio_hw_trig_init_param ad7091r8_timer_trig_ip
Initial value:
= {
.irq_id = AD7091R8_TIMER_TRIG_IRQ_ID,
.name = AD7091R8_TIMER_TRIG_NAME,
}
const struct iio_hw_trig_cb_info ad7091r8_timer_cb_info
Definition iio_timer_trigger_example.c:70