![]() |
Autodrone
Multi-Domain Vehicle
|
This files enables the gpio, timer, and dma peripherals to send dshot commands with pwm. More...
#include "board.h"
Functions | |
void | dshotInit (dshot_type_e dshot_type) |
Initializes the low level registers to set up the timer with PWM DMA. More... | |
void | dshotWrite (uint16_t *motor_value) |
Writes to the DMA buffer and starts the DMA stream. More... | |
void | dshotWait (uint16_t wait_counts) |
Waits for a certain amount of dshot commands. More... | |
void | DMA1_Stream2_IRQHandler (void) |
This function handles DMA1 stream2 global interrupt. More... | |
void | DMA1_Stream4_IRQHandler (void) |
This function handles DMA1 stream4 global interrupt. More... | |
void | DMA1_Stream0_IRQHandler (void) |
This function handles DMA1 stream0 global interrupt. More... | |
void | DMA1_Stream3_IRQHandler (void) |
This function handles DMA1 stream3 global interrupt. More... | |
Variables | |
volatile uint16_t | dshot_command_count = 0 |
bool | dshot_telemetry = false |
This files enables the gpio, timer, and dma peripherals to send dshot commands with pwm.
void DMA1_Stream0_IRQHandler | ( | void | ) |
This function handles DMA1 stream0 global interrupt.
void DMA1_Stream2_IRQHandler | ( | void | ) |
This function handles DMA1 stream2 global interrupt.
void DMA1_Stream3_IRQHandler | ( | void | ) |
This function handles DMA1 stream3 global interrupt.
void DMA1_Stream4_IRQHandler | ( | void | ) |
This function handles DMA1 stream4 global interrupt.
void dshotInit | ( | dshot_type_e | dshot_type | ) |
Initializes the low level registers to set up the timer with PWM DMA.
dshot_type | DSHOT150/300/600. Allows you to adjust the speed. DSHOT600 is preferred |
void dshotWait | ( | uint16_t | wait_counts | ) |
Waits for a certain amount of dshot commands.
wait_counts | Number of commands to wait for. |
void dshotWrite | ( | uint16_t * | motor_value | ) |
Writes to the DMA buffer and starts the DMA stream.
*motor_value | A four length array with elements from 0 to 2047. |
volatile uint16_t dshot_command_count = 0 |
bool dshot_telemetry = false |