espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.84k stars 7.32k forks source link

RMT byte encoder less than 1 byte (IDFGH-13969) #14799

Open gamadan opened 4 weeks ago

gamadan commented 4 weeks ago

Answers checklist.

General issue report

I only need the byte encoder to dynamically encode four bits. Not a full byte.

uint8_t data = 0b1111 | *((uint8_t*)primary_data);
encoded_symbols += bytes_encoder->encode(bytes_encoder, channel, &data, sizeof(data), &session_state);

The code above encodes 8 bits, 4 (leading) zeros, and 4 bits from primary_data.

My protocol has 20 address bits, 4 data bits, and 2 stop bits. Do I really need to dynamically encode the last 4 address bits with the 4 data bits each time?