#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include "stm32f10x_conf.h"
#include "drv_gpio.h"
#include "drv_timer.h"
#include "drv_pwm.h"
#include "drv_system.h"
Go to the source code of this file.
|
static void | configureSonar (uint8_t port) |
|
static void | ppmCallback (uint8_t port, uint16_t capture) |
|
static void | pwmCallback (uint8_t port, uint16_t capture) |
|
static void | pwmGPIOConfig (GPIO_TypeDef *gpio, uint32_t pin, GPIO_Mode mode) |
|
static void | pwmICConfig (TIM_TypeDef *tim, uint8_t channel, uint16_t polarity) |
|
static pwmPortData_t * | pwmInConfig (uint8_t port, timerCCCallbackPtr callback, uint8_t channel) |
|
void | pwmInit (bool useCPPM, bool usePwmFilter, bool fastPWM, uint32_t motorPwmRate, uint16_t idlePulseUsec) |
|
uint32_t | pwmLastUpdate () |
|
bool | pwmNewData () |
|
static void | pwmOCConfig (TIM_TypeDef *tim, uint8_t channel, uint16_t value) |
|
static pwmPortData_t * | pwmOutConfig (uint8_t port, uint8_t mhz, uint16_t period, uint16_t value) |
|
uint16_t | pwmRead (uint8_t channel) |
|
static void | pwmWriteBrushed (uint8_t index, uint16_t value) |
|
void | pwmWriteMotor (uint8_t index, uint16_t value) |
|
static void | pwmWriteStandard (uint8_t index, uint16_t value) |
|
static void | sonarCallback (uint8_t port, uint16_t capture) |
|
bool | sonarPresent () |
|
float | sonarRead (uint8_t channel) |
|
#define PWM_TIMER_8_MHZ 8 |
typedef void(* pwmWriteFuncPtr) (uint8_t index, uint16_t value) |
Enumerator |
---|
TYPE_IP |
|
TYPE_IW |
|
TYPE_M |
|
TYPE_S |
|
Definition at line 274 of file drv_pwm.c.
Enumerator |
---|
TYPE_PWM_IN_OUT |
|
TYPE_GPIO_OUTPUT |
|
Definition at line 281 of file drv_pwm.c.
static void configureSonar |
( |
uint8_t |
port | ) |
|
|
static |
static void ppmCallback |
( |
uint8_t |
port, |
|
|
uint16_t |
capture |
|
) |
| |
|
static |
static void pwmCallback |
( |
uint8_t |
port, |
|
|
uint16_t |
capture |
|
) |
| |
|
static |
static void pwmICConfig |
( |
TIM_TypeDef * |
tim, |
|
|
uint8_t |
channel, |
|
|
uint16_t |
polarity |
|
) |
| |
|
static |
void pwmInit |
( |
bool |
useCPPM, |
|
|
bool |
usePwmFilter, |
|
|
bool |
fastPWM, |
|
|
uint32_t |
motorPwmRate, |
|
|
uint16_t |
idlePulseUsec |
|
) |
| |
uint32_t pwmLastUpdate |
( |
| ) |
|
static void pwmOCConfig |
( |
TIM_TypeDef * |
tim, |
|
|
uint8_t |
channel, |
|
|
uint16_t |
value |
|
) |
| |
|
static |
static pwmPortData_t* pwmOutConfig |
( |
uint8_t |
port, |
|
|
uint8_t |
mhz, |
|
|
uint16_t |
period, |
|
|
uint16_t |
value |
|
) |
| |
|
static |
uint16_t pwmRead |
( |
uint8_t |
channel | ) |
|
static void pwmWriteBrushed |
( |
uint8_t |
index, |
|
|
uint16_t |
value |
|
) |
| |
|
static |
void pwmWriteMotor |
( |
uint8_t |
index, |
|
|
uint16_t |
value |
|
) |
| |
static void pwmWriteStandard |
( |
uint8_t |
index, |
|
|
uint16_t |
value |
|
) |
| |
|
static |
static void sonarCallback |
( |
uint8_t |
port, |
|
|
uint16_t |
capture |
|
) |
| |
|
static |
float sonarRead |
( |
uint8_t |
channel | ) |
|
const uint16_t multiPPM[] |
|
static |
const uint16_t multiPPMSONAR[] |
|
static |
const uint16_t multiPWM[] |
|
static |
uint32_t pwmLastUpdateTime_ms = 0 |
|
static |
bool sonar_present = false |
|
static |
uint8_t sonar_trigger_port |
|
static |