Skip to content

Class daisy::PWMHandle::Channel

ClassList > daisy > PWMHandle > Channel

Classes

Type Name
struct Config
Configuration struct for an individual channel.

Public Functions

Type Name
Channel (PWMHandle * owner, uint32_t channel)
Private constructor for channel. Do not use.
PWMHandle::Result DeInit ()
Deinitialize the channel. Called automatically by PWMHandle::DeInit .
const Config & GetConfig () const
Returns a const reference to the Config struct.
PWMHandle::Result Init (const Channel::Config & config)
Initialize the channel. Must be called manually, after PWMHandle::Init __ __
PWMHandle::Result Init ()
Initialize the channel using all defaults. Must be called manually, after PWMHandle::Init __ __
void Set (float val)
Set the duty cycle for the PWM channel. Automatically normalized to the timer's period.
void SetRaw (uint32_t raw)
Set the duty cycle for the PWM channel.

Public Functions Documentation

function Channel

Private constructor for channel. Do not use.

inline daisy::PWMHandle::Channel::Channel (
    PWMHandle * owner,
    uint32_t channel
) 


function DeInit

Deinitialize the channel. Called automatically by PWMHandle::DeInit .

PWMHandle::Result daisy::PWMHandle::Channel::DeInit () 


function GetConfig

Returns a const reference to the Config struct.

inline const  Config & daisy::PWMHandle::Channel::GetConfig () const


function Init [½]

Initialize the channel. Must be called manually, after PWMHandle::Init __ __

PWMHandle::Result daisy::PWMHandle::Channel::Init (
    const  Channel::Config & config
) 


function Init [2/2]

Initialize the channel using all defaults. Must be called manually, after PWMHandle::Init __ __

PWMHandle::Result daisy::PWMHandle::Channel::Init () 


function Set

Set the duty cycle for the PWM channel. Automatically normalized to the timer's period.

inline void daisy::PWMHandle::Channel::Set (
    float val
) 

Parameters:

  • val Relative value, [0.0, 1.0]

Note:

May experience rounding errors when period is > 2^24; use SetRaw.


function SetRaw

Set the duty cycle for the PWM channel.

inline void daisy::PWMHandle::Channel::SetRaw (
    uint32_t raw
) 

Parameters:

  • raw Must be less than or equal to the timer's period


The documentation for this class was generated from the following file external-docs/libDaisy/src/per/pwm.h