Nut/OS  5.0.5
API Reference
lpc177x_8x_gpio.h
Go to the documentation of this file.
00001 #ifndef _LPC177X_8X_GPIO_H_
00002 #define _LPC177X_8X_GPIO_H_
00003 
00004 /*
00005  * Copyright (C) 2012 by Ole Reinhardt (ole.reinhardt@embedded-it.de)
00006  *
00007  * All rights reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted provided that the following conditions
00011  * are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright
00014  *    notice, this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in the
00017  *    documentation and/or other materials provided with the distribution.
00018  * 3. Neither the name of the copyright holders nor the names of
00019  *    contributors may be used to endorse or promote products derived
00020  *    from this software without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00026  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00029  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00030  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00031  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00032  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00033  * SUCH DAMAGE.
00034  *
00035  * For additional information see http://www.ethernut.de/
00036  */
00037 
00038 /*
00039  * \verbatim
00040  * $Id:$
00041  * \endverbatim
00042  */
00043 
00044 #define IOCON_FUNC_POS              0
00045 #define IOCON_FUNC_BITMASK          0x00000007
00046 
00047 #define IOCON_MODE_POS              3
00048 #define IOCON_MODE_BITMASK          0x00000018
00049 
00050 #define IOCON_HYSTERESIS_POS        5
00051 #define IOCON_HYSTERESIS_BITMASK    0x00000020
00052 
00053 #define IOCON_INVERT_POS            6
00054 #define IOCON_INVERT_BITMASK        0x00000040
00055 
00056 #define IOCON_ADMODE_POS            7
00057 #define IOCON_ADMODE_BITMASK        0x00000080
00058 
00059 #define IOCON_GLITCH_FILTER_POS     8
00060 #define IOCON_GLITCH_FILTER_BITMASK 0x00000100
00061 
00062 #define IOCON_I2C_MODE_POS          8
00063 #define IOCON_I2C_MODE_BITMASK      0x00000300
00064 
00065 #define IOCON_SLEW_POS              9
00066 #define IOCON_SLEW_BITMASK          0x00000200
00067 
00068 #define IOCON_ODMODE_POS            10
00069 #define IOCON_ODMODE_BITMASK        0x00000400
00070 
00071 #define IOCON_DACEN_POS             16
00072 #define IOCON_DACEN_BITMASK         0x00010000
00073 
00074 
00075 
00076 #define IOCON_MODE_PLAIN            (0 << 3)
00077 #define IOCON_MODE_PULLDOWN         (1 << 3)
00078 #define IOCON_MODE_PULLUP           (2 << 3)
00079 #define IOCON_MODE_REPEATER         (3 << 3)
00080 
00081 #define IOCON_HYSTERESIS            (1 << 5)
00082 
00083 #define IOCON_INVERTED              (1 << 6)
00084 
00085 #define IOCON_ADMODE                (1 << 7)
00086 
00087 #define IOCON_GLITCH_FILTER         (1 << 8)
00088 
00089 #define IOCON_SLEW                  (1 << 9)
00090 
00091 #define IOCON_I2CMODE_FAST          (0 << 8)
00092 #define IOCON_I2CMODE_OPENDRAIN     (1 << 8)
00093 #define IOCON_I2CMODE_FASTPLUS      (2 << 8)
00094 #define IOCON_I2CMODE_HIGHOPENDRAIN (3 << 8)
00095 
00096 #define IOCON_ODMODE                (1 << 10)
00097 
00098 #define IOCON_DACEN                 (1 << 16)
00099 
00100 #endif /* _LPC177X_8X_GPIO_H_ */