요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
===========================
Walkera WK-0701 transmitter
===========================
Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
this transmitter as joystick
Devel homepage and download:
http://zub.fei.tuke.sk/walkera-wk0701/
or use cogito:
cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick
Connecting to PC
================
At back side of transmitter S-video connector can be found. Modulation
pulses from processor to HF part can be found at pin 2 of this connector,
pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
modulation pulses to PC, signal pulses must be amplified.
Cable: (walkera TX to parport)
Walkera WK-0701 TX S-VIDEO connector::
(back side of TX)
__ __ S-video: canon25
/ |_| \ pin 2 (signal) NPN parport
/ O 4 3 O \ pin 3 (GND) LED ________________ 10 ACK
( O 2 1 O ) | C
\ ___ / 2 ________________________|\|_____|/
| [___] | |/| B |\
------- 3 __________________________________|________________ 25 GND
E
I use green LED and BC109 NPN transistor.
Software
========
Build kernel with walkera0701 module. Module walkera0701 need exclusive
access to parport, modules like lp must be unloaded before loading
walkera0701 module, check dmesg for error messages. Connect TX to PC by
cable and run jstest /dev/input/js0 to see values from TX. If no value can
be changed by TX "joystick", check output from /proc/interrupts. Value for
(usually irq7) parport must increase if TX is on.
Technical details
=================
Driver use interrupt from parport ACK input bit to measure pulse length
using hrtimers.
Frame format:
Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
Signal pulses
-------------
::
(ANALOG)
SYNC BIN OCT
+---------+ +------+
| | | |
--+ +------+ +---
Frame
-----
::
SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..
pulse length
------------
::
Binary values: Analog octal values:
288 uS Binary 0 318 uS 000
438 uS Binary 1 398 uS 001
478 uS 010
558 uS 011
638 uS 100
1306 uS SYNC 718 uS 101
798 uS 110
878 uS 111
24 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits
(Warning, pulses on ACK are inverted by transistor, irq is raised up on sync
to bin change or octal value to bin change).
Binary data representations
---------------------------
One binary and octal value can be grouped to nibble. 24 nibbles + one binary
values can be sampled between sync pulses.
Values for first four channels (analog joystick values) can be found in
first 10 nibbles. Analog value is represented by one sign bit and 9 bit
absolute binary value. (10 bits per channel). Next nibble is checksum for
first ten nibbles.
Next nibbles 12 .. 21 represents four channels (not all channels can be
directly controlled from TX). Binary representations are the same as in first
four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
checksum for nibbles 12..23.
After last octal value for nibble 24 and next sync pulse one additional
binary value can be sampled. This bit and magic number is not used in
software driver. Some details about this magic numbers can be found in
Walkera_Wk-0701_PCM.pdf.
Checksum calculation
--------------------
Summary of octal values in nibbles must be same as octal value in checksum
nibble (only first 3 bits are used). Binary value for checksum nibble is
calculated by sum of binary values in checked nibbles + sum of octal values
in checked nibbles divided by 8. Only bit 0 of this sum is used.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
WK-0701 송신기 연결 회로와 드라이버 실행
1-51Walkera WK-0701 송신기는 HM36, HM37, HM60 같은 ready-to-fly 헬리콥터와 함께 제공됩니다. `walkera0701` 모듈은 이 무선 조종 송신기를 Linux 조이스틱으로 사용할 수 있게 합니다. 원문에는 개발 홈페이지와 `cg-clone` 저장소 주소가 보존돼 있습니다.
송신기 뒷면 S-video 커넥터의 pin 2에서 프로세서가 HF 부분으로 보내는 modulation pulse를 얻고 pin 3을 Ground로 사용합니다. Pin 3과 CPU 사이에는 5.6 kOhm 저항이 있으며, PC 병렬 포트에 넣기 전 신호를 증폭해야 합니다.
원문의 S-video·LED·NPN·DB25 ASCII 회로를 연결 단계로 다시 그렸습니다.
커널에 `walkera0701` 모듈을 포함해야 하며 이 모듈은 병렬 포트를 독점 사용합니다. `lp` 같은 다른 병렬 포트 모듈을 먼저 내리고 `dmesg`의 오류를 확인합니다. 케이블로 TX를 연결한 뒤 `jstest /dev/input/js0`에서 값을 확인합니다.
모듈 충돌과 IRQ 동작을 확인하는 절차입니다.
하드웨어 배선부터 입력 확인까지의 흐름입니다.
===========================
Walkera WK-0701 transmitter
===========================
Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
this transmitter as joystick
Devel homepage and download:
http://zub.fei.tuke.sk/walkera-wk0701/
or use cogito:
cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick
Connecting to PC
================
At back side of transmitter S-video connector can be found. Modulation
pulses from processor to HF part can be found at pin 2 of this connector,
pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
modulation pulses to PC, signal pulses must be amplified.
Cable: (walkera TX to parport)
Walkera WK-0701 TX S-VIDEO connector::
(back side of TX)
__ __ S-video: canon25
/ |_| \ pin 2 (signal) NPN parport
/ O 4 3 O \ pin 3 (GND) LED ________________ 10 ACK
( O 2 1 O ) | C
\ ___ / 2 ________________________|\|_____|/
| [___] | |/| B |\
------- 3 __________________________________|________________ 25 GND
E
I use green LED and BC109 NPN transistor.
Software
========
Build kernel with walkera0701 module. Module walkera0701 need exclusive
access to parport, modules like lp must be unloaded before loading
walkera0701 module, check dmesg for error messages. Connect TX to PC by
cable and run jstest /dev/input/js0 to see values from TX. If no value can
be changed by TX "joystick", check output from /proc/interrupts. Value for
(usually irq7) parport must increase if TX is on.
ACK 인터럽트와 PCM 펄스 프레임
52-100드라이버는 병렬 포트 ACK 입력의 interrupt와 high-resolution timer를 사용해 pulse 길이를 측정합니다. 프레임 설명은 Shaul Eizikovich의 Walkera WK-0701 PCM 형식을 기반으로 합니다.
원문의 파형과 길이표를 논리 값으로 구조화했습니다.
한 프레임은 `SYNC, BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25` 뒤 다음 SYNC로 이어집니다. 24개의 binary+octal 조합은 각각 1+3비트이고 마지막 binary 1비트를 더해 `24*4+1 = 97`비트입니다.
SYNC 사이의 데이터 단위를 순서와 크기로 나타냅니다.
NPN transistor 때문에 ACK에서 관찰되는 pulse는 반전됩니다. IRQ는 sync에서 binary로 바뀔 때 또는 octal value에서 다음 binary로 바뀔 때 상승합니다.
ACK 에지 간 시간을 PCM 데이터로 바꾸는 흐름입니다.
Technical details
=================
Driver use interrupt from parport ACK input bit to measure pulse length
using hrtimers.
Frame format:
Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
Signal pulses
-------------
::
(ANALOG)
SYNC BIN OCT
+---------+ +------+
| | | |
--+ +------+ +---
Frame
-----
::
SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..
pulse length
------------
::
Binary values: Analog octal values:
288 uS Binary 0 318 uS 000
438 uS Binary 1 398 uS 001
478 uS 010
558 uS 011
638 uS 100
1306 uS SYNC 718 uS 101
798 uS 110
878 uS 111
24 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits
(Warning, pulses on ACK are inverted by transistor, irq is raised up on sync
to bin change or octal value to bin change).
채널 비트 배치와 두 checksum
101-128Binary 1비트와 octal 3비트를 묶으면 nibble 하나가 됩니다. 두 SYNC 사이에서 24개 nibble과 추가 binary bit 하나를 채집합니다.
채널 값, checksum과 magic number의 위치입니다.
첫 네 채널은 첫 10개 nibble에 있으며 각 analog 값은 sign bit 1개와 9비트 절대 binary 값, 총 10비트입니다. Nibble 11은 첫 영역 checksum입니다. Nibbles 12~21은 같은 표현의 다음 네 채널이지만 송신기에서 모두 직접 제어할 수 있는 것은 아닙니다.
Nibbles 22와 23의 magic number와 nibble 24 뒤의 추가 binary bit는 소프트웨어 드라이버가 사용하지 않습니다. 두 번째 checksum은 nibbles 12~23을 검증합니다.
Checksum nibble의 octal 3비트와 binary 1비트 규칙입니다.
97비트 프레임에서 조이스틱 축을 얻는 순서입니다.
Binary data representations
---------------------------
One binary and octal value can be grouped to nibble. 24 nibbles + one binary
values can be sampled between sync pulses.
Values for first four channels (analog joystick values) can be found in
first 10 nibbles. Analog value is represented by one sign bit and 9 bit
absolute binary value. (10 bits per channel). Next nibble is checksum for
first ten nibbles.
Next nibbles 12 .. 21 represents four channels (not all channels can be
directly controlled from TX). Binary representations are the same as in first
four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
checksum for nibbles 12..23.
After last octal value for nibble 24 and next sync pulse one additional
binary value can be sampled. This bit and magic number is not used in
software driver. Some details about this magic numbers can be found in
Walkera_Wk-0701_PCM.pdf.
Checksum calculation
--------------------
Summary of octal values in nibbles must be same as octal value in checksum
nibble (only first 3 bits are used). Binary value for checksum nibble is
calculated by sum of binary values in checked nibbles + sum of octal values
in checked nibbles divided by 8. Only bit 0 of this sum is used.
요약·해설
walkera0701.rst:1-128WK-0701 송신기의 S-video modulation signal을 LED와 NPN transistor로 증폭·반전해 병렬 포트 ACK에 넣고, interrupt 간 펄스 길이로 97비트 PCM 프레임과 여덟 채널을 복원합니다.
회로와 프레임의 핵심입니다.