1# MAX30101 heart rate sensor
2
3# Copyright (c) 2017, NXP
4# SPDX-License-Identifier: Apache-2.0
5
6menuconfig MAX30101
7	bool "MAX30101 Pulse Oximeter and Heart Rate Sensor"
8	default y
9	depends on DT_HAS_MAXIM_MAX30101_ENABLED
10	select I2C
11
12if MAX30101
13
14config MAX30101_SMP_AVE
15	int "Sample averaging"
16	range 0 7
17	default 0
18	help
19	  To reduce the amount of data throughput, adjacent samples (in each
20	  individual channel) can be averaged and decimated on the chip by
21	  setting this register. Set to 0 for no averaging.
22	  0 = 1 sample (no averaging)
23	  1 = 2 samples
24	  2 = 4 samples
25	  3 = 8 samples
26	  4 = 16 samples
27	  5 = 32 samples
28	  6 = 32 samples
29	  7 = 32 samples
30
31config MAX30101_FIFO_ROLLOVER_EN
32	bool "FIFO rolls on full"
33	help
34	  Controls the behavior of the FIFO when the FIFO becomes completely
35	  filled with data. If set, the FIFO address rolls over to zero and the
36	  FIFO continues to fill with new data. If not set, then the FIFO is
37	  not updated until FIFO_DATA is read or the WRITE/READ pointer
38	  positions are changed.
39
40config MAX30101_FIFO_A_FULL
41	int "FIFO almost full value"
42	range 0 15
43	default 0
44	help
45	  Set the trigger for the FIFO_A_FULL interrupt
46
47choice MAX30101_MODE
48	prompt "Mode control"
49	default MAX30101_MULTI_LED_MODE
50
51config MAX30101_HEART_RATE_MODE
52	bool "Heart rate mode"
53	help
54	  Set to operate in heart rate only mode. The red LED channel is
55	  active.
56
57config MAX30101_SPO2_MODE
58	bool "SpO2 mode"
59	help
60	  Set to operate in SpO2 mode. The red and IR LED channels are active.
61
62config MAX30101_MULTI_LED_MODE
63	bool "Multi-LED mode"
64	help
65	  Set to operate in multi-LED mode. The green, red, and/or IR LED
66	  channels are active.
67
68endchoice
69
70config MAX30101_ADC_RGE
71	int "ADC range control"
72	range 0 3
73	default 2
74	help
75	  Set the ADC's full-scale range.
76	  0 = 7.81 pA/LSB
77	  1 = 15.63 pA/LSB
78	  2 = 31.25 pA/LSB
79	  3 = 62.5 pA/LSB
80
81config MAX30101_SR
82	int "ADC sample rate control"
83	range 0 7
84	default 0
85	help
86	  Set the effective sampling rate with one sample consisting of one
87	  pulse/conversion per active LED channel. In SpO2 mode, these means
88	  one IR pulse/conversion and one red pulse/conversion per sample
89	  period.
90	  0 = 50 Hz
91	  1 = 100 Hz
92	  2 = 200 Hz
93	  3 = 400 Hz
94	  4 = 800 Hz
95	  5 = 1000 Hz
96	  6 = 1600 Hz
97	  7 = 3200 Hz
98
99config MAX30101_LED1_PA
100	hex "LED1 (red) pulse amplitude"
101	range 0 0xff
102	default 0xff
103	help
104	  Set the pulse amplitude to control the LED1 (red) current. The actual
105	  measured LED current for each part can vary significantly due to the
106	  trimming methodology.
107	  0x00 = 0.0 mA
108	  0x01 = 0.2 mA
109	  0x02 = 0.4 mA
110	  0x0f = 3.1 mA
111	  0xff = 50.0 mA
112
113config MAX30101_LED2_PA
114	hex "LED2 (IR) pulse amplitude"
115	range 0 0xff
116	default 0x33
117	help
118	  Set the pulse amplitude to control the LED2 (IR) current. The actual
119	  measured LED current for each part can vary significantly due to the
120	  trimming methodology.
121	  0x00 = 0.0 mA
122	  0x01 = 0.2 mA
123	  0x02 = 0.4 mA
124	  0x0f = 3.1 mA
125	  0xff = 50.0 mA
126
127config MAX30101_LED3_PA
128	hex "LED3 (green) pulse amplitude"
129	range 0 0xff
130	default 0xff
131	help
132	  Set the pulse amplitude to control the LED3 (green) current. The
133	  actual measured LED current for each part can vary significantly due
134	  to the trimming methodology.
135	  0x00 = 0.0 mA
136	  0x01 = 0.2 mA
137	  0x02 = 0.4 mA
138	  0x0f = 3.1 mA
139	  0xff = 50.0 mA
140
141if MAX30101_MULTI_LED_MODE
142
143config MAX30101_SLOT1
144	int "Slot 1"
145	range 0 7
146	default 3
147	help
148	  Set which LED and pulse amplitude are active in time slot 1.
149	  0: None (disabled)
150	  1: LED1 (red), LED1_PA
151	  2: LED2 (IR), LED2_PA
152	  3: LED3 (green), LED3_PA
153	  4: None (disabled)
154	  5: LED1 (red), PILOT_PA
155	  6: LED2 (IR), PILOT_PA
156	  7: LED3 (green), PILOT_PA
157
158config MAX30101_SLOT2
159	int "Slot 2"
160	range 0 7
161	default 0
162	help
163	  Set which LED and pulse amplitude are active in time slot 2.
164	  0: None (disabled)
165	  1: LED1 (red), LED1_PA
166	  2: LED2 (IR), LED2_PA
167	  3: LED3 (green), LED3_PA
168	  4: None (disabled)
169	  5: LED1 (red), PILOT_PA
170	  6: LED2 (IR), PILOT_PA
171	  7: LED3 (green), PILOT_PA
172
173config MAX30101_SLOT3
174	int "Slot 3"
175	range 0 7
176	default 0
177	help
178	  Set which LED and pulse amplitude are active in time slot 3.
179	  0: None (disabled)
180	  1: LED1 (red), LED1_PA
181	  2: LED2 (IR), LED2_PA
182	  3: LED3 (green), LED3_PA
183	  4: None (disabled)
184	  5: LED1 (red), PILOT_PA
185	  6: LED2 (IR), PILOT_PA
186	  7: LED3 (green), PILOT_PA
187
188config MAX30101_SLOT4
189	int "Slot 4"
190	range 0 7
191	default 0
192	help
193	  Set which LED and pulse amplitude are active in time slot 4.
194	  0: None (disabled)
195	  1: LED1 (red), LED1_PA
196	  2: LED2 (IR), LED2_PA
197	  3: LED3 (green), LED3_PA
198	  4: None (disabled)
199	  5: LED1 (red), PILOT_PA
200	  6: LED2 (IR), PILOT_PA
201	  7: LED3 (green), PILOT_PA
202
203endif # MAX30101_MULTI_LED_MODE
204
205endif # MAX30101
206