Functions | |
uint8_t | beginI2C (I2C_Handle i2cHandle, uint8_t *statusByte) |
Takes the I2C handle object to read the current sensor hub mode. More... | |
uint8_t | configMAX32664 (uint8_t outputFormat, uint8_t algoMode, uint8_t intThresh) |
Configures the MAX32664. More... | |
struct bioData | readSensorData (uint8_t *statusByte) |
Read sensor data from MAX32664 output FIFO. More... | |
struct bioData | readRawData (uint8_t *statusByte) |
Reads the raw sensor data, assuming only the raw sensor data is being output. More... | |
struct bioData | readAlgoData (uint8_t *statusByte) |
Reads the algorithm data, assuming only the algorithm data is being output. More... | |
struct bioData | readRawAndAlgoData (uint8_t *statusByte) |
Reads the raw+algorithm data if that this is the output format. More... | |
uint8_t | softwareResetMAX32664 (void) |
Does a software reset of the device. More... | |
uint8_t | softwareResetMAX30101 (void) |
Performs a reset of MAX30101 by setting the Reset Control bit to 1. More... | |
uint8_t | setOutputMode (uint8_t outputType) |
Sets the data output mode: raw, algorithm, raw+algorithm, etc. More... | |
uint8_t | setFifoThreshold (uint8_t intThresh) |
Sets output FIFO threshold (# data samples extracted before MRIO output interrupt generated) More... | |
uint8_t | numSamplesOutFifo (uint8_t *statusByte) |
Reads number of samples available in the output FIFO. More... | |
uint8_t | agcAlgoControl (uint8_t enable) |
Controls the AGC algorithm, enables or disables it. More... | |
uint8_t | max30101Control (uint8_t senSwitch) |
Controls the MAX30101 pulse oximeter, enables or disables it. More... | |
uint8_t | readMAX30101State (uint8_t *statusByte) |
Reads the MAX30101 pulse oximeter state. More... | |
uint8_t | maximFastAlgoControl (uint8_t mode) |
Controls the WHRM/Maxim Algorithm, disables it or sets the mode (mode 1 or mode 2) More... | |
uint8_t | readDeviceMode (uint8_t *statusByte) |
Reads the current MAX32664 operating mode. More... | |
uint8_t | setDeviceMode (uint8_t operatingMode, uint8_t *statusByte) |
Sets the operating mode for the MAX32664. More... | |
uint8_t | readSensorHubStatus (uint8_t *statusByte) |
Reads the current sensor hub status. More... | |
uint8_t | readAlgoSamples (uint8_t *statusByte) |
Reads the number of samples available in the output FIFO. More... | |
uint8_t | readAlgoRange (uint8_t *statusByte) |
Reads the percent of full scale ADC range that the AGC algorithm is using. More... | |
uint8_t | readAlgoStepSize (uint8_t *statusByte) |
Reads the step size towards the target for the AGC algorithm. More... | |
uint8_t | readAlgoSensitivity (uint8_t *statusByte) |
Reads the sensitivity of the AGC algorithm. More... | |
uint16_t | readAlgoSampleRate (uint8_t *statusByte) |
Reads the WHRM algorithm sample rate. More... | |
uint8_t | readMaximFastCoef (int32_t *coefArray) |
Reads the 3 Maxim Fast algorithm coefficients, which are 32-bit signed values * 100,000. More... | |
struct version | readSensorHubVersion (uint8_t *statusByte) |
Reads the current version of the sensor hub. More... | |
struct version | readAlgorithmVersion (uint8_t *statusByte) |
Reads the current version of the algorithm. More... | |
struct version | readBootloaderVersion (uint8_t *statusByte) |
Reads the current version of the bootloader. More... | |
uint8_t | getMcuType (uint8_t *statusByte) |
Reads the MCU type of biometric sensor hub (expect MAX32660/MAX32664) More... | |
uint16_t | readADCSampleRate (uint8_t *statusByte) |
Reads the ADC sample rate of the MAX30101 internal ADC. More... | |
uint16_t | readADCRange (uint8_t *statusByte) |
Reads the internal ADC range of the MAX30101. More... | |
uint16_t | readPulseWidth (uint8_t *statusByte) |
Reads the LED pulse width of the LEDs in the MAX30101. More... | |
uint8_t | readPulseAmp (uint8_t *ledArray, uint8_t *statusByte) |
Reads the LED pulse amplitude of the LEDs in the MAX30101. More... | |
uint8_t | readMAX30101Mode (uint8_t *statusByte) |
Reads the operating mode of the MAX30101 PO sensor. More... | |
struct sensorAttr | getAfeAttributesMAX30101 (uint8_t *statusByte) |
Gets the attributes for the MAX30101 sensor. More... | |
struct sensorAttr | getAfeAttributesAccelerometer (uint8_t *statusByte) |
Gets the attributes for the accelerometer. More... | |
uint8_t | getExtAccelMode (uint8_t *statusByte) |
Gets the current mode of the external accelerometer. More... | |
uint8_t | readRegisterMAX30101 (uint8_t regAddr, uint8_t *statusByte) |
Reads the value in specific register in the MAX30101. More... | |
uint8_t | writeRegisterMAX30101 (uint8_t regAddr, uint8_t regVal) |
Writes the given value to the given register address in the MAX30101. More... | |
uint8_t | I2CReadByte (uint8_t familyByte, uint8_t indexByte, uint8_t *statusByte) |
Does an I2C read transaction with the MAX32664 that will read a single byte. More... | |
uint8_t | I2CReadBytewithWriteByte (uint8_t familyByte, uint8_t indexByte, uint8_t dataByte, uint8_t *statusByte) |
Does an I2C read transaction with the MAX32664 that requires a single write byte, that will read a single byte. More... | |
uint8_t | I2CReadFillArray (uint8_t familyByte, uint8_t indexByte, uint8_t arraySize, uint8_t *arraytoFill) |
Does an I2C read transaction with the MAX32664 that will read an array of data back,. More... | |
uint16_t | I2CReadInt (uint8_t familyByte, uint8_t indexByte, uint8_t *statusByte) |
Performs a read transaction with no write bytes. More... | |
uint16_t | I2CReadIntWithWriteByte (uint8_t familyByte, uint8_t indexByte, uint8_t writeByte, uint8_t *statusByte) |
Performs a read transaction with a single write byte. More... | |
int32_t | I2CRead32BitValue (uint8_t familyByte, uint8_t indexByte, uint8_t dataByte, uint8_t *statusByte) |
Does an I2C read transaction with the MAX32664 that reads a single 32-bit variable. More... | |
uint8_t | I2CReadMultiple32BitValues (uint8_t familyByte, uint8_t indexByte, uint8_t dataByte, uint8_t numReads, int32_t *numArray) |
Does an I2C read transaction with the MAX32664 that reads multiple 32-bit variables. More... | |
uint8_t | I2CWriteByte (uint8_t familyByte, uint8_t indexByte, uint8_t dataByte) |
Does an I2C write transaction with the MAX32664 that will write a single byte. More... | |
uint8_t | I2CWrite2Bytes (uint8_t familyByte, uint8_t indexByte, uint8_t dataByte0, uint8_t dataByte1) |
Does an I2C write transaction with the MAX32664 that will write two bytes. More... | |
uint8_t | I2CenableWriteByte (uint8_t familyByte, uint8_t indexByte, uint8_t dataByte) |
Does an I2C write transaction with the MAX32664 that will write a single byte, with a longer delay between write and read. More... | |
Variables | |
I2C_Handle | gi2cHandle |
global I2C Handle object used in handle I2C issues | |
I2C_Transaction | gi2cTransaction |
global I2C Transaction object. Used for I2C transactions. Includes information like peripheral address, TX/RX size, etc. | |
uint8_t | userAlgoMode |
Selected User Mode (disabled, algorithm Mode 1 or Mode 2) | |
uint8_t | userOutputMode |
Selected User Output Mode (Raw data, algorithm data, raw + algo data) | |
uint8_t | sampleNum = 100 |
Number of samples averaged by the AGC algorithm. | |
Created on: Nov 12, 2020 Author: AveryW
This library is based heavily on the SparkFun Bio Sensor Hub Library: https://github.com/sparkfun/SparkFun_Bio_Sensor_Hub_Library which is an open source library produced by SparkFun Electronics. We would like to thank SparkFun and Elias Santistevan (main author) for writing this library and making it available to the public.
Below is the header from the SparkFun Bio Sensor Hub Library files, which gives a description of the library ours was based on:
"This is an Arduino Library written for the MAXIM 32664 Biometric Sensor Hub The MAX32664 Biometric Sensor Hub is in actuality a small Cortex M4 microcontroller with pre-loaded firmware and algorithms used to interact with the a number of MAXIM sensors; specifically the MAX30101 Pulse Oximter and Heart Rate Monitor and the KX122 Accelerometer. With that in mind, this library is built to communicate with a middle-person and so has a unique method of communication (family, index, and write bytes) that is more simplistic than writing and reading to registers, but includes a larger set of definable values.
SparkFun Electronics Date: June, 2019 Author: Elias Santistevan kk License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Feel like supporting our work? Buy a board from SparkFun!"
uint8_t agcAlgoControl | ( | uint8_t | enable | ) |
Controls the AGC algorithm, enables or disables it.
familyByte - ENABLE_ALGORITHM (0x52)
indexByte - ENABLE_AGC_ALGO (0x00)
writeByte0 - enable
writeByteN - none
enable | Algorithm enable (0x01)/disable (0x00) parameter |
uint8_t beginI2C | ( | I2C_Handle | i2cHandle, |
uint8_t * | statusByte | ||
) |
Takes the I2C handle object to read the current sensor hub mode.
familyByte N/A - multiple I2C transactions internally
indexByte N/A - multiple I2C transactions internally
writeByte0 N/A - multiple I2C transactions internally
writeByteN N/A - multiple I2C transactions internally
i2cHandle | I2C_Handle Object |
*statusByte | Pointer to status byte |
uint8_t configMAX32664 | ( | uint8_t | outputFormat, |
uint8_t | algoMode, | ||
uint8_t | intThresh | ||
) |
Configures the MAX32664.
Configures the output format of the data, set the algorithm mode, sets FIFO threshold, enables the Automatic Gain Control (AGC) algorithm, enables the MAX30101 pulse oximeter, enables the Wearable Heart Rate Monitor (WHRM)/MaximFast algorithm to the specified mode, reads number of samples averaged by the AGC algorithm.
familyByte N/A - multiple I2C transactions internally
indexByte N/A - multiple I2C transactions internally
writeByte0 N/A - multiple I2C transactions internally
writeByteN N/A - multiple I2C transactions internally
outputFormat | Format of the output data (raw MAX30101 ADC reading, algorithm data, OR raw reading + algorithm data) |
algoMode | Mode you want to set the MaximFast Algorithm to (mode 1 OR mode 2) |
intTresh | Number of samples taken before interrupt is generate |
struct sensorAttr getAfeAttributesAccelerometer | ( | uint8_t * | statusByte | ) |
Gets the attributes for the accelerometer.
Includes how many bytes to a word and number of registers
familyByte - READ_ATTRIBUTES_AFE (0x42)
indexByte - RETRIEVE_AFE_ACCELEROMETER (0x04)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
struct sensorAttr getAfeAttributesMAX30101 | ( | uint8_t * | statusByte | ) |
Gets the attributes for the MAX30101 sensor.
Includes how many bytes to a word and number of registers
familyByte - READ_ATTRIBUTES_AFE (0x42)
indexByte - RETRIEVE_AFE_MAX30101 (0x03)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t getExtAccelMode | ( | uint8_t * | statusByte | ) |
Gets the current mode of the external accelerometer.
Tells info about sensor hub accelerometer or host accelerometer
familyByte - READ_SENSOR_MODE (0x45)
indexByte - READ_ENABLE_ACCELEROMETER (0x04)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t getMcuType | ( | uint8_t * | statusByte | ) |
Reads the MCU type of biometric sensor hub (expect MAX32660/MAX32664)
familyByte - IDENTITY (0xFF)
indexByte - READ_MCU_TYPE (0x00)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t I2CenableWriteByte | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t | dataByte | ||
) |
Does an I2C write transaction with the MAX32664 that will write a single byte, with a longer delay between write and read.
familyByte - familyByte
indexByte - indexByte
writeByte0 - dataByte
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
dataByte | Write data byte for I2C transaction |
int32_t I2CRead32BitValue | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t | dataByte, | ||
uint8_t * | statusByte | ||
) |
Does an I2C read transaction with the MAX32664 that reads a single 32-bit variable.
familyByte - familyByte
indexByte - indexByte
writeByte0 - writeBtye0
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
dataByte | Desired write byte 0 for I2C transaction |
*statusByte | Pointer to status byte |
uint8_t I2CReadByte | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t * | statusByte | ||
) |
Does an I2C read transaction with the MAX32664 that will read a single byte.
familyByte - familyByte
indexByte - indexByte
writeByte0 - none
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
*statusByte | Pointer to status byte of transaction |
uint8_t I2CReadBytewithWriteByte | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t | dataByte, | ||
uint8_t * | statusByte | ||
) |
Does an I2C read transaction with the MAX32664 that requires a single write byte, that will read a single byte.
familyByte - familyByte
indexByte - indexByte
writeByte0 - dataByte
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
dataByte | Write data byte for I2C transaction |
*statusByte | Pointer to the status byte |
uint8_t I2CReadFillArray | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t | arraySize, | ||
uint8_t * | arraytoFill | ||
) |
Does an I2C read transaction with the MAX32664 that will read an array of data back,.
familyByte - familyByte
indexByte - indexByte
writeByte0 - none
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
arraySize | Size of expected read array |
*arraytoFill | Pointer to array to fill |
uint16_t I2CReadInt | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t * | statusByte | ||
) |
Performs a read transaction with no write bytes.
Will perform an I2C transaction and translate result into a 16 bit value
familyByte - familyByte
indexByte - indexByte
writeByte0 - none
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
*statusByte | Pointer to status byte |
uint16_t I2CReadIntWithWriteByte | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t | writeByte, | ||
uint8_t * | statusByte | ||
) |
Performs a read transaction with a single write byte.
Will perform an I2C transaction and translate result into a 16 bit value
familyByte - familyByte
indexByte - indexByte
writeByte0 - writeByte
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
writeByte | Desired write byte for I2C transaction |
*statusByte | Pointer to status byte |
uint8_t I2CReadMultiple32BitValues | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t | dataByte, | ||
uint8_t | numReads, | ||
int32_t * | numArray | ||
) |
Does an I2C read transaction with the MAX32664 that reads multiple 32-bit variables.
familyByte - familyByte
indexByte - indexByte
writeByte0 - dataByte
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
dataByte | Desired write byte 0 for I2C transaction |
numReads | Number of 32-bit signed values you want to read |
*numArray | Pointer to array to be filled. Must be a 32-bit array and be the same size as numReads |
uint8_t I2CWrite2Bytes | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t | dataByte0, | ||
uint8_t | dataByte1 | ||
) |
Does an I2C write transaction with the MAX32664 that will write two bytes.
familyByte - familyByte
indexByte - indexByte
writeByte0 - dataByte0
writeByteN - dataByte1
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
dataByte0 | Write data byte 0 for I2C transaction |
dataByte1 | Write data byte 1 for I2C transaction |
uint8_t I2CWriteByte | ( | uint8_t | familyByte, |
uint8_t | indexByte, | ||
uint8_t | dataByte | ||
) |
Does an I2C write transaction with the MAX32664 that will write a single byte.
familyByte - familyByte
indexByte - indexByte
writeByte0 - dataByte
writeByteN - none
familyByte | Desired family byte for I2C transaction |
indexByte | Desired index byte for I2C transaction |
dataByte | Write data byte for I2C transaction |
uint8_t max30101Control | ( | uint8_t | senSwitch | ) |
Controls the MAX30101 pulse oximeter, enables or disables it.
familyByte - ENABLE_SENSOR (0x44)
indexByte - ENABLE_MAX30101 (0x03)
writeByte0 - senSwitch
writeByteN - none
senSwitch | MAX30101 enable (0x01)/disable(0x00) parameter |
uint8_t maximFastAlgoControl | ( | uint8_t | mode | ) |
Controls the WHRM/Maxim Algorithm, disables it or sets the mode (mode 1 or mode 2)
familyByte - ENABLE_ALGORITHM (0x52)
indexByte - ENABLE_WHRM_ALGO (0x02)
writeByte0 - mode
writeByteN - none
mode | Disables (0x00) or sets algorithm mode to mode 1 (0x01) or mode 2 (0x02) |
uint8_t numSamplesOutFifo | ( | uint8_t * | statusByte | ) |
Reads number of samples available in the output FIFO.
familyByte - READ_DATA_OUTPUT (0x12)
indexByte - NUM_SAMPLES (0x00)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint16_t readADCRange | ( | uint8_t * | statusByte | ) |
Reads the internal ADC range of the MAX30101.
MAX30101 Register - CONFIGURATION_REGISTER (0x0A)
*statusByte | Pointer to status byte |
uint16_t readADCSampleRate | ( | uint8_t * | statusByte | ) |
Reads the ADC sample rate of the MAX30101 internal ADC.
MAX30101 Register - CONFIGURATION_REGISTER (0x0A)
*statusByte | Pointer to status byte |
struct bioData readAlgoData | ( | uint8_t * | statusByte | ) |
Reads the algorithm data, assuming only the algorithm data is being output.
familyByte - READ_DATA_OUTPUT (0x12)
indexByte - READ_DATA (0x01)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t readAlgoRange | ( | uint8_t * | statusByte | ) |
Reads the percent of full scale ADC range that the AGC algorithm is using.
familyByte - READ_ALGORITHM_CONFIG (0x51)
indexByte - READ_AGC_PERCENTAGE (0x00)
writeByte0 - READ_AGC_PERC_ID (0x00)
writeByteN - none
*statusByte | Pointer to status byte |
struct version readAlgorithmVersion | ( | uint8_t * | statusByte | ) |
Reads the current version of the algorithm.
Format of version is major.minor.revision
familyByte - IDENTITY (0xFF)
indexByte - READ_ALGO_VERS (0x07)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint16_t readAlgoSampleRate | ( | uint8_t * | statusByte | ) |
Reads the WHRM algorithm sample rate.
familyByte - READ_ALGORITHM_CONFIG (0x51)
indexByte - READ_MAX_FAST_RATE (0x02)
writeByte0 - READ_MAX_FAST_RATE_ID (0x00)
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t readAlgoSamples | ( | uint8_t * | statusByte | ) |
Reads the number of samples available in the output FIFO.
familyByte - READ_ALGORITHM_CONFIG (0x51)
indexByte - READ_AGC_NUM_SAMPLES (0x00)
writeByte0 - READ_AGC_NUM_SAMPLES_ID (0x03)
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t readAlgoSensitivity | ( | uint8_t * | statusByte | ) |
Reads the sensitivity of the AGC algorithm.
familyByte - READ_ALGORITHM_CONFIG (0x51)
indexByte - READ_AGC_SENSITIVITY (0x00)
writeByte0 - READ_AGC_SENSITIVITY_ID (0x02)
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t readAlgoStepSize | ( | uint8_t * | statusByte | ) |
Reads the step size towards the target for the AGC algorithm.
familyByte - READ_ALGORITHM_CONFIG (0x51)
indexByte - READ_AGC_STEP_SIZE (0x00)
writeByte0 - READ_AGC_STEP_SIZE_ID (0x01)
writeByteN - none
*statusByte | Pointer to status byte |
struct version readBootloaderVersion | ( | uint8_t * | statusByte | ) |
Reads the current version of the bootloader.
Format of version is major.minor.revision
familyByte - BOOTLOADER_INFO (0x81)
indexByte - BOOTLOADER_VERS (0x00)
writeByte0 - none
writeByteN - none
*statusByte | pointer to status byte |
uint8_t readDeviceMode | ( | uint8_t * | statusByte | ) |
Reads the current MAX32664 operating mode.
0x00: Application operating mode 0x02: Reset 0x08: Bootloader operating mode
familyByte - READ_DEVICE_MODE (0x02)
indexByte - 0x00
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t readMAX30101Mode | ( | uint8_t * | statusByte | ) |
Reads the operating mode of the MAX30101 PO sensor.
Results indicate which LEDs are being used
MAX30101 Register - MODE_REGISTER (0x09)
*statusByte | Pointer to status byte |
uint8_t readMAX30101State | ( | uint8_t * | statusByte | ) |
Reads the MAX30101 pulse oximeter state.
familyByte - READ_SENSOR_MODE (0x45)
indexByte - READ_ENABLE_MAX30101 (0x03)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t readMaximFastCoef | ( | int32_t * | coefArray | ) |
Reads the 3 Maxim Fast algorithm coefficients, which are 32-bit signed values * 100,000.
familyByte - READ_ALGORITHM_CONFIG (0x51)
indexByte - READ_MAX_FAST_COEF (0x02)
writeByte0 - READ_MAX_FAST_COEF_ID (0x0B)
*coefArray | Pointer to array to fill with the 3 coefficients. Needs to be 32-bit |
uint8_t readPulseAmp | ( | uint8_t * | ledArray, |
uint8_t * | statusByte | ||
) |
Reads the LED pulse amplitude of the LEDs in the MAX30101.
MAX30101 Register - LEDX_REGISTER (0x0C <-> 0x0F)
*ledArray | Array that the LED data is put into |
*statusByte | Pointer to status byte |
uint16_t readPulseWidth | ( | uint8_t * | statusByte | ) |
Reads the LED pulse width of the LEDs in the MAX30101.
MAX30101 Register - CONFIGURATION_REGISTER (0x0A)
*statusByte | Pointer to status byte |
struct bioData readRawAndAlgoData | ( | uint8_t * | statusByte | ) |
Reads the raw+algorithm data if that this is the output format.
familyByte - READ_DATA_OUTPUT (0x12)
indexByte - READ_DATA (0x01)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
struct bioData readRawData | ( | uint8_t * | statusByte | ) |
Reads the raw sensor data, assuming only the raw sensor data is being output.
familyByte - READ_DATA_OUTPUT (0x12)
indexByte - READ_DATA (0x01)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t readRegisterMAX30101 | ( | uint8_t | regAddr, |
uint8_t * | statusByte | ||
) |
Reads the value in specific register in the MAX30101.
Passed parameter selects the specific register
familyByte - READ_REGISTER (0x41)
indexByte - READ_MAX30101 (0x03)
writeByte0 - regAddr
writeByteN - none
regAddr | Register address in the MAX30101 |
*statusByte | Pointer to statusByte |
struct bioData readSensorData | ( | uint8_t * | statusByte | ) |
Read sensor data from MAX32664 output FIFO.
Data contents/format depend on previous settings (typically set by configMAX32664)
familyByte N/A - multiple I2C transactions internally
indexByte N/A - multiple I2C transactions internally
writeByte0 N/A - multiple I2C transactions internally
writeByteN N/A - multiple I2C transactions internally
*statusByte | Pointer to status byte |
uint8_t readSensorHubStatus | ( | uint8_t * | statusByte | ) |
Reads the current sensor hub status.
Includes sensor communication status, current FIFO threshold, FIFO input overflow, FIFO output overflow, and host accelerometer underflow info
familyByte - HUB_STATUS (0x00)
indexByte - 0x00
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
struct version readSensorHubVersion | ( | uint8_t * | statusByte | ) |
Reads the current version of the sensor hub.
Format of version is major.minor.revision
familyByte - IDENTITY (0xFF)
indexByte - READ_SENSOR_HUB_VERS (0x03)
writeByte0 - none
writeByteN - none
*statusByte | Pointer to status byte |
uint8_t setDeviceMode | ( | uint8_t | operatingMode, |
uint8_t * | statusByte | ||
) |
Sets the operating mode for the MAX32664.
Alternative method to setting operating mode (to external pin method)
familyByte - SET_DEVICE_MODE (0x01)
indexByte - 0x00
writeByte0 - none
writeByteN - none
operatingMode | Desired operating mode to be written out. 0x00: exit bootloader, enter application mode, 0x02: reset, 0x08: enter bootloader |
*statusByte | Pointer to the status byte |
uint8_t setFifoThreshold | ( | uint8_t | intThresh | ) |
Sets output FIFO threshold (# data samples extracted before MRIO output interrupt generated)
familyByte - OUTPUT_MODE (0x10)
indexByte - WRITE_SET_THRESHOLD (0x01)
writeByte0 - intThresh (0x01 to 0xff)
writeByteN - none
intThresh | FIFO interrupt threshold (0x01 to 0xff) |
uint8_t setOutputMode | ( | uint8_t | outputType | ) |
Sets the data output mode: raw, algorithm, raw+algorithm, etc.
familyByte - OUTPUT_MODE (0x10)
indexByte - SET_FORMAT (0x00)
writeByte0 - outputType (0x00 to 0x07)
writeByteN - none
outputType | Output type of the data. See OUTPUT_MODE_WRITE_BYTE for valid options |
uint8_t softwareResetMAX30101 | ( | void | ) |
Performs a reset of MAX30101 by setting the Reset Control bit to 1.
MAX30101 Register - MODE_REGISTER (0x09)
none |
uint8_t softwareResetMAX32664 | ( | void | ) |
Does a software reset of the device.
Sets the device mode of the MAX32664 to reset mode, then to application mode. Finally waits 1s before turning to ensure that initialization is complete
familyByte N/A - multiple I2C transactions internally
indexByte N/A - multiple I2C transactions internally
writeByte0 N/A - multiple I2C transactions internally
writeByteN N/A - multiple I2C transactions internally
none |
uint8_t writeRegisterMAX30101 | ( | uint8_t | regAddr, |
uint8_t | regVal | ||
) |
Writes the given value to the given register address in the MAX30101.
Returns status of I2C transaction
familyByte - WRITE_REGISTER (0x40)
indexByte - WRITE_MAX30101 (0x03)
writeByte0 - regAddr
writeByteN - regVal
regAddr | Address of the register we want to write to in the MAX30101 |
regVal | Value you want to write into that register |