5 namespace remote_base {
7 static const char *
const TAG =
"remote.jvc";
9 static const uint8_t NBITS = 16;
10 static const uint32_t HEADER_HIGH_US = 8400;
11 static const uint32_t HEADER_LOW_US = 4200;
12 static const uint32_t BIT_ONE_LOW_US = 1725;
13 static const uint32_t BIT_ZERO_LOW_US = 525;
14 static const uint32_t BIT_HIGH_US = 525;
20 dst->
item(HEADER_HIGH_US, HEADER_LOW_US);
22 for (uint32_t mask = 1UL << (NBITS - 1); mask != 0; mask >>= 1) {
23 if (data.
data & mask) {
24 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
26 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
30 dst->
mark(BIT_HIGH_US);
34 if (!src.
expect_item(HEADER_HIGH_US, HEADER_LOW_US))
37 for (uint8_t i = 0; i < NBITS; i++) {
41 }
else if (src.
expect_item(BIT_HIGH_US, BIT_ZERO_LOW_US)) {
void set_carrier_frequency(uint32_t carrier_frequency)
optional< JVCData > decode(RemoteReceiveData src) override
void item(uint32_t mark, uint32_t space)
void mark(uint32_t length)
void encode(RemoteTransmitData *dst, const JVCData &data) override
Implementation of SPI Controller mode.
void dump(const JVCData &data) override
void reserve(uint32_t len)
bool expect_item(uint32_t mark, uint32_t space)