[Overview][Types][Classes][Index] |
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
PWM implementation based on Linux SysFS user space interface
Source position: fppwm.pas line 69
type TPWMLinux = class(TPWM) |
||
strict protected |
||
function GetDutyCycle; override; |
||
function GetEnabled; override; |
||
function GetPeriod; override; |
||
function GetPolarity; override; |
||
procedure SetDutyCycle(); override; |
||
procedure SetEnabled(); override; |
||
procedure SetPeriod(); override; |
||
procedure SetPolarity(); override; |
||
class procedure SetExport(); |
|
Exports or unexports PWM channel |
public |
||
property ChipCount: LongInt; [r] |
|
Returns the chip count visible in SysFS |
property ChannelCount []: LongInt; [r] |
|
Channel cound provided by given chip |
property Chip: LongInt; [r] |
|
The used PWM chip |
property Channel: LongInt; [r] |
|
The used PWM channel |
constructor Create(); |
|
Creates a new PWM object |
destructor Destroy; override; |
|
Unexports PWM channel and destroys object |
end; |
|
PWM implementation based on Linux SysFS user space interface |
|
| | ||
|
Abstract PWM access class |
|
| | ||
TObject |
program pwm_linux; uses fppwm; var pwm: TPWMLinux; begin pwm := TPWMLinux.Create(0,0); try pwm.Period := 10000; // 10 kHz total time pwm.DutyCycle := 6000; // 6 kHz active time pwm.Enabled := True; finally pwm.Destroy; end; end.