* * *

Author Topic: hwiringpi pascal wrapper with I2C support  (Read 382 times)

pascalbythree

  • Jr. Member
  • **
  • Posts: 59
hwiringpi pascal wrapper with I2C support
« on: September 10, 2017, 08:00:28 pm »
Hey can somebody send me the hwiringpi pascal wrapper with i2c functions/procedures in it?

to:

woutervanwegen@mijnplinq.nl

I did come accross the version before. Then i installed my I2C debug station as seen in the attached photo. And started coding again then i could not find the wrapper back with i2c support in it.

Thank you very Much, Greets Wouter van Wegen

pascalbythree

  • Jr. Member
  • **
  • Posts: 59
Re: hwiringpi pascal wrapper with I2C support
« Reply #1 on: September 10, 2017, 08:26:14 pm »
Mzz... Found it back already!

Check this:

unit h2wiringpiI2c;

(* Pascal wrapper unit for Gordon Henderson wiringPi library. The source can
 * be found at https://http://wiringpi.com
 *
 * hwiringpi: origanal Wrapper and
 * pascal sample by Alex Schaller.
 *
 * h2wiringpiI2C: Version 0.1 By Allen Roton
 * wiringPi Version 2.23
 * $linklib
 *
 * wiringPi:
 *   Arduino compatable (ish) Wiring library for the Raspberry Pi
 *   Copyright (c) 2012 Gordon Henderson
 ***********************************************************************
 * This file is part of wiringPi:
 *   https://projects.drogon.net/raspberry-pi/wiringpi/
 *
 *    wiringPi is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    wiringPi is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with wiringPi.  If not, see <http://www.gnu.org/licenses/>.
 ***********************************************************************
 *)

//{$mode objfpc}{$H+}

{$linklib c}
{$linklib libwiringPi}
interface
    {
    }


//extern int wiringPiI2CRead           (int fd) ;
Function wiringPiI2CRead(fd : longint ):longint;cdecl;external;

//extern int wiringPiI2CReadReg8       (int fd, int reg) ;
Function wiringPiI2CReadReg8(fd : longint;reg : longint ):longint;cdecl;external;

//extern int wiringPiI2CReadReg16      (int fd, int reg) ;
Function wiringPiI2CReadReg16(fd : longint;reg : longint ):longint;cdecl;external;

//extern int wiringPiI2CWrite          (int fd, int data) ;
Function wiringPiI2CWrite(fd : longint;data : longint ):longint;cdecl;external;

//extern int wiringPiI2CWriteReg8      (int fd, int reg, int data) ;
Function wiringPiI2CWriteReg8(fd : longint;reg : longint ;data : longint ):longint;cdecl;external;

//extern int wiringPiI2CWriteReg16     (int fd, int reg, int data) ;
Function wiringPiI2CWriteReg16(fd : longint;reg : longint ;data : longint ):longint;cdecl;external;

//extern int wiringPiI2CSetupInterface (const char *device, int devId) ;
// ??? what is it ?

//extern int wiringPiI2CSetup          (const int devId) ;
Function wiringPiI2CSetup(devId : longint ):longint;cdecl;external;


implementation

end.


pascalbythree

  • Jr. Member
  • **
  • Posts: 59
Re: hwiringpi pascal wrapper with I2C support
« Reply #2 on: September 10, 2017, 08:36:52 pm »
Now i am going to try to compile the damm thing.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus