Nut/OS  4.10.3
API Reference
gpio.h File Reference

General purpose I/O. More...

#include <cfg/arch/gpio.h>
#include <dev/irqreg.h>
Include dependency graph for gpio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GPIO_VECTOR
struct  GPIO_SIGNAL

Defines

#define NUTGPIO_PORT   0
#define NUTGPIO_PORTA   1
#define NUTGPIO_PORTB   2
#define NUTGPIO_PORTC   3
#define NUTGPIO_PORTD   4
#define NUTGPIO_PORTE   5
#define NUTGPIO_PORTF   6
#define NUTGPIO_PORTG   7
#define NUTGPIO_PORTH   8
#define NUTGPIO_PORTI   9
#define NUTGPIO_PORTJ   10
#define NUTGPIO_PORTK   11
#define NUTGPIO_PORTL   12
#define NUTGPIO_EXTINT0   1
#define NUTGPIO_EXTINT1   2
#define NUTGPIO_EXTINT2   3
#define NUTGPIO_EXTINT3   4
#define NUTGPIO_EXTINT4   5
#define NUTGPIO_EXTINT5   6
#define NUTGPIO_EXTINT6   7
#define NUTGPIO_EXTINT7   8
#define NUTGPIO_EXTFIQ0   -1
#define GPIO_CFG_DISABLED   0x00000001
 GPIO disabled.
#define GPIO_CFG_OUTPUT   0x00000002
 GPIO output direction enabled.
#define GPIO_CFG_PULLUP   0x00000004
 GPIO pull-up enabled.
#define GPIO_CFG_MULTIDRIVE   0x00000008
 GPIO open drain output feature enabled.
#define GPIO_CFG_DEBOUNCE   0x00000010
 GPIO input glitch filter enabled.
#define GPIO_CFG_PERIPHERAL0   0x00000020
 GPIO Peripheral 0 mux. Switch pin function to peripheral 0.
#define GPIO_CFG_PERIPHERAL1   0x00000040
 GPIO Peripheral 1 mux. Switch pin function to peripheral 1.
#define GPIO_CFG_PERIPHERAL2   0x00000080
 GPIO Peripheral 2 mux. Switch pin function to peripheral 2.
#define GPIO_CFG_PERIPHERAL3   0x00000100
 GPIO Peripheral 3 mux. Switch pin function to peripheral 3.

Functions

uint32_t GpioPinConfigGet (int bank, int bit)
 Get pin configuration.
int GpioPinConfigSet (int bank, int bit, uint32_t flags)
 Set pin configuration.
int GpioPortConfigSet (int bank, unsigned int mask, uint32_t flags)
 Set port wide pin configuration.
int GpioPinGet (int bank, int bit)
 Get pin level.
void GpioPinSet (int bank, int bit, int value)
 Set pin level.
void GpioPinSetLow (int bank, int bit)
 Set pin level to low.
void GpioPinSetHigh (int bank, int bit)
 Set pin level to high.
unsigned int GpioPortGet (int bank)
 Get all pin levels of a specified bank/port.
void GpioPortSet (int bank, unsigned int value)
 Set all pin levels of a bank/port.
void GpioPortSetLow (int bank, unsigned int mask)
 Set multiple pin levels of a bank/port to low.
void GpioPortSetHigh (int bank, unsigned int mask)
 Set multiple pin levels of a bank/port to high.
int GpioRegisterIrqHandler (GPIO_SIGNAL *sig, int bit, void(*handler)(void *), void *arg)
 Register a GPIO pin interrupt handler.
int GpioIrqEnable (GPIO_SIGNAL *sig, int bit)
 Enable a specified GPIO interrupt.
int GpioIrqDisable (GPIO_SIGNAL *sig, int bit)
 Disable a specified GPIO interrupt.

Detailed Description

General purpose I/O.

Copyright (C) 2007 by egnite Software GmbH. All rights reserved.

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 the copyright holders nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS ``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 EGNITE SOFTWARE GMBH OR CONTRIBUTORS 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.

For additional information see http://www.ethernut.de/

 * $Id: gpio.h 2560 2009-03-18 04:00:06Z thiagocorrea $
 * 

Definition in file gpio.h.


Define Documentation

#define NUTGPIO_PORT   0
#define NUTGPIO_PORTA   1
#define NUTGPIO_PORTB   2
#define NUTGPIO_PORTC   3
#define NUTGPIO_PORTD   4

Definition at line 52 of file gpio.h.

#define NUTGPIO_PORTE   5

Definition at line 53 of file gpio.h.

#define NUTGPIO_PORTF   6

Definition at line 54 of file gpio.h.

#define NUTGPIO_PORTG   7

Definition at line 55 of file gpio.h.

#define NUTGPIO_PORTH   8

Definition at line 56 of file gpio.h.

#define NUTGPIO_PORTI   9

Definition at line 57 of file gpio.h.

#define NUTGPIO_PORTJ   10

Definition at line 58 of file gpio.h.

#define NUTGPIO_PORTK   11

Definition at line 59 of file gpio.h.

#define NUTGPIO_PORTL   12

Definition at line 60 of file gpio.h.

#define NUTGPIO_EXTINT0   1

Definition at line 62 of file gpio.h.

#define NUTGPIO_EXTINT1   2

Definition at line 63 of file gpio.h.

#define NUTGPIO_EXTINT2   3

Definition at line 64 of file gpio.h.

#define NUTGPIO_EXTINT3   4

Definition at line 65 of file gpio.h.

#define NUTGPIO_EXTINT4   5

Definition at line 66 of file gpio.h.

#define NUTGPIO_EXTINT5   6

Definition at line 67 of file gpio.h.

#define NUTGPIO_EXTINT6   7

Definition at line 68 of file gpio.h.

#define NUTGPIO_EXTINT7   8

Definition at line 69 of file gpio.h.

#define NUTGPIO_EXTFIQ0   -1

Definition at line 70 of file gpio.h.

#define GPIO_CFG_DISABLED   0x00000001

GPIO disabled.

Will activate the pins alternate function if set. This may not work on all platforms.

Definition at line 78 of file gpio.h.

Referenced by GpioPinConfigGet(), and GpioPortConfigSet().

#define GPIO_CFG_OUTPUT   0x00000002

GPIO output direction enabled.

If set, the pin is configured as an output. Otherwise it is in input mode or z-state.

Examples:
portdio/portdio.c.

Definition at line 86 of file gpio.h.

Referenced by GpioPinConfigGet(), GpioPinConfigSet(), GpioPortConfigSet(), GpioSpiBus0Select(), init_dio(), InitLED(), and IOExpPinConfigSet().

#define GPIO_CFG_PULLUP   0x00000004

GPIO pull-up enabled.

Examples:
portdio/portdio.c.

Definition at line 91 of file gpio.h.

Referenced by GpioPinConfigGet(), GpioPinConfigSet(), GpioPortConfigSet(), init_dio(), and InitKEY().

#define GPIO_CFG_MULTIDRIVE   0x00000008

GPIO open drain output feature enabled.

If not set, the output will use push pull mode.

Definition at line 98 of file gpio.h.

Referenced by GpioPinConfigGet(), and GpioPortConfigSet().

#define GPIO_CFG_DEBOUNCE   0x00000010

GPIO input glitch filter enabled.

Definition at line 103 of file gpio.h.

Referenced by GpioPinConfigGet(), GpioPortConfigSet(), and InitKEY().

#define GPIO_CFG_PERIPHERAL0   0x00000020

GPIO Peripheral 0 mux. Switch pin function to peripheral 0.

Definition at line 109 of file gpio.h.

Referenced by GpioPinConfigGet().

#define GPIO_CFG_PERIPHERAL1   0x00000040

GPIO Peripheral 1 mux. Switch pin function to peripheral 1.

Definition at line 115 of file gpio.h.

Referenced by GpioPinConfigGet().

#define GPIO_CFG_PERIPHERAL2   0x00000080

GPIO Peripheral 2 mux. Switch pin function to peripheral 2.

Definition at line 121 of file gpio.h.

Referenced by GpioPinConfigGet().

#define GPIO_CFG_PERIPHERAL3   0x00000100

GPIO Peripheral 3 mux. Switch pin function to peripheral 3.

Definition at line 127 of file gpio.h.

Referenced by GpioPinConfigGet().


Function Documentation

uint32_t GpioPinConfigGet ( int  bank,
int  bit 
)

Get pin configuration.

Parameters:
bankGPIO bank/port number.
bitBit number of the specified bank/port.
Returns:
Attribute flags of the pin.

Definition at line 325 of file gpio_at91.c.

References _BV, AVRPORTA, AVRPORTB, AVRPORTC, AVRPORTD, AVRPORTE, AVRPORTF, AVRPORTG, AVRPORTH, AVRPORTI, AVRPORTJ, AVRPORTK, AVRPORTL, GPIO_CFG_DEBOUNCE, GPIO_CFG_DISABLED, GPIO_CFG_MULTIDRIVE, GPIO_CFG_OUTPUT, GPIO_CFG_PERIPHERAL0, GPIO_CFG_PERIPHERAL1, GPIO_CFG_PERIPHERAL2, GPIO_CFG_PERIPHERAL3, GPIO_CFG_PULLUP, inb, inr, NUTGPIO_PORT, NUTGPIO_PORTA, NUTGPIO_PORTB, and NUTGPIO_PORTC.

Referenced by GpioPinConfigSet().

int GpioPinConfigSet ( int  bank,
int  bit,
uint32_t  flags 
)

Set pin configuration.

Applications may also use this function to make sure, that a specific attribute is available for a specific pin.

Note:
GPIO pins are typically initialized to a safe state after power up. This routine is not able to determine the consequences of changing pin configurations. In the worst case you may permanently damage your hardware by bad pin settings.
Parameters:
bankGPIO bank/port number.
bitBit number of the specified bank/port.
flagsAttribute flags.
Returns:
0 if all attributes had been set, -1 otherwise.
Examples:
portdio/portdio.c.

Definition at line 710 of file gpio_at91.c.

References _BV, AVRPORTA, AVRPORTB, AVRPORTC, AVRPORTD, AVRPORTE, AVRPORTF, cbi, GPIO_CFG_OUTPUT, GPIO_CFG_PULLUP, GpioPinConfigGet(), GpioPortConfigSet(), and sbi.

Referenced by GpioSpiBus0Select(), init_dio(), InitKEY(), and InitLED().

Here is the call graph for this function:

int GpioPortConfigSet ( int  bank,
unsigned int  mask,
uint32_t  flags 
)

Set port wide pin configuration.

Note:
This function does not check for undefined ports and pins or invalid attributes. If this is required, use GpioPinConfigSet().
Parameters:
bankGPIO bank/port number.
maskThe given attributes are set for a specific pin, if the corresponding bit in this mask is 1.
flagsAttribute flags to set.
Returns:
Always 0.

Definition at line 475 of file gpio_at91.c.

References _BV, AVRPORTA, AVRPORTB, AVRPORTC, AVRPORTD, AVRPORTE, AVRPORTF, AVRPORTG, AVRPORTH, AVRPORTI, AVRPORTJ, AVRPORTK, AVRPORTL, GPIO_CFG_DEBOUNCE, GPIO_CFG_DISABLED, GPIO_CFG_MULTIDRIVE, GPIO_CFG_OUTPUT, GPIO_CFG_PULLUP, inb, NUTGPIO_PORT, NUTGPIO_PORTA, NUTGPIO_PORTB, NUTGPIO_PORTC, outb, outr, PERIPHERALS_MASK, PIO_ID, PIOA_ID, PIOB_ID, PIOC_ID, and PMC_PCER.

Referenced by GpioPinConfigSet().

int GpioPinGet ( int  bank,
int  bit 
)

Get pin level.

Copyright (C) 2007 by egnite Software GmbH. All rights reserved.

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 the copyright holders nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS ``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 EGNITE SOFTWARE GMBH OR CONTRIBUTORS 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.

For additional information see http://www.ethernut.de/

Id:
gpio_at91.c 3449 2011-05-31 19:08:15Z mifi
Parameters:
bankGPIO bank/port number.
bitBit number of the specified bank/port.
Returns:
1 if the pin level is high. 0 is returned if the pin level is low or if the pin is undefined.

Copyright (C) 2007 by egnite Software GmbH. All rights reserved.

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 the copyright holders nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS ``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 EGNITE SOFTWARE GMBH OR CONTRIBUTORS 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.

For additional information see http://www.ethernut.de/

Id:
gpio_avr.c 2700 2009-09-17 10:48:13Z haraldkipp
Parameters:
bankGPIO bank/port number.
bitBit number of the specified bank/port.
Returns:
1 if the pin level is high. 0 is returned if the pin level is low or if the pin is undefined.
Examples:
portdio/portdio.c, and tcps/tcps.c.

Definition at line 53 of file gpio_at91.c.

References _BV, AVRPORTA, AVRPORTB, AVRPORTC, AVRPORTD, AVRPORTE, AVRPORTF, AVRPORTG, AVRPORTH, AVRPORTI, AVRPORTJ, AVRPORTK, AVRPORTL, bit_is_set, inr, NUTGPIO_PORT, NUTGPIO_PORTA, NUTGPIO_PORTB, and NUTGPIO_PORTC.

Referenced by sys_key().

void GpioPinSet ( int  bank,
int  bit,
int  value 
)

Set pin level.

Trying to set undefined pins is silently ignored.

Parameters:
bankGPIO bank/port number.
bitBit number of the specified bank/port.
valueLevel, 0 for low or any other value for high.

Definition at line 168 of file gpio_at91.c.

References GpioPinSetHigh(), and GpioPinSetLow().

Referenced by NutSetLed().

Here is the call graph for this function:

void GpioPinSetLow ( int  bank,
int  bit 
)

Set pin level to low.

Trying to set undefined pins is silently ignored.

Parameters:
bankGPIO bank/port number.
bitBit number of the specified bank/port.
Examples:
portdio/portdio.c.

Definition at line 93 of file gpio_at91.c.

References _BV, AVRPORTA, AVRPORTB, AVRPORTC, AVRPORTD, AVRPORTE, AVRPORTF, AVRPORTG, AVRPORTH, AVRPORTI, AVRPORTJ, AVRPORTK, AVRPORTL, cbi, NUTGPIO_PORT, NUTGPIO_PORTA, NUTGPIO_PORTB, NUTGPIO_PORTC, and outr.

Referenced by GpioPinSet(), GpioSpiBus0Select(), init_dio(), and ProcessRequests().

void GpioPinSetHigh ( int  bank,
int  bit 
)

Set pin level to high.

Trying to set undefined pins is silently ignored.

Parameters:
bankGPIO bank/port number.
bitBit number of the specified bank/port.
Examples:
portdio/portdio.c.

Definition at line 130 of file gpio_at91.c.

References _BV, AVRPORTA, AVRPORTB, AVRPORTC, AVRPORTD, AVRPORTE, AVRPORTF, AVRPORTG, AVRPORTH, AVRPORTI, AVRPORTJ, AVRPORTK, AVRPORTL, NUTGPIO_PORT, NUTGPIO_PORTA, NUTGPIO_PORTB, NUTGPIO_PORTC, outr, and sbi.

Referenced by GpioPinSet(), InitLED(), and ProcessRequests().

unsigned int GpioPortGet ( int  bank)

Get all pin levels of a specified bank/port.

Parameters:
bankGPIO bank/port number.
Returns:
Pin levels. 0 is returned for unknown banks and pins.

Definition at line 185 of file gpio_at91.c.

References AVRPORTA, AVRPORTB, AVRPORTC, AVRPORTD, AVRPORTE, AVRPORTF, AVRPORTG, AVRPORTH, AVRPORTI, AVRPORTJ, AVRPORTK, AVRPORTL, inb, inr, NUTGPIO_PORT, NUTGPIO_PORTA, NUTGPIO_PORTB, and NUTGPIO_PORTC.

Referenced by GpioPortSetHigh(), and GpioPortSetLow().

void GpioPortSet ( int  bank,
unsigned int  value 
)

Set all pin levels of a bank/port.

This routine can be used to simultaneously set all pins of a specific port. However, in some implementations the high bit values will be set before the low bit values. If this is a problem, you should use GpioPortSetHigh() and GpioPortSetLow().

Parameters:
bankGPIO bank/port number.
valuePin levels are set to high, if the corresponding bit in this mask is 1. All other pin levels are set to low.

Definition at line 306 of file gpio_at91.c.

References AVRPORTA, AVRPORTB, AVRPORTC, AVRPORTD, AVRPORTE, AVRPORTF, AVRPORTG, AVRPORTH, AVRPORTI, AVRPORTJ, AVRPORTK, AVRPORTL, GpioPortSetHigh(), GpioPortSetLow(), and outb.

Referenced by GpioPortSetHigh(), and GpioPortSetLow().

Here is the call graph for this function:

void GpioPortSetLow ( int  bank,
unsigned int  mask 
)

Set multiple pin levels of a bank/port to low.

Parameters:
bankGPIO bank/port number.
maskPin levels are set to low, if the corresponding bit in this mask is 1.
Returns:
Levels.

Definition at line 226 of file gpio_at91.c.

References GpioPortGet(), GpioPortSet(), NUTGPIO_PORT, NUTGPIO_PORTA, NUTGPIO_PORTB, NUTGPIO_PORTC, and outr.

Referenced by GpioPortSet().

Here is the call graph for this function:

void GpioPortSetHigh ( int  bank,
unsigned int  mask 
)

Set multiple pin levels of a bank/port to high.

Trying to set undefined ports is silently ignored.

Parameters:
bankGPIO bank/port number.
maskPin levels are set to high, if the corresponding bit in this mask is 1.

Definition at line 264 of file gpio_at91.c.

References GpioPortGet(), GpioPortSet(), NUTGPIO_PORT, NUTGPIO_PORTA, NUTGPIO_PORTB, NUTGPIO_PORTC, and outr.

Referenced by GpioPortSet().

Here is the call graph for this function:

int GpioRegisterIrqHandler ( GPIO_SIGNAL sig,
int  bit,
void(*)(void *)  handler,
void *  arg 
)

Register a GPIO pin interrupt handler.

Generating interrupts on GPIO pin changes is not supported on all platforms. In this case dedicated external interrupt pins may be used with NutRegisterIrqHandler().

Interrupts are triggered on rising and falling edges. Level triggering or triggering on specific edges is not supported.

After registering, interrupts are disabled. Calling GpioIrqEnable() is required to activate the interrupt.

The following code fragment registers an interrupt handler which is called on each change of bit 4 of the first GPIO port:

 #include <dev/gpio.h>

 static void PinChange(void *arg)
 {
     ...
 }

 {
     ...
     GpioPinConfigSet(0, 4, GPIO_CFG_PULLUP);
     GpioRegisterIrqHandler(&sig_GPIO, 4, PinChange, NULL);
     GpioIrqEnable(&sig_GPIO, 4);
     ...
 }
Parameters:
sigBank/port interrupt to be associated with this handler.
bitBit number of the specified bank/port.
handlerThis routine will be called by Nut/OS, when the specified pin changes its state.
argArgument to be passed to the interrupt handler routine.
Returns:
0 on success, -1 otherwise.

Generating interrupts on GPIO pin changes is not supported on all platforms. In this case dedicated external interrupt pins may be used with NutRegisterIrqHandler().

Interrupts are triggered on rising and falling edges. Level triggering or triggering on specific edges is not supported.

After registering, interrupts are disabled. Calling GpioIrqEnable() is required to activate the interrupt.

The following code fragment registers an interrupt handler which is called on each change of bit 4 of the first GPIO port:

 #include <dev/gpio.h>

 static void PinChange(void *arg)
 {
     ...
 }

 {
     ...
     GpioPinConfigSet(0, 4, GPIO_CFG_PULLUP);
     GpioRegisterIrqHandler(&sig_GPIO, 4, PinChange, NULL);
     GpioIrqEnable(&sig_GPIO, 30);
     ...
 }
Parameters:
sigBank/port interrupt to be associated with this handler.
bitBit number of the specified bank/port.
handlerThis routine will be called by Nut/OS, when the specified pin changes its state.
argArgument to be passed to the interrupt handler routine.
Returns:
0 on success, -1 otherwise.

Definition at line 761 of file gpio_at91.c.

References GPIO_SIGNAL::ios_handler, GPIO_SIGNAL::ios_sig, GPIO_SIGNAL::ios_vector, GPIO_VECTOR::iov_arg, GPIO_VECTOR::iov_handler, malloc(), memset(), NutIrqEnable(), and NutRegisterIrqHandler().

Here is the call graph for this function:

int GpioIrqEnable ( GPIO_SIGNAL sig,
int  bit 
)

Enable a specified GPIO interrupt.

A related interrupt handler must have been registered before calling this function. See GpioRegisterIrqHandler().

Parameters:
sigInterrupt to enable.
bitBit number of the specified bank/port.
Returns:
0 on success, -1 otherwise.

Definition at line 797 of file gpio_at91.c.

References GPIO_SIGNAL::ios_ctl, and NUT_IRQCTL_ENABLE.

int GpioIrqDisable ( GPIO_SIGNAL sig,
int  bit 
)

Disable a specified GPIO interrupt.

Parameters:
sigInterrupt to disable.
bitBit number of the specified bank/port.
Returns:
0 on success, -1 otherwise.

Definition at line 810 of file gpio_at91.c.

References GPIO_SIGNAL::ios_ctl, and NUT_IRQCTL_DISABLE.