-
Notifications
You must be signed in to change notification settings - Fork 2
/
pigpio.xojo_code
2776 lines (2409 loc) · 121 KB
/
pigpio.xojo_code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#tag Module
Protected Module pigpio
#tag Method, Flags = &h1, Description = 546869732066756E6374696F6E207374617274732061206E657720656D7074792077617665666F726D2E200A596F7520776F756C646E2774206E6F726D616C6C79206E65656420746F2063616C6C20746869732066756E6374696F6E206173206974206973206175746F6D61746963616C6C792063616C6C656420616674657220612077617665666F726D2069732063726561746564207769746820746865206770696F576176654372656174652066756E6374696F6E2E20
Protected Sub AddWaveForm()
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioWaveAddNew()
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 52657475726E7320746865206E657720746F74616C206E756D626572206F662070756C73657320696E207468652063757272656E742077617665666F726D206966204F4B2E
Protected Function AddWaveForm(NumberOfPulses As UInteger, Pulse as pigpio.pigpioPulse) As UInteger
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioWaveAddGeneric(NumberOfPulses, Pulse)
if result < 0 then MakeException (result) else return result
#else
PigpioErrorCheck
#pragma unused NumberOfPulses
#pragma unused pulse
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 4164647320612077617665666F726D20726570726573656E74696E672073657269616C206461746120746F20746865206578697374696E672077617665666F726D2028696620616E79292E205468652073657269616C206461746120737461727473206F6666736574206D6963726F7365636F6E64732066726F6D20746865207374617274206F66207468652077617665666F726D2E200A52657475726E7320746865206E657720746F74616C206E756D626572206F662070756C73657320696E207468652063757272656E742077617665666F726D206966204F4B2E
Protected Function AddWaveForm(UserGpio as uinteger, baud as uinteger, dataBits as Uinteger, StopBits As Uinteger, Offset as uinteger, NumberofBytes As Uinteger = -1, WaveData As Xojo.Core.MemoryBlock) As UInteger
#If TargetARM And TargetLinux Then
if NumberofBytes <-1 then NumberofBytes = WaveData.Size
dim result as integer = pigpio.gpioWaveAddSerial(UserGpio, baud, dataBits, StopBits, Offset, NumberofBytes, waveData.data)
if result < 0 then MakeException (result) else return result
#else
PigpioErrorCheck
#pragma unused usergpio
#pragma unused baud
#pragma unused databits
#pragma unused StopBits
#pragma unused offset
#pragma unused NumberofBytes
#pragma unused wavedata
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 52656769737465727320612066756E6374696F6E20746F2062652063616C6C65642028612063616C6C6261636B29207768656E2074686520737065636966696564204750494F206368616E6765732073746174652E20536565207468652074656D706C61746520666F722072657475726E2076616C7565732E
Protected Sub AlertFunction(GPIO As UInteger, assigns AlertFunction as Ptr)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioSetAlertFunc(GPIO, AlertFunction)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused gpio
#pragma unused AlertFunction
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 52656769737465727320612066756E6374696F6E20746F2062652063616C6C65642028612063616C6C6261636B29207768656E2074686520737065636966696564204750494F206368616E6765732073746174652E2054616B657320616E206164646974696F6E616C20636F72652E6D656D6F7279626C6F636B20617320757365726461746120636F6E7461696E65722E20536565207468652074656D706C61746520666F722072657475726E2076616C7565732E
Protected Sub AlertFunction(GPIO As UInteger, userdata as xojo.core.memoryblock, assigns AlertFunction as Ptr)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioSetAlertFuncEx(GPIO, AlertFunction, userdata.Data)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused gpio
#pragma unused userdata
#pragma unused AlertFunction
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h21
Private Sub AlertFunctionTemplate(GPIO As Integer, Level as Integer, Tick as Uint32, UserData as Ptr)
// These are the parameters an AlertFunction receives
#Pragma unused GPIO
#Pragma unused Level
#Pragma unused Tick
#Pragma Unused UserData
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 52657475726E732074686520647574796379636C652072616E6765207573656420666F7220746865204750494F206966204F4B2E0A4966206120686172647761726520636C6F636B206F722068617264776172652050574D20697320616374697665206F6E20746865204750494F20746865207265706F727465642072616E67652077696C6C2062652031303030303030
Protected Function AnalogRange(User_GPIO As UInteger) As uinteger
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioGetPWMrange(User_GPIO)
if result < 0 then MakeException (result) else return result
#else
PigpioErrorCheck
#pragma unused user_gpio
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 53656C656374732074686520647574796379636C652072616E676520746F206265207573656420666F7220746865204750494F2E2053756273657175656E742063616C6C7320746F206770696F50574D2077696C6C20757365206120647574796379636C65206265747765656E203020286F66662920616E642072616E6765202866756C6C79206F6E292E200A52616E6765206D757374206265206265747765656E20323520616E642034303030302E
Protected Sub AnalogRange(User_GPIO As UInteger, assigns range as uinteger)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioSetPWMrange(User_GPIO, range)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused user_gpio
#pragma unused range
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 52657475726E7320746865207265616C2072616E6765207573656420666F7220746865204750494F206966204F4B2E0A4966206120686172647761726520636C6F636B20697320616374697665206F6E20746865204750494F20746865207265706F72746564207265616C2072616E67652077696C6C20626520313030303030302028314D292E200A49662068617264776172652050574D20697320616374697665206F6E20746865204750494F20746865207265706F72746564207265616C2072616E67652077696C6C20626520617070726F78696D6174656C79203235304D206469766964656420627920746865207365742050574D206672657175656E63792E
Protected Function AnalogRealRange(User_GPIO As UInteger) As uinteger
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioGetPWMrealRange(User_GPIO)
if result < 0 then MakeException (result) else return result
#else
PigpioErrorCheck
#pragma unused user_gpio
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 52657475726E73207468652050574D20647574796379636C652073657474696E6720666F7220746865204750494F2C206F722072616973657320616E20657863657074696F6E
Protected Function AnalogValue(GPIO As UInteger) As UInteger
#pragma StackOverflowChecking false
#Pragma BackgroundTasks false
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioGetPWMdutycycle(GPIO)
if result < 0 then MakeException (result) else return result
#else
PigpioErrorCheck
#pragma unused gpio
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 5374617274732050574D206F6E20746865204750494F2C20647574796379636C65206265747765656E203020286F66662920616E642072616E6765202866756C6C79206F6E292E2052616E67652064656661756C747320746F203235352E20
Protected Sub AnalogValue(User_GPIO As UInteger, assigns dutyCycle as uinteger)
#pragma StackOverflowChecking false
#Pragma BackgroundTasks false
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioPWM(User_GPIO, dutyCycle)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused user_gpio
#pragma unused dutyCycle
#endif
End Sub
#tag EndMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function bbI2CClose Lib pigpioLibName (SDA As UInteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function bbI2COpen Lib pigpioLibName (SDA As UInteger, SCL As Uinteger, Baud as Uinteger) As Integer
#tag EndExternalMethod
#tag Method, Flags = &h1, Description = 526561647320746865204750494F206C6576656C2C206F6E206F72206F66662C206F722072616973657320616E206572726F722E
Protected Function Bits_0_31() As Uint32
#If TargetARM And TargetLinux Then
return pigpio.gpioRead_Bits_0_31()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 526561647320746865204750494F206C6576656C2C206F6E206F72206F66662C206F722072616973657320616E206572726F722E
Protected Function Bits_32_53() As Uint32
#If TargetARM And TargetLinux Then
return pigpio.gpioRead_Bits_32_53()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 436C65617273204750494F20302D33312069662074686520636F72726573706F6E64696E672062697420696E2062697473206973207365742E20
Protected Sub ClearBits_0_31(bitmask as uint32)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioWrite_Bits_0_31_Clear(bitmask)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused bitmask
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436C65617273204750494F20302D33312069662074686520636F72726573706F6E64696E672062697420696E2062697473206973207365742E20
Protected Sub ClearBits_32_53(bitmask as uint32)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioWrite_Bits_32_53_Clear(bitmask)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused bitmask
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20746F20627566666572206366674D696C6C6973206D696C6C697365636F6E6473206F66204750494F2073616D706C65732E202056616C7565206D757374206265206265747765656E2031303020616E642031303030302E2044656661756C74203132302E0A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E20
Protected Sub ConfigureBufferSize(forMilliseconds as Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioCfgBufferSize(forMilliseconds)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused forMilliseconds
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20746F20757365206120706172746963756C61722073616D706C6520726174652074696D6564206279206120737065636966696564207065726970686572616C2E202044656661756C74206973203520C2B5732E0A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E20
Protected Sub ConfigureClock(Microseconds as cfgMicros, Peripheral as cfgPeripheral)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioCfgClock(Microseconds, Peripheral, 0)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused Microseconds
#pragma unused Peripheral
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20746F20757365207468652073706563696669656420444D41206368616E6E656C2E2028302D3134290A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E20
Protected Sub ConfigureDMAChannel(DMAChannel as Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioCfgDMAchannel(DMAChannel)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused DMAChannel
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20746F20757365207468652073706563696669656420444D41206368616E6E656C732E2028302D3134292E2044656661756C747320617265203134206173207072696D61727920616E642036206173207365636F6E64617279206368616E6E656C2E0A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E20
Protected Sub ConfigureDMAChannels(PrimaryChannel as Uinteger, SecondaryChannel as Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioCfgDMAchannels(PrimaryChannel,SecondaryChannel)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused PrimaryChannel
#pragma Unused SecondaryChannel
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20746F20757365207468652073706563696669656420444D41206368616E6E656C2E2028302D3134290A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E20
Protected Sub ConfigureDMAMemoryAllocation(Mode as memAllocMode)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioCfgMemAlloc(Mode)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused Mode
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20737570706F7274206F6620746865206669666F20616E6420736F636B657420696E74657266616365732E2044656661756C743A20616C6C20656E61626C65642E0A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E20
Protected Sub ConfigureInterfaces(DisableFIFO_Pipe As Boolean = False, DisableSocketInterface As Boolean = False, DisableRemoteAccess As boolean = False)
#If TargetARM And TargetLinux Then
dim flags as uinteger = if (DisableFIFO_Pipe, PI_DISABLE_FIFO_IF, 0) + if (DisableSocketInterface, PI_DISABLE_SOCK_IF, 0) + _
if (DisableRemoteAccess, PI_LOCALHOST_SOCK_IF, 0)
dim result as integer = pigpio.gpioCfgInterfaces(Flags)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused DisableFIFO_Pipe
#pragma unused DisableSocketInterface
#pragma unused DisableRemoteAccess
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20746F206F6E6C7920616C6C6F7720757064617465732028777269746573206F72206D6F6465206368616E6765732920666F7220746865204750494F2073706563696669656420627920746865206D61736B2E200A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E200A536565207468652050495F44656661756C745F436F6E7374616E7473206F662074686973206D6F64756C6520666F722064656661756C7473206F6620646966666572656E7420626F6172642074797065732E
Protected Sub Configureinternals(What As cfgWhat, Value As Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioCfgInternals(what, value)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused what
#pragma unused value
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20746F206F6E6C7920616C6C6F7720757064617465732028777269746573206F72206D6F6465206368616E6765732920666F7220746865204750494F2073706563696669656420627920746865206D61736B2E200A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E200A536565207468652050495F44656661756C745F436F6E7374616E7473206F662074686973206D6F64756C6520666F722064656661756C7473206F6620646966666572656E7420626F6172642074797065732E
Protected Sub ConfigurePermission(UpdateMask As uint64)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioCfgPermissions(UpdateMask)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused UpdateMask
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436F6E666967757265732070696770696F20746F20757365207468652073706563696669656420736F636B657420706F72742E202028313032342D3332303030292E2044656661756C7420383838382E0A546869732066756E6374696F6E206973206F6E6C79206566666563746976652069662063616C6C6564206265666F7265206770696F496E697469616C6973652E20
Protected Sub ConfigureSocketPort(Port as Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioCfgSocketPort(Port)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma Unused Port
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 44656C61797320666F72206174206C6561737420746865206E756D626572206F66206D6963726F7365636F6E647320737065636966696564206279206D6963726F732E0A52657475726E73207468652061637475616C206C656E677468206F66207468652064656C617920696E206D6963726F7365636F6E64732E200A44656C617973206F6620313030206D6963726F7365636F6E6473206F72206C6573732075736520627573792077616974732E
Protected Function Delay(MySecs as Uint32) As uint32
#If TargetARM And TargetLinux Then
return pigpio.gpioDelay(Mysecs)
#else
PigpioErrorCheck
#pragma unused MySecs
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 526561647320746865204750494F206C6576656C2C206F6E206F72206F66662C206F722072616973657320616E206572726F722E
Protected Function DigitalValue(GPIO As UInteger) As Boolean
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioRead(GPIO)
if result < 0 then MakeException (result) else return (result = 1)
#else
PigpioErrorCheck
#pragma unused gpio
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 5365747320746865204750494F206C6576656C2C206F6E206F72206F66662E20
Protected Sub DigitalValue(GPIO As UInteger, assigns value as Boolean)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.gpioWrite(GPIO, if (value ,1,0))
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused gpio
#pragma unused value
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206C656E67746820696E20444D4120636F6E74726F6C20626C6F636B73206F6620746865206C6F6E676573742077617665666F726D20637265617465642073696E6365206770696F496E697469616C697365207761732063616C6C65642C206F7220616E206572726F7220636F64652E
Protected Function DMAHighestLength() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetHighCbs()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206C656E67746820696E20444D4120636F6E74726F6C20626C6F636B73206F66207468652063757272656E742077617665666F726D2C206F7220616E206572726F7220636F64652E20
Protected Function DMALength() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetCbs()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206D6178696D756D20706F737369626C652073697A65206F6620612077617665666F726D20696E20444D4120636F6E74726F6C20626C6F636B732E
Protected Function DMAMaxLength() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetMaxCbs()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206D6178696D756D20706F737369626C652073697A65206F6620612077617665666F726D20696E2070756C7365732E2028726561642D6F6E6C7929
Protected Function DMAMaxPulses() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetMaxPulses()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206C656E67746820696E2070756C736573206F6620746865206C6F6E676573742077617665666F726D20637265617465642073696E6365206770696F496E697469616C697365207761732063616C6C65642C206F7220616E206572726F7220636F64652E
Protected Function DMAPulseHighestLength() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetHighPulses()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206C656E67746820696E2070756C736573206F66207468652063757272656E742077617665666F726D2C206F7220616E206572726F7220636F64652E20
Protected Function DMAPulseLength() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetPulses()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 5768657468657220612077617665666F726D2069732063757272656E746C79206265696E67207472616E736D69747465642E
Protected Function DMATransmitsWaveform() As Boolean
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveTxBusy = 1
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206C656E67746820696E206D6963726F7365636F6E6473206F6620746865206C6F6E676573742077617665666F726D20637265617465642073696E6365206770696F496E697469616C697365207761732063616C6C65642C206F7220616E206572726F7220636F64652E20
Protected Function DMAWaveformHighestLength() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetHighMicros()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206C656E67746820696E206D6963726F7365636F6E6473206F6620746865206C6F6E676573742077617665666F726D20637265617465642073696E6365206770696F496E697469616C697365207761732063616C6C65642C206F7220616E206572726F7220636F64652E
Protected Function DMAWaveformLength() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetMicros()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 546865206C656E67746820696E206D6963726F7365636F6E6473206F6620746865206C6F6E676573742077617665666F726D20637265617465642073696E6365206770696F496E697469616C697365207761732063616C6C65642C206F7220616E206572726F7220636F64652E
Protected Function DMAWaveformMaxLength() As Integer
#If TargetARM And TargetLinux Then
return pigpio.gpioWaveGetMaxMicros()
#else
PigpioErrorCheck
#endif
End Function
#tag EndMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgBufferSize Lib pigpioLibName (millis as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgClock Lib pigpioLibName (Microseconds as cfgMicros, Peripheral as cfgPeripheral, source as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgDMAchannel Lib pigpioLibName (channel as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgDMAchannels Lib pigpioLibName (primary as uinteger, secondary as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgGetInternals Lib pigpioLibName () As UInt32
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgInterfaces Lib pigpioLibName (Flags as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgInternals Lib pigpioLibName (what as cfgwhat, value as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgMemAlloc Lib pigpioLibName (Mode as memAllocMode) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgPermissions Lib pigpioLibName (Mask as uint64) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgSetInternals Lib pigpioLibName (value as uint32) As integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioCfgSocketPort Lib pigpioLibName (Port as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioDelay Lib pigpioLibName (gpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioGetMode Lib pigpioLibName (gpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioGetPWMdutycycle Lib pigpioLibName (gpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioGetPWMfrequency Lib pigpioLibName (gpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioGetPWMrange Lib pigpioLibName (gpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioGetPWMrealRange Lib pigpioLibName (gpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioGetServoPulsewidth Lib pigpioLibName (gpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioGlitchFilter Lib pigpioLibName (userGpio as uinteger, steady as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioHardwareClock Lib pigpioLibName (gpio as uinteger, clockkfrequency as Uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioHardwarePWM Lib pigpioLibName (GPIO as Uinteger, PWMFrequency As Uinteger, PWMDuty as Uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioHardwareRevision Lib pigpioLibName () As UInteger
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioInitialise Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioNoiseFilter Lib pigpioLibName (userGpio as uinteger, steady as uinteger, active as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioNotifyBegin Lib pigpioLibName (notificationhandle as uinteger, bitMask as uint32) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioNotifyClose Lib pigpioLibName (notificationhandle as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioNotifyOpen Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioNotifyOpenWithSize Lib pigpioLibName (size as integer) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioNotifyPause Lib pigpioLibName (notificationhandle as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h0
Attributes( hidden ) Soft Declare Function gpioPWM Lib pigpioLibName (gpio as uinteger, dutycycle as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h0
Attributes( hidden ) Soft Declare Function gpioRead Lib pigpioLibName (gpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioRead_Bits_0_31 Lib pigpioLibName () As uint32
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioRead_Bits_32_53 Lib pigpioLibName () As uint32
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSerialRead Lib pigpioLibName (usergpio as uinteger, byref buffer as ptr, buffersize as UInteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSerialReadClose Lib pigpioLibName (userGpio as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSerialReadInvert Lib pigpioLibName (userGPIO as Uinteger, Invert as UInteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSerialReadOpen Lib pigpioLibName (user_GPIO as Uinteger, baud as uinteger, dataBits as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioServo Lib pigpioLibName (gpio as uinteger, pulsewidth as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetAlertFunc Lib pigpioLibName (gpio as uinteger, alertFunction as Ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetAlertFuncEx Lib pigpioLibName (gpio as uinteger, alertFunction as Ptr, userData as ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetGetSamplesFunc Lib pigpioLibName (SampleFunction as Ptr, Bits as Uint32) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetGetSamplesFuncEx Lib pigpioLibName (SampleFunction as Ptr, Bits as Uint32, userData as Ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetISRFunc Lib pigpioLibName (gpio as uinteger, edge as pigpio . PigpioEdge, timeout as integer, ISRFunc as ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetISRFuncEx Lib pigpioLibName (gpio as uinteger, edge as pigpio . PigpioEdge, timeout as integer, ISRFunc as ptr, userdata as ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetMode Lib pigpioLibName (gpio as uinteger, mode as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetPullUpDown Lib pigpioLibName (gpio as uinteger, mode as pigpio . PigpioPud) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetPWMfrequency Lib pigpioLibName (gpio as uinteger, value as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetPWMrange Lib pigpioLibName (gpio as uinteger, range as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetSignalFunc Lib pigpioLibName (signalnum as uinteger, callback As Ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetSignalFuncEx Lib pigpioLibName (signalnum as uinteger, callback As Ptr, userData as Ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetTimerFunc Lib pigpioLibName (Timernum as uinteger, Millis As uinteger, TimerFunction As Ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetTimerFuncEx Lib pigpioLibName (Timernum as uinteger, Millis As uinteger, TimerFunction As Ptr, userData As Ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSetWatchdog Lib pigpioLibName (UserGPIO as uinteger, timeout as uinteger) As Integer
#tag EndExternalMethod
#tag Method, Flags = &h21, Description = 44656C61797320666F72206174206C6561737420746865206E756D626572206F66206D6963726F7365636F6E647320737065636966696564206279206D6963726F732E0A52657475726E73207468652061637475616C206C656E677468206F66207468652064656C617920696E206D6963726F7365636F6E64732E200A44656C617973206F6620313030206D6963726F7365636F6E6473206F72206C6573732075736520627573792077616974732E
Private Sub gpioSleep(timetype as uinteger, Seconds as Uinteger, micros as Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer= pigpio.gpioSleep(timetype, seconds, micros)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma unused timetype
#pragma unused seconds
#pragma unused micros
#endif
End Sub
#tag EndMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioSleep Lib pigpioLibName (timetype as uinteger, Seconds as uinteger, Micros as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Sub gpioTerminate Lib pigpioLibName ()
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioTick Lib pigpioLibName () As UInt32
#tag EndExternalMethod
#tag Method, Flags = &h21, Description = 44656C61797320666F72206174206C6561737420746865206E756D626572206F66206D6963726F7365636F6E647320737065636966696564206279206D6963726F732E0A52657475726E73207468652061637475616C206C656E677468206F66207468652064656C617920696E206D6963726F7365636F6E64732E200A44656C617973206F6620313030206D6963726F7365636F6E6473206F72206C6573732075736520627573792077616974732E
Private Sub gpioTime(timetype as uinteger, byref Seconds as Uinteger, byref micros as Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer= pigpio.gpioTime(timetype, seconds, micros)
if result < 0 then MakeException(result)
#else
PigpioErrorCheck
#pragma unused timetype
#pragma unused Seconds
#pragma unused micros
#endif
End Sub
#tag EndMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioTime Lib pigpioLibName (timeType as Uinteger, Byref Seconds as uinteger, Byref Micros as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioTrigger Lib pigpioLibName (userGPIO as uinteger, pulseLength as uinteger, level as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioVersion Lib pigpioLibName () As Uinteger
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveAddGeneric Lib pigpioLibName (numberOfPulses as uinteger, Pulse as pigpio . pigpioPulse) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveAddNew Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveAddSerial Lib pigpioLibName (User_gpio as uinteger, baud as uinteger, dataBits as uinteger, stopBits as Uinteger, offset as uinteger, numberOfBytes as uinteger, Data as ptr) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveChain Lib pigpioLibName (Waves as ptr, Size as Uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveClear Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveCreate Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveDelete Lib pigpioLibName (id as uinteger) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetCbs Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetHighCbs Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetHighMicros Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetHighPulses Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetMaxCbs Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetMaxMicros Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetMaxPulses Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetMicros Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveGetPulses Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveTxAt Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveTxBusy Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWaveTxSend Lib pigpioLibName (waveId as uinteger, WaveMode as pigpio . PigpioWavemode) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h0
Attributes( hidden ) Soft Declare Function gpioWaveTxStop Lib pigpioLibName () As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h0
Attributes( hidden ) Soft Declare Function gpioWrite Lib pigpioLibName (gpio as uinteger, value as integer) As integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWrite_Bits_0_31_Clear Lib pigpioLibName (bitmask as uint32) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWrite_Bits_0_31_Set Lib pigpioLibName (bitmask as uint32) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWrite_Bits_32_53_Clear Lib pigpioLibName (bitmask as uint32) As Integer
#tag EndExternalMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function gpioWrite_Bits_32_53_Set Lib pigpioLibName (bitmask as uint32) As Integer
#tag EndExternalMethod
#tag Method, Flags = &h1, Description = 5265616473206120626C6F636B206F6620757020746F2033322062797465732066726F6D2074686520737065636966696564207265676973746572206F662074686520646576696365206173736F63696174656420776974682068616E646C652E20
Protected Function i2cBlockData(i2cHandle as Uinteger, i2cRegister as Uint8) As xojo.Core.MemoryBlock
#If TargetARM And TargetLinux Then
dim block as new xojo.Core.MutableMemoryBlock(32)
dim blockptr as ptr = block.Data
dim result as integer = pigpio.i2cReadBlockData(i2cHandle, i2cRegister, blockptr)
if result < 0 then MakeException (result) else return new xojo.Core.MemoryBlock(blockptr)
#else
PigpioErrorCheck
#pragma unused i2cHandle
#pragma unused i2cRegister
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 52656164732061206365727461696E206E756D626572206F662062797465732066726F6D2074686520737065636966696564207265676973746572206F662074686520646576696365206173736F63696174656420776974682068616E646C65202E2054686520636F756E74206D617920626520312D33322E20
Protected Function i2cBlockData(i2cHandle as Uinteger, i2cRegister as Uint8, numberOfBytes as uinteger) As xojo.Core.MemoryBlock
#If TargetARM And TargetLinux Then
dim block as new xojo.Core.MutableMemoryBlock(numberOfBytes)
dim blockptr as ptr = block.Data
dim result as integer = pigpio.i2cReadI2CBlockData(i2cHandle, i2cRegister, blockptr, numberOfBytes)
if result < 0 then MakeException (result) else return new xojo.Core.MemoryBlock(blockptr)
#else
PigpioErrorCheck
#pragma unused i2cHandle
#pragma unused i2cRegister
#pragma unused numberOfBytes
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 577269746573203120746F20333220627974657320746F2074686520737065636966696564207265676973746572206F662074686520646576696365206173736F63696174656420776974682068616E646C652E20
Protected Sub i2cBlockDatai2c(i2cHandle as Uinteger, i2cRegister as Uint8, numberOfbytes as uinteger, assigns value as xojo.Core.MemoryBlock)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.i2cWritei2cBlockData(i2cHandle, i2cRegister, value.data, numberOfbytes)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused i2cHandle
#pragma unused value
#pragma unused i2cRegister
#pragma Unused numberOfbytes
#endif
End Sub
#tag EndMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function i2cBlockProcessCall Lib pigpioLibName (i2chandle as uinteger, i2cregister as uint8, byref buffer as ptr, count as UInteger) As Integer
#tag EndExternalMethod
#tag Method, Flags = &h1, Description = 526561647320612073696E676C6520627974652066726F6D2074686520646576696365206173736F63696174656420776974682068616E646C652E20
Protected Function i2cByte(i2cHandle as Uinteger) As uint8
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.i2cReadByte(i2cHandle)
if result < 0 then MakeException (result) else return result
#else
PigpioErrorCheck
#pragma unused i2cHandle
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 53656E647320612073696E676C65206279746520746F2074686520646576696365206173736F63696174656420776974682068616E646C652E20
Protected Sub i2cByte(i2cHandle as Uinteger, assigns value as uint8)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.i2cWriteByte(i2cHandle, value)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused i2cHandle
#pragma unused value
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 526561647320612073696E676C6520627974652066726F6D2074686520737065636966696564207265676973746572206F662074686520646576696365206173736F63696174656420776974682068616E646C652E
Protected Function i2cByteData(i2cHandle as Uinteger, i2cRegister as Uint8) As UInt8
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.i2cReadByteData(i2cHandle, i2cRegister)
if result < 0 then MakeException (result) else return result
#else
PigpioErrorCheck
#pragma unused i2cHandle
#pragma unused i2cRegister
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 57726974657320612073696E676C65206279746520746F2074686520737065636966696564207265676973746572206F662074686520646576696365206173736F63696174656420776974682068616E646C652E
Protected Sub i2cByteData(i2cHandle as Uinteger, i2cRegister as Uint8, assigns value as uint8)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.i2cWriteByteData(i2cHandle, i2cRegister, value)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused i2cHandle
#pragma unused i2cRegister
#pragma unused value
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 436C6F736573207468652049324320646576696365206173736F6369617465642077697468207468652068616E646C652E20
Protected Sub i2cClose(i2cHandle as Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.i2cClose(i2cHandle)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused i2cHandle
#endif
End Sub
#tag EndMethod
#tag ExternalMethod, Flags = &h1
Attributes( hidden ) Protected Soft Declare Function i2cClose Lib pigpioLibName (i2chandle as uinteger) As Integer
#tag EndExternalMethod
#tag Method, Flags = &h1, Description = 5772697465732061206365727461696E206E756D626572206F6620627974657320286F7220616C6C20696620796F7520646F6EE28099742073706563696679206974292066726F6D2076616C756520746F2074686520726177206465766963652E20
Protected Sub i2cDevice(i2cHandle as Uinteger, numberOfBytes As UInteger = 0, assigns value as xojo.Core.MemoryBlock)
#If TargetARM And TargetLinux Then
if numberOfBytes = 0 then numberOfBytes = value.size
dim result as integer = pigpio.i2cWriteDevice(i2cHandle, value.data, numberOfBytes)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused i2cHandle
#pragma unused numberOfBytes
#pragma unused value
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 52656164732061206365727461696E206E756D626572206F662062797465732066726F6D20746865207261772064657669636520696E746F206275662E20
Protected Function i2cDevice(i2cHandle as Uinteger, numberOfBytes As UInteger) As Xojo.Core.Memoryblock
#If TargetARM And TargetLinux Then
dim block as new xojo.Core.MutableMemoryBlock(numberOfBytes)
dim blockptr as ptr = block.data
dim result as integer = pigpio.i2cReadDevice(i2cHandle, blockptr, numberOfBytes)
if result < 0 then MakeException (result) else return new xojo.Core.MemoryBlock(blockptr)
#else
PigpioErrorCheck
#pragma unused i2cHandle
#pragma unused numberOfBytes
#endif
End Function
#tag EndMethod
#tag Method, Flags = &h1, Description = 53746F7073206269742062616E67696E6720493243206F6E20612070616972206F66204750494F2070726576696F75736C79206F70656E656420776974682062624932434F70656E2E20
Protected Sub i2cEndBitBanging(DataGPIO as Uinteger)
#If TargetARM And TargetLinux Then
dim result as integer = pigpio.bbI2CClose(DataGPIO)
if result < 0 then MakeException (result)
#else
PigpioErrorCheck
#pragma unused DataGPIO
#endif
End Sub
#tag EndMethod
#tag Method, Flags = &h1, Description = 52657475726E7320612068616E646C6520666F722074686520646576696365206174207468652061646472657373206F6E2074686520493243206275732E