123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef __DSHOT_H
- #define __DSHOT_H
- #include "stm32f4xx.h"
- #define ESC_CMD_BUFFER_LEN 18
- #define ESC_BIT_0 26
- #define ESC_BIT_1 52
- #define PWM3_PORT GPIOB
- #define PWM3_PIN GPIO_Pin_6
- #define PWM3_PinSource GPIO_PinSource6
- #define PWM3_GPIO_AF GPIO_AF_TIM4
- #define PWM4_PORT GPIOA
- #define PWM4_PIN GPIO_Pin_7
- #define PWM4_PinSource GPIO_PinSource7
- #define PWM4_GPIO_AF GPIO_AF_TIM3
- #define PWM5_PORT GPIOB
- #define PWM5_PIN GPIO_Pin_4
- #define PWM5_PinSource GPIO_PinSource4
- #define PWM5_GPIO_AF GPIO_AF_TIM3
- #define PWM6_PORT GPIOB
- #define PWM6_PIN GPIO_Pin_0
- #define PWM6_PinSource GPIO_PinSource0
- #define PWM6_GPIO_AF GPIO_AF_TIM3
- #define PWM7_PORT GPIOB
- #define PWM7_PIN GPIO_Pin_7
- #define PWM7_PinSource GPIO_PinSource7
- #define PWM7_GPIO_AF GPIO_AF_TIM4
- #define PWM8_PORT GPIOA
- #define PWM8_PIN GPIO_Pin_5
- #define PWM8_PinSource GPIO_PinSource5
- #define PWM8_GPIO_AF GPIO_AF_TIM2
- void pwmWriteDigital(u32 *esc_cmd, u16 value, DMA_Stream_TypeDef *DMA_Streamx);
- void Dshot_GPIO_Config(u32 RCC_APBnPeriphn, GPIO_TypeDef *GPIOx,u16 PIN, u8 GPIO_PinSource, u8 GPIO_AF);
- void DSHOT_DMA_Config(TIM_TypeDef* TIMx,uint16_t TIM_DMASource, DMA_Stream_TypeDef *DMA_Streamx,u32 chx,u32 par,u32 mar);
- void Dshot_NVIC_Config(u8 NVIC_IRQChannel, u8 pre, u8 sub);
-
- void Dshot_TIM_Config(void(*ClockCMD)(uint32_t, FunctionalState),u32 RCC_APBnPeriphn,
- TIM_TypeDef* TIMx, u16 psc, u16 per,
- void(*TIM_OCInit)(TIM_TypeDef*, TIM_OCInitTypeDef*),
- void(*TIM_OCPreloadConfig)(TIM_TypeDef*, uint16_t));
-
-
- #endif
-
-
-
-
-
-
-
-
-
-
-
-
|