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.
Dependencies: USBDevice max32630fthr
Fork of MAXREFDES220# by
MaximSensor.cpp
00001 #include "MaximSensor.h" 00002 #include "Peripherals.h" 00003 00004 /* PUBLIC FUNCTION DECLARATIONS */ 00005 /** 00006 * @brief Reads from register. 00007 * @details Reads specific Maxim Sensor register via SPI bus. 00008 * 00009 * @param[in] reg Beginning address of a register to be read. 00010 * @param[out] data Buffer space to save result value. 00011 * @param[in] len Number of consecutive bytes to be read. 00012 * 00013 * @returns 0 on success, negative error code on failure. 00014 */ 00015 int MaximSensor::readRegister(uint8_t reg, uint8_t *data, int len){ 00016 pr_err("Empty function is called"); 00017 return -1; 00018 } 00019 00020 /** 00021 * @brief Writes data to Maxim Sensor register. 00022 * @details Writes data to specific Maxim Sensor register via SPI bus. 00023 * 00024 * @param[in] reg Address of a register to be wrote. 00025 * @param[in] data Data to write on register. 00026 * 00027 * @returns 0 on success, negative error code on failure. 00028 */ 00029 int MaximSensor::writeRegister(uint8_t reg, const uint8_t data){ 00030 pr_err("Empty function is called"); 00031 return -1; 00032 } 00033 00034 /** 00035 * @brief Get Maxim Sensor part and revision info. 00036 * @details Reads Maxim Sensor part and revision info from device. 00037 * 00038 * @param[in] reg Beginning address of a register to be read. 00039 * @param[out] data Buffer space to save result value. 00040 * @param[in] len Number of consecutive bytes to be read. 00041 * 00042 * @returns 0 on success, negative error code on failure. 00043 */ 00044 int MaximSensor::get_part_info(uint8_t *part_id, uint8_t *rev_id){ 00045 pr_err("Empty function is called"); 00046 return -1; 00047 } 00048 00049 /** 00050 * @brief Enables Maxim Sensor. 00051 * @details Enable IRQ, enable LEDs, enable AGC 00052 * 00053 * @param[in] enable Any value to enable, 0 to disable. 00054 * 00055 * @returns 0 on success, negative error code on failure. 00056 */ 00057 int MaximSensor::sensor_enable(int enable){ 00058 pr_err("Empty function is called"); 00059 return -1; 00060 } 00061 00062 /** 00063 * @brief Enables AGC. 00064 * @details Enable Maxim Sensor automatic gain controller. 00065 * AGC automatically adjusts sampling rates and LED currents to save energy. 00066 * 00067 * @param[in] agc_enable Any value to enable, 0 to disable. 00068 * 00069 * @returns 0 on success, negative error code on failure. 00070 */ 00071 int MaximSensor::agc_enable(int agc_enable){ 00072 pr_err("Empty function is called"); 00073 return -1; 00074 } 00075 00076 /** 00077 * @brief Get sensor part name. 00078 * 00079 * @returns Sensor part name string. 00080 */ 00081 const char *MaximSensor::get_sensor_part_name(){ 00082 pr_err("Empty function is called"); 00083 return ""; 00084 } 00085 #if 0 00086 int dump_registers(addr_val_pair *reg_values) { 00087 pr_err("Empty function is called"); 00088 return 0; 00089 } 00090 #endif 00091 /** 00092 * @brief Get sensor name. 00093 * 00094 * @returns Sensor name string. 00095 */ 00096 const char *MaximSensor::get_sensor_name(){ 00097 pr_err("Empty function is called"); 00098 return ""; 00099 } 00100 00101 int MaximSensor::MS_Max30001_ECG_InitStart(uint8_t En_ecg, uint8_t Openp, uint8_t Openn, 00102 uint8_t Pol, uint8_t Calp_sel, uint8_t Caln_sel, 00103 uint8_t E_fit, uint8_t Rate, uint8_t Gain, 00104 uint8_t Dhpf, uint8_t Dlpf){ 00105 pr_err("Empty function is called"); 00106 return -1; 00107 } 00108 00109 int MaximSensor::MS_Max30001_ECG_Stop(){ 00110 pr_err("Empty function is called"); 00111 return -1; 00112 } 00113 00114 int MaximSensor::MS_Max30001_RtoR_InitStart(uint8_t En_rtor, uint8_t Wndw, uint8_t Gain, 00115 uint8_t Pavg, uint8_t Ptsf, uint8_t Hoff, 00116 uint8_t Ravg, uint8_t Rhsf, uint8_t Clr_rrint){ 00117 pr_err("Empty function is called"); 00118 return -1; 00119 } 00120 00121 int MaximSensor::MS_Max30001_RtoR_Stop(){ 00122 pr_err("Empty function is called"); 00123 return -1; 00124 } 00125 00126 // Max30001 Interrupt Assignment Function 00127 int MaximSensor::MS_max30001_INT_assignment(uint8_t en_enint_loc, uint8_t en_eovf_loc, uint8_t en_fstint_loc, 00128 uint8_t en_dcloffint_loc, uint8_t en_bint_loc, uint8_t en_bovf_loc, 00129 uint8_t en_bover_loc, uint8_t en_bundr_loc, uint8_t en_bcgmon_loc, 00130 uint8_t en_pint_loc, uint8_t en_povf_loc, uint8_t en_pedge_loc, 00131 uint8_t en_lonint_loc, uint8_t en_rrint_loc, uint8_t en_samp_loc, 00132 uint8_t intb_Type, uint8_t int2b_Type){ 00133 pr_err("Empty function is called"); 00134 return -1; 00135 } 00136 00137 int MaximSensor::MS_max30001readRegister(uint8_t addr, uint32_t *return_data){ 00138 pr_err("Empty function is called"); 00139 return -1; 00140 } 00141 00142 int MaximSensor::MS_max30001writeRegister(uint8_t addr, uint32_t data){ 00143 pr_err("Empty function is called"); 00144 return -1; 00145 } 00146 00147 int MaximSensor::MS_max30001sync(){ 00148 pr_err("Empty MS_max30001sync is called"); 00149 return -1; 00150 }
Generated on Mon Jul 18 2022 23:37:28 by
