요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
LIS302 accelerometer devicetree bindings
This device is matched via its bus drivers, and has a number of properties
that apply in on the generic device (independent from the bus).
Required properties for the SPI bindings:
- compatible: should be set to "st,lis3lv02d-spi"
- reg: the chipselect index
- spi-max-frequency: maximal bus speed, should be set to 1000000 unless
constrained by external circuitry
- interrupts: the interrupt generated by the device
Required properties for the I2C bindings:
- compatible: should be set to "st,lis3lv02d"
- reg: i2c slave address
- Vdd-supply: The input supply for Vdd
- Vdd_IO-supply: The input supply for Vdd_IO
Optional properties for all bus drivers:
- st,click-single-{x,y,z}: if present, tells the device to issue an
interrupt on single click events on the
x/y/z axis.
- st,click-double-{x,y,z}: if present, tells the device to issue an
interrupt on double click events on the
x/y/z axis.
- st,click-thresh-{x,y,z}: set the x/y/z axis threshold
- st,click-click-time-limit: click time limit, from 0 to 127.5msec
with step of 0.5 msec
- st,click-latency: click latency, from 0 to 255 msec with
step of 1 msec.
- st,click-window: click window, from 0 to 255 msec with
step of 1 msec.
- st,irq{1,2}-disable: disable IRQ 1/2
- st,irq{1,2}-ff-wu-1: raise IRQ 1/2 on FF_WU_1 condition
- st,irq{1,2}-ff-wu-2: raise IRQ 1/2 on FF_WU_2 condition
- st,irq{1,2}-data-ready: raise IRQ 1/2 on data ready condition
- st,irq{1,2}-click: raise IRQ 1/2 on click condition
- st,irq-open-drain: consider IRQ lines open-drain
- st,irq-active-low: make IRQ lines active low
- st,wu-duration-1: duration register for Free-Fall/Wake-Up
interrupt 1
- st,wu-duration-2: duration register for Free-Fall/Wake-Up
interrupt 2
- st,wakeup-{x,y,z}-{lo,hi}: set wakeup condition on x/y/z axis for
upper/lower limit
- st,wakeup-threshold: set wakeup threshold
- st,wakeup2-{x,y,z}-{lo,hi}: set wakeup condition on x/y/z axis for
upper/lower limit for second wakeup
engine.
- st,wakeup2-threshold: set wakeup threshold for second wakeup
engine.
- st,highpass-cutoff-hz=: 1, 2, 4 or 8 for 1Hz, 2Hz, 4Hz or 8Hz of
highpass cut-off frequency
- st,hipass{1,2}-disable: disable highpass 1/2.
- st,default-rate=: set the default rate
- st,axis-{x,y,z}=: set the axis to map to the three coordinates.
Negative values can be used for inverted axis.
- st,{min,max}-limit-{x,y,z} set the min/max limits for x/y/z axis
(used by self-test)
Example for a SPI device node:
accelerometer@0 {
compatible = "st,lis302dl-spi";
reg = <0>;
spi-max-frequency = <1000000>;
interrupt-parent = <&gpio>;
interrupts = <104 0>;
st,click-single-x;
st,click-single-y;
st,click-single-z;
st,click-thresh-x = <10>;
st,click-thresh-y = <10>;
st,click-thresh-z = <10>;
st,irq1-click;
st,irq2-click;
st,wakeup-x-lo;
st,wakeup-x-hi;
st,wakeup-y-lo;
st,wakeup-y-hi;
st,wakeup-z-lo;
st,wakeup-z-hi;
};
Example for a I2C device node:
lis331dlh: accelerometer@18 {
compatible = "st,lis331dlh", "st,lis3lv02d";
reg = <0x18>;
Vdd-supply = <&lis3_reg>;
Vdd_IO-supply = <&lis3_reg>;
st,click-single-x;
st,click-single-y;
st,click-single-z;
st,click-thresh-x = <10>;
st,click-thresh-y = <10>;
st,click-thresh-z = <10>;
st,irq1-click;
st,irq2-click;
st,wakeup-x-lo;
st,wakeup-x-hi;
st,wakeup-y-lo;
st,wakeup-y-hi;
st,wakeup-z-lo;
st,wakeup-z-hi;
st,min-limit-x = <120>;
st,min-limit-y = <120>;
st,min-limit-z = <140>;
st,max-limit-x = <550>;
st,max-limit-y = <550>;
st,max-limit-z = <750>;
};
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
LIS302 SPI/I2C 필수 속성
1-20LIS302 accelerometer는 각 bus driver를 통해 match되며, bus 종류와 무관하게 generic device에 적용되는 여러 property를 갖습니다.
SPI binding의 필수 `compatible`은 `st,lis3lv02d-spi`, `reg`는 chip-select index, `spi-max-frequency`는 최대 bus speed입니다. 외부 회로가 제한하지 않는 한 1000000으로 설정해야 합니다. `interrupts`는 device가 생성하는 interrupt입니다.
I2C binding의 필수 `compatible`은 `st,lis3lv02d`, `reg`는 I2C slave address입니다. `Vdd-supply`와 `Vdd_IO-supply`는 각각 Vdd와 Vdd_IO input supply입니다.
Click, IRQ, wakeup과 axis 속성
21-64모든 bus driver에서 `st,click-single-{x,y,z}`와 `st,click-double-{x,y,z}`는 각 축의 single/double click event에 interrupt를 생성하게 합니다. `st,click-thresh-{x,y,z}`는 축별 threshold입니다. `st,click-click-time-limit`는 0~127.5 ms를 0.5 ms step으로, `st,click-latency`와 `st,click-window`는 0~255 ms를 1 ms step으로 설정합니다.
`st,irq{1,2}-disable`은 IRQ 1/2를 끕니다. `st,irq{1,2}-ff-wu-1`, `st,irq{1,2}-ff-wu-2`, `st,irq{1,2}-data-ready`, `st,irq{1,2}-click`은 각각 FF_WU_1, FF_WU_2, data-ready, click condition에서 IRQ 1/2를 발생시킵니다. `st,irq-open-drain`은 IRQ line을 open-drain으로 취급하고 `st,irq-active-low`는 active-low로 만듭니다.
`st,wu-duration-1`과 `st,wu-duration-2`는 Free-Fall/Wake-Up interrupt 1과 2의 duration register입니다. `st,wakeup-{x,y,z}-{lo,hi}`는 첫 wakeup engine의 각 축 upper/lower limit condition, `st,wakeup-threshold`는 그 threshold입니다. `st,wakeup2-{x,y,z}-{lo,hi}`와 `st,wakeup2-threshold`는 둘째 wakeup engine에 같은 역할을 합니다.
`st,highpass-cutoff-hz` 값 1, 2, 4, 8은 각각 1, 2, 4, 8 Hz high-pass cutoff frequency를 뜻하고 `st,hipass{1,2}-disable`은 high-pass 1/2를 끕니다. `st,default-rate`는 기본 rate, `st,axis-{x,y,z}`는 세 좌표에 mapping할 axis이며 음수 값으로 axis를 반전할 수 있습니다. Self-test에 쓰는 `st,{min,max}-limit-{x,y,z}`는 축별 min/max limit입니다.
Click, free-fall/wakeup와 data-ready source를 IRQ 1/2에 연결하는 property군입니다.
SPI와 I2C device 예제
65-119SPI 예제는 chip-select 0, 최대 1 MHz, GPIO interrupt 104를 사용합니다. X/Y/Z single-click과 threshold 10을 설정하고 click을 IRQ1/IRQ2에 route하며 각 축의 low/high wakeup condition을 모두 활성화합니다. 예제 compatible은 원문 그대로 `st,lis302dl-spi`입니다.
accelerometer@0 {
compatible = "st,lis302dl-spi";
reg = <0>;
spi-max-frequency = <1000000>;
interrupt-parent = <&gpio>;
interrupts = <104 0>;
st,click-single-x;
st,click-single-y;
st,click-single-z;
st,click-thresh-x = <10>;
st,click-thresh-y = <10>;
st,click-thresh-z = <10>;
st,irq1-click;
st,irq2-click;
st,wakeup-x-lo;
st,wakeup-x-hi;
st,wakeup-y-lo;
st,wakeup-y-hi;
st,wakeup-z-lo;
st,wakeup-z-hi;
};
I2C 예제의 LIS331DLH는 address `0x18`에서 `st,lis331dlh`와 generic `st,lis3lv02d` compatible을 함께 사용하고 Vdd/Vdd_IO 모두 `lis3_reg`에서 공급받습니다. 같은 click/wakeup 설정에 더해 X/Y/Z self-test minimum 120/120/140과 maximum 550/550/750을 지정합니다.
lis331dlh: accelerometer@18 {
compatible = "st,lis331dlh", "st,lis3lv02d";
reg = <0x18>;
Vdd-supply = <&lis3_reg>;
Vdd_IO-supply = <&lis3_reg>;
st,click-single-x;
st,click-single-y;
st,click-single-z;
st,click-thresh-x = <10>;
st,click-thresh-y = <10>;
st,click-thresh-z = <10>;
st,irq1-click;
st,irq2-click;
st,wakeup-x-lo;
st,wakeup-x-hi;
st,wakeup-y-lo;
st,wakeup-y-hi;
st,wakeup-z-lo;
st,wakeup-z-hi;
st,min-limit-x = <120>;
st,min-limit-y = <120>;
st,min-limit-z = <140>;
st,max-limit-x = <550>;
st,max-limit-y = <550>;
st,max-limit-z = <750>;
};
요약과 해설
lis302.txt:1-119두 bus 방식과 event engine 설정을 함께 설명합니다.