|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
39 #ifndef DSHOT_AT_LEAST_ONE_32B_TIMER
40 #define DSHOT_AT_LEAST_ONE_32B_TIMER TRUE
43 #ifndef DSHOT_CHANNEL_FIRST_INDEX
44 #define DSHOT_CHANNEL_FIRST_INDEX 0U
49 #define DSHOT_BIT_WIDTHS 16U
50 #define DSHOT_PRE_FRAME_SILENT_SYNC_BITS 2U
51 #define DSHOT_POST_FRAME_SILENT_SYNC_BITS 2U
52 #define DSHOT_DMA_BUFFER_SIZE (DSHOT_BIT_WIDTHS + \
53 DSHOT_PRE_FRAME_SILENT_SYNC_BITS + \
54 DSHOT_POST_FRAME_SILENT_SYNC_BITS )
56 #define DSHOT_CHANNELS 4U // depend on the number of channels per timer
63 #define DSHOT_ALL_MOTORS 255U
133 } __attribute__((__packed__, scalar_storage_order(
"big-endian")));
140 #if DSHOT_AT_LEAST_ONE_32B_TIMER
185 bool dcache_memory_in_use;
@ DSHOT_CMD_SAVE_SETTINGS
@ DSHOT_CMD_SPIN_DIRECTION_2
@ DSHOT_CMD_AUDIO_STREAM_MODE_ON_OFF
uint8_t dma_channel
: dma channel associated with pwm timer used to generate dshot output
PWMConfig pwm_conf
PWM config associated with pwm timer.
PWMDriver * pwmp
PWM driver that feed up to 4 dshot lines.
uint32_t dma_stream
: dma stream associated with pwm timer used to generate dshot output
@ DSHOT_UNINIT
Not initialized.
const DSHOTConfig * config
DMA config associated with pwm timer.
volatile uint8_t currentTlmQry
@ DSHOT_CMD_SPIN_DIRECTION_1
THD_WORKING_AREA(waDshotTlmRec, 512)
stack working area for dshot telemetry thread
uint32_t crc_errors
number of crc errors
uint32_t dshotGetCrcErrorsCount(DSHOTDriver *driver)
return number of telemetry crc error since dshotStart
@ DSHOT_ONGOING_TELEMETRY_QUERY
Transfering.
DMADriver dmap
DMA driver associated with pwm timer.
static const struct usb_config_descriptor config
@ DSHOT_CMD_SETTINGS_REQUEST
DshotDmaBuffer * dma_buf
dshot dma buffer, sgould be defined in a non Dcached region
dshotstate_t
Driver state machine possible states.
mailbox_t mb
mailbox for dshot telemetry thread
STM32 DMA subsystem driver header.
msg_t _mbBuf[1]
mailbox buffer for dshot telemetry thread
SerialDriver * tlm_sd
if non null : dshot telemetry serial driver
DMAConfig dma_conf
DMA config associated with pwm timer.
void dshotStart(DSHOTDriver *driver, const DSHOTConfig *config)
Configures and activates the DSHOT peripheral.
Structure representing a DMA driver.
@ DSHOT_CMD_SILENT_MODE_ON_OFF
telemetry packed as sent by some KISS ESC
dshot_special_commands_t
DSHOT special commands (0-47) for KISS and BLHELI ESC.
@ DSHOT_ERROR
Transfert error.
void dshotSetThrottle(DSHOTDriver *driver, const uint8_t index, const uint16_t throttle)
prepare throttle order for specified ESC
void dshotSendSpecialCommand(DSHOTDriver *driver, const uint8_t index, const dshot_special_commands_t specmd)
send special order to one of the ESC (BHELIX, KISS, ...)
DMA stream configuration structure.
@ DSHOT_CMD_SPIN_DIRECTION_NORMAL
@ DSHOT_CMD_SPIN_DIRECTION_REVERSED
void dshotSendThrottles(DSHOTDriver *driver, const uint16_t throttles[DSHOT_CHANNELS])
send throttle packed order to all of the ESCs
#define DSHOT_DMA_BUFFER_SIZE
const DshotTelemetry * dshotGetTelemetry(const DSHOTDriver *driver, const uint32_t index)
return last received telemetry data
void dshotSendFrame(DSHOTDriver *driver)
send throttle order
DSHOT Driver configuration structure.