1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 23:05:19 +03:00

Changes to sonar for new IO

This commit is contained in:
blckmn 2016-06-15 22:28:08 +10:00
parent 4bd0b0fb9c
commit c16d642d66
19 changed files with 150 additions and 113 deletions

View file

@ -16,7 +16,7 @@
*/
#pragma once
#include "gpio.h"
#include "timer.h"
#define MAX_PWM_MOTORS 12
@ -42,11 +42,10 @@
#define ONESHOT42_TIMER_MHZ 24
#define ONESHOT125_TIMER_MHZ 8
typedef struct sonarGPIOConfig_s {
GPIO_TypeDef *gpio;
uint16_t triggerPin;
uint16_t echoPin;
} sonarGPIOConfig_t;
typedef struct sonarIOConfig_s {
ioTag_t triggerPin;
ioTag_t echoPin;
} sonarIOConfig_t;
typedef struct drv_pwm_config_s {
bool useParallelPWM;
@ -78,7 +77,7 @@ typedef struct drv_pwm_config_s {
uint16_t motorPwmRate;
uint16_t idlePulse; // PWM value to use when initializing the driver. set this to either PULSE_1MS (regular pwm),
// some higher value (used by 3d mode), or 0, for brushed pwm drivers.
sonarGPIOConfig_t *sonarGPIOConfig;
sonarIOConfig_t *sonarConfig;
} drv_pwm_config_t;
enum {