/* * Driver to use 4CH RC transmitter using Zhen Hua 5-byte protocol (Walkera Lama, * EasyCopter etc.) as a joystick under Linux. * * RC transmitters using Zhen Hua 5-byte protocol are cheap four channels * transmitters for control a RC planes or RC helicopters with possibility to * connect on a serial port. * Data coming from transmitter is in this order: * 1. byte = synchronisation byte * 2. byte = X axis * 3. byte = Y axis * 4. byte = RZ axis * 5. byte = Z axis * (and this is repeated) * * For questions or feedback regarding this driver module please contact: * Martin Kebert <gkmarty@gmail.com> - but I am not a C-programmer nor kernel * coder :-(
*/
/* * zhenhua_interrupt() is called by the low level driver when characters * are ready for us. We then buffer them for further processing, or call the * packet processing routine.
*/
/* All Zhen Hua packets are 5 bytes. The fact that the first byte * is allways 0xf7 and all others are in range 0x32 - 0xc8 (50-200)
* can be used to check and regain sync. */
if (data == 0xef)
zhenhua->idx = 0; /* this byte starts a new packet */ elseif (zhenhua->idx == 0) return IRQ_HANDLED; /* wrong MSB -- ignore this byte */
if (zhenhua->idx < ZHENHUA_MAX_LENGTH)
zhenhua->data[zhenhua->idx++] = bitrev8(data);
if (zhenhua->idx == ZHENHUA_MAX_LENGTH) {
zhenhua_process_packet(zhenhua);
zhenhua->idx = 0;
}
return IRQ_HANDLED;
}
/* * zhenhua_disconnect() is the opposite of zhenhua_connect()
*/
/* * zhenhua_connect() is the routine that is called when someone adds a * new serio device. It looks for the Twiddler, and if found, registers * it as an input device.
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.