00001 /********************************************************************* 00002 * 00003 * Software License Agreement (BSD License) 00004 * 00005 * Copyright (c) 2012, Robert Bosch LLC. 00006 * All rights reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * * Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * * Redistributions in binary form must reproduce the above 00015 * copyright notice, this list of conditions and the following 00016 * disclaimer in the documentation and/or other materials provided 00017 * with the distribution. 00018 * * Neither the name of the Robert Bosch nor the names of its 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; 00029 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00030 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00031 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00032 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00033 * POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 *********************************************************************/ 00036 00037 /********************************************************************* 00038 * 00039 * Disclaimer 00040 * 00041 * This source code is not officially released or supported by Bosch Sensortec. 00042 * Please contact the listed authors with bugs or other modifications. 00043 * If you would like the official Bosch Sensortec drivers, please contact: 00044 * contact@bosch-sensortec.com 00045 * 00046 *********************************************************************/ 00047 00048 //\Author Joshua Vasquez and Philip Roan, Robert Bosch LLC 00049 00050 #ifndef BMG160_PARAMETERS_H_ 00051 #define BMG160_PARAMETERS_H_ 00052 00053 #include <ros/console.h> 00054 00055 #include <bosch_drivers_parameters.hpp> 00056 #include <bosch_drivers_hardware_interface.hpp> 00057 00058 00059 using namespace bosch_drivers_common; 00060 00061 class BMG160Parameters: public Parameters 00062 { 00063 public: 00064 00069 enum range 00070 { 00074 RANGE_2000 = 0x00, 00078 RANGE_1000 = 0x01, 00082 RANGE_500 = 0x02, 00086 RANGE_250 = 0x03, 00090 RANGE_125 = 0x04 00091 }; 00092 00096 enum bandwidth 00097 { 00098 BW_32HZ = 0x07, 00099 BW_64HZ = 0x06, 00100 BW_12HZ = 0x05, 00101 BW_23HZ = 0x04, 00102 BW_47HZ = 0x03, 00103 BW_116HZ = 0x02, 00104 BW_230HZ = 0x01, 00105 BW_UNFILTERED = 0x00, 00106 }; 00107 00111 BMG160Parameters(); 00112 00116 ~BMG160Parameters(); 00117 00124 bool setProtocol( interface_protocol protocol ); 00125 00132 bool setFrequency( int frequency ); 00133 00140 bool setPin( uint8_t pin ); 00141 00150 void setSlaveAddressBit( bool high_or_low ); 00151 00167 bool setSpiMode( uint8_t mode ); 00168 00180 bool setByteOrder( uint8_t value ); 00181 00189 void setRange( range new_range ); 00190 00200 void setFilter( bool input ); 00201 00209 void setBandwidth( bandwidth bw ); 00210 00219 double getSensitivity(); 00220 00226 interface_protocol getProtocol(); 00227 00232 int getFrequency(); 00233 00243 int* getFlags(); 00244 00252 int getPin(); 00253 00257 bool getSlaveAddressBit(); 00258 00262 range range_; 00263 00268 bool gyro_is_filtered_; 00269 00273 bandwidth bw_reg_; 00274 00278 double sensitivity_; 00279 00283 bool slave_address_bit_; 00284 }; 00285 00286 #endif // BMG160_PARAMETERS_H_