Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
range_upscaling_driver.h
00001 /******************************************************************************* 00002 ################################################################################ 00003 # (C) STMicroelectronics 2014 00004 # 00005 # This program is free software; you can redistribute it and/or modify it under 00006 # the terms of the GNU General Public License version 2 and only version 2 as 00007 # published by the Free Software Foundation. 00008 # 00009 # This program is distributed in the hope that it will be useful, but WITHOUT 00010 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00012 # details. 00013 # 00014 # You should have received a copy of the GNU General Public License along with 00015 # this program; if not, write to the Free Software Foundation, Inc., 00016 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 # 00018 #------------------------------------------------------------------------------ 00019 # Imaging Division 00020 ################################################################################ 00021 ********************************************************************************/ 00022 00023 /*! 00024 *\file range_upscaling_driver.h 00025 *\brief Application-level functions used for configuration and operation during upscaled ranging. 00026 */ 00027 00028 00029 #ifndef EXT_RANGING_DRIVER 00030 #define EXT_RANGING_DRIVER 00031 00032 //----------------------------------------------------------------------------- 00033 // module imports 00034 //----------------------------------------------------------------------------- 00035 00036 // ST libraries 00037 #include "definitions.h" 00038 00039 //----------------------------------------------------------------------------- 00040 // type definitions 00041 //----------------------------------------------------------------------------- 00042 typedef enum { Scale1X = 1, Scale2X = 2, Scale3X = 3 } ExtRangeScaler; 00043 00044 //----------------------------------------------------------------------------- 00045 // method definitions 00046 //----------------------------------------------------------------------------- 00047 00048 /*! 00049 *\brief Device setup for Upscaled Ranging operations. 00050 * 00051 * Device setup for extended-range operations. To apply these settings the operation bit (bit 0) in the SYSRANGE__START & SYSALS__START Registers must be cleared. 00052 *\param[in] device_base_address 00053 *\retval sensor_error 00054 */ 00055 sensor_error er_set_static_config(uint8_t device_base_address); 00056 00057 /*! 00058 *\brief Set the Part-to-Part Range Offset 00059 * 00060 * Set part-to-part range offset in the sysrange_part_to_part_range_offset register. 00061 * 00062 *\param[in] device_base_address 00063 *\param[in] part_to_part_range_offset 00064 *\retval sensor_error 00065 */ 00066 sensor_error er_set_part2Part_range_offset(uint8_t device_base_address, uint8_t part_to_part_range_offset); 00067 00068 /*! 00069 *\brief Report the part-to-part range offset. 00070 * 00071 * Report the part-to-part range offset from sysrange_part_to_part_range_offset register. 00072 * 00073 *\param[in] device_base_address 00074 *\retval Byte-wide, integer 00075 */ 00076 uint8_t er_range_get_part2Part_range_offset(uint8_t device_base_address); 00077 00078 /*! 00079 *\brief Report result from last completed upscaled ranging operation. 00080 *\param[in] device_base_address 00081 *\retval 32-bit integer 00082 */ 00083 uint32_t er_get_result(uint8_t device_base_address); 00084 00085 /*! 00086 *\brief Set the extended range scaling to either 2X or 3X scaling. An increased scaler 00087 *\ will result in a greater measurement distance but more coarse resolution. 00088 *\param[in] scaler 00089 *\param[in] device_base_address 00090 *\retval sensor_error 00091 */ 00092 sensor_error er_set_scaler(uint8_t scaler, uint8_t device_base_address); 00093 00094 /*! 00095 *\brief Reports the current scaler setting. 00096 *\param[in] device_base_address 00097 *\retval Byte-wide, integer 00098 */ 00099 uint8_t er_get_scaler(uint8_t device_base_address); 00100 00101 00102 /** 00103 * @brief Function to return the Maximum range reported by the 00104 * sensor. 00105 *\param[in] device_base_address 00106 *\retval 32-bit integer 00107 */ 00108 uint32_t er_get_upper_limit(uint8_t device_base_address); 00109 00110 /** 00111 * @brief Function to return the Minimum range reported by the 00112 * sensor. 00113 *\param[in] device_base_address 00114 *\retval 32-bit integer 00115 */ 00116 uint32_t er_get_lower_limit(uint8_t device_base_address); 00117 00118 #endif 00119 00120 00121
Generated on Tue Jul 12 2022 22:19:50 by
