NIBO Library 2.11
|
00001 /* BSD-License: 00002 00003 Copyright (c) 2007 by Nils Springob, nicai-systems, Germany 00004 00005 All rights reserved. 00006 00007 Redistribution and use in source and binary forms, with or without modification, 00008 are permitted provided that the following conditions are met: 00009 00010 * Redistributions of source code must retain the above copyright notice, 00011 this list of conditions and the following disclaimer. 00012 * Redistributions in binary form must reproduce the above copyright notice, 00013 this list of conditions and the following disclaimer in the documentation 00014 and/or other materials provided with the distribution. 00015 * Neither the name nicai-systems nor the names of its contributors may be 00016 used to endorse or promote products derived from this software without 00017 specific prior written permission. 00018 00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00020 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00021 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00022 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00023 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00024 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00025 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00027 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00028 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00029 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 00031 */ 00032 00039 #ifndef NIBOCC_FLOOR_HPP_ 00040 #define NIBOCC_FLOOR_HPP_ 00041 #if defined(NIBOCC_USE_FLOOR) || defined (DOXYGEN) 00042 00043 #include <stdint.h> 00044 #include "nibo/floor.h" 00045 00046 namespace nibocc { 00047 00051 class Floor 00052 { 00053 public: 00054 00055 enum { 00056 LINE_LEFT = ::LINE_LEFT, 00057 LINE_RIGHT = ::LINE_RIGHT, 00058 FLOOR_LEFT = ::FLOOR_LEFT, 00059 FLOOR_RIGHT = ::FLOOR_RIGHT 00060 }; 00061 00062 00066 static void enable_ir() {floor_enable_ir();} 00067 00071 static void disable_ir() {floor_disable_ir();} 00072 00076 static const int SENS_DALAY_US = FLOOR_SENS_DALAY_US; 00077 00081 static uint16_t getAbsolute(uint8_t index) {return ::floor_absolute[index];} 00082 00086 static uint16_t getRelative(uint8_t index) {return ::floor_relative[index];} 00087 00091 static void init() {::floor_init();} 00092 00096 static void update() {::floor_update();} 00097 00101 static void calibrateBlack() {::floor_calibrateBlack();} 00102 00106 static void calibrateWhite() {::floor_calibrateWhite();} 00107 00111 static void readPersistent() {::floor_readPersistent();} 00112 00116 static void writePersistent() {::floor_writePersistent();} 00117 00118 }; 00119 00120 } // namespace 00121 #endif // NIBO_USE_FLOOR 00122 #endif // NIBO_FLOOR_H_