Go to the documentation of this file.
34 #ifndef IIO_TRIGGER_H_
35 #define IIO_TRIGGER_H_
47 #define TRIG_MAX_NAME_SIZE 20
123 #ifndef LINUX_PLATFORM
int iio_trig_disable(void *trig)
Disable system interrupt which is linked to the given trigger.
Definition: iio_trigger.c:127
Header file for iio_trigger.
struct iio_desc * iio_desc
Definition: iio_trigger.h:58
Structure describing a callback to be registered.
Definition: no_os_irq.h:142
Header file of IRQ interface.
int32_t no_os_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register a callback to handle the irq events.
Definition: no_os_irq.c:92
uint32_t irq_id
Definition: iio_trigger.h:62
Structure holding channel attributess.
Definition: iio_types.h:103
int iio_hw_trig_init(struct iio_hw_trig **iio_trig, struct iio_hw_trig_init_param *init_param)
Initialize hardware trigger.
Definition: iio_trigger.c:56
void iio_hw_trig_handler(void *trig)
Trigger interrupt handler. This function will be called when a system interrupt is asserted for the c...
Definition: iio_trigger.c:143
struct iio_desc * iio_desc
Definition: iio_trigger.h:107
int iio_trig_disable(void *trig)
Disable system interrupt which is linked to the given trigger.
Definition: iio_trigger.c:127
const char * name
Definition: iio_trigger.h:120
char name[TRIG_MAX_NAME_SIZE+1]
Definition: iio_trigger.h:109
int iio_sw_trig_init(struct iio_sw_trig **iio_trig, struct iio_sw_trig_init_param *init_param)
Initialize software trigger.
Definition: iio_trigger.c:177
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: iio_trigger.h:90
no_os_irq_peripheral
Definition: no_os_irq.h:84
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
int iio_hw_trig_init(struct iio_hw_trig **iio_trig, struct iio_hw_trig_init_param *init_param)
Initialize hardware trigger.
Definition: iio_trigger.c:56
int iio_sw_trig_remove(struct iio_sw_trig *trig)
Free the resources allocated by iio_sw_trig_init().
Definition: iio_trigger.c:227
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.
Definition: iio_trigger.c:208
struct iio_desc * iio_desc
Definition: iio_trigger.h:88
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: iio_trigger.h:60
#define TRIG_MAX_NAME_SIZE
Definition: iio_trigger.h:47
enum no_os_irq_trig_level irq_trig_lvl
Definition: iio_trigger.h:94
int iio_trig_enable(void *trig)
Enable system interrupt which is linked to the given trigger.
Definition: iio_trigger.c:110
char name[TRIG_MAX_NAME_SIZE+1]
Definition: iio_trigger.h:66
no_os_irq_trig_level
Definition: no_os_irq.h:76
int iio_hw_trig_remove(struct iio_hw_trig *trig)
Free the resources allocated by iio_hw_trig_init().
Definition: iio_trigger.c:160
void * handle
Definition: iio_trigger.h:79
void(* callback)(void *context)
Definition: no_os_irq.h:144
int iio_trig_remove(struct iio_sw_trig *trig)
int iio_hw_trig_remove(struct iio_hw_trig *trig)
Free the resources allocated by iio_hw_trig_init().
Definition: iio_trigger.c:160
int iio_process_trigger_type(struct iio_desc *desc, char *trigger_name)
Searches for trigger name and processes the trigger based on its type (sync or async with the interru...
Definition: iio.c:1091
enum no_os_irq_trig_level irq_trig_lvl
Definition: iio_trigger.h:64
IIO software trigger structure.
Definition: iio_trigger.h:105
int iio_trig_enable(void *trig)
Enable system interrupt which is linked to the given trigger.
Definition: iio_trigger.c:110
Header file for iio_types.
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
IIO hardware trigger initialization structure.
Definition: iio_trigger.h:86
enum no_os_irq_event event
Definition: iio_trigger.h:75
enum no_os_irq_peripheral peripheral
Definition: iio_trigger.h:77
uint32_t irq_id
Definition: iio_trigger.h:92
IIO software trigger initialization structure.
Definition: iio_trigger.h:116
void iio_hw_trig_handler(void *trig)
Trigger interrupt handler. This function will be called when a system interrupt is asserted for the c...
Definition: iio_trigger.c:143
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
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.
Definition: iio_trigger.c:208
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:62
no_os_irq_event
Definition: no_os_irq.h:61
int iio_sw_trig_init(struct iio_sw_trig **iio_trig, struct iio_sw_trig_init_param *init_param)
Initialize software trigger.
Definition: iio_trigger.c:177
int32_t no_os_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific interrupt.
Definition: no_os_irq.c:181
struct iio_hw_trig_cb_info cb_info
Definition: iio_trigger.h:96
Hardware trigger callback extra information structure.
Definition: iio_trigger.h:73
int32_t no_os_irq_trigger_level_set(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig)
Set interrupt trigger level.
Definition: no_os_irq.c:162
struct iio_desc * iio_desc
Definition: iio_trigger.h:118
int32_t no_os_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific interrupt.
Definition: no_os_irq.c:198
Definition: no_os_irq.h:123
IIO hardware trigger structure.
Definition: iio_trigger.h:56
const char * name
Definition: iio_trigger.h:98