10 const static uint32_t PERF_CLK_HZ = 80000000;
12 const static uint8_t clk_div = 1;
26 const static float ticks_per_second_in_nanosecond = ((float) PERF_CLK_HZ / (
float) clk_div) / 1000000000;
42 case ESP_ERR_INVALID_ARG:
89 const static size_t rmt_size = 17;
90 static rmt_item32_t rmt_frame[rmt_size];
92 for (uint8_t i = 0; i < rmt_size - 1; ++i) {
93 uint16_t i_bit = (dshot_frame >> (rmt_size - 2 - i)) & 0b1;
97 rmt_frame[i] = {{{on_time, 1, off_time, 0}}};
100 rmt_frame[rmt_size - 1] = {{{0, 1, 0, 0}}};
102 ESP_ERROR_CHECK(rmt_write_items(
driver_config.channel, rmt_frame, rmt_size,
true));
static void * _update_task(void *_this)
static function to help pthead
err_t single_write(uint16_t dshot_frame)
Write a single Dshot frame to the bus.
pthread_mutex_t dshot_frame_lock
void update_task()
updates ESC with current dshot buffer, blocks CPU
rmt_config_t driver_config
err_t startup_error
error when constructing gets put here, read before usage.
ESP32_RMT_Dshot(rmt_channel_t channel, gpio_num_t gpio_port)
Dshot150 using RMT hardware.
err_t _write_frame_continuous(uint16_t dshot_frame) override
Write set Dshot frame continuously on the bus.