mirror of https://github.com/ARMmbed/mbed-os.git
PwmOut: Add explicit pinmap support
parent
ce4a943350
commit
db5c5b5fb0
|
@ -61,6 +61,12 @@ public:
|
||||||
*/
|
*/
|
||||||
PwmOut(PinName pin);
|
PwmOut(PinName pin);
|
||||||
|
|
||||||
|
/** Create a PwmOut connected to the specified pin
|
||||||
|
*
|
||||||
|
* @param pinmap reference to strucure which holds static pinmap.
|
||||||
|
*/
|
||||||
|
PwmOut(const PinMap &pinmap);
|
||||||
|
|
||||||
~PwmOut();
|
~PwmOut();
|
||||||
|
|
||||||
/** Set the output duty-cycle, specified as a percentage (float)
|
/** Set the output duty-cycle, specified as a percentage (float)
|
||||||
|
|
|
@ -35,6 +35,13 @@ PwmOut::PwmOut(PinName pin) :
|
||||||
PwmOut::init();
|
PwmOut::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PwmOut::PwmOut(const PinMap &pinmap) : _deep_sleep_locked(false)
|
||||||
|
{
|
||||||
|
core_util_critical_section_enter();
|
||||||
|
pwmout_init_direct(&_pwm, &pinmap);
|
||||||
|
core_util_critical_section_exit();
|
||||||
|
}
|
||||||
|
|
||||||
PwmOut::~PwmOut()
|
PwmOut::~PwmOut()
|
||||||
{
|
{
|
||||||
PwmOut::deinit();
|
PwmOut::deinit();
|
||||||
|
|
Loading…
Reference in New Issue