no-OS
Functions | Variables
xilinx_gpio_irq.c File Reference

Implementation of Xilinx GPIO IRQ Generic Driver. More...

#include <stdlib.h>
#include "xparameters.h"
#include "no_os_error.h"
#include "xilinx_gpio_irq.h"
#include "no_os_util.h"
#include "no_os_list.h"
#include "no_os_irq.h"
#include "no_os_alloc.h"
Include dependency graph for xilinx_gpio_irq.c:

Functions

int32_t xil_gpio_irq_disable (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
 Disable specific GPIO IRQ pin. More...
 
int32_t xil_gpio_irq_ctrl_init (struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
 Initialize the GPIO IRQ controller. More...
 
int32_t xil_gpio_irq_trigger_level_set (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig)
 Set GPIO interrupt trigger level. More...
 
int32_t xil_gpio_irq_register_callback (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
 Register pin specific GPIO interrupt. More...
 
int32_t xil_gpio_irq_unregister_callback (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *cb)
 Unregister pin specific GPIO interrupt. More...
 
int32_t xil_gpio_irq_enable (struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
 Enable specific GPIO IRQ pin. More...
 
int32_t xil_gpio_irq_ctrl_remove (struct no_os_irq_ctrl_desc *desc)
 Remove the GPIO IRQ controller. More...
 

Variables

const struct no_os_irq_platform_ops xil_gpio_irq_ops
 Xilinx platform specific GPIO IRQ platform ops structure. More...
 

Detailed Description

Implementation of Xilinx GPIO IRQ Generic Driver.

Author
Porumb Andrei (andre.nosp@m.i.po.nosp@m.rumb@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2021(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.

Function Documentation

◆ xil_gpio_irq_ctrl_init()

int32_t xil_gpio_irq_ctrl_init ( struct no_os_irq_ctrl_desc **  desc,
const struct no_os_irq_init_param param 
)

Initialize the GPIO IRQ controller.

Parameters
desc- The GPIO IRQ controller descriptor.
param- The GPIO IRQ controller initial parameters. irq_ctrl_id from irq_init_param is the interrupt id for the parent controller
Returns
0 in case of success, -1 otherwise.

◆ xil_gpio_irq_ctrl_remove()

int32_t xil_gpio_irq_ctrl_remove ( struct no_os_irq_ctrl_desc desc)

Remove the GPIO IRQ controller.

Parameters
desc- The GPIO IRQ controller descriptor.
Returns
0 in case of success, -1 otherwise.

◆ xil_gpio_irq_disable()

int32_t xil_gpio_irq_disable ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id 
)

Disable specific GPIO IRQ pin.

Parameters
desc- The GPIO IRQ controller descriptor.
irq_id- Pin number.
Returns
0 in case of success, -1 otherwise.

◆ xil_gpio_irq_enable()

int32_t xil_gpio_irq_enable ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id 
)

Enable specific GPIO IRQ pin.

Parameters
desc- The GPIO IRQ controller descriptor.
irq_id- Pin number.
Returns
0 in case of success, -1 otherwise.

◆ xil_gpio_irq_register_callback()

int32_t xil_gpio_irq_register_callback ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
struct no_os_callback_desc callback_desc 
)

Register pin specific GPIO interrupt.

Parameters
desc- The GPIO IRQ controller descriptor.
irq_id- Pin number.
callback_desc- Callback.
Returns
0 in case of success, -1 otherwise.

◆ xil_gpio_irq_trigger_level_set()

int32_t xil_gpio_irq_trigger_level_set ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
enum no_os_irq_trig_level  trig 
)

Set GPIO interrupt trigger level.

Parameters
desc- The GPIO IRQ controller descriptor.
irq_id- Pin number.
trig- New trigger level for the GPIO interrupt.
Returns
0 in case of success, -1 otherwise.

◆ xil_gpio_irq_unregister_callback()

int32_t xil_gpio_irq_unregister_callback ( struct no_os_irq_ctrl_desc desc,
uint32_t  irq_id,
struct no_os_callback_desc cb 
)

Unregister pin specific GPIO interrupt.

Parameters
desc- The GPIO IRQ controller descriptor.
irq_id- Pin number.
cb- Callback descriptor.
Returns
0 in case of success, -1 otherwise.

Variable Documentation

◆ xil_gpio_irq_ops

const struct no_os_irq_platform_ops xil_gpio_irq_ops
Initial value:
= {
.enable = &xil_gpio_irq_enable,
.disable = &xil_gpio_irq_disable,
.trigger_level_set = &xil_gpio_irq_trigger_level_set,
.register_callback = &xil_gpio_irq_register_callback,
.unregister_callback = xil_gpio_irq_unregister_callback,
}

Xilinx platform specific GPIO IRQ platform ops structure.

Xilinx specific GPIO IRQ platform ops structure.

xil_gpio_irq_ctrl_remove
int32_t xil_gpio_irq_ctrl_remove(struct no_os_irq_ctrl_desc *desc)
Remove the GPIO IRQ controller.
Definition: xilinx_gpio_irq.c:324
xil_gpio_irq_enable
int32_t xil_gpio_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific GPIO IRQ pin.
Definition: xilinx_gpio_irq.c:295
xil_gpio_irq_disable
int32_t xil_gpio_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific GPIO IRQ pin.
Definition: xilinx_gpio_irq.c:103
xil_gpio_irq_register_callback
int32_t xil_gpio_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register pin specific GPIO interrupt.
Definition: xilinx_gpio_irq.c:238
xil_gpio_irq_trigger_level_set
int32_t xil_gpio_irq_trigger_level_set(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig)
Set GPIO interrupt trigger level.
Definition: xilinx_gpio_irq.c:213
xil_gpio_irq_unregister_callback
int32_t xil_gpio_irq_unregister_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *cb)
Unregister pin specific GPIO interrupt.
Definition: xilinx_gpio_irq.c:269
xil_gpio_irq_ctrl_init
int32_t xil_gpio_irq_ctrl_init(struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
Initialize the GPIO IRQ controller.
Definition: xilinx_gpio_irq.c:133