-
Notifications
You must be signed in to change notification settings - Fork 29
/
mraa.py
785 lines (648 loc) · 25.2 KB
/
mraa.py
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
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""Python interface to libmraa"""
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_import_helper():
import importlib
pkg = __name__.rpartition('.')[0]
mname = '.'.join((pkg, '_mraa')).lstrip('.')
try:
return importlib.import_module(mname)
except ImportError:
return importlib.import_module('_mraa')
_mraa = swig_import_helper()
del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_mraa', [dirname(__file__)])
except ImportError:
import _mraa
return _mraa
if fp is not None:
try:
_mod = imp.load_module('_mraa', fp, pathname, description)
finally:
fp.close()
return _mod
_mraa = swig_import_helper()
del swig_import_helper
else:
import _mraa
del _swig_python_version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
try:
import builtins as __builtin__
except ImportError:
import __builtin__
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
if _newclass:
object.__setattr__(self, name, value)
else:
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr(self, class_type, name):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except __builtin__.Exception:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except __builtin__.Exception:
class _object:
pass
_newclass = 0
class uint8Array(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, uint8Array, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, uint8Array, name)
__repr__ = _swig_repr
def __init__(self, nelements):
this = _mraa.new_uint8Array(nelements)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _mraa.delete_uint8Array
__del__ = lambda self: None
def __getitem__(self, index):
return _mraa.uint8Array___getitem__(self, index)
def __setitem__(self, index, value):
return _mraa.uint8Array___setitem__(self, index, value)
def cast(self):
return _mraa.uint8Array_cast(self)
if _newclass:
frompointer = staticmethod(_mraa.uint8Array_frompointer)
else:
frompointer = _mraa.uint8Array_frompointer
uint8Array_swigregister = _mraa.uint8Array_swigregister
uint8Array_swigregister(uint8Array)
def uint8Array_frompointer(t):
return _mraa.uint8Array_frompointer(t)
uint8Array_frompointer = _mraa.uint8Array_frompointer
INTEL_GALILEO_GEN1 = _mraa.INTEL_GALILEO_GEN1
INTEL_GALILEO_GEN2 = _mraa.INTEL_GALILEO_GEN2
INTEL_EDISON_FAB_C = _mraa.INTEL_EDISON_FAB_C
INTEL_DE3815 = _mraa.INTEL_DE3815
INTEL_MINNOWBOARD_MAX = _mraa.INTEL_MINNOWBOARD_MAX
RASPBERRY_PI = _mraa.RASPBERRY_PI
BEAGLEBONE = _mraa.BEAGLEBONE
BANANA = _mraa.BANANA
INTEL_NUC5 = _mraa.INTEL_NUC5
A96BOARDS = _mraa.A96BOARDS
INTEL_SOFIA_3GR = _mraa.INTEL_SOFIA_3GR
INTEL_CHERRYHILLS = _mraa.INTEL_CHERRYHILLS
INTEL_UP = _mraa.INTEL_UP
INTEL_JOULE_EXPANSION = _mraa.INTEL_JOULE_EXPANSION
PHYBOARD_WEGA = _mraa.PHYBOARD_WEGA
DE_NANO_SOC = _mraa.DE_NANO_SOC
INTEL_UP2 = _mraa.INTEL_UP2
FTDI_FT4222 = _mraa.FTDI_FT4222
GROVEPI = _mraa.GROVEPI
GENERIC_FIRMATA = _mraa.GENERIC_FIRMATA
ANDROID_PERIPHERALMANAGER = _mraa.ANDROID_PERIPHERALMANAGER
MOCK_PLATFORM = _mraa.MOCK_PLATFORM
NULL_PLATFORM = _mraa.NULL_PLATFORM
UNKNOWN_PLATFORM = _mraa.UNKNOWN_PLATFORM
INTEL_EDISON_MINIBOARD_J17_1 = _mraa.INTEL_EDISON_MINIBOARD_J17_1
INTEL_EDISON_MINIBOARD_J17_5 = _mraa.INTEL_EDISON_MINIBOARD_J17_5
INTEL_EDISON_MINIBOARD_J17_7 = _mraa.INTEL_EDISON_MINIBOARD_J17_7
INTEL_EDISON_MINIBOARD_J17_8 = _mraa.INTEL_EDISON_MINIBOARD_J17_8
INTEL_EDISON_MINIBOARD_J17_9 = _mraa.INTEL_EDISON_MINIBOARD_J17_9
INTEL_EDISON_MINIBOARD_J17_10 = _mraa.INTEL_EDISON_MINIBOARD_J17_10
INTEL_EDISON_MINIBOARD_J17_11 = _mraa.INTEL_EDISON_MINIBOARD_J17_11
INTEL_EDISON_MINIBOARD_J17_12 = _mraa.INTEL_EDISON_MINIBOARD_J17_12
INTEL_EDISON_MINIBOARD_J17_14 = _mraa.INTEL_EDISON_MINIBOARD_J17_14
INTEL_EDISON_MINIBOARD_J18_1 = _mraa.INTEL_EDISON_MINIBOARD_J18_1
INTEL_EDISON_MINIBOARD_J18_2 = _mraa.INTEL_EDISON_MINIBOARD_J18_2
INTEL_EDISON_MINIBOARD_J18_6 = _mraa.INTEL_EDISON_MINIBOARD_J18_6
INTEL_EDISON_MINIBOARD_J18_7 = _mraa.INTEL_EDISON_MINIBOARD_J18_7
INTEL_EDISON_MINIBOARD_J18_8 = _mraa.INTEL_EDISON_MINIBOARD_J18_8
INTEL_EDISON_MINIBOARD_J18_10 = _mraa.INTEL_EDISON_MINIBOARD_J18_10
INTEL_EDISON_MINIBOARD_J18_11 = _mraa.INTEL_EDISON_MINIBOARD_J18_11
INTEL_EDISON_MINIBOARD_J18_12 = _mraa.INTEL_EDISON_MINIBOARD_J18_12
INTEL_EDISON_MINIBOARD_J18_13 = _mraa.INTEL_EDISON_MINIBOARD_J18_13
INTEL_EDISON_MINIBOARD_J19_4 = _mraa.INTEL_EDISON_MINIBOARD_J19_4
INTEL_EDISON_MINIBOARD_J19_5 = _mraa.INTEL_EDISON_MINIBOARD_J19_5
INTEL_EDISON_MINIBOARD_J19_6 = _mraa.INTEL_EDISON_MINIBOARD_J19_6
INTEL_EDISON_MINIBOARD_J19_8 = _mraa.INTEL_EDISON_MINIBOARD_J19_8
INTEL_EDISON_MINIBOARD_J19_9 = _mraa.INTEL_EDISON_MINIBOARD_J19_9
INTEL_EDISON_MINIBOARD_J19_10 = _mraa.INTEL_EDISON_MINIBOARD_J19_10
INTEL_EDISON_MINIBOARD_J19_11 = _mraa.INTEL_EDISON_MINIBOARD_J19_11
INTEL_EDISON_MINIBOARD_J19_12 = _mraa.INTEL_EDISON_MINIBOARD_J19_12
INTEL_EDISON_MINIBOARD_J19_13 = _mraa.INTEL_EDISON_MINIBOARD_J19_13
INTEL_EDISON_MINIBOARD_J19_14 = _mraa.INTEL_EDISON_MINIBOARD_J19_14
INTEL_EDISON_MINIBOARD_J20_3 = _mraa.INTEL_EDISON_MINIBOARD_J20_3
INTEL_EDISON_MINIBOARD_J20_4 = _mraa.INTEL_EDISON_MINIBOARD_J20_4
INTEL_EDISON_MINIBOARD_J20_5 = _mraa.INTEL_EDISON_MINIBOARD_J20_5
INTEL_EDISON_MINIBOARD_J20_6 = _mraa.INTEL_EDISON_MINIBOARD_J20_6
INTEL_EDISON_MINIBOARD_J20_7 = _mraa.INTEL_EDISON_MINIBOARD_J20_7
INTEL_EDISON_MINIBOARD_J20_8 = _mraa.INTEL_EDISON_MINIBOARD_J20_8
INTEL_EDISON_MINIBOARD_J20_9 = _mraa.INTEL_EDISON_MINIBOARD_J20_9
INTEL_EDISON_MINIBOARD_J20_10 = _mraa.INTEL_EDISON_MINIBOARD_J20_10
INTEL_EDISON_MINIBOARD_J20_11 = _mraa.INTEL_EDISON_MINIBOARD_J20_11
INTEL_EDISON_MINIBOARD_J20_12 = _mraa.INTEL_EDISON_MINIBOARD_J20_12
INTEL_EDISON_MINIBOARD_J20_13 = _mraa.INTEL_EDISON_MINIBOARD_J20_13
INTEL_EDISON_MINIBOARD_J20_14 = _mraa.INTEL_EDISON_MINIBOARD_J20_14
INTEL_EDISON_GP182 = _mraa.INTEL_EDISON_GP182
INTEL_EDISON_GP135 = _mraa.INTEL_EDISON_GP135
INTEL_EDISON_GP27 = _mraa.INTEL_EDISON_GP27
INTEL_EDISON_GP20 = _mraa.INTEL_EDISON_GP20
INTEL_EDISON_GP28 = _mraa.INTEL_EDISON_GP28
INTEL_EDISON_GP111 = _mraa.INTEL_EDISON_GP111
INTEL_EDISON_GP109 = _mraa.INTEL_EDISON_GP109
INTEL_EDISON_GP115 = _mraa.INTEL_EDISON_GP115
INTEL_EDISON_GP128 = _mraa.INTEL_EDISON_GP128
INTEL_EDISON_GP13 = _mraa.INTEL_EDISON_GP13
INTEL_EDISON_GP165 = _mraa.INTEL_EDISON_GP165
INTEL_EDISON_GP19 = _mraa.INTEL_EDISON_GP19
INTEL_EDISON_GP12 = _mraa.INTEL_EDISON_GP12
INTEL_EDISON_GP183 = _mraa.INTEL_EDISON_GP183
INTEL_EDISON_GP110 = _mraa.INTEL_EDISON_GP110
INTEL_EDISON_GP114 = _mraa.INTEL_EDISON_GP114
INTEL_EDISON_GP129 = _mraa.INTEL_EDISON_GP129
INTEL_EDISON_GP130 = _mraa.INTEL_EDISON_GP130
INTEL_EDISON_GP44 = _mraa.INTEL_EDISON_GP44
INTEL_EDISON_GP46 = _mraa.INTEL_EDISON_GP46
INTEL_EDISON_GP48 = _mraa.INTEL_EDISON_GP48
INTEL_EDISON_GP131 = _mraa.INTEL_EDISON_GP131
INTEL_EDISON_GP14 = _mraa.INTEL_EDISON_GP14
INTEL_EDISON_GP40 = _mraa.INTEL_EDISON_GP40
INTEL_EDISON_GP43 = _mraa.INTEL_EDISON_GP43
INTEL_EDISON_GP77 = _mraa.INTEL_EDISON_GP77
INTEL_EDISON_GP82 = _mraa.INTEL_EDISON_GP82
INTEL_EDISON_GP83 = _mraa.INTEL_EDISON_GP83
INTEL_EDISON_GP134 = _mraa.INTEL_EDISON_GP134
INTEL_EDISON_GP45 = _mraa.INTEL_EDISON_GP45
INTEL_EDISON_GP47 = _mraa.INTEL_EDISON_GP47
INTEL_EDISON_GP49 = _mraa.INTEL_EDISON_GP49
INTEL_EDISON_GP15 = _mraa.INTEL_EDISON_GP15
INTEL_EDISON_GP84 = _mraa.INTEL_EDISON_GP84
INTEL_EDISON_GP42 = _mraa.INTEL_EDISON_GP42
INTEL_EDISON_GP41 = _mraa.INTEL_EDISON_GP41
INTEL_EDISON_GP78 = _mraa.INTEL_EDISON_GP78
INTEL_EDISON_GP79 = _mraa.INTEL_EDISON_GP79
INTEL_EDISON_GP80 = _mraa.INTEL_EDISON_GP80
INTEL_EDISON_GP81 = _mraa.INTEL_EDISON_GP81
RASPBERRY_WIRING_PIN8 = _mraa.RASPBERRY_WIRING_PIN8
RASPBERRY_WIRING_PIN9 = _mraa.RASPBERRY_WIRING_PIN9
RASPBERRY_WIRING_PIN7 = _mraa.RASPBERRY_WIRING_PIN7
RASPBERRY_WIRING_PIN15 = _mraa.RASPBERRY_WIRING_PIN15
RASPBERRY_WIRING_PIN16 = _mraa.RASPBERRY_WIRING_PIN16
RASPBERRY_WIRING_PIN0 = _mraa.RASPBERRY_WIRING_PIN0
RASPBERRY_WIRING_PIN1 = _mraa.RASPBERRY_WIRING_PIN1
RASPBERRY_WIRING_PIN2 = _mraa.RASPBERRY_WIRING_PIN2
RASPBERRY_WIRING_PIN3 = _mraa.RASPBERRY_WIRING_PIN3
RASPBERRY_WIRING_PIN4 = _mraa.RASPBERRY_WIRING_PIN4
RASPBERRY_WIRING_PIN5 = _mraa.RASPBERRY_WIRING_PIN5
RASPBERRY_WIRING_PIN12 = _mraa.RASPBERRY_WIRING_PIN12
RASPBERRY_WIRING_PIN13 = _mraa.RASPBERRY_WIRING_PIN13
RASPBERRY_WIRING_PIN6 = _mraa.RASPBERRY_WIRING_PIN6
RASPBERRY_WIRING_PIN14 = _mraa.RASPBERRY_WIRING_PIN14
RASPBERRY_WIRING_PIN10 = _mraa.RASPBERRY_WIRING_PIN10
RASPBERRY_WIRING_PIN11 = _mraa.RASPBERRY_WIRING_PIN11
RASPBERRY_WIRING_PIN17 = _mraa.RASPBERRY_WIRING_PIN17
RASPBERRY_WIRING_PIN21 = _mraa.RASPBERRY_WIRING_PIN21
RASPBERRY_WIRING_PIN18 = _mraa.RASPBERRY_WIRING_PIN18
RASPBERRY_WIRING_PIN19 = _mraa.RASPBERRY_WIRING_PIN19
RASPBERRY_WIRING_PIN22 = _mraa.RASPBERRY_WIRING_PIN22
RASPBERRY_WIRING_PIN20 = _mraa.RASPBERRY_WIRING_PIN20
RASPBERRY_WIRING_PIN26 = _mraa.RASPBERRY_WIRING_PIN26
RASPBERRY_WIRING_PIN23 = _mraa.RASPBERRY_WIRING_PIN23
RASPBERRY_WIRING_PIN24 = _mraa.RASPBERRY_WIRING_PIN24
RASPBERRY_WIRING_PIN27 = _mraa.RASPBERRY_WIRING_PIN27
RASPBERRY_WIRING_PIN25 = _mraa.RASPBERRY_WIRING_PIN25
RASPBERRY_WIRING_PIN28 = _mraa.RASPBERRY_WIRING_PIN28
RASPBERRY_WIRING_PIN29 = _mraa.RASPBERRY_WIRING_PIN29
SUCCESS = _mraa.SUCCESS
ERROR_FEATURE_NOT_IMPLEMENTED = _mraa.ERROR_FEATURE_NOT_IMPLEMENTED
ERROR_FEATURE_NOT_SUPPORTED = _mraa.ERROR_FEATURE_NOT_SUPPORTED
ERROR_INVALID_VERBOSITY_LEVEL = _mraa.ERROR_INVALID_VERBOSITY_LEVEL
ERROR_INVALID_PARAMETER = _mraa.ERROR_INVALID_PARAMETER
ERROR_INVALID_HANDLE = _mraa.ERROR_INVALID_HANDLE
ERROR_NO_RESOURCES = _mraa.ERROR_NO_RESOURCES
ERROR_INVALID_RESOURCE = _mraa.ERROR_INVALID_RESOURCE
ERROR_INVALID_QUEUE_TYPE = _mraa.ERROR_INVALID_QUEUE_TYPE
ERROR_NO_DATA_AVAILABLE = _mraa.ERROR_NO_DATA_AVAILABLE
ERROR_INVALID_PLATFORM = _mraa.ERROR_INVALID_PLATFORM
ERROR_PLATFORM_NOT_INITIALISED = _mraa.ERROR_PLATFORM_NOT_INITIALISED
ERROR_UART_OW_SHORTED = _mraa.ERROR_UART_OW_SHORTED
ERROR_UART_OW_NO_DEVICES = _mraa.ERROR_UART_OW_NO_DEVICES
ERROR_UART_OW_DATA_ERROR = _mraa.ERROR_UART_OW_DATA_ERROR
ERROR_UNSPECIFIED = _mraa.ERROR_UNSPECIFIED
PIN_VALID = _mraa.PIN_VALID
PIN_GPIO = _mraa.PIN_GPIO
PIN_PWM = _mraa.PIN_PWM
PIN_FAST_GPIO = _mraa.PIN_FAST_GPIO
PIN_SPI = _mraa.PIN_SPI
PIN_I2C = _mraa.PIN_I2C
PIN_AIO = _mraa.PIN_AIO
PIN_UART = _mraa.PIN_UART
I2C_STD = _mraa.I2C_STD
I2C_FAST = _mraa.I2C_FAST
I2C_HIGH = _mraa.I2C_HIGH
UART_PARITY_NONE = _mraa.UART_PARITY_NONE
UART_PARITY_EVEN = _mraa.UART_PARITY_EVEN
UART_PARITY_ODD = _mraa.UART_PARITY_ODD
UART_PARITY_MARK = _mraa.UART_PARITY_MARK
UART_PARITY_SPACE = _mraa.UART_PARITY_SPACE
def init():
return _mraa.init()
init = _mraa.init
def getVersion():
return _mraa.getVersion()
getVersion = _mraa.getVersion
def setPriority(priority):
return _mraa.setPriority(priority)
setPriority = _mraa.setPriority
def getPlatformType():
return _mraa.getPlatformType()
getPlatformType = _mraa.getPlatformType
def printError(result):
return _mraa.printError(result)
printError = _mraa.printError
def pinModeTest(pin, mode):
return _mraa.pinModeTest(pin, mode)
pinModeTest = _mraa.pinModeTest
def adcRawBits():
return _mraa.adcRawBits()
adcRawBits = _mraa.adcRawBits
def adcSupportedBits():
return _mraa.adcSupportedBits()
adcSupportedBits = _mraa.adcSupportedBits
def getPlatformName():
return _mraa.getPlatformName()
getPlatformName = _mraa.getPlatformName
def getPlatformVersion(*args):
return _mraa.getPlatformVersion(*args)
getPlatformVersion = _mraa.getPlatformVersion
def getPinCount():
return _mraa.getPinCount()
getPinCount = _mraa.getPinCount
def getUartCount():
return _mraa.getUartCount()
getUartCount = _mraa.getUartCount
def getI2cBusCount():
return _mraa.getI2cBusCount()
getI2cBusCount = _mraa.getI2cBusCount
def getI2cBusId(i2c_bus):
return _mraa.getI2cBusId(i2c_bus)
getI2cBusId = _mraa.getI2cBusId
def getPinName(pin):
return _mraa.getPinName(pin)
getPinName = _mraa.getPinName
def getGpioLookup(pin_name):
return _mraa.getGpioLookup(pin_name)
getGpioLookup = _mraa.getGpioLookup
def getI2cLookup(i2c_name):
return _mraa.getI2cLookup(i2c_name)
getI2cLookup = _mraa.getI2cLookup
def getSpiLookup(spi_name):
return _mraa.getSpiLookup(spi_name)
getSpiLookup = _mraa.getSpiLookup
def getPwmLookup(pwm_name):
return _mraa.getPwmLookup(pwm_name)
getPwmLookup = _mraa.getPwmLookup
def getUartLookup(uart_name):
return _mraa.getUartLookup(uart_name)
getUartLookup = _mraa.getUartLookup
def setLogLevel(level):
return _mraa.setLogLevel(level)
setLogLevel = _mraa.setLogLevel
def hasSubPlatform():
return _mraa.hasSubPlatform()
hasSubPlatform = _mraa.hasSubPlatform
def isSubPlatformId(pin_or_bus_id):
return _mraa.isSubPlatformId(pin_or_bus_id)
isSubPlatformId = _mraa.isSubPlatformId
def getSubPlatformId(pin_or_bus_index):
return _mraa.getSubPlatformId(pin_or_bus_index)
getSubPlatformId = _mraa.getSubPlatformId
def getSubPlatformIndex(pin_or_bus_id):
return _mraa.getSubPlatformIndex(pin_or_bus_id)
getSubPlatformIndex = _mraa.getSubPlatformIndex
def getDefaultI2cBus(*args):
return _mraa.getDefaultI2cBus(*args)
getDefaultI2cBus = _mraa.getDefaultI2cBus
def addSubplatform(subplatformtype, dev):
return _mraa.addSubplatform(subplatformtype, dev)
addSubplatform = _mraa.addSubplatform
def removeSubplatform(subplatformtype):
return _mraa.removeSubplatform(subplatformtype)
removeSubplatform = _mraa.removeSubplatform
def initJsonPlatform(path):
return _mraa.initJsonPlatform(path)
initJsonPlatform = _mraa.initJsonPlatform
def gpioFromDesc(desc):
return _mraa.gpioFromDesc(desc)
gpioFromDesc = _mraa.gpioFromDesc
def aioFromDesc(desc):
return _mraa.aioFromDesc(desc)
aioFromDesc = _mraa.aioFromDesc
def uartFromDesc(desc):
return _mraa.uartFromDesc(desc)
uartFromDesc = _mraa.uartFromDesc
def spiFromDesc(desc):
return _mraa.spiFromDesc(desc)
spiFromDesc = _mraa.spiFromDesc
def i2cFromDesc(desc):
return _mraa.i2cFromDesc(desc)
i2cFromDesc = _mraa.i2cFromDesc
def pwmFromDesc(desc):
return _mraa.pwmFromDesc(desc)
pwmFromDesc = _mraa.pwmFromDesc
def ledFromDesc(desc):
return _mraa.ledFromDesc(desc)
ledFromDesc = _mraa.ledFromDesc
MODE_STRONG = _mraa.MODE_STRONG
MODE_PULLUP = _mraa.MODE_PULLUP
MODE_PULLDOWN = _mraa.MODE_PULLDOWN
MODE_HIZ = _mraa.MODE_HIZ
DIR_OUT = _mraa.DIR_OUT
DIR_IN = _mraa.DIR_IN
DIR_OUT_HIGH = _mraa.DIR_OUT_HIGH
DIR_OUT_LOW = _mraa.DIR_OUT_LOW
EDGE_NONE = _mraa.EDGE_NONE
EDGE_BOTH = _mraa.EDGE_BOTH
EDGE_RISING = _mraa.EDGE_RISING
EDGE_FALLING = _mraa.EDGE_FALLING
MODE_IN_ACTIVE_HIGH = _mraa.MODE_IN_ACTIVE_HIGH
MODE_IN_ACTIVE_LOW = _mraa.MODE_IN_ACTIVE_LOW
MODE_OUT_OPEN_DRAIN = _mraa.MODE_OUT_OPEN_DRAIN
MODE_OUT_PUSH_PULL = _mraa.MODE_OUT_PUSH_PULL
class Gpio(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Gpio, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Gpio, name)
__repr__ = _swig_repr
def __init__(self, pin, owner=True, raw=False):
this = _mraa.new_Gpio(pin, owner, raw)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _mraa.delete_Gpio
__del__ = lambda self: None
def edge(self, mode):
return _mraa.Gpio_edge(self, mode)
def isr(self, mode, pyfunc, args):
return _mraa.Gpio_isr(self, mode, pyfunc, args)
def isrExit(self):
return _mraa.Gpio_isrExit(self)
def mode(self, mode):
return _mraa.Gpio_mode(self, mode)
def dir(self, dir):
return _mraa.Gpio_dir(self, dir)
def readDir(self):
return _mraa.Gpio_readDir(self)
def read(self):
return _mraa.Gpio_read(self)
def write(self, value):
return _mraa.Gpio_write(self, value)
def useMmap(self, enable):
return _mraa.Gpio_useMmap(self, enable)
def getPin(self, raw=False):
return _mraa.Gpio_getPin(self, raw)
def inputMode(self, mode):
return _mraa.Gpio_inputMode(self, mode)
def outputMode(self, mode):
return _mraa.Gpio_outputMode(self, mode)
Gpio_swigregister = _mraa.Gpio_swigregister
Gpio_swigregister(Gpio)
class I2c(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, I2c, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, I2c, name)
__repr__ = _swig_repr
def __init__(self, bus, raw=False):
this = _mraa.new_I2c(bus, raw)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _mraa.delete_I2c
__del__ = lambda self: None
def frequency(self, mode):
return _mraa.I2c_frequency(self, mode)
def address(self, address):
return _mraa.I2c_address(self, address)
def readByte(self):
return _mraa.I2c_readByte(self)
def read(self, data):
return _mraa.I2c_read(self, data)
def readReg(self, reg):
return _mraa.I2c_readReg(self, reg)
def readWordReg(self, reg):
return _mraa.I2c_readWordReg(self, reg)
def readBytesReg(self, reg, data):
return _mraa.I2c_readBytesReg(self, reg, data)
def writeByte(self, data):
return _mraa.I2c_writeByte(self, data)
def write(self, data):
return _mraa.I2c_write(self, data)
def writeReg(self, reg, data):
return _mraa.I2c_writeReg(self, reg, data)
def writeWordReg(self, reg, data):
return _mraa.I2c_writeWordReg(self, reg, data)
I2c_swigregister = _mraa.I2c_swigregister
I2c_swigregister(I2c)
class Pwm(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Pwm, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Pwm, name)
__repr__ = _swig_repr
def __init__(self, pin, owner=True, chipid=-1):
this = _mraa.new_Pwm(pin, owner, chipid)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _mraa.delete_Pwm
__del__ = lambda self: None
def write(self, percentage):
return _mraa.Pwm_write(self, percentage)
def read(self):
return _mraa.Pwm_read(self)
def period(self, period):
return _mraa.Pwm_period(self, period)
def period_ms(self, ms):
return _mraa.Pwm_period_ms(self, ms)
def period_us(self, us):
return _mraa.Pwm_period_us(self, us)
def pulsewidth(self, seconds):
return _mraa.Pwm_pulsewidth(self, seconds)
def pulsewidth_ms(self, ms):
return _mraa.Pwm_pulsewidth_ms(self, ms)
def pulsewidth_us(self, us):
return _mraa.Pwm_pulsewidth_us(self, us)
def enable(self, enable):
return _mraa.Pwm_enable(self, enable)
def max_period(self):
return _mraa.Pwm_max_period(self)
def min_period(self):
return _mraa.Pwm_min_period(self)
Pwm_swigregister = _mraa.Pwm_swigregister
Pwm_swigregister(Pwm)
SPI_MODE0 = _mraa.SPI_MODE0
SPI_MODE1 = _mraa.SPI_MODE1
SPI_MODE2 = _mraa.SPI_MODE2
SPI_MODE3 = _mraa.SPI_MODE3
class Spi(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Spi, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Spi, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _mraa.new_Spi(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _mraa.delete_Spi
__del__ = lambda self: None
def mode(self, mode):
return _mraa.Spi_mode(self, mode)
def frequency(self, hz):
return _mraa.Spi_frequency(self, hz)
def writeByte(self, data):
return _mraa.Spi_writeByte(self, data)
def writeWord(self, data):
return _mraa.Spi_writeWord(self, data)
def write(self, txBuf):
return _mraa.Spi_write(self, txBuf)
def lsbmode(self, lsb):
return _mraa.Spi_lsbmode(self, lsb)
def bitPerWord(self, bits):
return _mraa.Spi_bitPerWord(self, bits)
Spi_swigregister = _mraa.Spi_swigregister
Spi_swigregister(Spi)
class Aio(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Aio, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Aio, name)
__repr__ = _swig_repr
def __init__(self, pin):
this = _mraa.new_Aio(pin)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _mraa.delete_Aio
__del__ = lambda self: None
def read(self):
return _mraa.Aio_read(self)
def readFloat(self):
return _mraa.Aio_readFloat(self)
def setBit(self, bits):
return _mraa.Aio_setBit(self, bits)
def getBit(self):
return _mraa.Aio_getBit(self)
Aio_swigregister = _mraa.Aio_swigregister
Aio_swigregister(Aio)
class Uart(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Uart, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Uart, name)
__repr__ = _swig_repr
def __init__(self, *args):
this = _mraa.new_Uart(*args)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _mraa.delete_Uart
__del__ = lambda self: None
def getDevicePath(self):
return _mraa.Uart_getDevicePath(self)
def read(self, data):
return _mraa.Uart_read(self, data)
def write(self, data):
return _mraa.Uart_write(self, data)
def readStr(self, length):
return _mraa.Uart_readStr(self, length)
def writeStr(self, data):
return _mraa.Uart_writeStr(self, data)
def dataAvailable(self, millis=0):
return _mraa.Uart_dataAvailable(self, millis)
def flush(self):
return _mraa.Uart_flush(self)
def sendBreak(self, duration):
return _mraa.Uart_sendBreak(self, duration)
def setBaudRate(self, baud):
return _mraa.Uart_setBaudRate(self, baud)
def setMode(self, bytesize, parity, stopbits):
return _mraa.Uart_setMode(self, bytesize, parity, stopbits)
def setFlowcontrol(self, xonxoff, rtscts):
return _mraa.Uart_setFlowcontrol(self, xonxoff, rtscts)
def setTimeout(self, read, write, interchar):
return _mraa.Uart_setTimeout(self, read, write, interchar)
def setNonBlocking(self, nonblock):
return _mraa.Uart_setNonBlocking(self, nonblock)
Uart_swigregister = _mraa.Uart_swigregister
Uart_swigregister(Uart)
class Led(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, Led, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, Led, name)
__repr__ = _swig_repr
def __init__(self, led):
this = _mraa.new_Led(led)
try:
self.this.append(this)
except __builtin__.Exception:
self.this = this
__swig_destroy__ = _mraa.delete_Led
__del__ = lambda self: None
def setBrightness(self, value):
return _mraa.Led_setBrightness(self, value)
def readBrightness(self):
return _mraa.Led_readBrightness(self)
def readMaxBrightness(self):
return _mraa.Led_readMaxBrightness(self)
def trigger(self, trigger):
return _mraa.Led_trigger(self, trigger)
def clearTrigger(self):
return _mraa.Led_clearTrigger(self)
Led_swigregister = _mraa.Led_swigregister
Led_swigregister(Led)
# This file is compatible with both classic and new-style classes.