no-OS
Classes | Macros | Functions
iio_trigger.h File Reference

Header file for iio_trigger. More...

#include "iio.h"
#include "iio_types.h"
#include "no_os_irq.h"
Include dependency graph for iio_trigger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  iio_hw_trig
 IIO hardware trigger structure. More...
 
struct  iio_hw_trig_cb_info
 Hardware trigger callback extra information structure. More...
 
struct  iio_hw_trig_init_param
 IIO hardware trigger initialization structure. More...
 
struct  iio_sw_trig
 IIO software trigger structure. More...
 
struct  iio_sw_trig_init_param
 IIO software trigger initialization structure. More...
 

Macros

#define TRIG_MAX_NAME_SIZE   20
 

Functions

int iio_hw_trig_init (struct iio_hw_trig **iio_trig, struct iio_hw_trig_init_param *init_param)
 Initialize hardware trigger. More...
 
int iio_trig_enable (void *trig)
 Enable system interrupt which is linked to the given trigger. More...
 
int iio_trig_disable (void *trig)
 Disable system interrupt which is linked to the given trigger. More...
 
void iio_hw_trig_handler (void *trig)
 Trigger interrupt handler. This function will be called when a system interrupt is asserted for the configured trigger. More...
 
int iio_hw_trig_remove (struct iio_hw_trig *trig)
 Free the resources allocated by iio_hw_trig_init(). More...
 
int iio_sw_trig_init (struct iio_sw_trig **iio_trig, struct iio_sw_trig_init_param *init_param)
 Initialize software trigger. More...
 
int iio_sw_trig_handler (void *trig, char *buf, uint32_t len, const struct iio_ch_info *channel, intptr_t priv)
 Handles the write request for trigger_now attribute. More...
 
int iio_trig_remove (struct iio_sw_trig *trig)
 

Detailed Description

Header file for iio_trigger.

Author
RBolboac(ramon.nosp@m.a.bo.nosp@m.lboac.nosp@m.a@an.nosp@m.alog..nosp@m.com)

Copyright 2022(c) Analog Devices, Inc.

All rights reserved.

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

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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

◆ TRIG_MAX_NAME_SIZE

#define TRIG_MAX_NAME_SIZE   20

Function Documentation

◆ iio_hw_trig_handler()

void iio_hw_trig_handler ( void *  trig)

Trigger interrupt handler. This function will be called when a system interrupt is asserted for the configured trigger.

API for hardware trigger handler

Parameters
trig- Trigger structure which is linked to this handler.
Here is the caller graph for this function:

◆ iio_hw_trig_init()

int iio_hw_trig_init ( struct iio_hw_trig **  iio_trig,
struct iio_hw_trig_init_param init_param 
)

Initialize hardware trigger.

API to initialize a hardware trigger

Parameters
iio_trig- The iio trigger structure.
init_param- The structure that contains the trigger initial params.
Returns
ret - Result of the initialization procedure.
Here is the caller graph for this function:

◆ iio_hw_trig_remove()

int iio_hw_trig_remove ( struct iio_hw_trig trig)

Free the resources allocated by iio_hw_trig_init().

API to remove a hardware trigger

Parameters
trig- The trigger structure.
Returns
ret - Result of the remove procedure.

◆ iio_sw_trig_handler()

int iio_sw_trig_handler ( void *  trig,
char *  buf,
uint32_t  len,
const struct iio_ch_info channel,
intptr_t  priv 
)

Handles the write request for trigger_now attribute.

API for software trigger handler

Parameters
trig- The iio trigger structure.
buf- Command buffer to be filled with the data to be written.
len- Length of the received command buffer in bytes.
channel- Command channel info (is NULL).
priv- Command attribute id.
Returns
ret - Result of the sw trigger handler procedure.

◆ iio_sw_trig_init()

int iio_sw_trig_init ( struct iio_sw_trig **  iio_trig,
struct iio_sw_trig_init_param init_param 
)

Initialize software trigger.

API to initialize a software trigger

Parameters
iio_trig- The iio trigger structure.
init_param- The structure that contains the sw trigger initial params.
Returns
ret - Result of the initialization procedure.

◆ iio_trig_disable()

int iio_trig_disable ( void *  trig)

Disable system interrupt which is linked to the given trigger.

API to disable a hardware trigger

Parameters
trig- Trigger structure.
Returns
ret - Result of the disable procedure.

◆ iio_trig_enable()

int iio_trig_enable ( void *  trig)

Enable system interrupt which is linked to the given trigger.

API to enable a hardware trigger

Parameters
trig- Trigger structure.
Returns
ret - Result of the enable procedure.

◆ iio_trig_remove()

int iio_trig_remove ( struct iio_sw_trig trig)

API to remove a software trigger