#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" #include "esp_log.h" #include "driver/rmt.h" #include "toshiba_ir.h" #include "config.h" #ifdef IR_TRANSMIT extern uint8_t bitReverse(uint8_t b); // RMT values #define RMT_TX_CHANNEL RMT_CHANNEL_0 #define RMT_TX_GPIO GPIO_NUM_26 // channel clock period = 1 uS #define RMT_CLK_DIV 80 // Variable that holds the IR protocol transmission. 1 start bit, 8*8+19*8 data bits and one stop bit #define RMT_BITS (1+64+1+1+152+1+1) // 221 bits in total rmt_item32_t toshiba_rmt[RMT_BITS]; QueueHandle_t toshibaTxQueue = NULL; void copyDataToRmtArray( const uint8_t rmtStartBit, const uint8_t* data, const uint8_t noOfBytes, const bool reverseByte) { for(uint8_t b=0;b