19 uint32_t command1 = 0;
20 uint32_t command2 = 0;
22 for (uint32_t bit = 0; bit < 4; bit++) {
24 command1 |= (1UL << (7 - bit));
27 for (uint32_t bit = 0; bit < 4; bit++) {
29 command1 |= (1UL << (3 - bit));
32 for (uint32_t bit = 0; bit < 4; bit++) {
34 command2 |= (1UL << (7 - bit));
37 for (uint32_t bit = 0; bit < 4; bit++) {
39 command2 |= (1UL << (3 - bit));
42 command1 = (command1 << 8) | ((~command1) & 0xff);
43 command2 = (command2 << 8) | ((~command2) & 0xff);
53 dst->
item(HEADER_HIGH_US, HEADER_LOW_US);
54 for (uint32_t mask = 1UL << 15; mask; mask >>= 1) {
55 if (address1 & mask) {
56 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
58 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
62 for (uint32_t mask = 1UL << 15; mask; mask >>= 1) {
63 if (command1 & mask) {
64 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
66 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
70 dst->
mark(BIT_HIGH_US);
73 dst->
space(TRAILER_SPACE_US);
74 dst->
item(HEADER_HIGH_US, HEADER_LOW_US);
75 for (uint32_t mask = 1UL << 15; mask; mask >>= 1) {
76 if (address2 & mask) {
77 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
79 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
83 for (uint32_t mask = 1UL << 15; mask; mask >>= 1) {
84 if (command2 & mask) {
85 dst->
item(BIT_HIGH_US, BIT_ONE_LOW_US);
87 dst->
item(BIT_HIGH_US, BIT_ZERO_LOW_US);
91 dst->
mark(BIT_HIGH_US);
95 uint16_t address1 = 0;
96 uint16_t command1 = 0;
102 if (!src.
expect_item(HEADER_HIGH_US, HEADER_LOW_US))
105 for (uint32_t mask = 1UL << 15; mask != 0; mask >>= 1) {
106 if (src.
expect_item(BIT_HIGH_US, BIT_ONE_LOW_US)) {
108 }
else if (src.
expect_item(BIT_HIGH_US, BIT_ZERO_LOW_US)) {
115 for (uint32_t mask = 1UL << 15; mask != 0; mask >>= 1) {
116 if (src.
expect_item(BIT_HIGH_US, BIT_ONE_LOW_US)) {
118 }
else if (src.
expect_item(BIT_HIGH_US, BIT_ZERO_LOW_US)) {
128 if ((address1 >> 8) != ((~address1) & 0xff))
131 if ((command1 >> 8) != ((~command1) & 0xff))
134 for (uint32_t bit = 0; bit < 4; bit++) {
135 if ((~command1 >> bit) & 1)
136 data.rc_code_1 |= (1UL << (7 - bit));
139 for (uint32_t bit = 0; bit < 4; bit++) {
140 if ((~command1 >> (bit + 4)) & 1)
141 data.rc_code_1 |= (1UL << (3 - bit));