#include <68332/types.h>
#include <68332/tpu.h>
Go to the source code of this file.
Functions | |
void | ptapulse_init (TPUChannel *handle, bool pulseLevel) |
uint32 | ptapulse_result (TPUChannel *handle) |
To use the functions defined in this file, include <68332/ptapulse.h> and link libtpu.a.
|
Starts pulse width measurement of square wave pulses input to a TPU channel pin. The first call to this function initializes the pin for pulse width measurement using PTA. Should only be called once; the PTA function will measure every pulse thereafter and set the channel interrupt status bit after every pulse.
|
|
Returns the result of the pulse width measurements started by ptapulse_init(). Must be called after ptapulse_init(). Valid only when the channel interrupt status bit is set. NOTE: Must be called before the next pulse measurement accumulates more than 65535 counts of TCR1, or else the result will be corrupted.
|