initial commit, reads dev id

Files at this revision

API Documentation at this revision

Comitter:
phonemacro
Date:
Fri Sep 02 22:15:27 2022 +0000
Parent:
5:1f7b8cb07e26
Child:
7:ffa35f46725e
Commit message:
updated MAX8614X::read_fifo_data to not enable, disable clock when reading the FIFO (this is only needed for Rev A of the chip)

Changed in this revision

MAX8614X.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MAX8614X.cpp	Fri Aug 17 05:35:58 2018 +0000
+++ b/MAX8614X.cpp	Fri Sep 02 22:15:27 2022 +0000
@@ -1,5 +1,4 @@
 /*******************************************************************************
-* Author: Ihsan Mert Ozcelik, Ihsan.Ozcelik@maximintegrated.com
 * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
@@ -164,13 +163,14 @@
         {0xFF, 0x00}
     };
 
-
+    // only need the following for Rev A of MAXM86141/0
+    #ifdef MAX86141_REV_A
     ret = writeBlock(test_clk_enable, ARRAY_SIZE(test_clk_enable));
     if (ret < 0) {
         pr_err("writeBlock failed. ret: %d", ret);
         return ret;
     }
-
+    #endif
     fifo_data[0] = MAX8614X_FIFO_DATA_REG;
     ret = readRegister(MAX8614X_FIFO_DATA_REG, fifo_data, num_bytes);
     if (ret < 0) {
@@ -178,11 +178,14 @@
         return ret;
     }
 
+    // only need the following for Rev A of MAXM86141/0
+    #ifdef MAX86141_REV_A
     ret = writeBlock(test_clk_disable, ARRAY_SIZE(test_clk_disable));
     if (ret < 0) {
         pr_err("writeBlock failed. ret: %d", ret);
         return ret;
     }
+    #endif
 
     return ret;
 }