summaryrefslogtreecommitdiff
path: root/zephyr/Kconfig.body_detection
blob: 85386a68c123fb69d4c48e3b67dff8cbb4b6982e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

menuconfig PLATFORM_EC_BODY_DETECTION
	bool "Sensor body detection"
	help
	  Enable the body detection function.

	  The Power Reduction Algorithm is based on the Motion Detector
	  output of In Motion (on body) state or Stationary (off body) state.
	  The input of the Motion Detector is the X and Y axis signal
	  from an accelerometer.

if PLATFORM_EC_BODY_DETECTION

config PLATFORM_EC_BODY_DETECTION_MAX_WINDOW_SIZE
	int "Maximal sensor data rate"
	default 250
	help
	  Sets the maximum sensor data rate, in Hz. Note that larger data rate
	  values consume more memory and computing resource.

config PLATFORM_EC_BODY_DETECTION_VAR_THRESHOLD
	int "The threshold of acceleration variance for confidence calculation"
	default 550
	help
	  The unit is (mm/s^2)^2

	  The motion confidence is calculated if the variance is within
	  variance_threshold +/- confidence_delta. Otherwise, if variance is
	  too high/low, confidence will be 100%/0%

config PLATFORM_EC_BODY_DETECTION_CONFIDENCE_DELTA
	int "The delta of acceleration variance for confidence calculation"
	default 525
	help
	  The unit is (mm/s^2)^2

	  The motion confidence is calculated if the variance is within
	  variance_threshold +/- confidence_delta. Otherwise, if variance is
	  too high/low, confidence will be 100%/0%

config PLATFORM_EC_BODY_DETECTION_VAR_NOISE_FACTOR
	int "How much noise affects the threshold of variance"
	default 120
	help
	  The unit is percentage

	  This is used for mitigate the effect of the noise from the sensor.
	  If set to 100%, the average noise is canceled out. This is set to
	  120% by default because the noise might get larger than average
	  sometimes.

config PLATFORM_EC_BODY_DETECTION_ON_BODY_CON
	int "The confidence limit of on_body"
	default 50
	help
	  The unit is percentage

	  Higher the value, more diffcult to enter the on-body from off-body

config PLATFORM_EC_BODY_DETECTION_OFF_BODY_CON
	int "The confidence limit of off body"
	default 10
	help
	  The unit is percentage

	  Lower the value, more diffcult to enter the off-body from on-body.
	  Should be set less than the PLATFORM_EC_BODY_DETECTION_ON_BODY_CON

config PLATFORM_EC_BODY_DETECTION_STATIONARY_DURATION
	int "The threshold duration to change to off_body"
	default 15
	help
	  The unit is seconds

	  How long should we stay in on-body state before entering to off-body
	  state when the motion confidence is less than
	  PLATFORM_EC_BODY_DETECTION_OFF_BODY_CON

config PLATFORM_EC_BODY_DETECTION_NOTIFY_MODE_CHANGE
	bool "Notify host with a specific host event when body status is changed"
	default n
	help
	  Notify the host via SCI events EC_HOST_EVENT_MODE_CHANGE when body
	  status is changed, in addition to adding an event in the motion sensor
	  FIFO queue.

config PLATFORM_EC_BODY_DETECTION_ALWAYS_ENABLE_IN_S0
	bool "Always enable body detection function in S0"
	default n
	help
	  Always enable the body detection function in S0
	  w/o the host command

endif # PLATFORM_EC_BODY_DETECTION