/** * ir_sharp_decode() - Decode one Sharp pulse or space * @dev: the struct rc_dev descriptor of the device * @ev: the struct ir_raw_event descriptor of the pulse/space * * This function returns -EINVAL if the pulse violates the state machine
*/ staticint ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
{ struct sharp_dec *data = &dev->raw->sharp;
u32 msg, echo, address, command, scancode;
if (!is_timing_event(ev)) { if (ev.overflow)
data->state = STATE_INACTIVE; return 0;
}
dev_dbg(&dev->dev, "Sharp decode started at state %d (%uus %s)\n",
data->state, ev.duration, TO_STR(ev.pulse));
switch (data->state) {
case STATE_INACTIVE: if (!ev.pulse) break;
if (!eq_margin(ev.duration, SHARP_BIT_PULSE,
SHARP_BIT_PULSE / 2)) break;
/** * ir_sharp_encode() - Encode a scancode as a stream of raw events * * @protocol: protocol to encode * @scancode: scancode to encode * @events: array of raw ir events to write into * @max: maximum size of @events * * Returns: The number of events written. * -ENOBUFS if there isn't enough space in the array to fit the * encoding. In this case all @max events will have been written.
*/ staticint ir_sharp_encode(enum rc_proto protocol, u32 scancode, struct ir_raw_event *events, unsignedint max)
{ struct ir_raw_event *e = events; int ret;
u32 raw;
raw = (((bitrev8(scancode >> 8) >> 3) << 8) & 0x1f00) |
bitrev8(scancode);
ret = ir_raw_gen_pd(&e, max, &ir_sharp_timings, SHARP_NBITS,
(raw << 2) | 2); if (ret < 0) return ret;
max -= ret;
raw = (((bitrev8(scancode >> 8) >> 3) << 8) & 0x1f00) |
bitrev8(~scancode);
ret = ir_raw_gen_pd(&e, max, &ir_sharp_timings, SHARP_NBITS,
(raw << 2) | 1); if (ret < 0) return ret;
MODULE_LICENSE("GPL");
MODULE_AUTHOR("James Hogan ");
MODULE_DESCRIPTION("Sharp IR protocol decoder");
Messung V0.5
¤ 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.0.0Bemerkung:
(vorverarbeitet)
¤
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.