no-OS
|
Implementation of generic iio trigger. More...
#include <stdlib.h>
#include <string.h>
#include "no_os_error.h"
#include "no_os_alloc.h"
#include "iio.h"
#include "iio_trigger.h"
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_sw_trig_remove (struct iio_sw_trig *trig) |
Free the resources allocated by iio_sw_trig_init(). More... | |
Implementation of generic iio trigger.
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:
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.
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.
trig | - Trigger structure which is linked to this handler. |
int iio_hw_trig_init | ( | struct iio_hw_trig ** | iio_trig, |
struct iio_hw_trig_init_param * | init_param | ||
) |
Initialize hardware trigger.
iio_trig | - The iio trigger structure. |
init_param | - The structure that contains the trigger initial params. |
int iio_hw_trig_remove | ( | struct iio_hw_trig * | trig | ) |
Free the resources allocated by iio_hw_trig_init().
trig | - The trigger structure. |
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.
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. |
int iio_sw_trig_init | ( | struct iio_sw_trig ** | iio_trig, |
struct iio_sw_trig_init_param * | init_param | ||
) |
Initialize software trigger.
iio_trig | - The iio trigger structure. |
init_param | - The structure that contains the sw trigger initial params. |
int iio_sw_trig_remove | ( | struct iio_sw_trig * | trig | ) |
Free the resources allocated by iio_sw_trig_init().
trig | - The trigger structure. |
int iio_trig_disable | ( | void * | trig | ) |
Disable system interrupt which is linked to the given trigger.
trig | - Trigger structure. |
int iio_trig_enable | ( | void * | trig | ) |
Enable system interrupt which is linked to the given trigger.
trig | - Trigger structure. |