Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Motor_Control_using_lib Motor_Control_API
You are viewing an older revision! See the latest version
Homepage
PwmOutResetSync¶
In the reset-synchronized PWM mode, three-phase output of positive and negative PWM waveforms that share a common wave transition point can be obtained by combining channels 3 and 4.
When set for reset-synchronized PWM mode, the TIOC3B, TIOC3D, TIOC4A, TIOC4C, TIOC4B, and TIOC4D pins function as PWM output pins and TCNT3 functions as an upcounter.
RZ/A1H infomation.
Output Pin | Description | Pin to connect to |
---|---|---|
TIOC3B | PWM output pin 1 | P8_11, (P7_9), (P3_5) |
TIOC3D | PWM output pin 1' (negative-phase waveform of PWM output 1) | P8_13, P5_4, (P7_11), (P3_7) |
TIOC4A | PWM output pin 2 | P3_8, P4_4, (P7_12), (P11_0) |
TIOC4C | PWM output pin 2' (negative-phase waveform of PWM output 2) | P3_10, P4_6, (P7_14), (P11_2) |
TIOC4B | PWM output pin 3 | P3_9, P4_5, (P7_13), (P11_1) |
TIOC4D | PWM output pin 3' (negative-phase waveform of PWM output 3) | P7_15, P3_11, P4_7, (P11_3) |
():On the GR-PEACH, it can not be used.
API¶
Import library
Public Member Functions |
|
PwmOutResetSync (PinName pin, PinName neg_ph_pin=NC) | |
Create a
PwmOutResetSync
connected to the specified pin.
|
|
virtual | ~PwmOutResetSync () |
Destructor.
|
|
void | write (float value) |
Set the ouput duty-cycle, specified as a percentage (float)
|
|
float | read () |
Return the current output duty-cycle setting, measured as a percentage (float)
|
|
void | pulsewidth (float seconds) |
Set the PWM pulsewidth, specified in seconds (float), keeping the period the same.
|
|
void | pulsewidth_ms (int ms) |
Set the PWM pulsewidth, specified in milli-seconds (int), keeping the period the same.
|
|
void | pulsewidth_us (int us) |
Set the PWM pulsewidth, specified in micro-seconds (int), keeping the period the same.
|
|
PwmOutResetSync & | operator= (float value) |
A operator shorthand for
write()
|
|
operator float () | |
An operator shorthand for
read()
|
|
Static Public Member Functions |
|
static void | period (float seconds) |
Set the PWM period, specified in seconds (float), keeping the duty cycle the same.
|
|
static void | period_ms (int ms) |
Set the PWM period, specified in milli-seconds (int), keeping the duty cycle the same.
|
|
static void | period_us (int us) |
Set the PWM period, specified in micro-seconds (int), keeping the duty cycle the same.
|