Difference between revisions of "Hardware Access"

From Free Pascal wiki
Jump to navigationJump to search
m
m
Line 6: Line 6:
 
<code>
 
<code>
 
  uses
 
  uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
 
 
  {$IFDEF WIN32}
 
  {$IFDEF WIN32}
   Windows,
+
   Windows;
 
  {$ENDIF}
 
  {$ENDIF}
 
  {$IFDEF Linux}
 
  {$IFDEF Linux}
   ports,
+
   ports;
 
  {$ENDIF}
 
  {$ENDIF}
  ComCtrls, StdCtrls, Buttons, ActnList, Spin, controles, Geral, hardware;
 
 
</code>
 
</code>
  

Revision as of 02:05, 16 October 2005

Overview

This page is the start of a tutorial about accessing hardware devices on Lazarus. These devices include, but are not limited to: ISA, PCI, USB, parallel port, serial port.

Access to hardware devices in a multi-platform way is not implemented by Free Pascal Runtime Library or by the LCL, so this will basically cover hardware access methods on different platforms. The code can be compiled on different environments using conditional compiles, like this:

uses
{$IFDEF WIN32}
  Windows;
{$ENDIF}
{$IFDEF Linux}
  ports;
{$ENDIF}

Using inpout32.dll for Windows

Using ioperm to access ports on Linux