NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pwm_output.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <platform.h>
#include "target.h"
#include "gpio.h"
#include "timer.h"
#include "system.h"
#include "pwm_mapping.h"
#include "pwm_output.h"
#include "common/maths.h"
Include dependency graph for pwm_output.c:

Data Structures

struct  pwmOutputPort_t
 

Macros

#define MAX_PWM_OUTPUT_PORTS   MAX(MAX_MOTORS, MAX_SERVOS)
 

Typedefs

typedef void(* pwmWriteFuncPtr )(uint8_t index, uint16_t value)
 

Functions

void pwmBrushedMotorConfig (const timerHardware_t *timerHardware, uint8_t motorIndex, uint16_t motorPwmRate, uint16_t idlePulse)
 
void pwmBrushlessMotorConfig (const timerHardware_t *timerHardware, uint8_t motorIndex, uint16_t motorPwmRate, uint16_t idlePulse)
 
void pwmOneshotMotorConfig (const timerHardware_t *timerHardware, uint8_t motorIndex)
 
void pwmServoConfig (const timerHardware_t *timerHardware, uint8_t servoIndex, uint16_t servoPwmRate, uint16_t servoCenterPulse)
 
void pwmWriteMotor (uint8_t index, uint16_t value)
 
void pwmShutdownPulsesForAllMotors (uint8_t motorCount)
 
void pwmWriteAllMotors (uint8_t motorCount, uint16_t mc, bool oneshot)
 
void pwmStopMotors (bool oneshot)
 
void pwmDisableMotors (void)
 
void pwmEnableMotors (void)
 
void pwmCompleteOneshotMotorUpdate (uint8_t motorCount)
 
bool isMotorBrushed (uint16_t motorPwmRate)
 

Macro Definition Documentation

#define MAX_PWM_OUTPUT_PORTS   MAX(MAX_MOTORS, MAX_SERVOS)

Typedef Documentation

typedef void(* pwmWriteFuncPtr)(uint8_t index, uint16_t value)

Function Documentation

bool isMotorBrushed ( uint16_t  motorPwmRate)
void pwmBrushedMotorConfig ( const timerHardware_t timerHardware,
uint8_t  motorIndex,
uint16_t  motorPwmRate,
uint16_t  idlePulse 
)
void pwmBrushlessMotorConfig ( const timerHardware_t timerHardware,
uint8_t  motorIndex,
uint16_t  motorPwmRate,
uint16_t  idlePulse 
)
void pwmCompleteOneshotMotorUpdate ( uint8_t  motorCount)

Here is the call graph for this function:

void pwmDisableMotors ( void  )
void pwmEnableMotors ( void  )
void pwmOneshotMotorConfig ( const timerHardware_t timerHardware,
uint8_t  motorIndex 
)
void pwmServoConfig ( const timerHardware_t timerHardware,
uint8_t  servoIndex,
uint16_t  servoPwmRate,
uint16_t  servoCenterPulse 
)
void pwmShutdownPulsesForAllMotors ( uint8_t  motorCount)
void pwmStopMotors ( bool  oneshot)

Here is the call graph for this function:

void pwmWriteAllMotors ( uint8_t  motorCount,
uint16_t  mc,
bool  oneshot 
)

Here is the call graph for this function:

void pwmWriteMotor ( uint8_t  index,
uint16_t  value 
)