Home

Add

Edit

Without Linenumbers

Code in Textfield

Download

  1. ''
    
  2. ''
    
  3. '' wiringPi -- header translated with help of SWIG FB wrapper
    
  4. ''
    
  5. '' NOTICE: This file is part of the FreeBASIC Compiler package and can't
    
  6. ''         be included in other distributions without authorization.
    
  7. ''
    
  8. ''
    
  9. #IFNDEF __wiringPi_bi__
    
  10. #DEFINE __wiringPi_bi__
    
  11. 
    
  12. #DEFINE NUM_PINS 17
    
  13. #DEFINE WPI_MODE_PINS 0
    
  14. #DEFINE WPI_MODE_GPIO 1
    
  15. #DEFINE WPI_MODE_GPIO_SYS 2
    
  16. #DEFINE WPI_MODE_PHYS 3
    
  17. #DEFINE WPI_MODE_PIFACE 4
    
  18. #DEFINE WPI_MODE_UNINITIALISED -1
    
  19. #DEFINE MODE_INPUT 0
    
  20. #DEFINE MODE_OUTPUT 1
    
  21. #DEFINE PWM_OUTPUT 2
    
  22. #DEFINE GPIO_CLOCK 3
    
  23. #DEFINE LOW 0
    
  24. #DEFINE HIGH 1
    
  25. #DEFINE PUD_OFF 0
    
  26. #DEFINE PUD_DOWN 1
    
  27. #DEFINE PUD_UP 2
    
  28. #DEFINE PWM_MODE_MS 0
    
  29. #DEFINE PWM_MODE_BAL 1
    
  30. #DEFINE INT_EDGE_SETUP 0
    
  31. #DEFINE INT_EDGE_FALLING 1
    
  32. #DEFINE INT_EDGE_RISING 2
    
  33. #DEFINE INT_EDGE_BOTH 3
    
  34. 
    
  35. Type wiringPiNodeStruct
    
  36.     pinBase As Integer
    
  37.     pinMax As Integer
    
  38.     fd As Integer
    
  39.     data0 As Uinteger
    
  40.     data1 As Uinteger
    
  41.     data2 As Uinteger
    
  42.     data3 As Uinteger
    
  43.     pinMode As Sub Cdecl(Byval As wiringPiNodeStruct Ptr, Byval As Integer, Byval As Integer)
    
  44.     pullUpDnControl As Sub Cdecl(Byval As wiringPiNodeStruct Ptr, Byval As Integer, Byval As Integer)
    
  45.     digitalRead As Function Cdecl(Byval As wiringPiNodeStruct Ptr, Byval As Integer) As Integer
    
  46.     digitalWrite As Sub Cdecl(Byval As wiringPiNodeStruct Ptr, Byval As Integer, Byval As Integer)
    
  47.     pwmWrite As Sub Cdecl(Byval As wiringPiNodeStruct Ptr, Byval As Integer, Byval As Integer)
    
  48.     analogRead As Function Cdecl(Byval As wiringPiNodeStruct Ptr, Byval As Integer) As Integer
    
  49.     analogWrite As Sub Cdecl(Byval As wiringPiNodeStruct Ptr, Byval As Integer, Byval As Integer)
    
  50.     Next As wiringPiNodeStruct Ptr
    
  51. End Type
    
  52. Extern wiringPiNodes Alias "wiringPiNodes" As wiringPiNodeStruct Ptr
    
  53. 
    
  54. Declare Function wiringPiFailure Cdecl Alias "wiringPiFailure" (Byval fatal As Integer, Byval message As Zstring Ptr, ...) As Integer
    
  55. Declare Function wiringPiFindNode Cdecl Alias "wiringPiFindNode" (Byval pin As Integer) As wiringPiNodeStruct Ptr
    
  56. Declare Function wiringPiNewNode Cdecl Alias "wiringPiNewNode" (Byval pinBase As Integer, Byval numPins As Integer) As wiringPiNodeStruct Ptr
    
  57. Declare Function wiringPiSetup Cdecl Alias "wiringPiSetup" () As Integer
    
  58. Declare Function wiringPiSetupSys Cdecl Alias "wiringPiSetupSys" () As Integer
    
  59. Declare Function wiringPiSetupGpio Cdecl Alias "wiringPiSetupGpio" () As Integer
    
  60. Declare Function wiringPiSetupPhys Cdecl Alias "wiringPiSetupPhys" () As Integer
    
  61. Declare Sub pinModeAlt Cdecl Alias "pinModeAlt" (Byval pin As Integer, Byval mode As Integer)
    
  62. Declare Sub pinMode Cdecl Alias "pinMode" (Byval pin As Integer, Byval mode As Integer)
    
  63. Declare Sub pullUpDnControl Cdecl Alias "pullUpDnControl" (Byval pin As Integer, Byval pud As Integer)
    
  64. Declare Function digitalRead Cdecl Alias "digitalRead" (Byval pin As Integer) As Integer
    
  65. Declare Sub digitalWrite Cdecl Alias "digitalWrite" (Byval pin As Integer, Byval value As Integer)
    
  66. Declare Sub pwmWrite Cdecl Alias "pwmWrite" (Byval pin As Integer, Byval value As Integer)
    
  67. Declare Function analogRead Cdecl Alias "analogRead" (Byval pin As Integer) As Integer
    
  68. Declare Sub analogWrite Cdecl Alias "analogWrite" (Byval pin As Integer, Byval value As Integer)
    
  69. Declare Function wiringPiSetupPiFace Cdecl Alias "wiringPiSetupPiFace" () As Integer
    
  70. Declare Function wiringPiSetupPiFaceForGpioProg Cdecl Alias "wiringPiSetupPiFaceForGpioProg" () As Integer
    
  71. Declare Function piBoardRev Cdecl Alias "piBoardRev" () As Integer
    
  72. Declare Function wpiPinToGpio Cdecl Alias "wpiPinToGpio" (Byval wpiPin As Integer) As Integer
    
  73. Declare Function physPinToGpio Cdecl Alias "physPinToGpio" (Byval physPin As Integer) As Integer
    
  74. Declare Sub setPadDrive Cdecl Alias "setPadDrive" (Byval group As Integer, Byval value As Integer)
    
  75. Declare Function getAlt Cdecl Alias "getAlt" (Byval pin As Integer) As Integer
    
  76. Declare Sub digitalWriteByte Cdecl Alias "digitalWriteByte" (Byval value As Integer)
    
  77. Declare Sub pwmSetMode Cdecl Alias "pwmSetMode" (Byval mode As Integer)
    
  78. Declare Sub pwmSetRange Cdecl Alias "pwmSetRange" (Byval range As Uinteger)
    
  79. Declare Sub pwmSetClock Cdecl Alias "pwmSetClock" (Byval divisor As Integer)
    
  80. Declare Sub gpioClockSet Cdecl Alias "gpioClockSet" (Byval pin As Integer, Byval freq As Integer)
    
  81. Declare Function waitForInterrupt Cdecl Alias "waitForInterrupt" (Byval pin As Integer, Byval mS As Integer) As Integer
    
  82. Declare Function wiringPiISR Cdecl Alias "wiringPiISR" (Byval pin As Integer, Byval mode As Integer, Byval Function As Sub Cdecl()) As Integer
    
  83. Declare Function piThreadCreate Cdecl Alias "piThreadCreate" (Byval fn As Sub Cdecl(Byval As Any Ptr)) As Integer
    
  84. Declare Sub piLock Cdecl Alias "piLock" (Byval key As Integer)
    
  85. Declare Sub piUnlock Cdecl Alias "piUnlock" (Byval key As Integer)
    
  86. Declare Function piHiPri Cdecl Alias "piHiPri" (Byval pri As Integer) As Integer
    
  87. Declare Sub delay Cdecl Alias "delay" (Byval howLong As Uinteger)
    
  88. Declare Sub delayMicroseconds Cdecl Alias "delayMicroseconds" (Byval howLong As Uinteger)
    
  89. Declare Function millis Cdecl Alias "millis" () As Uinteger
    
  90. Declare Function micros Cdecl Alias "micros" () As Uinteger
    
  91. 
    
  92. #ENDIF