Implement PID and telemetry
This commit is contained in:
+13
-1
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32H2
|
||||
#define DSHOT_ESC_RESOLUTION_HZ 32000000 // 32MHz resolution, DSHot protocol needs a relative high resolution
|
||||
@@ -10,11 +11,22 @@
|
||||
|
||||
#define ESC_UART_NUM UART_NUM_2
|
||||
|
||||
/**
|
||||
* Struct for returning telemetry data
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t temperature;
|
||||
uint16_t voltage;
|
||||
uint16_t current;
|
||||
uint16_t consumption;
|
||||
uint16_t rpm;
|
||||
} esc_telemetry_t;
|
||||
|
||||
void init_rmt_esc_tx(void);
|
||||
|
||||
void send_dshot_packet(void);
|
||||
|
||||
void parse_telemetry(void);
|
||||
bool parse_telemetry(esc_telemetry_t * telemetry);
|
||||
|
||||
void init_motor(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user