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.
Fork of mbed-os-test by
MAX30205 Class Reference
Driver for the MAX30205 on the HSP Platform. More...
#include <MAX30205.h>
Public Types | |
| enum | Registers |
MAX30205 Register Addresses. More... | |
Public Member Functions | |
| MAX30205 (PinName sda, PinName scl, int slaveAddress) | |
| Constructor using I2C PinNames. | |
| MAX30205 (I2C *i2c, int slaveAddress) | |
| Constructor using pointer to I2C object. | |
| ~MAX30205 (void) | |
| Destructor. | |
| int | reg_write (char reg, char value) |
| Write a register into device at slave address. | |
| int | reg_read (char reg, char *value) |
| Detect the second instance of the MAX30205. | |
| int | reg_write16 (char reg, uint16_t value) |
| Write a 16-bit value into device at slave address. | |
| int | reg_read16 (char reg, uint16_t *value) |
| Read a 16-bit value from a device at a slave address. | |
| int | readTemperature (uint16_t *value) |
| Read the temperature from the device into a 16 bit value. | |
| int | reg_THYST_Read (uint16_t *value) |
| Read the THYST value from a specified device instance. | |
| int | reg_THYST_Write (uint16_t value) |
| Write the THYST to a device instance. | |
| float | toCelsius (unsigned int rawTemp) |
| Convert a raw temperature value into a float. | |
| float | toFahrenheit (float temperatureC) |
| Convert the passed in temperature in C to Fahrenheit. | |
Detailed Description
Driver for the MAX30205 on the HSP Platform.
#include <stdio.h> #include "mbed.h" #include "xxx.h" I2C i2c(I2C_SDA, I2C_SCL); xxx xxx(&i2c); int main(void) { printf("Initialized xxx\n"); while(1) { if (xxx.init() != 0) { printf("Error communicating with xxx\n"); } else { printf("Initialized xxx\n"); break; } wait(1); } while(1) { printf(""); wait(1); } }
Definition at line 69 of file MAX30205.h.
Member Enumeration Documentation
| enum Registers |
MAX30205 Register Addresses.
Definition at line 72 of file MAX30205.h.
Constructor & Destructor Documentation
| MAX30205 | ( | PinName | sda, |
| PinName | scl, | ||
| int | slaveAddress | ||
| ) |
Constructor using I2C PinNames.
- Parameters:
-
sda Pinname for sda scl Pinname for scl
Definition at line 36 of file MAX30205.cpp.
| MAX30205 | ( | I2C * | i2c, |
| int | slaveAddress | ||
| ) |
Constructor using pointer to I2C object.
- Parameters:
-
*i2c Pointer to I2C object
Definition at line 44 of file MAX30205.cpp.
| ~MAX30205 | ( | void | ) |
Destructor.
Definition at line 51 of file MAX30205.cpp.
Member Function Documentation
| int readTemperature | ( | uint16_t * | value ) |
Read the temperature from the device into a 16 bit value.
- Parameters:
-
value pointer to a 16 bit short
Definition at line 103 of file MAX30205.cpp.
| int reg_read | ( | char | reg, |
| char * | value | ||
| ) |
Detect the second instance of the MAX30205.
- Parameters:
-
reg register address value 8-bit value to writes
Definition at line 78 of file MAX30205.cpp.
| int reg_read16 | ( | char | reg, |
| uint16_t * | value | ||
| ) |
Read a 16-bit value from a device at a slave address.
- Parameters:
-
reg register address value pointer to store read value
Definition at line 90 of file MAX30205.cpp.
| int reg_THYST_Read | ( | uint16_t * | value ) |
Read the THYST value from a specified device instance.
- Parameters:
-
value 16-bit pointer of value to read into
Definition at line 127 of file MAX30205.cpp.
| int reg_THYST_Write | ( | uint16_t | value ) |
Write the THYST to a device instance.
- Parameters:
-
value 16-bit value to write
Definition at line 132 of file MAX30205.cpp.
| int reg_write | ( | char | reg, |
| char | value | ||
| ) |
Write a register into device at slave address.
- Parameters:
-
reg register address value value to write
Definition at line 58 of file MAX30205.cpp.
| int reg_write16 | ( | char | reg, |
| uint16_t | value | ||
| ) |
Write a 16-bit value into device at slave address.
- Parameters:
-
reg register address value 16-bit value to write
Definition at line 67 of file MAX30205.cpp.
| float toCelsius | ( | unsigned int | rawTemp ) |
Convert a raw temperature value into a float.
- Parameters:
-
rawTemp raw temperature value to convert
- Returns:
- the convereted value in degrees C
Definition at line 112 of file MAX30205.cpp.
| float toFahrenheit | ( | float | temperatureC ) |
Convert the passed in temperature in C to Fahrenheit.
- Parameters:
-
temperatureC Temperature in C to convert
- Returns:
- Returns the converted Fahrenheit value
Definition at line 122 of file MAX30205.cpp.
Generated on Wed Jul 13 2022 17:00:35 by
1.7.2
