5 namespace remote_base {
7 static const char *
const TAG =
"remote.roomba";
9 static const uint8_t NBITS = 8;
10 static const uint32_t BIT_ONE_HIGH_US = 3000;
11 static const uint32_t BIT_ONE_LOW_US = 1000;
12 static const uint32_t BIT_ZERO_HIGH_US = BIT_ONE_LOW_US;
13 static const uint32_t BIT_ZERO_LOW_US = BIT_ONE_HIGH_US;
19 for (uint32_t mask = 1UL << (NBITS - 1); mask != 0; mask >>= 1) {
20 if (data.
data & mask) {
21 dst->
item(BIT_ONE_HIGH_US, BIT_ONE_LOW_US);
23 dst->
item(BIT_ZERO_HIGH_US, BIT_ZERO_LOW_US);
30 for (uint8_t i = 0; i < (NBITS - 1); i++) {
32 if (src.
expect_item(BIT_ONE_HIGH_US, BIT_ONE_LOW_US)) {
34 }
else if (src.
expect_item(BIT_ZERO_HIGH_US, BIT_ZERO_LOW_US)) {
void set_carrier_frequency(uint32_t carrier_frequency)
void item(uint32_t mark, uint32_t space)
bool expect_mark(uint32_t length)
optional< RoombaData > decode(RemoteReceiveData src) override
void dump(const RoombaData &data) override
void encode(RemoteTransmitData *dst, const RoombaData &data) override
Implementation of SPI Controller mode.
void reserve(uint32_t len)
bool expect_item(uint32_t mark, uint32_t space)