Initial release. Mbed library for VL53L1CB

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers vl53l1_nvm.h Source File

vl53l1_nvm.h

00001 
00002 /*******************************************************************************
00003  * Copyright (c) 2020, STMicroelectronics - All Rights Reserved
00004 
00005  This file is part of VL53L1 Core and is dual licensed,
00006  either 'STMicroelectronics
00007  Proprietary license'
00008  or 'BSD 3-clause "New" or "Revised" License' , at your option.
00009 
00010 ********************************************************************************
00011 
00012  'STMicroelectronics Proprietary license'
00013 
00014 ********************************************************************************
00015 
00016  License terms: STMicroelectronics Proprietary in accordance with licensing
00017  terms at www.st.com/sla0081
00018 
00019  STMicroelectronics confidential
00020  Reproduction and Communication of this document is strictly prohibited unless
00021  specifically authorized in writing by STMicroelectronics.
00022 
00023 
00024 ********************************************************************************
00025 
00026  Alternatively, VL53L1 Core may be distributed under the terms of
00027  'BSD 3-clause "New" or "Revised" License', in which case the following
00028  provisions apply instead of the ones
00029  mentioned above :
00030 
00031 ********************************************************************************
00032 
00033  License terms: BSD 3-clause "New" or "Revised" License.
00034 
00035  Redistribution and use in source and binary forms, with or without
00036  modification, are permitted provided that the following conditions are met:
00037 
00038  1. Redistributions of source code must retain the above copyright notice, this
00039  list of conditions and the following disclaimer.
00040 
00041  2. Redistributions in binary form must reproduce the above copyright notice,
00042  this list of conditions and the following disclaimer in the documentation
00043  and/or other materials provided with the distribution.
00044 
00045  3. Neither the name of the copyright holder nor the names of its contributors
00046  may be used to endorse or promote products derived from this software
00047  without specific prior written permission.
00048 
00049  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00050  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00051  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00052  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00053  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00054  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00055  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00056  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00057  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00058  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00059 
00060 
00061 ********************************************************************************
00062 
00063 */
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 #ifndef _VL53L1_NVM_H_
00072 #define _VL53L1_NVM_H_
00073 
00074 #include "vl53l1_ll_def.h"
00075 #include "vl53l1_platform.h"
00076 
00077 #ifdef __cplusplus
00078 extern "C"
00079 {
00080 #endif
00081 
00082 #define VL53L1_NVM_POWER_UP_DELAY_US             50
00083 #define VL53L1_NVM_READ_TRIGGER_DELAY_US          5
00084 
00085 
00086 
00087 VL53L1_Error VL53L1_nvm_enable(
00088     VL53L1_DEV     Dev,
00089     uint16_t       nvm_ctrl_pulse_width,
00090     int32_t        nvm_power_up_delay_us);
00091 
00092 
00093 
00094 
00095 VL53L1_Error VL53L1_nvm_read(
00096     VL53L1_DEV     Dev,
00097     uint8_t        start_address,
00098     uint8_t        count,
00099     uint8_t       *pdata);
00100 
00101 
00102 
00103 
00104 VL53L1_Error VL53L1_nvm_disable(
00105     VL53L1_DEV     Dev);
00106 
00107 
00108 
00109 
00110 VL53L1_Error VL53L1_nvm_format_decode(
00111     uint16_t                   buf_size,
00112     uint8_t                   *pbuffer,
00113     VL53L1_decoded_nvm_data_t *pdata);
00114 
00115 
00116 
00117 
00118 VL53L1_Error VL53L1_nvm_decode_optical_centre(
00119     uint16_t                             buf_size,
00120     uint8_t                             *pbuffer,
00121     VL53L1_optical_centre_t             *pdata);
00122 
00123 
00124 
00125 
00126 VL53L1_Error VL53L1_nvm_decode_cal_peak_rate_map(
00127     uint16_t                             buf_size,
00128     uint8_t                             *pbuffer,
00129     VL53L1_cal_peak_rate_map_t          *pdata);
00130 
00131 
00132 
00133 
00134 VL53L1_Error VL53L1_nvm_decode_additional_offset_cal_data(
00135     uint16_t                             buf_size,
00136     uint8_t                             *pbuffer,
00137     VL53L1_additional_offset_cal_data_t *pdata);
00138 
00139 
00140 
00141 
00142 VL53L1_Error VL53L1_nvm_decode_fmt_range_results_data(
00143     uint16_t                             buf_size,
00144     uint8_t                             *pbuffer,
00145     VL53L1_decoded_nvm_fmt_range_data_t *pdata);
00146 
00147 
00148 
00149 
00150 VL53L1_Error VL53L1_nvm_decode_fmt_info(
00151     uint16_t                       buf_size,
00152     uint8_t                       *pbuffer,
00153     VL53L1_decoded_nvm_fmt_info_t *pdata);
00154 
00155 
00156 
00157 
00158 VL53L1_Error VL53L1_nvm_decode_ews_info(
00159     uint16_t                       buf_size,
00160     uint8_t                       *pbuffer,
00161     VL53L1_decoded_nvm_ews_info_t *pdata);
00162 
00163 
00164 
00165 
00166 void VL53L1_nvm_format_encode(
00167     VL53L1_decoded_nvm_data_t *pnvm_info,
00168     uint8_t                   *pnvm_data);
00169 
00170 
00171 
00172 
00173 VL53L1_Error VL53L1_read_nvm_raw_data(
00174     VL53L1_DEV     Dev,
00175     uint8_t        start_address,
00176     uint8_t        count,
00177     uint8_t       *pnvm_raw_data);
00178 
00179 
00180 
00181 
00182 VL53L1_Error VL53L1_read_nvm(
00183     VL53L1_DEV                 Dev,
00184     uint8_t                    nvm_format,
00185     VL53L1_decoded_nvm_data_t *pnvm_info);
00186 
00187 
00188 
00189 
00190 VL53L1_Error VL53L1_read_nvm_optical_centre(
00191     VL53L1_DEV                           Dev,
00192     VL53L1_optical_centre_t             *pcentre);
00193 
00194 
00195 
00196 
00197 VL53L1_Error VL53L1_read_nvm_cal_peak_rate_map(
00198     VL53L1_DEV                           Dev,
00199     VL53L1_cal_peak_rate_map_t          *pcal_data);
00200 
00201 
00202 
00203 
00204 VL53L1_Error VL53L1_read_nvm_additional_offset_cal_data(
00205     VL53L1_DEV                           Dev,
00206     VL53L1_additional_offset_cal_data_t *pcal_data);
00207 
00208 
00209 
00210 
00211 VL53L1_Error VL53L1_read_nvm_fmt_range_results_data(
00212     VL53L1_DEV                           Dev,
00213     uint16_t                             range_results_select,
00214     VL53L1_decoded_nvm_fmt_range_data_t *prange_data);
00215 
00216 
00217 #ifdef __cplusplus
00218 }
00219 #endif
00220 
00221 #endif
00222 
00223