Zephyr API Documentation 4.3.0-rc1
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
7#ifndef ZEPHYR_INCLUDE_DRIVERS_SENSOR_MAX32664C_H_
8#define ZEPHYR_INCLUDE_DRIVERS_SENSOR_MAX32664C_H_
9
10#include <zephyr/device.h>
11
16#define MAX32664C_MOTION_TIME(ms) ((uint8_t)((ms * 25UL) / 1000))
17
22#define MAX32664C_MOTION_THRESHOLD(mg) ((uint8_t)((mg * 16UL) / 1000))
23
24/* MAX32664C specific channels */
39
40/* MAX32664C specific attributes */
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
71 /* For hardware testing purposes, the user may choose to start the sensor hub to collect
72 * raw PPG samples. In this case, the host configures the sensor hub to work in Raw Data
73 * mode (no algorithm) by enabling the accelerometer and the AFE.
74 */
76 /* Automatic Exposure Control (AEC) is Maxim’s gain control algorithm that is superior to
77 * AGC. The AEC algorithm optimally maintains the best SNR range and power optimization. The
78 * targeted SNR range is maintained regardless of skin color or ambient temperature within
79 * the limits of the LED currents configurations; The AEC dynamically manages the
80 * appropriate register settings for sampling rate, LED current, pulse width and integration
81 * time.
82 */
85 /* In this mode, the wearable algorithm suite (SpO2 and WHRM) is enabled and the R value,
86 * SpO2, SpO2 confidence level, heart rate, heart rate confidence level, RR value, and
87 * activity class are reported. Furthermore, automatic gain control (AGC) is enabled.
88 * Because AGC is a subset of AEC functionality, to enable AGC, AEC still needs to be
89 * enabled. However, automatic calculation of target PD should be turned off, and the
90 * desired level of AGC target PD current is set by the user. The user may change the
91 * algorithm to the desired configuration mode. If signal quality is poor, the user may need
92 * to adjust the AGC settings to maintain optimal performance. If signal quality is low, a
93 * LowSNR flag will be set. Excessive motion is also reported with a flag.
94 */
100};
101
112 /* NOTE: These algorithm modes are untested */
113 /*MAX32664C_ALGO_MODE_SAMPLED_HRM,*/
114 /*MAX32664C_ALGO_MODE_SAMPLED_HRM_SHOT_SPO2,*/
115 /*MAX32664C_ALGO_MODE_ACTIVITY_TRACK,*/
116 /*MAX32664C_ALGO_MODE_SAMPLED_HRM_FAST_SPO2 = 7,*/
117};
118
127
139
152
153#ifdef CONFIG_MAX32664C_USE_FIRMWARE_LOADER
160int max32664c_bl_enter(const struct device *dev, const uint8_t *firmware, uint32_t size);
161
166int max32664c_bl_leave(const struct device *dev);
167#endif /* CONFIG_MAX32664C_USE_FIRMWARE_LOADER */
168
169#ifdef CONFIG_MAX32664C_USE_EXTERNAL_ACC
178int max32664c_acc_fill_fifo(const struct device *dev, struct max32664c_acc_data_t *data,
179 uint8_t length);
180#endif /* CONFIG_MAX32664C_USE_EXTERNAL_ACC*/
181
182#ifdef __cplusplus
183}
184#endif
185
186#endif /* ZEPHYR_INCLUDE_DRIVERS_SENSOR_MAX32664C_H_ */
@ 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
max32664c_algo_activity
Activity classes for the MAX32664C sensor.
Definition max32664c.h:132
@ MAX32664C_ALGO_ACTIVITY_OTHER
Definition max32664c.h:134
@ MAX32664C_ALGO_ACTIVITY_REST
Definition max32664c.h:133
@ MAX32664C_ALGO_ACTIVITY_RUN
Definition max32664c.h:136
@ MAX32664C_ALGO_ACTIVITY_BIKE
Definition max32664c.h:137
@ MAX32664C_ALGO_ACTIVITY_WALK
Definition max32664c.h:135
sensor_attribute_max32664c
Definition max32664c.h:41
@ SENSOR_ATTR_MAX32664C_AGE
Age of the subject being monitored.
Definition max32664c.h:45
@ SENSOR_ATTR_MAX32664C_GENDER
Gender of the subject being monitored.
Definition max32664c.h:43
@ SENSOR_ATTR_MAX32664C_OP_MODE
Get / Set the operation mode of a sensor.
Definition max32664c.h:53
@ SENSOR_ATTR_MAX32664C_WEIGHT
Weight of the subject being monitored.
Definition max32664c.h:47
@ SENSOR_ATTR_MAX32664C_HEIGHT
Height of the subject being monitored.
Definition max32664c.h:49
sensor_channel_max32664c
Definition max32664c.h:25
@ SENSOR_CHAN_MAX32664C_HEARTRATE
Heart rate value (bpm)
Definition max32664c.h:27
@ SENSOR_CHAN_MAX32664C_STEP_COUNTER
Step counter.
Definition max32664c.h:37
@ SENSOR_CHAN_MAX32664C_ACTIVITY
Activity class (index).
Definition max32664c.h:35
@ SENSOR_CHAN_MAX32664C_SKIN_CONTACT
Skin contact (1 -> Skin contact, 0, no contact)
Definition max32664c.h:33
@ SENSOR_CHAN_MAX32664C_RESPIRATION_RATE
Respiration rate (breaths per minute)
Definition max32664c.h:31
@ SENSOR_CHAN_MAX32664C_BLOOD_OXYGEN_SATURATION
SpO2 value (%)
Definition max32664c.h:29
max32664c_algo_mode
Algorithm modes for the MAX32664C sensor.
Definition max32664c.h:108
@ MAX32664C_ALGO_MODE_CONT_HR_SHOT_SPO2
Definition max32664c.h:110
@ MAX32664C_ALGO_MODE_CONT_HR_CONT_SPO2
Definition max32664c.h:109
@ MAX32664C_ALGO_MODE_CONT_HRM
Definition max32664c.h:111
max32664c_device_mode
Device operating modes for the MAX32664C sensor.
Definition max32664c.h:67
@ MAX32664C_OP_MODE_ALGO_AGC_EXT
Algorithm AGC with extended reports.
Definition max32664c.h:95
@ MAX32664C_OP_MODE_RAW
Raw output mode.
Definition max32664c.h:70
@ MAX32664C_OP_MODE_SCD
SCD only mode.
Definition max32664c.h:96
@ MAX32664C_OP_MODE_ALGO_AGC
Algorithm AGC mode.
Definition max32664c.h:84
@ MAX32664C_OP_MODE_WAKE_ON_MOTION
Wake on motion mode.
Definition max32664c.h:97
@ MAX32664C_OP_MODE_ALGO_AEC_EXT
Algorithm with extended reports.
Definition max32664c.h:83
@ MAX32664C_OP_MODE_STOP_ALGO
Stop the current algorithm.
Definition max32664c.h:99
@ MAX32664C_OP_MODE_EXIT_WAKE_ON_MOTION
Exit wake on motion mode.
Definition max32664c.h:98
@ MAX32664C_OP_MODE_IDLE
Idle mode, no algorithm,.
Definition max32664c.h:68
@ MAX32664C_OP_MODE_ALGO_AEC
Algorithm AEC mode.
Definition max32664c.h:75
max32664c_algo_gender
Gender settings for the MAX32664C sensor.
Definition max32664c.h:123
@ MAX32664_ALGO_GENDER_FEMALE
Definition max32664c.h:125
@ MAX32664_ALGO_GENDER_MALE
Definition max32664c.h:124
__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:510
Data structure for external accelerometer data.
Definition max32664c.h:147
int16_t y
Definition max32664c.h:149
int16_t x
Definition max32664c.h:148
int16_t z
Definition max32664c.h:150