* NECX protocol STATE_TRAILER_SPACE
@ 2012-06-12 12:46 Ravi Kumar V
0 siblings, 0 replies; only message in thread
From: Ravi Kumar V @ 2012-06-12 12:46 UTC (permalink / raw)
To: Jarod Wilson, linux-media, mchehab
Hi Jardon,
I am writing IR receiver driver over GPIO line.
Trying to read the frame sent by Samsung remote.
I am sending interrupt events to rc frame work using
ir_raw_event_store_edge()
I am able to see that above API is pushing previous pulse/space packet
to rc framework when an interrupt is reported to it.
I am facing one issue with NEC decoder.
NECx protocol format has one start bit, 32 data bits and one stop bit
stop bit: pulse (562us) & space ( untill next key press event)
so i think here we should skip the STATE_TRAILER_SPACE event because the
width of it is not fixed for some of NECx protocols like samsung remote.
case STATE_TRAILER_PULSE:
if (!ev.pulse)
break;
if (!eq_margin(ev.duration, NEC_TRAILER_PULSE, NEC_UNIT
break;
data->state = STATE_TRAILER_SPACE;
IR_dprintk(1, "NEC (Ext) state set %d\n", data->state);
return 0;
case STATE_TRAILER_SPACE:
if (ev.pulse)
break;
if (!geq_margin(ev.duration, NEC_TRAILER_SPACE,
NEC_UNIT / 2))
break;
address = bitrev8((data->bits >> 24) & 0xff);
not_address = bitrev8((data->bits >> 16) & 0xff);
command = bitrev8((data->bits >> 8) & 0xff);
not_command = bitrev8((data->bits >> 0) & 0xff);
if ((command ^ not_command) != 0xff) {
IR_dprintk(1, "NEC checksum error: received
0x%08x\n",
data->bits);
send_32bits = true;
}
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-12 12:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12 12:46 NECX protocol STATE_TRAILER_SPACE Ravi Kumar V
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.