Unit Wiring

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo implementation of the Wiring API

This unit is intended to produce similar functionality to Gordon Henderson's WiringPi library for Linux to allow easy porting of existing code or examples to Ultibo. The WiringPi library itself is based loosely on the Wiring API for Arduino and other microcontrollers.

Note that Ultibo has an extensive API already that provides most of the same functionality as WiringPi by using the GPIO unit and some of the other device units such as I2C, SPI and PWM. It is not necessary to use this unit for GPIO access, it is simply provided as an alternative for those who have existing code or are familiar with the WiringPi API.

This unit is specific to Ultibo, if you want to use the WiringPi library from FPC/Lazarus on Linux then see the Lazarus WiringPi wrapper by Alex Schaller which is available from http://forum.lazarus.freepascal.org/index.php/topic,17404.0.html

Pin numbering is maintained as per the original WiringPi library so that example code will port without changes. The pin numbering is different to the GPIO device unit which uses a linear numbering scheme to make it hardware independent.

Function names and parameters are also maintained almost exactly as per the original library.

To use the Wiring unit you must also include the driver unit for the specific board that you are using by adding it to the uses clause in your program.

  • For Raspberry Pi A/B/A+/B+/Zero add BCM2708
  • For Raspberry Pi 2B add BCM2709
  • For Raspberry Pi 3B add BCM2710

Note that this unit implements the WiringPi version 2 API and not the old version 1 API.

Since version 2 was released in 2013 most code should now be updated to use the new functions.

Currently based on WiringPi release 2.32

Constants


See http://wiringpi.com/reference/

Type definitions


See http://wiringpi.com/reference/

Public variables


See http://wiringpi.com/reference/

Function declarations


See http://wiringpi.com/reference/


Return to Unit Reference