// SPDX-License-Identifier: GPL-2.0-or-later /* * ImgTec IR Decoder setup for Sanyo protocol. * * Copyright 2012-2014 Imagination Technologies Ltd. * * From ir-sanyo-decoder.c: * * This protocol uses the NEC protocol timings. However, data is formatted as: * 13 bits Custom Code * 13 bits NOT(Custom Code) * 8 bits Key data * 8 bits NOT(Key data) * * According with LIRC, this protocol is used on Sanyo, Aiwa and Chinon * Information for this protocol is available at the Sanyo LC7461 datasheet.
*/
#include"img-ir-hw.h"
/* Convert Sanyo data to a scancode */ staticint img_ir_sanyo_scancode(int len, u64 raw, u64 enabled_protocols, struct img_ir_scancode_req *request)
{ unsignedint addr, addr_inv, data, data_inv; /* a repeat code has no data */ if (!len) return IMG_IR_REPEATCODE; if (len != 42) return -EINVAL;
addr = (raw >> 0) & 0x1fff;
addr_inv = (raw >> 13) & 0x1fff;
data = (raw >> 26) & 0xff;
data_inv = (raw >> 34) & 0xff; /* Validate data */ if ((data_inv ^ data) != 0xff) return -EINVAL; /* Validate address */ if ((addr_inv ^ addr) != 0x1fff) return -EINVAL;
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.