Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
max32664c.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Daniel Kampert
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_MAX32664C_H_
14#define ZEPHYR_INCLUDE_DRIVERS_SENSOR_MAX32664C_H_
15
22
23#include <zephyr/device.h>
24
29#define MAX32664C_MOTION_TIME(ms) ((uint8_t)((ms * 25UL) / 1000))
30
35#define MAX32664C_MOTION_THRESHOLD(mg) ((uint8_t)((mg * 16UL) / 1000))
36
37/* MAX32664C specific channels */
52
53/* MAX32664C specific attributes */
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
83 /* For hardware testing purposes, the user may choose to start the sensor hub to collect
84 * raw PPG samples. In this case, the host configures the sensor hub to work in Raw Data
85 * mode (no algorithm) by enabling the accelerometer and the AFE.
86 */
88 /* Automatic Exposure Control (AEC) is Maxim’s gain control algorithm that is superior to
89 * AGC. The AEC algorithm optimally maintains the best SNR range and power optimization. The
90 * targeted SNR range is maintained regardless of skin color or ambient temperature within
91 * the limits of the LED currents configurations; The AEC dynamically manages the
92 * appropriate register settings for sampling rate, LED current, pulse width and integration
93 * time.
94 */
97 /* In this mode, the wearable algorithm suite (SpO2 and WHRM) is enabled and the R value,
98 * SpO2, SpO2 confidence level, heart rate, heart rate confidence level, RR value, and
99 * activity class are reported. Furthermore, automatic gain control (AGC) is enabled.
100 * Because AGC is a subset of AEC functionality, to enable AGC, AEC still needs to be
101 * enabled. However, automatic calculation of target PD should be turned off, and the
102 * desired level of AGC target PD current is set by the user. The user may change the
103 * algorithm to the desired configuration mode. If signal quality is poor, the user may need
104 * to adjust the AGC settings to maintain optimal performance. If signal quality is low, a
105 * LowSNR flag will be set. Excessive motion is also reported with a flag.
106 */
112};
113
124 /* NOTE: These algorithm modes are untested */
125 /*MAX32664C_ALGO_MODE_SAMPLED_HRM,*/
126 /*MAX32664C_ALGO_MODE_SAMPLED_HRM_SHOT_SPO2,*/
127 /*MAX32664C_ALGO_MODE_ACTIVITY_TRACK,*/
128 /*MAX32664C_ALGO_MODE_SAMPLED_HRM_FAST_SPO2 = 7,*/
129};
130
139
151
164
173int max32664c_bl_enter(const struct device *dev, const uint8_t *firmware, uint32_t size);
174
181int max32664c_bl_leave(const struct device *dev);
182
193int max32664c_acc_fill_fifo(const struct device *dev, struct max32664c_acc_data_t *data,
194 uint8_t length);
195
196#ifdef __cplusplus
197}
198#endif
199
203
204#endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_MAX32664C_H_ */
max32664c_algo_activity
Activity classes.
Definition max32664c.h:144
int max32664c_acc_fill_fifo(const struct device *dev, struct max32664c_acc_data_t *data, uint8_t length)
Fill the FIFO buffer with accelerometer data.
sensor_attribute_max32664c
Definition max32664c.h:54
sensor_channel_max32664c
Definition max32664c.h:38
int max32664c_bl_leave(const struct device *dev)
Leave the bootloader and enter the application mode.
max32664c_algo_mode
Algorithm modes.
Definition max32664c.h:120
max32664c_device_mode
Device operating modes.
Definition max32664c.h:80
int max32664c_bl_enter(const struct device *dev, const uint8_t *firmware, uint32_t size)
Enter the bootloader mode and run a firmware update.
max32664c_algo_gender
Gender settings.
Definition max32664c.h:135
@ MAX32664C_ALGO_ACTIVITY_OTHER
Other activity.
Definition max32664c.h:146
@ MAX32664C_ALGO_ACTIVITY_REST
Rest activity.
Definition max32664c.h:145
@ MAX32664C_ALGO_ACTIVITY_RUN
Run activity.
Definition max32664c.h:148
@ MAX32664C_ALGO_ACTIVITY_BIKE
Bike activity.
Definition max32664c.h:149
@ MAX32664C_ALGO_ACTIVITY_WALK
Walk activity.
Definition max32664c.h:147
@ SENSOR_ATTR_MAX32664C_AGE
Age of the subject being monitored.
Definition max32664c.h:58
@ SENSOR_ATTR_MAX32664C_GENDER
Gender of the subject being monitored.
Definition max32664c.h:56
@ SENSOR_ATTR_MAX32664C_OP_MODE
Get / Set the operation mode of a sensor.
Definition max32664c.h:66
@ SENSOR_ATTR_MAX32664C_WEIGHT
Weight of the subject being monitored.
Definition max32664c.h:60
@ SENSOR_ATTR_MAX32664C_HEIGHT
Height of the subject being monitored.
Definition max32664c.h:62
@ SENSOR_CHAN_MAX32664C_HEARTRATE
Heart rate value (bpm)
Definition max32664c.h:40
@ SENSOR_CHAN_MAX32664C_STEP_COUNTER
Step counter.
Definition max32664c.h:50
@ SENSOR_CHAN_MAX32664C_ACTIVITY
Activity class (index).
Definition max32664c.h:48
@ SENSOR_CHAN_MAX32664C_SKIN_CONTACT
Skin contact (1 -> Skin contact, 0, no contact)
Definition max32664c.h:46
@ SENSOR_CHAN_MAX32664C_RESPIRATION_RATE
Respiration rate (breaths per minute)
Definition max32664c.h:44
@ SENSOR_CHAN_MAX32664C_BLOOD_OXYGEN_SATURATION
SpO2 value (%)
Definition max32664c.h:42
@ MAX32664C_ALGO_MODE_CONT_HR_SHOT_SPO2
Continuous heart rate and shot SpO2.
Definition max32664c.h:122
@ MAX32664C_ALGO_MODE_CONT_HR_CONT_SPO2
Continuous heart rate and continuous SpO2.
Definition max32664c.h:121
@ MAX32664C_ALGO_MODE_CONT_HRM
Definition max32664c.h:123
@ MAX32664C_OP_MODE_ALGO_AGC_EXT
Algorithm AGC with extended reports.
Definition max32664c.h:107
@ MAX32664C_OP_MODE_RAW
Raw output mode.
Definition max32664c.h:82
@ MAX32664C_OP_MODE_SCD
SCD only mode.
Definition max32664c.h:108
@ MAX32664C_OP_MODE_ALGO_AGC
Algorithm AGC mode.
Definition max32664c.h:96
@ MAX32664C_OP_MODE_WAKE_ON_MOTION
Wake on motion mode.
Definition max32664c.h:109
@ MAX32664C_OP_MODE_ALGO_AEC_EXT
Algorithm with extended reports.
Definition max32664c.h:95
@ MAX32664C_OP_MODE_STOP_ALGO
Stop the current algorithm.
Definition max32664c.h:111
@ MAX32664C_OP_MODE_EXIT_WAKE_ON_MOTION
Exit wake on motion mode.
Definition max32664c.h:110
@ MAX32664C_OP_MODE_IDLE
Idle mode, no algorithm, sensors or wake on motion running.
Definition max32664c.h:81
@ MAX32664C_OP_MODE_ALGO_AEC
Algorithm AEC mode.
Definition max32664c.h:87
@ MAX32664_ALGO_GENDER_FEMALE
Female.
Definition max32664c.h:137
@ MAX32664_ALGO_GENDER_MALE
Male.
Definition max32664c.h:136
@ SENSOR_ATTR_PRIV_START
This and higher values are sensor specific.
Definition sensor.h:383
@ SENSOR_CHAN_PRIV_START
This and higher values are sensor specific.
Definition sensor.h:225
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__INT16_TYPE__ int16_t
Definition stdint.h:73
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Data structure for external accelerometer data.
Definition max32664c.h:159
int16_t y
Y-axis acceleration.
Definition max32664c.h:161
int16_t x
X-axis acceleration.
Definition max32664c.h:160
int16_t z
Z-axis acceleration.
Definition max32664c.h:162