Nut/OS  4.10.3
API Reference
pca9555.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2009 by Rittal GmbH & Co. KG,
00003  * Ulrich Prinz <prinz.u@rittal.de> All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  * 3. Neither the name of the copyright holders nor the names of
00015  *    contributors may be used to endorse or promote products derived
00016  *    from this software without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY EMBEDDED IT AND CONTRIBUTORS
00019  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00020  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00021  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EMBEDDED IT
00022  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029  *
00030  * For additional information see http://www.ethernut.de/
00031  *
00032  */
00033 
00034 /*
00035  * $Log$
00036  *
00037  * Revision 1.0  2009/04/13 ulrichprinz
00038  * First checkin, new twi driver for pca9555 (currently SAM7X256 is tested
00039  * only)
00040  *
00041  */
00042 #ifndef _DEV_PCA9555_H_
00043 #define _DEV_PCA9555_H_
00044 
00045 #include <cfg/pca9555.h>
00046 #include <dev/twif.h>
00047 
00048 #define IOXP_PORT0  0x80
00049 #define IOXP_PORT1  0x81
00050 
00051 #define IOXP_PIN0   0
00052 #define IOXP_PIN1   1
00053 #define IOXP_PIN2   2
00054 #define IOXP_PIN3   3
00055 #define IOXP_PIN4   4
00056 #define IOXP_PIN5   5
00057 #define IOXP_PIN6   6
00058 #define IOXP_PIN7   7
00059 
00060 #define GPIO_CFG_INVERT 0x00010000
00061 #define GPIO_CFG_NORM   0x00020000
00062 
00063 __BEGIN_DECLS
00064 /* Prototypes */
00065 extern int IOExpInit( void );
00066 extern int IOExpPinConfigSet( int bank, int bit, uint32_t flags);
00067 extern int IOExpRawWrite ( int bank, int value );
00068 extern int IOExpRawRead ( int bank, int *value );
00069 extern int IOExpSetBitLow( int bank, int bit );
00070 extern int IOExpSetBitHigh( int bank, int bit );
00071 extern int IOExpGetBit ( int bank, int bit, int *value );
00072 extern int IOExpSetBit( int bank, int bit, int value );
00073 
00074 __END_DECLS
00075 /* End of prototypes */
00076 #endif