20#include "platform/platform.h"
22#if DEVICE_PWMOUT || defined(DOXYGEN_ONLY)
23#include "hal/pwmout_api.h"
145 MBED_DEPRECATED(
"use read_pulsewidth_us() instead")
198 void lock_deep_sleep();
201 void unlock_deep_sleep();
208 static void _call_pwmout_init_direct(
PwmOut *thisPtr);
209 static void _call_pwmout_init(
PwmOut *thisPtr);
220 PinMap const *
const _pinmap;
223 void (*_init_func)(
PwmOut *);
225 bool _deep_sleep_locked;
A pulse-width modulation digital output.
void write(float value)
Set the output duty-cycle, specified as a percentage (float)
void period_ms(int ms)
Set the PWM period, specified in milliseconds (int), keeping the duty cycle the same.
void period_us(int us)
Set the PWM period, specified in microseconds (int), keeping the duty cycle the same.
void suspend()
Suspend PWM operation.
void resume()
Resume PWM operation.
int read_pulsewidth_us()
Read the PWM pulsewidth.
void period(float seconds)
Set the PWM period, specified in seconds (float), keeping the duty cycle the same.
void pulsewidth_ms(int ms)
Set the PWM pulsewidth, specified in milliseconds (int), keeping the period the same.
float read()
Return the current output duty-cycle setting, measured as a percentage (float)
int read_pulsewitdth_us()
Read the PWM pulsewidth.
PwmOut & operator=(float value)
A operator shorthand for write()
void pulsewidth_us(int us)
Set the PWM pulsewidth, specified in microseconds (int), keeping the period the same.
int read_period_us()
Read the PWM period.
void pulsewidth(float seconds)
Set the PWM pulsewidth, specified in seconds (float), keeping the period the same.
PwmOut(PinName pin)
Create a PwmOut connected to the specified pin.
PwmOut(const PinMap &pinmap)
Create a PwmOut connected to the specified pin.
struct pwmout_s pwmout_t
Pwmout hal structure.