libHartwer - Documentation

bcs_io.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) 2008-2011 Marius Zwicker / Elefant Racing Bayreuth. 
00003 * All rights reserved.
00004 *
00005 * @ERB_OPEN_LICENSE_HEADER_START@
00006 *
00007 * Licensed under the Apache License, Version 2.0 (the "License");
00008 * you may not use this file except in compliance with the License.
00009 * You may obtain a copy of the License at
00010 * 
00011 *     http://www.apache.org/licenses/LICENSE-2.0
00012 * 
00013 * Unless required by applicable law or agreed to in writing, software
00014 * distributed under the License is distributed on an "AS IS" BASIS,
00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016 * See the License for the specific language governing permissions and
00017 * limitations under the License.
00018 *
00019 *      http://www.elefantracing.de
00020 *
00021 * @ERB_OPEN_LICENSE_HEADER_END@
00022 */
00023 
00033 #ifndef BCS_IO_H_
00034 #define BCS_IO_H_
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 #include "bcs_general.h"
00041 
00042 #ifdef USE_DEVICE_ARRAY
00043 
00049 static const char* bcs_io_devices[3] = { "/dev/fsio0", "/dev/fsio1", "/dev/fsio2" };
00050 #endif
00051 
00055 typedef enum {
00056        BCS_IO_LOW, 
00057        BCS_IO_HIGH, 
00058        BCS_IO_ERROR 
00059 } BCS_IO_state;
00060 
00065 typedef enum {
00066        BCS_IO_P0=0x01, 
00067        BCS_IO_P1=0x02, 
00068        BCS_IO_P2=0x04, 
00069        BCS_IO_P3=0x08, 
00070        BCS_IO_P4=0x10, 
00071        BCS_IO_P5=0x20, 
00072        BCS_IO_P6=0x40, 
00073        BCS_IO_P7=0x80, 
00074        BCS_IO_ALL8=0xFF 
00075 } BCS_IO_pinconfig;
00076 
00081 typedef struct {
00082        UInt16 ch0;
00083        UInt16 ch1;
00084 } BCS_IO_ad;
00085 
00093 BCS_ERROR BCS_IO_openAsInput(BCS_ioport* fd, const void * device);
00094 
00107 BCS_ERROR BCS_IO_openConfigured(BCS_ioport* fd, const void * device, UInt8 outputs);
00108 
00115 UInt8 BCS_IO_getStatus(BCS_ioport* filedescriptor);
00116 
00123 BCS_ERROR BCS_IO_setStatus(BCS_ioport* fd, UInt8 mask);
00124 
00132 BCS_ERROR BCS_IO_setPinstatus(BCS_ioport* fd, UInt8 pin, BCS_IO_state s);
00133 
00141 BCS_IO_state BCS_IO_getPinstatus(BCS_ioport* filedescriptor, UInt8 pin);
00142 
00152 BCS_IO_state BCS_IO_pinTriggered(BCS_ioport* filedescriptor, UInt8 pin);
00153 
00159 BCS_ERROR BCS_IO_openAnalog(BCS_ioport* fd);
00160 
00167 BCS_ERROR BCS_IO_getAnalogvalues(BCS_ioport* fd, BCS_IO_ad* ad);
00168 
00174 void BCS_IO_closePort(BCS_ioport* filedescriptor);
00175 
00176 
00177 #ifdef __cplusplus
00178 }
00179 #endif
00180 
00181 #endif /* BCS_IO_H_ */

Generated on Fri Feb 11 2011 18:25:46 for libHartwer by Doxygen 1.7.3
Content © 2009-2011 Elefant Racing Bayreuth & MLBA (About) – Design © 2010 Emzeat. All Rights reserved.