NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
system_calls_pwm Struct Reference

pwm related system calls More...

#include <system_calls.h>

Data Fields

void(* write_motor )(const struct system_calls_pwm *self, uint8_t id, uint16_t value)
 
void(* write_servo )(const struct system_calls_pwm *self, uint8_t id, uint16_t value)
 
uint16_t(* read_pwm )(const struct system_calls_pwm *self, uint8_t chan)
 
uint16_t(* read_ppm )(const struct system_calls_pwm *self, uint8_t chan)
 

Detailed Description

pwm related system calls

System calls for reading and writing pwm/ppm values.

Field Documentation

uint16_t(* system_calls_pwm::read_ppm)(const struct system_calls_pwm *self, uint8_t chan)
Parameters
chanppm channel to read
Returns
ppm value of the given channel. If channel is out of range then 0 should be returned.
uint16_t(* system_calls_pwm::read_pwm)(const struct system_calls_pwm *self, uint8_t chan)
Parameters
chanpwm channel to read
Returns
pwm value of the given channel. If channel is out of range then 0 should be returned.
void(* system_calls_pwm::write_motor)(const struct system_calls_pwm *self, uint8_t id, uint16_t value)
Parameters
selfinstance of the system calls interface
idmotor id (typically in range 0 - 7)
valuepwm value (typically in range 1000-2000 but can be slightly more or less)

Writes a motor value to a motor output with given id. If id is out of range then values should be ignored. Motor outputs are typically separate from servo outputs and run at 490hz instead of 50hz update rate.

void(* system_calls_pwm::write_servo)(const struct system_calls_pwm *self, uint8_t id, uint16_t value)
Parameters
selfinstance of the system calls interface
idservo id (typically in range 0 - 7)
valuepwm value (typically in range 1000-2000 but can be slightly more or less)

Writes a servo value to the given output. If output id is out of range then value should be ignored.


The documentation for this struct was generated from the following file: