vlx lib
range_upscaling_driver.h@0:bc9f26b5dadf, 2015-02-08 (annotated)
- Committer:
- vijaynvr
- Date:
- Sun Feb 08 14:26:51 2015 +0000
- Revision:
- 0:bc9f26b5dadf
working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vijaynvr | 0:bc9f26b5dadf | 1 | /******************************************************************************* |
vijaynvr | 0:bc9f26b5dadf | 2 | ################################################################################ |
vijaynvr | 0:bc9f26b5dadf | 3 | # (C) STMicroelectronics 2014 |
vijaynvr | 0:bc9f26b5dadf | 4 | # |
vijaynvr | 0:bc9f26b5dadf | 5 | # This program is free software; you can redistribute it and/or modify it under |
vijaynvr | 0:bc9f26b5dadf | 6 | # the terms of the GNU General Public License version 2 and only version 2 as |
vijaynvr | 0:bc9f26b5dadf | 7 | # published by the Free Software Foundation. |
vijaynvr | 0:bc9f26b5dadf | 8 | # |
vijaynvr | 0:bc9f26b5dadf | 9 | # This program is distributed in the hope that it will be useful, but WITHOUT |
vijaynvr | 0:bc9f26b5dadf | 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
vijaynvr | 0:bc9f26b5dadf | 11 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
vijaynvr | 0:bc9f26b5dadf | 12 | # details. |
vijaynvr | 0:bc9f26b5dadf | 13 | # |
vijaynvr | 0:bc9f26b5dadf | 14 | # You should have received a copy of the GNU General Public License along with |
vijaynvr | 0:bc9f26b5dadf | 15 | # this program; if not, write to the Free Software Foundation, Inc., |
vijaynvr | 0:bc9f26b5dadf | 16 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
vijaynvr | 0:bc9f26b5dadf | 17 | # |
vijaynvr | 0:bc9f26b5dadf | 18 | #------------------------------------------------------------------------------ |
vijaynvr | 0:bc9f26b5dadf | 19 | # Imaging Division |
vijaynvr | 0:bc9f26b5dadf | 20 | ################################################################################ |
vijaynvr | 0:bc9f26b5dadf | 21 | ********************************************************************************/ |
vijaynvr | 0:bc9f26b5dadf | 22 | |
vijaynvr | 0:bc9f26b5dadf | 23 | /*! |
vijaynvr | 0:bc9f26b5dadf | 24 | *\file range_upscaling_driver.h |
vijaynvr | 0:bc9f26b5dadf | 25 | *\brief Application-level functions used for configuration and operation during upscaled ranging. |
vijaynvr | 0:bc9f26b5dadf | 26 | */ |
vijaynvr | 0:bc9f26b5dadf | 27 | |
vijaynvr | 0:bc9f26b5dadf | 28 | |
vijaynvr | 0:bc9f26b5dadf | 29 | #ifndef EXT_RANGING_DRIVER |
vijaynvr | 0:bc9f26b5dadf | 30 | #define EXT_RANGING_DRIVER |
vijaynvr | 0:bc9f26b5dadf | 31 | |
vijaynvr | 0:bc9f26b5dadf | 32 | //----------------------------------------------------------------------------- |
vijaynvr | 0:bc9f26b5dadf | 33 | // module imports |
vijaynvr | 0:bc9f26b5dadf | 34 | //----------------------------------------------------------------------------- |
vijaynvr | 0:bc9f26b5dadf | 35 | |
vijaynvr | 0:bc9f26b5dadf | 36 | // ST libraries |
vijaynvr | 0:bc9f26b5dadf | 37 | #include "definitions.h" |
vijaynvr | 0:bc9f26b5dadf | 38 | |
vijaynvr | 0:bc9f26b5dadf | 39 | //----------------------------------------------------------------------------- |
vijaynvr | 0:bc9f26b5dadf | 40 | // type definitions |
vijaynvr | 0:bc9f26b5dadf | 41 | //----------------------------------------------------------------------------- |
vijaynvr | 0:bc9f26b5dadf | 42 | typedef enum { Scale1X = 1, Scale2X = 2, Scale3X = 3 } ExtRangeScaler; |
vijaynvr | 0:bc9f26b5dadf | 43 | |
vijaynvr | 0:bc9f26b5dadf | 44 | //----------------------------------------------------------------------------- |
vijaynvr | 0:bc9f26b5dadf | 45 | // method definitions |
vijaynvr | 0:bc9f26b5dadf | 46 | //----------------------------------------------------------------------------- |
vijaynvr | 0:bc9f26b5dadf | 47 | |
vijaynvr | 0:bc9f26b5dadf | 48 | /*! |
vijaynvr | 0:bc9f26b5dadf | 49 | *\brief Device setup for Upscaled Ranging operations. |
vijaynvr | 0:bc9f26b5dadf | 50 | * |
vijaynvr | 0:bc9f26b5dadf | 51 | * 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. |
vijaynvr | 0:bc9f26b5dadf | 52 | *\param[in] device_base_address |
vijaynvr | 0:bc9f26b5dadf | 53 | *\retval sensor_error |
vijaynvr | 0:bc9f26b5dadf | 54 | */ |
vijaynvr | 0:bc9f26b5dadf | 55 | sensor_error er_set_static_config(uint8_t device_base_address); |
vijaynvr | 0:bc9f26b5dadf | 56 | |
vijaynvr | 0:bc9f26b5dadf | 57 | /*! |
vijaynvr | 0:bc9f26b5dadf | 58 | *\brief Set the Part-to-Part Range Offset |
vijaynvr | 0:bc9f26b5dadf | 59 | * |
vijaynvr | 0:bc9f26b5dadf | 60 | * Set part-to-part range offset in the sysrange_part_to_part_range_offset register. |
vijaynvr | 0:bc9f26b5dadf | 61 | * |
vijaynvr | 0:bc9f26b5dadf | 62 | *\param[in] device_base_address |
vijaynvr | 0:bc9f26b5dadf | 63 | *\param[in] part_to_part_range_offset |
vijaynvr | 0:bc9f26b5dadf | 64 | *\retval sensor_error |
vijaynvr | 0:bc9f26b5dadf | 65 | */ |
vijaynvr | 0:bc9f26b5dadf | 66 | sensor_error er_set_part2Part_range_offset(uint8_t device_base_address, uint8_t part_to_part_range_offset); |
vijaynvr | 0:bc9f26b5dadf | 67 | |
vijaynvr | 0:bc9f26b5dadf | 68 | /*! |
vijaynvr | 0:bc9f26b5dadf | 69 | *\brief Report the part-to-part range offset. |
vijaynvr | 0:bc9f26b5dadf | 70 | * |
vijaynvr | 0:bc9f26b5dadf | 71 | * Report the part-to-part range offset from sysrange_part_to_part_range_offset register. |
vijaynvr | 0:bc9f26b5dadf | 72 | * |
vijaynvr | 0:bc9f26b5dadf | 73 | *\param[in] device_base_address |
vijaynvr | 0:bc9f26b5dadf | 74 | *\retval Byte-wide, integer |
vijaynvr | 0:bc9f26b5dadf | 75 | */ |
vijaynvr | 0:bc9f26b5dadf | 76 | uint8_t er_range_get_part2Part_range_offset(uint8_t device_base_address); |
vijaynvr | 0:bc9f26b5dadf | 77 | |
vijaynvr | 0:bc9f26b5dadf | 78 | /*! |
vijaynvr | 0:bc9f26b5dadf | 79 | *\brief Report result from last completed upscaled ranging operation. |
vijaynvr | 0:bc9f26b5dadf | 80 | *\param[in] device_base_address |
vijaynvr | 0:bc9f26b5dadf | 81 | *\retval 32-bit integer |
vijaynvr | 0:bc9f26b5dadf | 82 | */ |
vijaynvr | 0:bc9f26b5dadf | 83 | uint32_t er_get_result(uint8_t device_base_address); |
vijaynvr | 0:bc9f26b5dadf | 84 | |
vijaynvr | 0:bc9f26b5dadf | 85 | /*! |
vijaynvr | 0:bc9f26b5dadf | 86 | *\brief Set the extended range scaling to either 2X or 3X scaling. An increased scaler |
vijaynvr | 0:bc9f26b5dadf | 87 | *\ will result in a greater measurement distance but more coarse resolution. |
vijaynvr | 0:bc9f26b5dadf | 88 | *\param[in] scaler |
vijaynvr | 0:bc9f26b5dadf | 89 | *\param[in] device_base_address |
vijaynvr | 0:bc9f26b5dadf | 90 | *\retval sensor_error |
vijaynvr | 0:bc9f26b5dadf | 91 | */ |
vijaynvr | 0:bc9f26b5dadf | 92 | sensor_error er_set_scaler(uint8_t scaler, uint8_t device_base_address); |
vijaynvr | 0:bc9f26b5dadf | 93 | |
vijaynvr | 0:bc9f26b5dadf | 94 | /*! |
vijaynvr | 0:bc9f26b5dadf | 95 | *\brief Reports the current scaler setting. |
vijaynvr | 0:bc9f26b5dadf | 96 | *\param[in] device_base_address |
vijaynvr | 0:bc9f26b5dadf | 97 | *\retval Byte-wide, integer |
vijaynvr | 0:bc9f26b5dadf | 98 | */ |
vijaynvr | 0:bc9f26b5dadf | 99 | uint8_t er_get_scaler(uint8_t device_base_address); |
vijaynvr | 0:bc9f26b5dadf | 100 | |
vijaynvr | 0:bc9f26b5dadf | 101 | |
vijaynvr | 0:bc9f26b5dadf | 102 | /** |
vijaynvr | 0:bc9f26b5dadf | 103 | * @brief Function to return the Maximum range reported by the |
vijaynvr | 0:bc9f26b5dadf | 104 | * sensor. |
vijaynvr | 0:bc9f26b5dadf | 105 | *\param[in] device_base_address |
vijaynvr | 0:bc9f26b5dadf | 106 | *\retval 32-bit integer |
vijaynvr | 0:bc9f26b5dadf | 107 | */ |
vijaynvr | 0:bc9f26b5dadf | 108 | uint32_t er_get_upper_limit(uint8_t device_base_address); |
vijaynvr | 0:bc9f26b5dadf | 109 | |
vijaynvr | 0:bc9f26b5dadf | 110 | /** |
vijaynvr | 0:bc9f26b5dadf | 111 | * @brief Function to return the Minimum range reported by the |
vijaynvr | 0:bc9f26b5dadf | 112 | * sensor. |
vijaynvr | 0:bc9f26b5dadf | 113 | *\param[in] device_base_address |
vijaynvr | 0:bc9f26b5dadf | 114 | *\retval 32-bit integer |
vijaynvr | 0:bc9f26b5dadf | 115 | */ |
vijaynvr | 0:bc9f26b5dadf | 116 | uint32_t er_get_lower_limit(uint8_t device_base_address); |
vijaynvr | 0:bc9f26b5dadf | 117 | |
vijaynvr | 0:bc9f26b5dadf | 118 | #endif |
vijaynvr | 0:bc9f26b5dadf | 119 | |
vijaynvr | 0:bc9f26b5dadf | 120 | |
vijaynvr | 0:bc9f26b5dadf | 121 |