Class TCustomPWM
Unit
PXL.Boards.Types
Declaration
type TCustomPWM = class abstract(TObject)
Description
Abstract PWM (Pulse-Width Modulation) manager.
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
function GetDutyCycle(const Channel: TPinChannel): Cardinal; virtual; abstract; |
|
Returns current duty cycle (nanoseconds, in relation to period) set for the specified channel.
|
 |
function GetEnabled(const Channnel: TPinChannel): Boolean; virtual; abstract; |
|
Returns True when the specified channel is configured for PWM output and False otherwise.
|
 |
function GetPeriod(const Channel: TPinChannel): Cardinal; virtual; abstract; |
|
Returns current period (nanoseconds) set for the specified channel.
|
 |
procedure Start(const Channel: TPinChannel; const Frequency, DutyCycle: Cardinal); virtual; |
|
Starts Pulse-Width Modulation on specified channel with the desired frequency (in Hz) and duty cycle.
Parameters
- Pin
- Physical channel number on which to enable PWM.
- Frequency
- The desired frequency (in Hz).
- DutyCycle
- The desired duty cycle as fixed-point between 0 and 65535, each corresponding to 0% and 100% respectively.
|
 |
procedure Stop(const Channel: TPinChannel); virtual; |
|
Stops PWM on the specified Pin.
|
 |
procedure SetDutyCycle(const Channel: TPinChannel; const Value: Cardinal); virtual; abstract; |
|
Changes duty cycle (nanoseconds, in relation to period) for the specified channel.
|
 |
procedure SetEnabled(const Channel: TPinChannel; const Value: Boolean); virtual; abstract; |
|
Changes status of PWM output on the specified channel.
|
 |
procedure SetPeriod(const Channel: TPinChannel; const Value: Cardinal); virtual; abstract; |
|
Changes period (nanoseconds) for the specified channel.
|
Properties
 |
property DutyCycle[constChannel:TPinChannel]: Cardinal read GetDutyCycle write SetDutyCycle; |
|
Determines PWM duty cycle in nanoseconds in respect to period (e.g. 500000 ns for period of 1000000 ns would define a 50% of duty cycle).
|
 |
property Period[constChannel:TPinChannel]: Cardinal read GetPeriod write SetPeriod; |
|
Determines PWM period in nanoseconds (e.g. 1000000 ns period would be 1 ms or 100 hz).
|
Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.
|