initial commit, reads dev id

Committer:
phonemacro
Date:
Fri Sep 02 22:34:45 2022 +0000
Revision:
7:ffa35f46725e
Parent:
5:1f7b8cb07e26
remove clock enable/disable in MAX8614X::read_fifo_data (that was only needed for Rev A)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
phonemacro 5:1f7b8cb07e26 1 /*******************************************************************************
phonemacro 5:1f7b8cb07e26 2 * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved.
phonemacro 5:1f7b8cb07e26 3 *
phonemacro 5:1f7b8cb07e26 4 * Permission is hereby granted, free of charge, to any person obtaining a
phonemacro 5:1f7b8cb07e26 5 * copy of this software and associated documentation files (the "Software"),
phonemacro 5:1f7b8cb07e26 6 * to deal in the Software without restriction, including without limitation
phonemacro 5:1f7b8cb07e26 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
phonemacro 5:1f7b8cb07e26 8 * and/or sell copies of the Software, and to permit persons to whom the
phonemacro 5:1f7b8cb07e26 9 * Software is furnished to do so, subject to the following conditions:
phonemacro 5:1f7b8cb07e26 10 *
phonemacro 5:1f7b8cb07e26 11 * The above copyright notice and this permission notice shall be included
phonemacro 5:1f7b8cb07e26 12 * in all copies or substantial portions of the Software.
phonemacro 5:1f7b8cb07e26 13 *
phonemacro 5:1f7b8cb07e26 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
phonemacro 5:1f7b8cb07e26 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
phonemacro 5:1f7b8cb07e26 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
phonemacro 5:1f7b8cb07e26 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
phonemacro 5:1f7b8cb07e26 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
phonemacro 5:1f7b8cb07e26 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
phonemacro 5:1f7b8cb07e26 20 * OTHER DEALINGS IN THE SOFTWARE.
phonemacro 5:1f7b8cb07e26 21 *
phonemacro 5:1f7b8cb07e26 22 * Except as contained in this notice, the name of Maxim Integrated
phonemacro 5:1f7b8cb07e26 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
phonemacro 5:1f7b8cb07e26 24 * Products, Inc. Branding Policy.
phonemacro 5:1f7b8cb07e26 25 *
phonemacro 5:1f7b8cb07e26 26 * The mere transfer of this software does not imply any licenses
phonemacro 5:1f7b8cb07e26 27 * of trade secrets, proprietary technology, copyrights, patents,
phonemacro 5:1f7b8cb07e26 28 * trademarks, maskwork rights, or any other form of intellectual
phonemacro 5:1f7b8cb07e26 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
phonemacro 5:1f7b8cb07e26 30 * ownership rights.
phonemacro 5:1f7b8cb07e26 31 *******************************************************************************
phonemacro 5:1f7b8cb07e26 32 */
phonemacro 5:1f7b8cb07e26 33
phonemacro 5:1f7b8cb07e26 34 #include "mbed.h"
phonemacro 5:1f7b8cb07e26 35 #include "MaximSensor.h"
phonemacro 5:1f7b8cb07e26 36 #include <string.h>
phonemacro 5:1f7b8cb07e26 37
phonemacro 5:1f7b8cb07e26 38 #define pr_err(fmt, args...) if(1) printf(fmt " (%s:%d)\n", ##args, __func__, __LINE__)
phonemacro 5:1f7b8cb07e26 39 #define pr_debug(fmt, args...) if(0) printf(fmt " (%s:%d)\n", ##args, __func__, __LINE__)
phonemacro 5:1f7b8cb07e26 40 #define pr_info(fmt, args...) if(0) printf(fmt " (%s:%d)\n", ##args, __func__, __LINE__)
phonemacro 5:1f7b8cb07e26 41
phonemacro 5:1f7b8cb07e26 42 int MaximSensor::agc_enable(int agc_enable)
phonemacro 5:1f7b8cb07e26 43 {
phonemacro 5:1f7b8cb07e26 44 pr_err("function %s is not implemented", __func__);
phonemacro 5:1f7b8cb07e26 45
phonemacro 5:1f7b8cb07e26 46 return 0;
phonemacro 5:1f7b8cb07e26 47 }
phonemacro 5:1f7b8cb07e26 48
phonemacro 5:1f7b8cb07e26 49 int MaximSensor::dump_registers()
phonemacro 5:1f7b8cb07e26 50 {
phonemacro 5:1f7b8cb07e26 51 int ret = 0;
phonemacro 5:1f7b8cb07e26 52 uint8_t reg_addr = 0;
phonemacro 5:1f7b8cb07e26 53 uint8_t val;
phonemacro 5:1f7b8cb07e26 54
phonemacro 5:1f7b8cb07e26 55 do {
phonemacro 5:1f7b8cb07e26 56 ret |= readRegister(reg_addr, &val, 1);
phonemacro 5:1f7b8cb07e26 57 printf("{%02X,%02X},", reg_addr, val);
phonemacro 5:1f7b8cb07e26 58 reg_addr++;
phonemacro 5:1f7b8cb07e26 59 } while (reg_addr > 0x00);
phonemacro 5:1f7b8cb07e26 60
phonemacro 5:1f7b8cb07e26 61 return ret;
phonemacro 5:1f7b8cb07e26 62 }
phonemacro 5:1f7b8cb07e26 63