Nut/OS  5.0.5
API Reference
lpc_gpio.h
Go to the documentation of this file.
00001 #ifndef _ARCH_CM3_NXP_MACH_LPC_GPIO_H_
00002 #define _ARCH_CM3_NXP_MACH_LPC_GPIO_H_
00003 
00004 /*
00005  * Copyright 2011 by egnite GmbH
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00024  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  */
00035 
00049 
00050 
00053 #define FIO_DIR_OFF         0x00000000  
00054 #define FIO_MASK_OFF        0x00000010  
00055 #define FIO_PIN_OFF         0x00000014  
00056 #define FIO_SET_OFF         0x00000018  
00057 #define FIO_CLR_OFF         0x0000001C  
00059 
00060 
00062 #ifdef LPC_GPIO0_BASE
00063 #define FIO0DIR             (LPC_GPIO0_BASE + FIO_DIR_OFF)
00064 #define FIO0MASK            (LPC_GPIO0_BASE + FIO_MASK_OFF)
00065 #define FIO0PIN             (LPC_GPIO0_BASE + FIO_PIN_OFF)
00066 #define FIO0SET             (LPC_GPIO0_BASE + FIO_SET_OFF)
00067 #define FIO0CLR             (LPC_GPIO0_BASE + FIO_CLR_OFF)
00068 #endif
00069 
00073 #ifdef LPC_GPIO1_BASE
00074 #define FIO1DIR             (LPC_GPIO1_BASE + FIO_DIR_OFF)
00075 #define FIO1MASK            (LPC_GPIO1_BASE + FIO_MASK_OFF)
00076 #define FIO1PIN             (LPC_GPIO1_BASE + FIO_PIN_OFF)
00077 #define FIO1SET             (LPC_GPIO1_BASE + FIO_SET_OFF)
00078 #define FIO1CLR             (LPC_GPIO1_BASE + FIO_CLR_OFF)
00079 #endif
00080 
00084 #ifdef LPC_GPIO2_BASE
00085 #define FIO2DIR             (LPC_GPIO2_BASE + FIO_DIR_OFF)
00086 #define FIO2MASK            (LPC_GPIO2_BASE + FIO_MASK_OFF)
00087 #define FIO2PIN             (LPC_GPIO2_BASE + FIO_PIN_OFF)
00088 #define FIO2SET             (LPC_GPIO2_BASE + FIO_SET_OFF)
00089 #define FIO2CLR             (LPC_GPIO2_BASE + FIO_CLR_OFF)
00090 #endif
00091 
00095 #ifdef LPC_GPIO3_BASE
00096 #define FIO3DIR             (LPC_GPIO3_BASE + FIO_DIR_OFF)
00097 #define FIO3MASK            (LPC_GPIO3_BASE + FIO_MASK_OFF)
00098 #define FIO3PIN             (LPC_GPIO3_BASE + FIO_PIN_OFF)
00099 #define FIO3SET             (LPC_GPIO3_BASE + FIO_SET_OFF)
00100 #define FIO3CLR             (LPC_GPIO3_BASE + FIO_CLR_OFF)
00101 #endif
00102 
00106 #ifdef LPC_GPIO4_BASE
00107 #define FIO4DIR             (LPC_GPIO4_BASE + FIO_DIR_OFF)
00108 #define FIO4MASK            (LPC_GPIO4_BASE + FIO_MASK_OFF)
00109 #define FIO4PIN             (LPC_GPIO4_BASE + FIO_PIN_OFF)
00110 #define FIO4SET             (LPC_GPIO4_BASE + FIO_SET_OFF)
00111 #define FIO4CLR             (LPC_GPIO4_BASE + FIO_CLR_OFF)
00112 #endif
00113 
00115 #ifdef LPC_GPIOINT_BASE
00116 #define GPIO_IER_OFF        0x00000010
00117 #define GPIO_IFR_OFF        0x00000014
00118 #define GPIO_ISR_OFF        0x00000004
00119 #define GPIO_ISF_OFF        0x00000008
00120 #define GPIO_IC_OFF         0x0000000C
00121 #define GPIO_IS_OFF         0x00000000
00122 #endif
00123 
00125 #endif
00126