dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_dmashot.h File Reference
#include <stdint.h>
#include <pios_stm32.h>
#include "stm32f4xx_tim.h"
#include "pios_tim_priv.h"

Go to the source code of this file.

Data Structures

struct  pios_dmashot_timer_cfg
 Configuration struct to assign a DMA channel and stream to a timer, and optionally specify a master timer to update single timer registers of timers without DMA channel. More...
 
struct  pios_dmashot_cfg
 Configuration struct holding all timer configurations. More...
 

Macros

#define DMASHOT_150   150000
 
#define DMASHOT_300   300000
 
#define DMASHOT_600   600000
 
#define DMASHOT_1200   1200000
 

Functions

void PIOS_DMAShot_Init (const struct pios_dmashot_cfg *config)
 Initializes the DMAShot driver by loading the configuration. More...
 
void PIOS_DMAShot_Prepare ()
 Makes sure the DMAShot driver has allocated all internal structs. More...
 
bool PIOS_DMAShot_IsConfigured ()
 Checks whether DMAShot has been configured. More...
 
bool PIOS_DMAShot_IsReady ()
 Checks whether DMAShot is ready for use (i.e. at least one DMA configured timer). More...
 
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. More...
 
bool PIOS_DMAShot_RegisterServo (const struct pios_tim_channel *servo_channel)
 Tells the DMAShot driver about a servo that needs to be set up. More...
 
void PIOS_DMAShot_InitializeGPIOs ()
 Initializes the GPIO on the registered servos for DMAShot operation. More...
 
void PIOS_DMAShot_InitializeTimers (TIM_OCInitTypeDef *ocinit)
 Initializes and configures the registered timers for DMAShot operation. More...
 
void PIOS_DMAShot_InitializeDMAs ()
 Initializes and configures the known DMA channels for DMAShot operation. More...
 
void PIOS_DMAShot_Validate ()
 Validates any timer and servo registrations. More...
 
void PIOS_DMAShot_WriteValue (const struct pios_tim_channel *servo_channel, uint16_t throttle)
 Sets the throttle value of a specific servo. More...
 
void PIOS_DMAShot_TriggerUpdate ()
 Triggers the configured DMA channels to fire and send throttle values to the timer DMAR and optional CCRx registers. More...
 

Detailed Description

Author
dRonin, http://dRonin.org/, Copyright (C) 2017

Definition in file pios_dmashot.h.