Yet another implementation of wave function generator
sawwave Class Reference
sawwave class More...
#include <sawwave.h>
Inherits wave.
Public Member Functions | |
| sawwave (float v, int f, int d=50, int p=0) | |
| constructor | |
| ~sawwave (void) | |
| destructor | |
| virtual void | duty (int newvalue) |
| mutator for duty (ignored for sawwave) | |
| virtual int | duty (void) |
| inspector for duty always returns 100 | |
| virtual int | value (void) |
| inspector for the value at _pos | |
| void | volt (float newvalue) |
| mutator for _amp but in float voltage | |
| float | volt (void) |
| inspector for _amp but in float voltage | |
| void | amp (int newvalue) |
| mutator for _amp in int value | |
| int | amp (void) |
| inspector for _amp | |
| void | cycle (int newvalue) |
| mutator for _cycle | |
| int | cycle (void) |
| inspector for _cycle | |
| void | phase (int newvalue) |
| mutator for _phase | |
| int | phase (void) |
| inspector for _phase | |
| void | freq (int newvalue) |
| mutator for _cycle but in frequency (Hz) | |
| int | freq (void) |
| inspector for _cycle but in frequency (Hz) | |
| void | pos (int newvalue) |
| mutator for _pos current positon in _cycle | |
| int | pos (void) |
| insepector for _pos | |
| virtual void | update (void) |
| update internal value consistancy | |
| virtual void | advance (int s=1) |
| advance position to be accessed through value() | |
| virtual const char * | name (void) |
| inspector to return class name | |
Protected Member Functions | |
| int | phase2pos (int p) |
| utility function to convert phase to position | |
| int | pos2phase (int p) |
| utility function to convert position to phase | |
Detailed Description
sawwave class
Definition at line 26 of file sawwave.h.
Constructor & Destructor Documentation
| sawwave | ( | float | v, |
| int | f, | ||
| int | d = 50, |
||
| int | p = 0 |
||
| ) |
constructor
sawwave class Copyright (c) 2014, 2015 Motoo Tanaka @ Design Methodology Lab
- Parameters:
-
float v amplitude in voltage (0.0 ~ 3.28V for FRDM-KL25Z) int f frequency in Hz (1 ~ 10000Hz) int d duty, ignored for sawwave int p phase in degree (0 ~ 359 degree)
- Returns:
- sawwave class instance
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition at line 15 of file sawwave.cpp.
| ~sawwave | ( | void | ) |
destructor
Definition at line 20 of file sawwave.cpp.
Member Function Documentation
| void advance | ( | int | s = 1 ) |
[virtual, inherited] |
| void amp | ( | int | newvalue ) | [inherited] |
| int amp | ( | void | ) | [inherited] |
| void cycle | ( | int | newvalue ) | [inherited] |
| int cycle | ( | void | ) | [inherited] |
| int duty | ( | void | ) | [virtual] |
inspector for duty always returns 100
Reimplemented from wave.
Definition at line 27 of file sawwave.cpp.
| void duty | ( | int | newvalue ) | [virtual] |
mutator for duty (ignored for sawwave)
Reimplemented from wave.
Definition at line 22 of file sawwave.cpp.
| void freq | ( | int | newvalue ) | [inherited] |
| int freq | ( | void | ) | [inherited] |
| const char * name | ( | void | ) | [virtual, inherited] |
| void phase | ( | int | newvalue ) | [inherited] |
| int phase | ( | void | ) | [inherited] |
| int phase2pos | ( | int | p ) | [protected, inherited] |
| void pos | ( | int | newvalue ) | [inherited] |
| int pos | ( | void | ) | [inherited] |
| int pos2phase | ( | int | p ) | [protected, inherited] |
| void update | ( | void | ) | [virtual, inherited] |
| int value | ( | void | ) | [virtual] |
inspector for the value at _pos
- Returns:
- int value at current position
Reimplemented from wave.
Definition at line 32 of file sawwave.cpp.
| void volt | ( | float | newvalue ) | [inherited] |
Generated on Wed Jul 13 2022 01:58:56 by
1.7.2