Maxim Integrated MAX30205 C, C++ source code driver software: MAX30205 is accurate to +-0.1°C over the range of 37.0°C to 39.0°C. One-shot, shutdown modes are available for reduced power usage. Thermostat thresholds allow for temperature hysteresis or for alarm settings. The MAX30205 is available in a compact 3x3 mm, 8-pin TDFN package. Operating supply voltage range is 2.7V to 3.3V. Typical applications are for clinical digital thermometers, thermostats with hysteresis, and temperature alarms.
Dependents: MAX30205_Human_Body_Temperature_Sensor
Revision 6:b5ab5204d944, committed 2017-04-11
- Comitter:
- j3
- Date:
- Tue Apr 11 22:07:28 2017 +0000
- Parent:
- 5:24039cc86fc1
- Child:
- 7:f005887f21e7
- Commit message:
- added suffix to enum, union, struct declaration names (_e, _u, _s) for clarity
Changed in this revision
| MAX30205.cpp | Show annotated file Show diff for this revision Revisions of this file |
| MAX30205.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MAX30205.cpp Fri Apr 07 21:48:48 2017 +0000
+++ b/MAX30205.cpp Tue Apr 11 22:07:28 2017 +0000
@@ -66,7 +66,7 @@
//******************************************************************************
-int32_t MAX30205::readConfiguration(Config &config)
+int32_t MAX30205::readConfiguration(Configuration_u &config)
{
uint16_t data;
@@ -82,7 +82,7 @@
//******************************************************************************
-int32_t MAX30205::writeConfiguration(const Config config)
+int32_t MAX30205::writeConfiguration(const Configuration_u config)
{
uint16_t local_config = (0x00FF & config.all);
@@ -141,7 +141,7 @@
//******************************************************************************
-int32_t MAX30205::writeRegister(Registers reg, uint16_t value)
+int32_t MAX30205::writeRegister(Registers_e reg, uint16_t value)
{
int32_t result;
@@ -156,7 +156,7 @@
//******************************************************************************
-int32_t MAX30205::readRegister(Registers reg, uint16_t &value)
+int32_t MAX30205::readRegister(Registers_e reg, uint16_t &value)
{
int32_t result;
--- a/MAX30205.h Fri Apr 07 21:48:48 2017 +0000
+++ b/MAX30205.h Tue Apr 11 22:07:28 2017 +0000
@@ -63,7 +63,7 @@
public:
/// MAX30205 Register Addresses
- enum Registers
+ enum Registers_e
{
Temperature = 0x00,
Configuration = 0x01,
@@ -72,10 +72,10 @@
};
///MAX30205 Configuration register bitfields
- union Config
+ union Configuration_u
{
uint8_t all;
- struct BitField
+ struct BitField_s
{
uint8_t shutdown : 1;
uint8_t comp_int : 1;
@@ -117,14 +117,14 @@
* @param config - Reference to Configuration type
* @return 0 on success, non-zero on failure
*/
- int32_t readConfiguration(Config &config);
+ int32_t readConfiguration(Configuration_u &config);
/**
* @brief Write the configuration register with given configuration
* @param config - Configuration to write
* @return 0 on success, non-zero on failure
*/
- int32_t writeConfiguration(const Config config);
+ int32_t writeConfiguration(const Configuration_u config);
/**
* @brief Read the THYST value from a specified device instance
@@ -176,7 +176,7 @@
* @param value - Value to write
* @return 0 on success, non-zero on failure
*/
- int32_t writeRegister(Registers reg, uint16_t value);
+ int32_t writeRegister(Registers_e reg, uint16_t value);
/**
* @brief Read register of device at slave address
@@ -184,7 +184,7 @@
* @param[out] value - Read data on success
* @return 0 on success, non-zero on failure
*/
- int32_t readRegister(Registers reg, uint16_t &value);
+ int32_t readRegister(Registers_e reg, uint16_t &value);
private:
/// I2C object