Arun Raj / Mbed OS MAXREFDES101_SOURCE

Dependencies:   max32630fthr Adafruit_FeatherOLED USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MaximSensor.cpp Source File

MaximSensor.cpp

00001 /*******************************************************************************
00002 * Copyright (C) Maxim Integrated Products, Inc., All rights Reserved.
00003 * 
00004 * This software is protected by copyright laws of the United States and
00005 * of foreign countries. This material may also be protected by patent laws
00006 * and technology transfer regulations of the United States and of foreign
00007 * countries. This software is furnished under a license agreement and/or a
00008 * nondisclosure agreement and may only be used or reproduced in accordance
00009 * with the terms of those agreements. Dissemination of this information to
00010 * any party or parties not specified in the license agreement and/or
00011 * nondisclosure agreement is expressly prohibited.
00012 *
00013 * The above copyright notice and this permission notice shall be included
00014 * in all copies or substantial portions of the Software.
00015 *
00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00017 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00018 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00019 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
00020 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00021 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
00022 * OTHER DEALINGS IN THE SOFTWARE.
00023 *
00024 * Except as contained in this notice, the name of Maxim Integrated
00025 * Products, Inc. shall not be used except as stated in the Maxim Integrated
00026 * Products, Inc. Branding Policy.
00027 *
00028 * The mere transfer of this software does not imply any licenses
00029 * of trade secrets, proprietary technology, copyrights, patents,
00030 * trademarks, maskwork rights, or any other form of intellectual
00031 * property whatsoever. Maxim Integrated Products, Inc. retains all
00032 * ownership rights.
00033 *******************************************************************************
00034 */
00035 
00036 #include "MaximSensor.h"
00037 #include "Peripherals.h"
00038 
00039     /* PUBLIC FUNCTION DECLARATIONS */
00040     /**
00041     * @brief    Reads from register.
00042     * @details  Reads specific Maxim Sensor register via SPI bus.
00043     *
00044     * @param[in]    reg Beginning address of a register to be read.
00045     * @param[out]   data Buffer space to save result value.
00046     * @param[in]    len Number of consecutive bytes to be read.
00047     *
00048     * @returns  0 on success, negative error code on failure.
00049     */
00050 int MaximSensor::readRegister(uint8_t reg, uint8_t *data, int len){
00051     pr_err("Empty function is called");
00052     return -1;
00053 }
00054 
00055     /**
00056     * @brief    Writes data to Maxim Sensor register.
00057     * @details  Writes data to specific Maxim Sensor register via SPI bus.
00058     *
00059     * @param[in]    reg Address of a register to be wrote.
00060     * @param[in]    data Data to write on register.
00061     *
00062     * @returns  0 on success, negative error code on failure.
00063     */
00064 int MaximSensor::writeRegister(uint8_t reg, const uint8_t data){
00065     pr_err("Empty function is called");
00066     return -1;
00067 }
00068 
00069     /**
00070     * @brief    Get Maxim Sensor part and revision info.
00071     * @details  Reads Maxim Sensor part and revision info from device.
00072     *
00073     * @param[in]    reg Beginning address of a register to be read.
00074     * @param[out]   data Buffer space to save result value.
00075     * @param[in]    len Number of consecutive bytes to be read.
00076     *
00077     * @returns  0 on success, negative error code on failure.
00078     */
00079 int MaximSensor::get_part_info(uint8_t *part_id,    uint8_t *rev_id){
00080     pr_err("Empty function is called");
00081     return -1;
00082 }
00083 
00084     /**
00085     * @brief    Enables Maxim Sensor.
00086     * @details  Enable IRQ, enable LEDs, enable AGC
00087     *
00088     * @param[in]    enable Any value to enable, 0 to disable.
00089     *
00090     * @returns  0 on success, negative error code on failure.
00091     */
00092 int MaximSensor::sensor_enable(int enable){
00093     pr_err("Empty function is called");
00094     return -1;
00095 }
00096 
00097     /**
00098     * @brief    Enables AGC.
00099     * @details  Enable Maxim Sensor automatic gain controller.
00100     *   AGC automatically adjusts sampling rates and LED currents to save energy.
00101     *
00102     * @param[in]    agc_enable Any value to enable, 0 to disable.
00103     *
00104     * @returns  0 on success, negative error code on failure.
00105     */
00106 int MaximSensor::agc_enable(int agc_enable){
00107     pr_err("Empty function is called");
00108     return -1;
00109 }
00110 
00111     /**
00112     * @brief    Get sensor part name.
00113     *
00114     * @returns  Sensor part name string.
00115     */
00116 const char *MaximSensor::get_sensor_part_name(){
00117     pr_err("Empty function is called");
00118     return "";
00119 }
00120 #if 0
00121 int dump_registers(addr_val_pair *reg_values) {
00122     pr_err("Empty function is called");
00123     return 0;
00124 }
00125 #endif
00126     /**
00127     * @brief    Get sensor name.
00128     *
00129     * @returns  Sensor name string.
00130     */
00131 const char *MaximSensor::get_sensor_name(){
00132     pr_err("Empty function is called");
00133     return "";
00134 }
00135 
00136 
00137 /**
00138 * @brief    Get sensor ID.
00139 *
00140 * @returns  Sensor ID number.
00141 */
00142 unsigned char MaximSensor::get_sensor_id() {
00143 
00144     // Base class returns 255
00145     return( 255 );
00146 
00147 }
00148 
00149 
00150 /**
00151 * @brief    Get sensor name.
00152 *
00153 * @returns  Sensor name string.
00154 */
00155 const char *MaximSensor::get_sensor_algo_ver(){
00156 pr_err("Empty function is called");
00157 return "";
00158 }
00159 
00160 int MaximSensor::MS_Max30001_ECG_InitStart(uint8_t En_ecg, uint8_t Openp, uint8_t Openn,
00161                          uint8_t Pol, uint8_t Calp_sel, uint8_t Caln_sel,
00162                                      uint8_t E_fit, uint8_t Rate, uint8_t Gain,
00163                                      uint8_t Dhpf, uint8_t Dlpf){
00164     pr_err("Empty function is called");
00165     return -1;
00166 }
00167 
00168 int MaximSensor::MS_Max30001_ECG_Stop(){
00169     pr_err("Empty function is called");
00170     return -1;
00171 }
00172 
00173 int MaximSensor::MS_Max30001_RtoR_InitStart(uint8_t En_rtor, uint8_t Wndw, uint8_t Gain,
00174                                             uint8_t Pavg, uint8_t Ptsf, uint8_t Hoff,
00175                                             uint8_t Ravg, uint8_t Rhsf, uint8_t Clr_rrint){
00176     pr_err("Empty function is called");
00177     return -1;
00178 }
00179 
00180 int MaximSensor::MS_Max30001_RtoR_Stop(){
00181     pr_err("Empty function is called");
00182     return -1;
00183 }
00184 
00185 // Max30001 Interrupt Assignment Function
00186 int MaximSensor::MS_max30001_INT_assignment(uint8_t en_enint_loc,     uint8_t en_eovf_loc,  uint8_t en_fstint_loc,
00187                                             uint8_t en_dcloffint_loc, uint8_t en_bint_loc,  uint8_t en_bovf_loc,
00188                                             uint8_t en_bover_loc,     uint8_t en_bundr_loc, uint8_t en_bcgmon_loc,
00189                                             uint8_t en_pint_loc,      uint8_t en_povf_loc,  uint8_t en_pedge_loc,
00190                                             uint8_t en_lonint_loc,    uint8_t en_rrint_loc, uint8_t en_samp_loc,
00191                                             uint8_t intb_Type,        uint8_t int2b_Type){
00192     pr_err("Empty function is called");
00193     return -1;
00194 }
00195 
00196 int  MaximSensor::MS_max30001readRegister(uint8_t addr, uint32_t *return_data){
00197     pr_err("Empty function is called");
00198     return -1;
00199 }
00200 
00201 int  MaximSensor::MS_max30001writeRegister(uint8_t addr, uint32_t data){
00202     pr_err("Empty function is called");
00203     return -1;
00204 }
00205 
00206 int MaximSensor::MS_max30001sync(){
00207     pr_err("Empty MS_max30001sync is called");
00208     return -1;
00209 }