...restructure for rework

This commit is contained in:
Wastl Kraus 2022-11-26 13:52:46 +01:00
parent 85814f39be
commit 873b228d59
5 changed files with 254 additions and 276 deletions

4
.gitignore vendored
View File

@ -1,3 +1,5 @@
.vs
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
@ -12,4 +14,4 @@
*.vsix
# Caching ESP32 Builds
buildCache/*
buildCache

View File

@ -1,32 +0,0 @@
#pragma once
// Source: https://github.com/bitdump/BLHeli/blob/master/BLHeli_S%20SiLabs/Dshotprog%20spec%20BLHeli_S.txt
// Date: 04.07.2021
enum dshot_cmd_t
{
DSHOT_CMD_MOTOR_STOP, // Currently not implemented - STOP Motors
DSHOT_CMD_BEEP1, // Wait at least length of beep (380ms) before next command
DSHOT_CMD_BEEP2, // Wait at least length of beep (380ms) before next command
DSHOT_CMD_BEEP3, // Wait at least length of beep (400ms) before next command
DSHOT_CMD_BEEP4, // Wait at least length of beep (400ms) before next command
DSHOT_CMD_BEEP5, // Wait at least length of beep (400ms) before next command
DSHOT_CMD_ESC_INFO, // Currently not implemented
DSHOT_CMD_SPIN_DIRECTION_1, // Need 6x, no wait required
DSHOT_CMD_SPIN_DIRECTION_2, // Need 6x, no wait required
DSHOT_CMD_3D_MODE_OFF, // Need 6x, no wait required
DSHOT_CMD_3D_MODE_ON, // Need 6x, no wait required
DSHOT_CMD_SETTINGS_REQUEST, // Currently not implemented
DSHOT_CMD_SAVE_SETTINGS, // Need 6x, wait at least 12ms before next command
DSHOT_CMD_SPIN_DIRECTION_NORMAL, // Need 6x, no wait required
DSHOT_CMD_SPIN_DIRECTION_REVERSED, // Need 6x, no wait required
DSHOT_CMD_LED0_ON, // Currently not implemented
DSHOT_CMD_LED1_ON, // Currently not implemented
DSHOT_CMD_LED2_ON, // Currently not implemented
DSHOT_CMD_LED3_ON, // Currently not implemented
DSHOT_CMD_LED0_OFF, // Currently not implemented
DSHOT_CMD_LED1_OFF, // Currently not implemented
DSHOT_CMD_LED2_OFF, // Currently not implemented
DSHOT_CMD_LED3_OFF, // Currently not implemented
DSHOT_CMD_MAX = 47
};

View File

@ -6,10 +6,16 @@
#pragma once
#include "BlheliCmdMap.h"
#include <Arduino.h>
#ifndef _DSHOTRMT_h
#define _DSHOTRMT_h
// ...utilizing the IR Module library for generating the DShot signal
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
// ...utilizing the RMT Module library for generating the DShot signal
#include <driver/rmt.h>
constexpr auto DSHOT_CLK_DIVIDER = 8; // ...slow down RMT clock to 0.1 microseconds / 100 nanoseconds per cycle
@ -110,3 +116,5 @@ private:
void output_rmt_data(const dshot_packet_t& dshot_packet);
};
#endif