← Documents Documentation/input/devices/cma3000_d0x.rst GitHub 원문 ↗

Linux 6.18.37 · Input

CMA3000-D0x Accelerometer

CMA3000-D0x 3축 가속도계의 I2C 드라이버, input 이벤트와 모드·임계값 계산을 설명합니다.

Source pathDocumentation/input/devices/cma3000_d0x.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

cma3000_d0x.rst:1-139

CMA3000-D0x 드라이버는 I2C로 3축 가속도, 움직임과 자유 낙하를 Linux input subsystem에 전달합니다. 보드별 platform data에서 축 잡음, 2G/8G 범위, 기본 모드와 시간·g 임계값을 정확히 설정해야 합니다.

문서 개요
항목내용
SourceDocumentation/input/devices/cma3000_d0x.rst
분량139 source lines
지원 칩VTI CMA3000-D0x
드라이버 버스I2C
측정 주기40Hz, 100Hz, 400Hz
축 범위-8000~8000 예제, fuzz 200
자유 낙하`ABS_MISC=1`

지원 기능과 Linux 입력 표현을 요약합니다.

구성 핵심
I2C bus mode와 platform data 준비2G/8G 범위와 기본 mode 선택움직임·자유 낙하 시간 및 g 임계값 계산X/Y/Z ABS 이벤트와 `ABS_MISC` 등록Sync로 입력 프레임 완료

플랫폼 설정에서 이벤트 보고까지의 핵심 단계입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 CMA3000-D0x Accelerometer
2 =========================
3
4 Supported chips:
5 * VTI CMA3000-D0x
6
7 Datasheet:
8 CMA3000-D0X Product Family Specification 8281000A.02.pdf
9 <http://www.vti.fi/en/>
10
11 :Author: Hemanth V <hemanthv@ti.com>
12
13
14 Description
15 -----------
16
17 CMA3000 Tri-axis accelerometer supports Motion detect, Measurement and
18 Free fall modes.
19
20 Motion Detect Mode:
21 Its the low power mode where interrupts are generated only
22 when motion exceeds the defined thresholds.
23
24 Measurement Mode:
25 This mode is used to read the acceleration data on X,Y,Z
26 axis and supports 400, 100, 40 Hz sample frequency.
27
28 Free fall Mode:
29 This mode is intended to save system resources.
30
31 Threshold values:
32 Chip supports defining threshold values for above modes
33 which includes time and g value. Refer product specifications for
34 more details.
35
36 CMA3000 chip supports mutually exclusive I2C and SPI interfaces for
37 communication, currently the driver supports I2C based communication only.
38 Initial configuration for bus mode is set in non volatile memory and can later
39 be modified through bus interface command.
40
41 Driver reports acceleration data through input subsystem. It generates ABS_MISC
42 event with value 1 when free fall is detected.
43
44 Platform data need to be configured for initial default values.
45
46 Platform Data
47 -------------
48
49 fuzz_x:
50 Noise on X Axis
51
52 fuzz_y:
53 Noise on Y Axis
54
55 fuzz_z:
56 Noise on Z Axis
57
58 g_range:
59 G range in milli g i.e 2000 or 8000
60
61 mode:
62 Default Operating mode
63
64 mdthr:
65 Motion detect g range threshold value
66
67 mdfftmr:
68 Motion detect and free fall time threshold value
69
70 ffthr:
71 Free fall g range threshold value
72
73 Input Interface
74 ---------------
75
76 Input driver version is 1.0.0
77 Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
78 Input device name: "cma3000-accelerometer"
79
80 Supported events::
81
82 Event type 0 (Sync)
83 Event type 3 (Absolute)
84 Event code 0 (X)
85 Value 47
86 Min -8000
87 Max 8000
88 Fuzz 200
89 Event code 1 (Y)
90 Value -28
91 Min -8000
92 Max 8000
93 Fuzz 200
94 Event code 2 (Z)
95 Value 905
96 Min -8000
97 Max 8000
98 Fuzz 200
99 Event code 40 (Misc)
100 Value 0
101 Min 0
102 Max 1
103 Event type 4 (Misc)
104
105
106 Register/Platform parameters Description
107 ----------------------------------------
108
109 mode::
110
111 0: power down mode
112 1: 100 Hz Measurement mode
113 2: 400 Hz Measurement mode
114 3: 40 Hz Measurement mode
115 4: Motion Detect mode (default)
116 5: 100 Hz Free fall mode
117 6: 40 Hz Free fall mode
118 7: Power off mode
119
120 grange::
121
122 2000: 2000 mg or 2G Range
123 8000: 8000 mg or 8G Range
124
125 mdthr::
126
127 X: X * 71mg (8G Range)
128 X: X * 18mg (2G Range)
129
130 mdfftmr::
131
132 X: (X & 0x70) * 100 ms (MDTMR)
133 (X & 0x0F) * 2.5 ms (FFTMR 400 Hz)
134 (X & 0x0F) * 10 ms (FFTMR 100 Hz)
135
136 ffthr::
137
138 X: (X >> 2) * 18mg (2G Range)
139 X: (X & 0x0F) * 71 mg (8G Range)
140

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

지원 칩, 동작 모드와 버스

1-44

이 드라이버는 VTI CMA3000-D0x 3축 가속도계를 지원합니다. 기준 자료는 `CMA3000-D0X Product Family Specification 8281000A.02.pdf`이며 원문은 VTI 웹사이트를 링크합니다. 문서 작성자는 Texas Instruments의 Hemanth V입니다.

CMA3000 동작 모드
모드목적동작
Motion Detect저전력 움직임 감지움직임이 정의한 임계값을 넘을 때만 interrupt 생성
MeasurementX/Y/Z 가속도 측정400Hz, 100Hz, 40Hz 샘플 주기 지원
Free fall자유 낙하 감지시스템 자원 절약을 위한 모드

센서가 제공하는 세 가지 기능 모드를 비교합니다.

각 모드에는 시간과 g 값을 포함하는 임계값을 정의할 수 있습니다. 정확한 범위와 동작은 제품 명세를 참조해야 합니다.

CMA3000은 I2C와 SPI 인터페이스 중 하나를 상호 배타적으로 사용합니다. 현재 이 드라이버는 I2C 통신만 지원합니다. 초기 버스 모드는 비휘발성 메모리에 저장되어 있으며 이후 버스 인터페이스 명령으로 바꿀 수 있습니다.

통신 인터페이스 상태
항목I2CSPI
칩 지원지원지원
동시 사용SPI와 상호 배타적I2C와 상호 배타적
현재 드라이버지원지원하지 않음
초기 선택비휘발성 메모리의 bus mode비휘발성 메모리의 bus mode

칩 기능과 현재 드라이버 지원 범위를 구분합니다.

드라이버는 가속도 데이터를 Linux input subsystem으로 보고합니다. 자유 낙하를 감지하면 값 1의 `ABS_MISC` 이벤트를 생성합니다. 초기 기본값을 위해 platform data를 구성해야 합니다.

CMA3000 데이터 경로
비휘발성 메모리에서 초기 bus mode 선택현재 드라이버는 I2C로 장치 통신platform data에서 기본 모드·범위·임계값 설정X/Y/Z 가속도 또는 움직임·자유 낙하 감지Linux input subsystem으로 ABS 축과 `ABS_MISC` 보고

센서 구성부터 input 이벤트 보고까지의 흐름입니다.

CMA3000-D0x Accelerometer
=========================

Supported chips:
* VTI CMA3000-D0x

Datasheet:
  CMA3000-D0X Product Family Specification 8281000A.02.pdf
  <http://www.vti.fi/en/>

:Author: Hemanth V <hemanthv@ti.com>


Description
-----------

CMA3000 Tri-axis accelerometer supports Motion detect, Measurement and
Free fall modes.

Motion Detect Mode:
    Its the low power mode where interrupts are generated only
    when motion exceeds the defined thresholds.

Measurement Mode:
    This mode is used to read the acceleration data on X,Y,Z
    axis and supports 400, 100, 40 Hz sample frequency.

Free fall Mode:
    This mode is intended to save system resources.

Threshold values:
    Chip supports defining threshold values for above modes
    which includes time and g value. Refer product specifications for
    more details.

CMA3000 chip supports mutually exclusive I2C and SPI interfaces for
communication, currently the driver supports I2C based communication only.
Initial configuration for bus mode is set in non volatile memory and can later
be modified through bus interface command.

Driver reports acceleration data through input subsystem. It generates ABS_MISC
event with value 1 when free fall is detected.

Platform data need to be configured for initial default values.

플랫폼 데이터 필드

45-72

보드 코드는 다음 platform data 필드로 센서의 초기 기본값을 지정합니다. `fuzz_x`, `fuzz_y`, `fuzz_z`는 각 축 입력의 잡음 허용량이며, 나머지 필드는 g 범위·기본 모드·움직임 및 자유 낙하 임계값을 정합니다.

CMA3000 platform data
필드의미
`fuzz_x`X축 잡음
`fuzz_y`Y축 잡음
`fuzz_z`Z축 잡음
`g_range`milli-g 단위 범위: 2000 또는 8000
`mode`기본 동작 모드
`mdthr`motion detect g 범위 임계값
`mdfftmr`motion detect와 free fall 시간 임계값
`ffthr`free fall g 범위 임계값

원문에 열거된 모든 초기 구성 필드입니다.

플랫폼 기본값 적용
축별 `fuzz_x/y/z`로 input 잡음 허용량 지정`g_range`에서 2G 또는 8G 선택`mode`로 전원 투입 후 동작 결정`mdthr`와 `mdfftmr`로 움직임 감지 조건 설정`ffthr`로 자유 낙하 임계값 설정

보드별 초기 센서 설정의 의존 관계입니다.


Platform Data
-------------

fuzz_x:
    Noise on X Axis

fuzz_y:
    Noise on Y Axis

fuzz_z:
    Noise on Z Axis

g_range:
    G range in milli g i.e 2000 or 8000

mode:
    Default Operating mode

mdthr:
    Motion detect g range threshold value

mdfftmr:
    Motion detect and free fall time threshold value

ffthr:
    Free fall g range threshold value

Linux input 인터페이스와 이벤트 범위

73-105

input 드라이버 버전은 1.0.0입니다. 장치 ID는 bus `0x18`, vendor `0x0`, product `0x0`, version `0x0`이며 장치 이름은 `cma3000-accelerometer`입니다.

CMA3000 input 장치 식별값
항목
Driver version`1.0.0`
Bus`0x18`
Vendor`0x0`
Product`0x0`
Version`0x0`
Name`cma3000-accelerometer`

드라이버가 등록하는 이름과 ID입니다.

지원 input 이벤트
TypeCode축/용도예제 ValueMinMaxFuzz
0 Sync-동기화----
3 Absolute0X47-80008000200
3 Absolute1Y-28-80008000200
3 Absolute2Z905-80008000200
3 Absolute40Misc / free fall001-
4 Misc-기타 이벤트 유형----

원문 예제의 현재값, 최소·최대와 fuzz를 축별로 보존합니다.

X/Y/Z는 absolute event code 0/1/2로 보고되고 예제 범위는 -8000~8000, fuzz는 200입니다. Misc code 40은 0~1 범위이며 자유 낙하 감지 시 `ABS_MISC=1`을 보고하는 데 사용됩니다.

input 이벤트 한 프레임
X/Y/Z 측정값을 absolute code 0/1/2로 변환설정한 fuzz로 작은 잡음 완화자유 낙하 여부를 Misc code 40의 0 또는 1로 표현필요한 Misc 이벤트와 함께 보고Sync 이벤트로 프레임 경계 전달

센서 값이 Linux input event로 묶이는 방식입니다.

Input Interface
---------------

Input driver version is 1.0.0
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "cma3000-accelerometer"

Supported events::

  Event type 0 (Sync)
  Event type 3 (Absolute)
    Event code 0 (X)
      Value     47
      Min    -8000
      Max     8000
      Fuzz     200
    Event code 1 (Y)
      Value    -28
      Min    -8000
      Max     8000
      Fuzz     200
    Event code 2 (Z)
      Value    905
      Min    -8000
      Max     8000
      Fuzz     200
    Event code 40 (Misc)
      Value      0
      Min        0
      Max        1
  Event type 4 (Misc)

레지스터 모드와 임계값 계산

106-139
CMA3000 `mode` 값
동작
0power down mode
1100Hz Measurement mode
2400Hz Measurement mode
340Hz Measurement mode
4Motion Detect mode, 기본값
5100Hz Free fall mode
640Hz Free fall mode
7Power off mode

플랫폼·레지스터 모드 번호와 동작입니다.

CMA3000 `grange`
범위
20002000mg 또는 2G
80008000mg 또는 8G

가속도 측정 범위 선택값입니다.

움직임 임계값 `mdthr`
범위계산식
8G`X * 71mg`
2G`X * 18mg`

선택한 g 범위에 따른 레지스터 X의 환산입니다.

시간 임계값 `mdfftmr`
필드/모드계산식
MDTMR`(X & 0x70) * 100ms`
FFTMR 400Hz`(X & 0x0F) * 2.5ms`
FFTMR 100Hz`(X & 0x0F) * 10ms`

상위 비트 MDTMR와 하위 비트 FFTMR의 샘플 주기별 계산입니다.

자유 낙하 임계값 `ffthr`
범위계산식
2G`(X >> 2) * 18mg`
8G`(X & 0x0F) * 71mg`

g 범위별 자유 낙하 임계값 환산입니다.

`mode` 4가 기본 Motion Detect이고, 측정 모드는 40/100/400Hz를 각각 값 3/1/2로 선택합니다. 자유 낙하 모드는 100Hz 값 5와 40Hz 값 6을 제공합니다. 임계값을 계산할 때는 선택한 2G 또는 8G 범위와 FFTMR 샘플 주기를 반드시 함께 적용해야 합니다.

임계값 계산 순서
`grange`로 2G 또는 8G 범위 선택`mode`에서 측정·움직임·자유 낙하 주기 결정`mdthr`는 범위에 따라 18mg 또는 71mg 단위로 환산`mdfftmr` 상위 비트는 100ms, 하위 비트는 샘플 주기로 환산`ffthr`는 범위별 shift 또는 mask 식으로 환산

레지스터 값 X를 실제 g와 시간으로 해석하는 기준입니다.

Register/Platform parameters Description
----------------------------------------

mode::

        0: power down mode
        1: 100 Hz Measurement mode
        2: 400 Hz Measurement mode
        3: 40 Hz Measurement mode
        4: Motion Detect mode (default)
        5: 100 Hz Free fall mode
        6: 40 Hz Free fall mode
        7: Power off mode

grange::

        2000: 2000 mg or 2G Range
        8000: 8000 mg or 8G Range

mdthr::

        X: X * 71mg (8G Range)
        X: X * 18mg (2G Range)

mdfftmr::

        X: (X & 0x70) * 100 ms (MDTMR)
           (X & 0x0F) * 2.5 ms (FFTMR 400 Hz)
           (X & 0x0F) * 10 ms  (FFTMR 100 Hz)

ffthr::

       X: (X >> 2) * 18mg (2G Range)
       X: (X & 0x0F) * 71 mg (8G Range)