ESP32Servo
|
#include <ESP32Servo.h>
Public Member Functions | |
Servo () | |
int | attach (int pin) |
int | attach (int pin, int min, int max) |
void | detach () |
void | write (int value) |
void | writeMicroseconds (int value) |
int | read () |
int | readMicroseconds () |
bool | attached () |
void | setTimerWidth (int value) |
int | readTimerWidth () |
void | setPeriodHertz (int hertz) |
Private Member Functions | |
int | usToTicks (int usec) |
int | ticksToUs (int ticks) |
ESP32PWM * | getPwm () |
Private Attributes | |
int | min = DEFAULT_uS_LOW |
int | max = DEFAULT_uS_HIGH |
int | pinNumber = 0 |
int | timer_width = DEFAULT_TIMER_WIDTH |
int | ticks = DEFAULT_PULSE_WIDTH_TICKS |
int | timer_width_ticks = DEFAULT_TIMER_WIDTH_TICKS |
ESP32PWM | pwm |
int | REFRESH_CPS = 50 |
Definition at line 121 of file ESP32Servo.h.
Servo::Servo | ( | ) |
Definition at line 57 of file ESP32Servo.cpp.
References DEFAULT_PULSE_WIDTH_TICKS, DEFAULT_TIMER_WIDTH, DEFAULT_uS_HIGH, DEFAULT_uS_LOW, max, min, pinNumber, REFRESH_CPS, ticks, timer_width, and timer_width_ticks.
int Servo::attach | ( | int | pin | ) |
Definition at line 73 of file ESP32Servo.cpp.
References DEFAULT_uS_HIGH, and DEFAULT_uS_LOW.
int Servo::attach | ( | int | pin, |
int | min, | ||
int | max | ||
) |
Definition at line 79 of file ESP32Servo.cpp.
References ESP32PWM::attachPin(), DEFAULT_PULSE_WIDTH_TICKS, DEFAULT_TIMER_WIDTH, ESP32PWM::hasPwm(), max, MAX_PULSE_WIDTH, min, MIN_PULSE_WIDTH, pin, pinNumber, pwm, REFRESH_CPS, ticks, timer_width, and timer_width_ticks.
bool Servo::attached | ( | ) |
Definition at line 183 of file ESP32Servo.cpp.
References ESP32PWM::attached(), and pwm.
Referenced by detach(), loop(), readMicroseconds(), setTimerWidth(), and writeMicroseconds().
void Servo::detach | ( | ) |
Definition at line 120 of file ESP32Servo.cpp.
References attached(), ESP32PWM::detachPin(), pinNumber, and pwm.
Referenced by loop().
|
private |
Definition at line 68 of file ESP32Servo.cpp.
References pwm.
int Servo::read | ( | ) |
Definition at line 163 of file ESP32Servo.cpp.
References max, min, and readMicroseconds().
int Servo::readMicroseconds | ( | ) |
Definition at line 168 of file ESP32Servo.cpp.
References attached(), ticks, and ticksToUs().
Referenced by read().
int Servo::readTimerWidth | ( | ) |
Definition at line 221 of file ESP32Servo.cpp.
References timer_width.
|
inline |
Definition at line 138 of file ESP32Servo.h.
References REFRESH_CPS, setTimerWidth(), ticks, ticksToUs(), timer_width, and usToTicks().
Referenced by loop(), and setup().
void Servo::setTimerWidth | ( | int | value | ) |
Definition at line 188 of file ESP32Servo.cpp.
References attached(), ESP32PWM::attachPin(), ESP32PWM::detachPin(), pinNumber, pwm, REFRESH_CPS, ticks, timer_width, and timer_width_ticks.
Referenced by setPeriodHertz().
|
private |
Definition at line 231 of file ESP32Servo.cpp.
References REFRESH_CPS, REFRESH_USEC, and timer_width_ticks.
Referenced by readMicroseconds(), and setPeriodHertz().
|
private |
Definition at line 226 of file ESP32Servo.cpp.
References REFRESH_CPS, REFRESH_USEC, and timer_width_ticks.
Referenced by setPeriodHertz(), and writeMicroseconds().
void Servo::write | ( | int | value | ) |
Definition at line 131 of file ESP32Servo.cpp.
References max, min, MIN_PULSE_WIDTH, and writeMicroseconds().
Referenced by loop().
void Servo::writeMicroseconds | ( | int | value | ) |
Definition at line 146 of file ESP32Servo.cpp.
References attached(), max, min, pwm, ticks, usToTicks(), and ESP32PWM::write().
Referenced by write().
|
private |
Definition at line 150 of file ESP32Servo.h.
Referenced by attach(), read(), Servo(), write(), and writeMicroseconds().
|
private |
Definition at line 149 of file ESP32Servo.h.
Referenced by attach(), read(), Servo(), write(), and writeMicroseconds().
|
private |
Definition at line 151 of file ESP32Servo.h.
Referenced by attach(), detach(), Servo(), and setTimerWidth().
|
private |
Definition at line 156 of file ESP32Servo.h.
Referenced by attach(), attached(), detach(), getPwm(), setTimerWidth(), and writeMicroseconds().
|
private |
Definition at line 157 of file ESP32Servo.h.
Referenced by attach(), Servo(), setPeriodHertz(), setTimerWidth(), ticksToUs(), and usToTicks().
|
private |
Definition at line 153 of file ESP32Servo.h.
Referenced by attach(), readMicroseconds(), Servo(), setPeriodHertz(), setTimerWidth(), and writeMicroseconds().
|
private |
Definition at line 152 of file ESP32Servo.h.
Referenced by attach(), readTimerWidth(), Servo(), setPeriodHertz(), and setTimerWidth().
|
private |
Definition at line 154 of file ESP32Servo.h.
Referenced by attach(), Servo(), setTimerWidth(), ticksToUs(), and usToTicks().