30 #ifndef PIOS_DMASHOT_H
31 #define PIOS_DMASHOT_H
36 #include "stm32f4xx_tim.h"
41 #define DMASHOT_150 150000
42 #define DMASHOT_300 300000
43 #define DMASHOT_600 600000
44 #define DMASHOT_1200 1200000
147 #endif // PIOS_DMASHOT_H
Types that are specific to the STM32 peripherals.
const struct pios_dmashot_timer_cfg * timer_cfg
void PIOS_DMAShot_Prepare()
Makes sure the DMAShot driver has allocated all internal structs.
struct usb_configuration_desc config
void PIOS_DMAShot_InitializeTimers(TIM_OCInitTypeDef *ocinit)
Initializes and configures the registered timers for DMAShot operation.
void PIOS_DMAShot_Validate()
Validates any timer and servo registrations.
TIM_TypeDef * master_timer
bool PIOS_DMAShot_RegisterTimer(TIM_TypeDef *timer, uint32_t clockrate, uint32_t dshot_freq)
Tells the DMAShot driver about a timer that needs to be set up.
bool PIOS_DMAShot_RegisterServo(const struct pios_tim_channel *servo_channel)
Tells the DMAShot driver about a servo that needs to be set up.
DMA_Stream_TypeDef * stream
bool PIOS_DMAShot_IsConfigured()
Checks whether DMAShot has been configured.
Configuration struct holding all timer configurations.
Configuration struct to assign a DMA channel and stream to a timer, and optionally specify a master t...
void PIOS_DMAShot_InitializeGPIOs()
Initializes the GPIO on the registered servos for DMAShot operation.
void PIOS_DMAShot_InitializeDMAs()
Initializes and configures the known DMA channels for DMAShot operation.
void PIOS_DMAShot_WriteValue(const struct pios_tim_channel *servo_channel, uint16_t throttle)
Sets the throttle value of a specific servo.
bool PIOS_DMAShot_IsReady()
Checks whether DMAShot is ready for use (i.e. at least one DMA configured timer). ...
void PIOS_DMAShot_Init(const struct pios_dmashot_cfg *config)
Initializes the DMAShot driver by loading the configuration.
void PIOS_DMAShot_TriggerUpdate()
Triggers the configured DMA channels to fire and send throttle values to the timer DMAR and optional ...