pigpio 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,748 +1,745 @@
1
- class Pigpio
2
- module Constant
3
- #/* gpio: 0-53 */
4
-
5
- PI_MIN_GPIO =0
6
- PI_MAX_GPIO =53
7
-
8
- #/* user_gpio: 0-31 */
9
-
10
- PI_MAX_USER_GPIO =31
11
-
12
- #/* level: 0-1 */
13
-
14
- PI_OFF =0
15
- PI_ON =1
16
-
17
- PI_CLEAR =0
18
- PI_SET =1
19
-
20
- PI_LOW =0
21
- PI_HIGH =1
22
-
23
- #/* level: only reported for GPIO time-out, see gpioSetWatchdog */
24
-
25
- PI_TIMEOUT =2
26
-
27
- #/* mode: 0-7 */
28
-
29
- PI_INPUT =0
30
- PI_OUTPUT =1
31
- PI_ALT0 =4
32
- PI_ALT1 =5
33
- PI_ALT2 =6
34
- PI_ALT3 =7
35
- PI_ALT4 =3
36
- PI_ALT5 =2
37
-
38
- #/* pud: 0-2 */
39
-
40
- PI_PUD_OFF =0
41
- PI_PUD_DOWN =1
42
- PI_PUD_UP =2
43
-
44
- #/* dutycycle: 0-range */
45
-
46
- PI_DEFAULT_DUTYCYCLE_RANGE =255
47
-
48
- #/* range: 25-40000 */
49
-
50
- PI_MIN_DUTYCYCLE_RANGE =25
51
- PI_MAX_DUTYCYCLE_RANGE =40000
52
-
53
- #/* pulsewidth: 0, 500-2500 */
54
-
55
- PI_SERVO_OFF =0
56
- PI_MIN_SERVO_PULSEWIDTH =500
57
- PI_MAX_SERVO_PULSEWIDTH =2500
58
-
59
- #/* hardware PWM */
60
-
61
- PI_HW_PWM_MIN_FREQ =1
62
- PI_HW_PWM_MAX_FREQ =125000000
63
- PI_HW_PWM_RANGE =1000000
64
-
65
- #/* hardware clock */
66
-
67
- PI_HW_CLK_MIN_FREQ =4689
68
- PI_HW_CLK_MAX_FREQ =250000000
69
-
70
- PI_NOTIFY_SLOTS =32
71
-
72
- PI_NTFY_FLAGS_EVENT =(1 <<7)
73
- PI_NTFY_FLAGS_ALIVE =(1 <<6)
74
- PI_NTFY_FLAGS_WDOG =(1 <<5)
75
- # PI_NTFY_FLAGS_BIT(x) =(((x)<<0)&31)
76
-
77
- PI_WAVE_BLOCKS =4
78
- PI_WAVE_MAX_PULSES =(PI_WAVE_BLOCKS * 3000)
79
- PI_WAVE_MAX_CHARS =(PI_WAVE_BLOCKS * 300)
80
-
81
- PI_BB_I2C_MIN_BAUD =50
82
- PI_BB_I2C_MAX_BAUD =500000
83
-
84
- PI_BB_SPI_MIN_BAUD =50
85
- PI_BB_SPI_MAX_BAUD =250000
86
-
87
- PI_BB_SER_MIN_BAUD =50
88
- PI_BB_SER_MAX_BAUD =250000
89
-
90
- PI_BB_SER_NORMAL =0
91
- PI_BB_SER_INVERT =1
92
-
93
- PI_WAVE_MIN_BAUD =50
94
- PI_WAVE_MAX_BAUD =1000000
95
-
96
- PI_SPI_MIN_BAUD =32000
97
- PI_SPI_MAX_BAUD =125000000
98
-
99
- PI_MIN_WAVE_DATABITS =1
100
- PI_MAX_WAVE_DATABITS =32
101
-
102
- PI_MIN_WAVE_HALFSTOPBITS =2
103
- PI_MAX_WAVE_HALFSTOPBITS =8
104
-
105
- PI_WAVE_MAX_MICROS =(30 * 60 * 1000000) #/* half an hour */
106
-
107
- PI_MAX_WAVES =250
108
-
109
- PI_MAX_WAVE_CYCLES =65535
110
- PI_MAX_WAVE_DELAY =65535
111
-
112
- PI_WAVE_COUNT_PAGES =10
113
-
114
- #/* wave tx mode */
115
-
116
- PI_WAVE_MODE_ONE_SHOT =0
117
- PI_WAVE_MODE_REPEAT =1
118
- PI_WAVE_MODE_ONE_SHOT_SYNC =2
119
- PI_WAVE_MODE_REPEAT_SYNC =3
120
-
121
- #/* special wave at return values */
122
-
123
- PI_WAVE_NOT_FOUND =9998 #/* Transmitted wave not found. */
124
- PI_NO_TX_WAVE =9999 #/* No wave being transmitted. */
125
-
126
- #/* Files, I2C, SPI, SER */
127
-
128
- PI_FILE_SLOTS =16
129
- PI_I2C_SLOTS =64
130
- PI_SPI_SLOTS =32
131
- PI_SER_SLOTS =16
132
-
133
- PI_MAX_I2C_ADDR =0x7F
134
-
135
- PI_NUM_AUX_SPI_CHANNEL =3
136
- PI_NUM_STD_SPI_CHANNEL =2
137
-
138
- PI_MAX_I2C_DEVICE_COUNT =(1<<16)
139
- PI_MAX_SPI_DEVICE_COUNT =(1<<16)
140
-
141
- #/* max pi_i2c_msg_t per transaction */
142
-
143
- PI_I2C_RDRW_IOCTL_MAX_MSGS =42
144
-
145
- #/* flags for i2cTransaction, pi_i2c_msg_t */
146
-
147
- PI_I2C_M_WR =0x0000 #/* write data */
148
- PI_I2C_M_RD =0x0001 #/* read data */
149
- PI_I2C_M_TEN =0x0010 #/* ten bit chip address */
150
- PI_I2C_M_RECV_LEN =0x0400 #/* length will be first received byte */
151
- PI_I2C_M_NO_RD_ACK =0x0800 #/* if I2C_FUNC_PROTOCOL_MANGLING */
152
- PI_I2C_M_IGNORE_NAK =0x1000 #/* if I2C_FUNC_PROTOCOL_MANGLING */
153
- PI_I2C_M_REV_DIR_ADDR =0x2000 #/* if I2C_FUNC_PROTOCOL_MANGLING */
154
- PI_I2C_M_NOSTART =0x4000 #/* if I2C_FUNC_PROTOCOL_MANGLING */
155
-
156
- #/* bbI2CZip and i2cZip commands */
157
-
158
- PI_I2C_END =0
159
- PI_I2C_ESC =1
160
- PI_I2C_START =2
161
- PI_I2C_COMBINED_ON =2
162
- PI_I2C_STOP =3
163
- PI_I2C_COMBINED_OFF =3
164
- PI_I2C_ADDR =4
165
- PI_I2C_FLAGS =5
166
- PI_I2C_READ =6
167
- PI_I2C_WRITE =7
168
-
169
- #/* SPI */
170
-
171
- # PI_SPI_FLAGS_BITLEN(x) =((x&63)<<16)
172
- # PI_SPI_FLAGS_RX_LSB(x) =((x&1)<<15)
173
- # PI_SPI_FLAGS_TX_LSB(x) =((x&1)<<14)
174
- # PI_SPI_FLAGS_3WREN(x) =((x&15)<<10)
175
- # PI_SPI_FLAGS_3WIRE(x) =((x&1)<<9)
176
- # PI_SPI_FLAGS_AUX_SPI(x) =((x&1)<<8)
177
- # PI_SPI_FLAGS_RESVD(x) =((x&7)<<5)
178
- # PI_SPI_FLAGS_CSPOLS(x) =((x&7)<<2)
179
- # PI_SPI_FLAGS_MODE(x) =((x&3))
180
-
181
- #/* BSC registers */
182
-
183
- BSC_DR =0
184
- BSC_RSR =1
185
- BSC_SLV =2
186
- BSC_CR =3
187
- BSC_FR =4
188
- BSC_IFLS =5
189
- BSC_IMSC =6
190
- BSC_RIS =7
191
- BSC_MIS =8
192
- BSC_ICR =9
193
- BSC_DMACR =10
194
- BSC_TDR =11
195
- BSC_GPUSTAT =12
196
- BSC_HCTRL =13
197
- BSC_DEBUG_I2C =14
198
- BSC_DEBUG_SPI =15
199
-
200
- BSC_CR_TESTFIFO =2048
201
- BSC_CR_RXE =512
202
- BSC_CR_TXE =256
203
- BSC_CR_BRK =128
204
- BSC_CR_CPOL =16
205
- BSC_CR_CPHA =8
206
- BSC_CR_I2C =4
207
- BSC_CR_SPI =2
208
- BSC_CR_EN =1
209
-
210
- BSC_FR_RXBUSY =32
211
- BSC_FR_TXFE =16
212
- BSC_FR_RXFF =8
213
- BSC_FR_TXFF =4
214
- BSC_FR_RXFE =2
215
- BSC_FR_TXBUSY =1
216
-
217
- #/* BSC GPIO */
218
-
219
- BSC_SDA_MOSI =18
220
- BSC_SCL_SCLK =19
221
- BSC_MISO =20
222
- BSC_CE_N =21
223
-
224
- #/* Longest busy delay */
225
-
226
- PI_MAX_BUSY_DELAY =100
227
-
228
- #/* timeout: 0-60000 */
229
-
230
- PI_MIN_WDOG_TIMEOUT =0
231
- PI_MAX_WDOG_TIMEOUT =60000
232
-
233
- #/* timer: 0-9 */
234
-
235
- PI_MIN_TIMER =0
236
- PI_MAX_TIMER =9
237
-
238
- #/* millis: 10-60000 */
239
-
240
- PI_MIN_MS =10
241
- PI_MAX_MS =60000
242
-
243
- PI_MAX_SCRIPTS =32
244
-
245
- PI_MAX_SCRIPT_TAGS =50
246
- PI_MAX_SCRIPT_VARS =150
247
- PI_MAX_SCRIPT_PARAMS =10
248
-
249
- #/* script status */
250
-
251
- PI_SCRIPT_INITING =0
252
- PI_SCRIPT_HALTED =1
253
- PI_SCRIPT_RUNNING =2
254
- PI_SCRIPT_WAITING =3
255
- PI_SCRIPT_FAILED =4
256
-
257
- #/* signum: 0-63 */
258
-
259
- PI_MIN_SIGNUM =0
260
- PI_MAX_SIGNUM =63
261
-
262
- #/* timetype: 0-1 */
263
-
264
- PI_TIME_RELATIVE =0
265
- PI_TIME_ABSOLUTE =1
266
-
267
- PI_MAX_MICS_DELAY =1000000 #/* 1 second */
268
- PI_MAX_MILS_DELAY =60000 #/* 60 seconds */
269
-
270
- #/* cfgMillis */
271
-
272
- PI_BUF_MILLIS_MIN =100
273
- PI_BUF_MILLIS_MAX =10000
274
-
275
- #/* cfgMicros: 1, 2, 4, 5, 8, or 10 */
276
-
277
- #/* cfgPeripheral: 0-1 */
278
-
279
- PI_CLOCK_PWM =0
280
- PI_CLOCK_PCM =1
281
-
282
- #/* DMA channel: 0-14 */
283
-
284
- PI_MIN_DMA_CHANNEL =0
285
- PI_MAX_DMA_CHANNEL =14
286
-
287
- #/* port */
288
-
289
- PI_MIN_SOCKET_PORT =1024
290
- PI_MAX_SOCKET_PORT =32000
291
-
292
-
293
- #/* ifFlags: */
294
-
295
- PI_DISABLE_FIFO_IF =1
296
- PI_DISABLE_SOCK_IF =2
297
- PI_LOCALHOST_SOCK_IF =4
298
-
299
- #/* memAllocMode */
300
-
301
- PI_MEM_ALLOC_AUTO =0
302
- PI_MEM_ALLOC_PAGEMAP =1
303
- PI_MEM_ALLOC_MAILBOX =2
304
-
305
- #/* filters */
306
-
307
- PI_MAX_STEADY =300000
308
- PI_MAX_ACTIVE =1000000
309
-
310
- #/* gpioCfgInternals */
311
-
312
- PI_CFG_DBG_LEVEL =0 #/* bits 0-3 */
313
- PI_CFG_ALERT_FREQ =4 #/* bits 4-7 */
314
- PI_CFG_RT_PRIORITY =(1<<8)
315
- PI_CFG_STATS =(1<<9)
316
-
317
- PI_CFG_ILLEGAL_VAL =(1<<10)
318
-
319
- #/* gpioISR */
320
-
321
- RISING_EDGE =0
322
- FALLING_EDGE =1
323
- EITHER_EDGE =2
324
-
325
-
326
- #/* pads */
327
-
328
- PI_MAX_PAD =2
329
-
330
- PI_MIN_PAD_STRENGTH =1
331
- PI_MAX_PAD_STRENGTH =16
332
-
333
- #/* files */
334
-
335
- PI_FILE_NONE =0
336
- PI_FILE_MIN =1
337
- PI_FILE_READ =1
338
- PI_FILE_WRITE =2
339
- PI_FILE_RW =3
340
- PI_FILE_APPEND =4
341
- PI_FILE_CREATE =8
342
- PI_FILE_TRUNC =16
343
- PI_FILE_MAX =31
344
-
345
- PI_FROM_START =0
346
- PI_FROM_CURRENT =1
347
- PI_FROM_END =2
348
-
349
- #/* Allowed socket connect addresses */
350
-
351
- MAX_CONNECT_ADDRESSES =256
352
-
353
- #/* events */
354
-
355
- PI_MAX_EVENT =31
356
-
357
- #/* Event auto generated on BSC slave activity */
358
-
359
- PI_EVENT_BSC =31
360
-
361
-
362
- #/*DEF_S Socket Command Codes*/
363
-
364
- PI_CMD_MODES =0
365
- PI_CMD_MODEG =1
366
- PI_CMD_PUD =2
367
- PI_CMD_READ =3
368
- PI_CMD_WRITE =4
369
- PI_CMD_PWM =5
370
- PI_CMD_PRS =6
371
- PI_CMD_PFS =7
372
- PI_CMD_SERVO =8
373
- PI_CMD_WDOG =9
374
- PI_CMD_BR1 =10
375
- PI_CMD_BR2 =11
376
- PI_CMD_BC1 =12
377
- PI_CMD_BC2 =13
378
- PI_CMD_BS1 =14
379
- PI_CMD_BS2 =15
380
- PI_CMD_TICK =16
381
- PI_CMD_HWVER =17
382
- PI_CMD_NO =18
383
- PI_CMD_NB =19
384
- PI_CMD_NP =20
385
- PI_CMD_NC =21
386
- PI_CMD_PRG =22
387
- PI_CMD_PFG =23
388
- PI_CMD_PRRG =24
389
- PI_CMD_HELP =25
390
- PI_CMD_PIGPV =26
391
- PI_CMD_WVCLR =27
392
- PI_CMD_WVAG =28
393
- PI_CMD_WVAS =29
394
- PI_CMD_WVGO =30
395
- PI_CMD_WVGOR =31
396
- PI_CMD_WVBSY =32
397
- PI_CMD_WVHLT =33
398
- PI_CMD_WVSM =34
399
- PI_CMD_WVSP =35
400
- PI_CMD_WVSC =36
401
- PI_CMD_TRIG =37
402
- PI_CMD_PROC =38
403
- PI_CMD_PROCD =39
404
- PI_CMD_PROCR =40
405
- PI_CMD_PROCS =41
406
- PI_CMD_SLRO =42
407
- PI_CMD_SLR =43
408
- PI_CMD_SLRC =44
409
- PI_CMD_PROCP =45
410
- PI_CMD_MICS =46
411
- PI_CMD_MILS =47
412
- PI_CMD_PARSE =48
413
- PI_CMD_WVCRE =49
414
- PI_CMD_WVDEL =50
415
- PI_CMD_WVTX =51
416
- PI_CMD_WVTXR =52
417
- PI_CMD_WVNEW =53
418
-
419
- PI_CMD_I2CO =54
420
- PI_CMD_I2CC =55
421
- PI_CMD_I2CRD =56
422
- PI_CMD_I2CWD =57
423
- PI_CMD_I2CWQ =58
424
- PI_CMD_I2CRS =59
425
- PI_CMD_I2CWS =60
426
- PI_CMD_I2CRB =61
427
- PI_CMD_I2CWB =62
428
- PI_CMD_I2CRW =63
429
- PI_CMD_I2CWW =64
430
- PI_CMD_I2CRK =65
431
- PI_CMD_I2CWK =66
432
- PI_CMD_I2CRI =67
433
- PI_CMD_I2CWI =68
434
- PI_CMD_I2CPC =69
435
- PI_CMD_I2CPK =70
436
-
437
- PI_CMD_SPIO =71
438
- PI_CMD_SPIC =72
439
- PI_CMD_SPIR =73
440
- PI_CMD_SPIW =74
441
- PI_CMD_SPIX =75
442
-
443
- PI_CMD_SERO =76
444
- PI_CMD_SERC =77
445
- PI_CMD_SERRB =78
446
- PI_CMD_SERWB =79
447
- PI_CMD_SERR =80
448
- PI_CMD_SERW =81
449
- PI_CMD_SERDA =82
450
-
451
- PI_CMD_GDC =83
452
- PI_CMD_GPW =84
453
-
454
- PI_CMD_HC =85
455
- PI_CMD_HP =86
456
-
457
- PI_CMD_CF1 =87
458
- PI_CMD_CF2 =88
459
-
460
- PI_CMD_BI2CC =89
461
- PI_CMD_BI2CO =90
462
- PI_CMD_BI2CZ =91
463
-
464
- PI_CMD_I2CZ =92
465
-
466
- PI_CMD_WVCHA =93
467
-
468
- PI_CMD_SLRI =94
469
-
470
- PI_CMD_CGI =95
471
- PI_CMD_CSI =96
472
-
473
- PI_CMD_FG =97
474
- PI_CMD_FN =98
475
-
476
- PI_CMD_NOIB =99
477
-
478
- PI_CMD_WVTXM =100
479
- PI_CMD_WVTAT =101
480
-
481
- PI_CMD_PADS =102
482
- PI_CMD_PADG =103
483
-
484
- PI_CMD_FO =104
485
- PI_CMD_FC =105
486
- PI_CMD_FR =106
487
- PI_CMD_FW =107
488
- PI_CMD_FS =108
489
- PI_CMD_FL =109
490
-
491
- PI_CMD_SHELL =110
492
-
493
- PI_CMD_BSPIC =111
494
- PI_CMD_BSPIO =112
495
- PI_CMD_BSPIX =113
496
-
497
- PI_CMD_BSCX =114
498
-
499
- PI_CMD_EVM =115
500
- PI_CMD_EVT =116
501
-
502
- #/*DEF_E*/
503
-
504
- #/* pseudo commands */
505
-
506
- PI_CMD_SCRIPT =800
507
-
508
- PI_CMD_ADD =800
509
- PI_CMD_AND =801
510
- PI_CMD_CALL =802
511
- PI_CMD_CMDR =803
512
- PI_CMD_CMDW =804
513
- PI_CMD_CMP =805
514
- PI_CMD_DCR =806
515
- PI_CMD_DCRA =807
516
- PI_CMD_DIV =808
517
- PI_CMD_HALT =809
518
- PI_CMD_INR =810
519
- PI_CMD_INRA =811
520
- PI_CMD_JM =812
521
- PI_CMD_JMP =813
522
- PI_CMD_JNZ =814
523
- PI_CMD_JP =815
524
- PI_CMD_JZ =816
525
- PI_CMD_TAG =817
526
- PI_CMD_LD =818
527
- PI_CMD_LDA =819
528
- PI_CMD_LDAB =820
529
- PI_CMD_MLT =821
530
- PI_CMD_MOD =822
531
- PI_CMD_NOP =823
532
- PI_CMD_OR =824
533
- PI_CMD_POP =825
534
- PI_CMD_POPA =826
535
- PI_CMD_PUSH =827
536
- PI_CMD_PUSHA =828
537
- PI_CMD_RET =829
538
- PI_CMD_RL =830
539
- PI_CMD_RLA =831
540
- PI_CMD_RR =832
541
- PI_CMD_RRA =833
542
- PI_CMD_STA =834
543
- PI_CMD_STAB =835
544
- PI_CMD_SUB =836
545
- PI_CMD_SYS =837
546
- PI_CMD_WAIT =838
547
- PI_CMD_X =839
548
- PI_CMD_XA =840
549
- PI_CMD_XOR =841
550
- PI_CMD_EVTWT =842
551
-
552
- #/*DEF_S Error Codes*/
553
-
554
- PI_INIT_FAILED =-1 #Error Code: gpioInitialise failed
555
- PI_BAD_USER_GPIO =-2 #Error Code: GPIO not 0-31
556
- PI_BAD_GPIO =-3 #Error Code: GPIO not 0-53
557
- PI_BAD_MODE =-4 #Error Code: mode not 0-7
558
- PI_BAD_LEVEL =-5 #Error Code: level not 0-1
559
- PI_BAD_PUD =-6 #Error Code: pud not 0-2
560
- PI_BAD_PULSEWIDTH =-7 #Error Code: pulsewidth not 0 or 500-2500
561
- PI_BAD_DUTYCYCLE =-8 #Error Code: dutycycle outside set range
562
- PI_BAD_TIMER =-9 #Error Code: timer not 0-9
563
- PI_BAD_MS =-10 #Error Code: ms not 10-60000
564
- PI_BAD_TIMETYPE =-11 #Error Code: timetype not 0-1
565
- PI_BAD_SECONDS =-12 #Error Code: seconds < 0
566
- PI_BAD_MICROS =-13 #Error Code: micros not 0-999999
567
- PI_TIMER_FAILED =-14 #Error Code: gpioSetTimerFunc failed
568
- PI_BAD_WDOG_TIMEOUT =-15 #Error Code: timeout not 0-60000
569
- PI_NO_ALERT_FUNC =-16 #Error Code: DEPRECATED
570
- PI_BAD_CLK_PERIPH =-17 #Error Code: clock peripheral not 0-1
571
- PI_BAD_CLK_SOURCE =-18 #Error Code: DEPRECATED
572
- PI_BAD_CLK_MICROS =-19 #Error Code: clock micros not 1, 2, 4, 5, 8, or 10
573
- PI_BAD_BUF_MILLIS =-20 #Error Code: buf millis not 100-10000
574
- PI_BAD_DUTYRANGE =-21 #Error Code: dutycycle range not 25-40000
575
- PI_BAD_DUTY_RANGE =-21 #Error Code: DEPRECATED (use PI_BAD_DUTYRANGE)
576
- PI_BAD_SIGNUM =-22 #Error Code: signum not 0-63
577
- PI_BAD_PATHNAME =-23 #Error Code: can't open pathname
578
- PI_NO_HANDLE =-24 #Error Code: no handle available
579
- PI_BAD_HANDLE =-25 #Error Code: unknown handle
580
- PI_BAD_IF_FLAGS =-26 #Error Code: ifFlags > 3
581
- PI_BAD_CHANNEL =-27 #Error Code: DMA channel not 0-14
582
- PI_BAD_PRIM_CHANNEL =-27 #Error Code: DMA primary channel not 0-14
583
- PI_BAD_SOCKET_PORT =-28 #Error Code: socket port not 1024-32000
584
- PI_BAD_FIFO_COMMAND =-29 #Error Code: unrecognized fifo command
585
- PI_BAD_SECO_CHANNEL =-30 #Error Code: DMA secondary channel not 0-6
586
- PI_NOT_INITIALISED =-31 #Error Code: function called before gpioInitialise
587
- PI_INITIALISED =-32 #Error Code: function called after gpioInitialise
588
- PI_BAD_WAVE_MODE =-33 #Error Code: waveform mode not 0-3
589
- PI_BAD_CFG_INTERNAL =-34 #Error Code: bad parameter in gpioCfgInternals call
590
- PI_BAD_WAVE_BAUD =-35 #Error Code: baud rate not 50-250K(RX)/50-1M(TX)
591
- PI_TOO_MANY_PULSES =-36 #Error Code: waveform has too many pulses
592
- PI_TOO_MANY_CHARS =-37 #Error Code: waveform has too many chars
593
- PI_NOT_SERIAL_GPIO =-38 #Error Code: no bit bang serial read on GPIO
594
- PI_BAD_SERIAL_STRUC =-39 #Error Code: bad (null) serial structure parameter
595
- PI_BAD_SERIAL_BUF =-40 #Error Code: bad (null) serial buf parameter
596
- PI_NOT_PERMITTED =-41 #Error Code: GPIO operation not permitted
597
- PI_SOME_PERMITTED =-42 #Error Code: one or more GPIO not permitted
598
- PI_BAD_WVSC_COMMND =-43 #Error Code: bad WVSC subcommand
599
- PI_BAD_WVSM_COMMND =-44 #Error Code: bad WVSM subcommand
600
- PI_BAD_WVSP_COMMND =-45 #Error Code: bad WVSP subcommand
601
- PI_BAD_PULSELEN =-46 #Error Code: trigger pulse length not 1-100
602
- PI_BAD_SCRIPT =-47 #Error Code: invalid script
603
- PI_BAD_SCRIPT_ID =-48 #Error Code: unknown script id
604
- PI_BAD_SER_OFFSET =-49 #Error Code: add serial data offset > 30 minutes
605
- PI_GPIO_IN_USE =-50 #Error Code: GPIO already in use
606
- PI_BAD_SERIAL_COUNT =-51 #Error Code: must read at least a byte at a time
607
- PI_BAD_PARAM_NUM =-52 #Error Code: script parameter id not 0-9
608
- PI_DUP_TAG =-53 #Error Code: script has duplicate tag
609
- PI_TOO_MANY_TAGS =-54 #Error Code: script has too many tags
610
- PI_BAD_SCRIPT_CMD =-55 #Error Code: illegal script command
611
- PI_BAD_VAR_NUM =-56 #Error Code: script variable id not 0-149
612
- PI_NO_SCRIPT_ROOM =-57 #Error Code: no more room for scripts
613
- PI_NO_MEMORY =-58 #Error Code: can't allocate temporary memory
614
- PI_SOCK_READ_FAILED =-59 #Error Code: socket read failed
615
- PI_SOCK_WRIT_FAILED =-60 #Error Code: socket write failed
616
- PI_TOO_MANY_PARAM =-61 #Error Code: too many script parameters (> 10)
617
- PI_NOT_HALTED =-62 #Error Code: DEPRECATED
618
- PI_SCRIPT_NOT_READY =-62 #Error Code: script initialising
619
- PI_BAD_TAG =-63 #Error Code: script has unresolved tag
620
- PI_BAD_MICS_DELAY =-64 #Error Code: bad MICS delay (too large)
621
- PI_BAD_MILS_DELAY =-65 #Error Code: bad MILS delay (too large)
622
- PI_BAD_WAVE_ID =-66 #Error Code: non existent wave id
623
- PI_TOO_MANY_CBS =-67 #Error Code: No more CBs for waveform
624
- PI_TOO_MANY_OOL =-68 #Error Code: No more OOL for waveform
625
- PI_EMPTY_WAVEFORM =-69 #Error Code: attempt to create an empty waveform
626
- PI_NO_WAVEFORM_ID =-70 #Error Code: no more waveforms
627
- PI_I2C_OPEN_FAILED =-71 #Error Code: can't open I2C device
628
- PI_SER_OPEN_FAILED =-72 #Error Code: can't open serial device
629
- PI_SPI_OPEN_FAILED =-73 #Error Code: can't open SPI device
630
- PI_BAD_I2C_BUS =-74 #Error Code: bad I2C bus
631
- PI_BAD_I2C_ADDR =-75 #Error Code: bad I2C address
632
- PI_BAD_SPI_CHANNEL =-76 #Error Code: bad SPI channel
633
- PI_BAD_FLAGS =-77 #Error Code: bad i2c/spi/ser open flags
634
- PI_BAD_SPI_SPEED =-78 #Error Code: bad SPI speed
635
- PI_BAD_SER_DEVICE =-79 #Error Code: bad serial device name
636
- PI_BAD_SER_SPEED =-80 #Error Code: bad serial baud rate
637
- PI_BAD_PARAM =-81 #Error Code: bad i2c/spi/ser parameter
638
- PI_I2C_WRITE_FAILED =-82 #Error Code: i2c write failed
639
- PI_I2C_READ_FAILED =-83 #Error Code: i2c read failed
640
- PI_BAD_SPI_COUNT =-84 #Error Code: bad SPI count
641
- PI_SER_WRITE_FAILED =-85 #Error Code: ser write failed
642
- PI_SER_READ_FAILED =-86 #Error Code: ser read failed
643
- PI_SER_READ_NO_DATA =-87 #Error Code: ser read no data available
644
- PI_UNKNOWN_COMMAND =-88 #Error Code: unknown command
645
- PI_SPI_XFER_FAILED =-89 #Error Code: spi xfer/read/write failed
646
- PI_BAD_POINTER =-90 #Error Code: bad (NULL) pointer
647
- PI_NO_AUX_SPI =-91 #Error Code: no auxiliary SPI on Pi A or B
648
- PI_NOT_PWM_GPIO =-92 #Error Code: GPIO is not in use for PWM
649
- PI_NOT_SERVO_GPIO =-93 #Error Code: GPIO is not in use for servo pulses
650
- PI_NOT_HCLK_GPIO =-94 #Error Code: GPIO has no hardware clock
651
- PI_NOT_HPWM_GPIO =-95 #Error Code: GPIO has no hardware PWM
652
- PI_BAD_HPWM_FREQ =-96 #Error Code: hardware PWM frequency not 1-125M
653
- PI_BAD_HPWM_DUTY =-97 #Error Code: hardware PWM dutycycle not 0-1M
654
- PI_BAD_HCLK_FREQ =-98 #Error Code: hardware clock frequency not 4689-250M
655
- PI_BAD_HCLK_PASS =-99 #Error Code: need password to use hardware clock 1
656
- PI_HPWM_ILLEGAL =-100 #Error Code: illegal, PWM in use for main clock
657
- PI_BAD_DATABITS =-101 #Error Code: serial data bits not 1-32
658
- PI_BAD_STOPBITS =-102 #Error Code: serial (half) stop bits not 2-8
659
- PI_MSG_TOOBIG =-103 #Error Code: socket/pipe message too big
660
- PI_BAD_MALLOC_MODE =-104 #Error Code: bad memory allocation mode
661
- PI_TOO_MANY_SEGS =-105 #Error Code: too many I2C transaction segments
662
- PI_BAD_I2C_SEG =-106 #Error Code: an I2C transaction segment failed
663
- PI_BAD_SMBUS_CMD =-107 #Error Code: SMBus command not supported by driver
664
- PI_NOT_I2C_GPIO =-108 #Error Code: no bit bang I2C in progress on GPIO
665
- PI_BAD_I2C_WLEN =-109 #Error Code: bad I2C write length
666
- PI_BAD_I2C_RLEN =-110 #Error Code: bad I2C read length
667
- PI_BAD_I2C_CMD =-111 #Error Code: bad I2C command
668
- PI_BAD_I2C_BAUD =-112 #Error Code: bad I2C baud rate, not 50-500k
669
- PI_CHAIN_LOOP_CNT =-113 #Error Code: bad chain loop count
670
- PI_BAD_CHAIN_LOOP =-114 #Error Code: empty chain loop
671
- PI_CHAIN_COUNTER =-115 #Error Code: too many chain counters
672
- PI_BAD_CHAIN_CMD =-116 #Error Code: bad chain command
673
- PI_BAD_CHAIN_DELAY =-117 #Error Code: bad chain delay micros
674
- PI_CHAIN_NESTING =-118 #Error Code: chain counters nested too deeply
675
- PI_CHAIN_TOO_BIG =-119 #Error Code: chain is too long
676
- PI_DEPRECATED =-120 #Error Code: deprecated function removed
677
- PI_BAD_SER_INVERT =-121 #Error Code: bit bang serial invert not 0 or 1
678
- PI_BAD_EDGE =-122 #Error Code: bad ISR edge value, not 0-2
679
- PI_BAD_ISR_INIT =-123 #Error Code: bad ISR initialisation
680
- PI_BAD_FOREVER =-124 #Error Code: loop forever must be last command
681
- PI_BAD_FILTER =-125 #Error Code: bad filter parameter
682
- PI_BAD_PAD =-126 #Error Code: bad pad number
683
- PI_BAD_STRENGTH =-127 #Error Code: bad pad drive strength
684
- PI_FIL_OPEN_FAILED =-128 #Error Code: file open failed
685
- PI_BAD_FILE_MODE =-129 #Error Code: bad file mode
686
- PI_BAD_FILE_FLAG =-130 #Error Code: bad file flag
687
- PI_BAD_FILE_READ =-131 #Error Code: bad file read
688
- PI_BAD_FILE_WRITE =-132 #Error Code: bad file write
689
- PI_FILE_NOT_ROPEN =-133 #Error Code: file not open for read
690
- PI_FILE_NOT_WOPEN =-134 #Error Code: file not open for write
691
- PI_BAD_FILE_SEEK =-135 #Error Code: bad file seek
692
- PI_NO_FILE_MATCH =-136 #Error Code: no files match pattern
693
- PI_NO_FILE_ACCESS =-137 #Error Code: no permission to access file
694
- PI_FILE_IS_A_DIR =-138 #Error Code: file is a directory
695
- PI_BAD_SHELL_STATUS=-139 #Error Code: bad shell return status
696
- PI_BAD_SCRIPT_NAME =-140 #Error Code: bad script name
697
- PI_BAD_SPI_BAUD =-141 #Error Code: bad SPI baud rate, not 50-500k
698
- PI_NOT_SPI_GPIO =-142 #Error Code: no bit bang SPI in progress on GPIO
699
- PI_BAD_EVENT_ID =-143 #Error Code: bad event id
700
-
701
- PI_PIGIF_ERR_0 =-2000
702
- PI_PIGIF_ERR_99 =-2099
703
-
704
- PI_CUSTOM_ERR_0 =-3000
705
- PI_CUSTOM_ERR_999 =-3999
706
-
707
- #/*DEF_E*/
708
-
709
- #/*DEF_S Defaults*/
710
-
711
- PI_DEFAULT_BUFFER_MILLIS =120
712
- PI_DEFAULT_CLK_MICROS =5
713
- PI_DEFAULT_CLK_PERIPHERAL =PI_CLOCK_PCM
714
- PI_DEFAULT_IF_FLAGS =0
715
- PI_DEFAULT_FOREGROUND =0
716
- PI_DEFAULT_DMA_CHANNEL =14
717
- PI_DEFAULT_DMA_PRIMARY_CHANNEL =14
718
- PI_DEFAULT_DMA_SECONDARY_CHANNEL =6
719
- PI_DEFAULT_SOCKET_PORT =8888
720
- PI_DEFAULT_SOCKET_PORT_STR ="8888"
721
- PI_DEFAULT_SOCKET_ADDR_STR ="127.0.0.1"
722
- PI_DEFAULT_UPDATE_MASK_UNKNOWN =0xFFFFFFFF
723
- PI_DEFAULT_UPDATE_MASK_B1 =0x03E7CF93
724
- PI_DEFAULT_UPDATE_MASK_A_B2 =0xFBC7CF9C
725
- PI_DEFAULT_UPDATE_MASK_APLUS_BPLUS =0x0080480FFFFFFC
726
- PI_DEFAULT_UPDATE_MASK_ZERO =0x0080000FFFFFFC
727
- PI_DEFAULT_UPDATE_MASK_PI2B =0x0080480FFFFFFC
728
- PI_DEFAULT_UPDATE_MASK_PI3B =0x0000000FFFFFFC
729
- PI_DEFAULT_UPDATE_MASK_COMPUTE =0x00FFFFFFFFFFFF
730
- PI_DEFAULT_MEM_ALLOC_MODE =PI_MEM_ALLOC_AUTO
731
-
732
- PI_DEFAULT_CFG_INTERNALS =0
733
-
734
- Pigif_bad_send = -2000
735
- Pigif_bad_recv = -2001
736
- Pigif_bad_getaddrinfo = -2002
737
- Pigif_bad_connect = -2003
738
- Pigif_bad_socket = -2004
739
- Pigif_bad_noib = -2005
740
- Pigif_duplicate_callback = -2006
741
- Pigif_bad_malloc = -2007
742
- Pigif_bad_callback = -2008
743
- Pigif_notify_failed = -2009
744
- Pigif_callback_not_found = -2010
745
- Pigif_unconnected_pi = -2011
746
- Pigif_too_many_pis = -2012
747
- end
748
- end
1
+ class Pigpio
2
+ module Constant
3
+ # /* gpio: 0-53 */
4
+
5
+ PI_MIN_GPIO = 0
6
+ PI_MAX_GPIO = 53
7
+
8
+ # /* user_gpio: 0-31 */
9
+
10
+ PI_MAX_USER_GPIO = 31
11
+
12
+ # /* level: 0-1 */
13
+
14
+ PI_OFF = 0
15
+ PI_ON = 1
16
+
17
+ PI_CLEAR = 0
18
+ PI_SET = 1
19
+
20
+ PI_LOW = 0
21
+ PI_HIGH = 1
22
+
23
+ # /* level: only reported for GPIO time-out, see gpioSetWatchdog */
24
+
25
+ PI_TIMEOUT = 2
26
+
27
+ # /* mode: 0-7 */
28
+
29
+ PI_INPUT = 0
30
+ PI_OUTPUT = 1
31
+ PI_ALT0 = 4
32
+ PI_ALT1 = 5
33
+ PI_ALT2 = 6
34
+ PI_ALT3 = 7
35
+ PI_ALT4 = 3
36
+ PI_ALT5 = 2
37
+
38
+ # /* pud: 0-2 */
39
+
40
+ PI_PUD_OFF = 0
41
+ PI_PUD_DOWN = 1
42
+ PI_PUD_UP = 2
43
+
44
+ # /* dutycycle: 0-range */
45
+
46
+ PI_DEFAULT_DUTYCYCLE_RANGE = 255
47
+
48
+ # /* range: 25-40000 */
49
+
50
+ PI_MIN_DUTYCYCLE_RANGE = 25
51
+ PI_MAX_DUTYCYCLE_RANGE = 40000
52
+
53
+ # /* pulsewidth: 0, 500-2500 */
54
+
55
+ PI_SERVO_OFF = 0
56
+ PI_MIN_SERVO_PULSEWIDTH = 500
57
+ PI_MAX_SERVO_PULSEWIDTH = 2500
58
+
59
+ # /* hardware PWM */
60
+
61
+ PI_HW_PWM_MIN_FREQ = 1
62
+ PI_HW_PWM_MAX_FREQ = 125000000
63
+ PI_HW_PWM_RANGE = 1000000
64
+
65
+ # /* hardware clock */
66
+
67
+ PI_HW_CLK_MIN_FREQ = 4689
68
+ PI_HW_CLK_MAX_FREQ = 250000000
69
+
70
+ PI_NOTIFY_SLOTS = 32
71
+
72
+ PI_NTFY_FLAGS_EVENT = (1 << 7)
73
+ PI_NTFY_FLAGS_ALIVE = (1 << 6)
74
+ PI_NTFY_FLAGS_WDOG = (1 << 5)
75
+ # PI_NTFY_FLAGS_BIT(x) =(((x)<<0)&31)
76
+
77
+ PI_WAVE_BLOCKS = 4
78
+ PI_WAVE_MAX_PULSES = (PI_WAVE_BLOCKS * 3000)
79
+ PI_WAVE_MAX_CHARS = (PI_WAVE_BLOCKS * 300)
80
+
81
+ PI_BB_I2C_MIN_BAUD = 50
82
+ PI_BB_I2C_MAX_BAUD = 500000
83
+
84
+ PI_BB_SPI_MIN_BAUD = 50
85
+ PI_BB_SPI_MAX_BAUD = 250000
86
+
87
+ PI_BB_SER_MIN_BAUD = 50
88
+ PI_BB_SER_MAX_BAUD = 250000
89
+
90
+ PI_BB_SER_NORMAL = 0
91
+ PI_BB_SER_INVERT = 1
92
+
93
+ PI_WAVE_MIN_BAUD = 50
94
+ PI_WAVE_MAX_BAUD = 1000000
95
+
96
+ PI_SPI_MIN_BAUD = 32000
97
+ PI_SPI_MAX_BAUD = 125000000
98
+
99
+ PI_MIN_WAVE_DATABITS = 1
100
+ PI_MAX_WAVE_DATABITS = 32
101
+
102
+ PI_MIN_WAVE_HALFSTOPBITS = 2
103
+ PI_MAX_WAVE_HALFSTOPBITS = 8
104
+
105
+ PI_WAVE_MAX_MICROS = (30 * 60 * 1000000) # /* half an hour */
106
+
107
+ PI_MAX_WAVES = 250
108
+
109
+ PI_MAX_WAVE_CYCLES = 65535
110
+ PI_MAX_WAVE_DELAY = 65535
111
+
112
+ PI_WAVE_COUNT_PAGES = 10
113
+
114
+ # /* wave tx mode */
115
+
116
+ PI_WAVE_MODE_ONE_SHOT = 0
117
+ PI_WAVE_MODE_REPEAT = 1
118
+ PI_WAVE_MODE_ONE_SHOT_SYNC = 2
119
+ PI_WAVE_MODE_REPEAT_SYNC = 3
120
+
121
+ # /* special wave at return values */
122
+
123
+ PI_WAVE_NOT_FOUND = 9998 # /* Transmitted wave not found. */
124
+ PI_NO_TX_WAVE = 9999 # /* No wave being transmitted. */
125
+
126
+ # /* Files, I2C, SPI, SER */
127
+
128
+ PI_FILE_SLOTS = 16
129
+ PI_I2C_SLOTS = 64
130
+ PI_SPI_SLOTS = 32
131
+ PI_SER_SLOTS = 16
132
+
133
+ PI_MAX_I2C_ADDR = 0x7F
134
+
135
+ PI_NUM_AUX_SPI_CHANNEL = 3
136
+ PI_NUM_STD_SPI_CHANNEL = 2
137
+
138
+ PI_MAX_I2C_DEVICE_COUNT = (1 << 16)
139
+ PI_MAX_SPI_DEVICE_COUNT = (1 << 16)
140
+
141
+ # /* max pi_i2c_msg_t per transaction */
142
+
143
+ PI_I2C_RDRW_IOCTL_MAX_MSGS = 42
144
+
145
+ # /* flags for i2cTransaction, pi_i2c_msg_t */
146
+
147
+ PI_I2C_M_WR = 0x0000 # /* write data */
148
+ PI_I2C_M_RD = 0x0001 # /* read data */
149
+ PI_I2C_M_TEN = 0x0010 # /* ten bit chip address */
150
+ PI_I2C_M_RECV_LEN = 0x0400 # /* length will be first received byte */
151
+ PI_I2C_M_NO_RD_ACK = 0x0800 # /* if I2C_FUNC_PROTOCOL_MANGLING */
152
+ PI_I2C_M_IGNORE_NAK = 0x1000 # /* if I2C_FUNC_PROTOCOL_MANGLING */
153
+ PI_I2C_M_REV_DIR_ADDR = 0x2000 # /* if I2C_FUNC_PROTOCOL_MANGLING */
154
+ PI_I2C_M_NOSTART = 0x4000 # /* if I2C_FUNC_PROTOCOL_MANGLING */
155
+
156
+ # /* bbI2CZip and i2cZip commands */
157
+
158
+ PI_I2C_END = 0
159
+ PI_I2C_ESC = 1
160
+ PI_I2C_START = 2
161
+ PI_I2C_COMBINED_ON = 2
162
+ PI_I2C_STOP = 3
163
+ PI_I2C_COMBINED_OFF = 3
164
+ PI_I2C_ADDR = 4
165
+ PI_I2C_FLAGS = 5
166
+ PI_I2C_READ = 6
167
+ PI_I2C_WRITE = 7
168
+
169
+ # /* SPI */
170
+
171
+ # PI_SPI_FLAGS_BITLEN(x) =((x&63)<<16)
172
+ # PI_SPI_FLAGS_RX_LSB(x) =((x&1)<<15)
173
+ # PI_SPI_FLAGS_TX_LSB(x) =((x&1)<<14)
174
+ # PI_SPI_FLAGS_3WREN(x) =((x&15)<<10)
175
+ # PI_SPI_FLAGS_3WIRE(x) =((x&1)<<9)
176
+ # PI_SPI_FLAGS_AUX_SPI(x) =((x&1)<<8)
177
+ # PI_SPI_FLAGS_RESVD(x) =((x&7)<<5)
178
+ # PI_SPI_FLAGS_CSPOLS(x) =((x&7)<<2)
179
+ # PI_SPI_FLAGS_MODE(x) =((x&3))
180
+
181
+ # /* BSC registers */
182
+
183
+ BSC_DR = 0
184
+ BSC_RSR = 1
185
+ BSC_SLV = 2
186
+ BSC_CR = 3
187
+ BSC_FR = 4
188
+ BSC_IFLS = 5
189
+ BSC_IMSC = 6
190
+ BSC_RIS = 7
191
+ BSC_MIS = 8
192
+ BSC_ICR = 9
193
+ BSC_DMACR = 10
194
+ BSC_TDR = 11
195
+ BSC_GPUSTAT = 12
196
+ BSC_HCTRL = 13
197
+ BSC_DEBUG_I2C = 14
198
+ BSC_DEBUG_SPI = 15
199
+
200
+ BSC_CR_TESTFIFO = 2048
201
+ BSC_CR_RXE = 512
202
+ BSC_CR_TXE = 256
203
+ BSC_CR_BRK = 128
204
+ BSC_CR_CPOL = 16
205
+ BSC_CR_CPHA = 8
206
+ BSC_CR_I2C = 4
207
+ BSC_CR_SPI = 2
208
+ BSC_CR_EN = 1
209
+
210
+ BSC_FR_RXBUSY = 32
211
+ BSC_FR_TXFE = 16
212
+ BSC_FR_RXFF = 8
213
+ BSC_FR_TXFF = 4
214
+ BSC_FR_RXFE = 2
215
+ BSC_FR_TXBUSY = 1
216
+
217
+ # /* BSC GPIO */
218
+
219
+ BSC_SDA_MOSI = 18
220
+ BSC_SCL_SCLK = 19
221
+ BSC_MISO = 20
222
+ BSC_CE_N = 21
223
+
224
+ # /* Longest busy delay */
225
+
226
+ PI_MAX_BUSY_DELAY = 100
227
+
228
+ # /* timeout: 0-60000 */
229
+
230
+ PI_MIN_WDOG_TIMEOUT = 0
231
+ PI_MAX_WDOG_TIMEOUT = 60000
232
+
233
+ # /* timer: 0-9 */
234
+
235
+ PI_MIN_TIMER = 0
236
+ PI_MAX_TIMER = 9
237
+
238
+ # /* millis: 10-60000 */
239
+
240
+ PI_MIN_MS = 10
241
+ PI_MAX_MS = 60000
242
+
243
+ PI_MAX_SCRIPTS = 32
244
+
245
+ PI_MAX_SCRIPT_TAGS = 50
246
+ PI_MAX_SCRIPT_VARS = 150
247
+ PI_MAX_SCRIPT_PARAMS = 10
248
+
249
+ # /* script status */
250
+
251
+ PI_SCRIPT_INITING = 0
252
+ PI_SCRIPT_HALTED = 1
253
+ PI_SCRIPT_RUNNING = 2
254
+ PI_SCRIPT_WAITING = 3
255
+ PI_SCRIPT_FAILED = 4
256
+
257
+ # /* signum: 0-63 */
258
+
259
+ PI_MIN_SIGNUM = 0
260
+ PI_MAX_SIGNUM = 63
261
+
262
+ # /* timetype: 0-1 */
263
+
264
+ PI_TIME_RELATIVE = 0
265
+ PI_TIME_ABSOLUTE = 1
266
+
267
+ PI_MAX_MICS_DELAY = 1000000 # /* 1 second */
268
+ PI_MAX_MILS_DELAY = 60000 # /* 60 seconds */
269
+
270
+ # /* cfgMillis */
271
+
272
+ PI_BUF_MILLIS_MIN = 100
273
+ PI_BUF_MILLIS_MAX = 10000
274
+
275
+ # /* cfgMicros: 1, 2, 4, 5, 8, or 10 */
276
+
277
+ # /* cfgPeripheral: 0-1 */
278
+
279
+ PI_CLOCK_PWM = 0
280
+ PI_CLOCK_PCM = 1
281
+
282
+ # /* DMA channel: 0-14 */
283
+
284
+ PI_MIN_DMA_CHANNEL = 0
285
+ PI_MAX_DMA_CHANNEL = 14
286
+
287
+ # /* port */
288
+
289
+ PI_MIN_SOCKET_PORT = 1024
290
+ PI_MAX_SOCKET_PORT = 32000
291
+
292
+ # /* ifFlags: */
293
+
294
+ PI_DISABLE_FIFO_IF = 1
295
+ PI_DISABLE_SOCK_IF = 2
296
+ PI_LOCALHOST_SOCK_IF = 4
297
+
298
+ # /* memAllocMode */
299
+
300
+ PI_MEM_ALLOC_AUTO = 0
301
+ PI_MEM_ALLOC_PAGEMAP = 1
302
+ PI_MEM_ALLOC_MAILBOX = 2
303
+
304
+ # /* filters */
305
+
306
+ PI_MAX_STEADY = 300000
307
+ PI_MAX_ACTIVE = 1000000
308
+
309
+ # /* gpioCfgInternals */
310
+
311
+ PI_CFG_DBG_LEVEL = 0 # /* bits 0-3 */
312
+ PI_CFG_ALERT_FREQ = 4 # /* bits 4-7 */
313
+ PI_CFG_RT_PRIORITY = (1 << 8)
314
+ PI_CFG_STATS = (1 << 9)
315
+
316
+ PI_CFG_ILLEGAL_VAL = (1 << 10)
317
+
318
+ # /* gpioISR */
319
+
320
+ RISING_EDGE = 0
321
+ FALLING_EDGE = 1
322
+ EITHER_EDGE = 2
323
+
324
+ # /* pads */
325
+
326
+ PI_MAX_PAD = 2
327
+
328
+ PI_MIN_PAD_STRENGTH = 1
329
+ PI_MAX_PAD_STRENGTH = 16
330
+
331
+ # /* files */
332
+
333
+ PI_FILE_NONE = 0
334
+ PI_FILE_MIN = 1
335
+ PI_FILE_READ = 1
336
+ PI_FILE_WRITE = 2
337
+ PI_FILE_RW = 3
338
+ PI_FILE_APPEND = 4
339
+ PI_FILE_CREATE = 8
340
+ PI_FILE_TRUNC = 16
341
+ PI_FILE_MAX = 31
342
+
343
+ PI_FROM_START = 0
344
+ PI_FROM_CURRENT = 1
345
+ PI_FROM_END = 2
346
+
347
+ # /* Allowed socket connect addresses */
348
+
349
+ MAX_CONNECT_ADDRESSES = 256
350
+
351
+ # /* events */
352
+
353
+ PI_MAX_EVENT = 31
354
+
355
+ # /* Event auto generated on BSC slave activity */
356
+
357
+ PI_EVENT_BSC = 31
358
+
359
+ # /*DEF_S Socket Command Codes*/
360
+
361
+ PI_CMD_MODES = 0
362
+ PI_CMD_MODEG = 1
363
+ PI_CMD_PUD = 2
364
+ PI_CMD_READ = 3
365
+ PI_CMD_WRITE = 4
366
+ PI_CMD_PWM = 5
367
+ PI_CMD_PRS = 6
368
+ PI_CMD_PFS = 7
369
+ PI_CMD_SERVO = 8
370
+ PI_CMD_WDOG = 9
371
+ PI_CMD_BR1 = 10
372
+ PI_CMD_BR2 = 11
373
+ PI_CMD_BC1 = 12
374
+ PI_CMD_BC2 = 13
375
+ PI_CMD_BS1 = 14
376
+ PI_CMD_BS2 = 15
377
+ PI_CMD_TICK = 16
378
+ PI_CMD_HWVER = 17
379
+ PI_CMD_NO = 18
380
+ PI_CMD_NB = 19
381
+ PI_CMD_NP = 20
382
+ PI_CMD_NC = 21
383
+ PI_CMD_PRG = 22
384
+ PI_CMD_PFG = 23
385
+ PI_CMD_PRRG = 24
386
+ PI_CMD_HELP = 25
387
+ PI_CMD_PIGPV = 26
388
+ PI_CMD_WVCLR = 27
389
+ PI_CMD_WVAG = 28
390
+ PI_CMD_WVAS = 29
391
+ PI_CMD_WVGO = 30
392
+ PI_CMD_WVGOR = 31
393
+ PI_CMD_WVBSY = 32
394
+ PI_CMD_WVHLT = 33
395
+ PI_CMD_WVSM = 34
396
+ PI_CMD_WVSP = 35
397
+ PI_CMD_WVSC = 36
398
+ PI_CMD_TRIG = 37
399
+ PI_CMD_PROC = 38
400
+ PI_CMD_PROCD = 39
401
+ PI_CMD_PROCR = 40
402
+ PI_CMD_PROCS = 41
403
+ PI_CMD_SLRO = 42
404
+ PI_CMD_SLR = 43
405
+ PI_CMD_SLRC = 44
406
+ PI_CMD_PROCP = 45
407
+ PI_CMD_MICS = 46
408
+ PI_CMD_MILS = 47
409
+ PI_CMD_PARSE = 48
410
+ PI_CMD_WVCRE = 49
411
+ PI_CMD_WVDEL = 50
412
+ PI_CMD_WVTX = 51
413
+ PI_CMD_WVTXR = 52
414
+ PI_CMD_WVNEW = 53
415
+
416
+ PI_CMD_I2CO = 54
417
+ PI_CMD_I2CC = 55
418
+ PI_CMD_I2CRD = 56
419
+ PI_CMD_I2CWD = 57
420
+ PI_CMD_I2CWQ = 58
421
+ PI_CMD_I2CRS = 59
422
+ PI_CMD_I2CWS = 60
423
+ PI_CMD_I2CRB = 61
424
+ PI_CMD_I2CWB = 62
425
+ PI_CMD_I2CRW = 63
426
+ PI_CMD_I2CWW = 64
427
+ PI_CMD_I2CRK = 65
428
+ PI_CMD_I2CWK = 66
429
+ PI_CMD_I2CRI = 67
430
+ PI_CMD_I2CWI = 68
431
+ PI_CMD_I2CPC = 69
432
+ PI_CMD_I2CPK = 70
433
+
434
+ PI_CMD_SPIO = 71
435
+ PI_CMD_SPIC = 72
436
+ PI_CMD_SPIR = 73
437
+ PI_CMD_SPIW = 74
438
+ PI_CMD_SPIX = 75
439
+
440
+ PI_CMD_SERO = 76
441
+ PI_CMD_SERC = 77
442
+ PI_CMD_SERRB = 78
443
+ PI_CMD_SERWB = 79
444
+ PI_CMD_SERR = 80
445
+ PI_CMD_SERW = 81
446
+ PI_CMD_SERDA = 82
447
+
448
+ PI_CMD_GDC = 83
449
+ PI_CMD_GPW = 84
450
+
451
+ PI_CMD_HC = 85
452
+ PI_CMD_HP = 86
453
+
454
+ PI_CMD_CF1 = 87
455
+ PI_CMD_CF2 = 88
456
+
457
+ PI_CMD_BI2CC = 89
458
+ PI_CMD_BI2CO = 90
459
+ PI_CMD_BI2CZ = 91
460
+
461
+ PI_CMD_I2CZ = 92
462
+
463
+ PI_CMD_WVCHA = 93
464
+
465
+ PI_CMD_SLRI = 94
466
+
467
+ PI_CMD_CGI = 95
468
+ PI_CMD_CSI = 96
469
+
470
+ PI_CMD_FG = 97
471
+ PI_CMD_FN = 98
472
+
473
+ PI_CMD_NOIB = 99
474
+
475
+ PI_CMD_WVTXM = 100
476
+ PI_CMD_WVTAT = 101
477
+
478
+ PI_CMD_PADS = 102
479
+ PI_CMD_PADG = 103
480
+
481
+ PI_CMD_FO = 104
482
+ PI_CMD_FC = 105
483
+ PI_CMD_FR = 106
484
+ PI_CMD_FW = 107
485
+ PI_CMD_FS = 108
486
+ PI_CMD_FL = 109
487
+
488
+ PI_CMD_SHELL = 110
489
+
490
+ PI_CMD_BSPIC = 111
491
+ PI_CMD_BSPIO = 112
492
+ PI_CMD_BSPIX = 113
493
+
494
+ PI_CMD_BSCX = 114
495
+
496
+ PI_CMD_EVM = 115
497
+ PI_CMD_EVT = 116
498
+
499
+ # /*DEF_E*/
500
+
501
+ # /* pseudo commands */
502
+
503
+ PI_CMD_SCRIPT = 800
504
+
505
+ PI_CMD_ADD = 800
506
+ PI_CMD_AND = 801
507
+ PI_CMD_CALL = 802
508
+ PI_CMD_CMDR = 803
509
+ PI_CMD_CMDW = 804
510
+ PI_CMD_CMP = 805
511
+ PI_CMD_DCR = 806
512
+ PI_CMD_DCRA = 807
513
+ PI_CMD_DIV = 808
514
+ PI_CMD_HALT = 809
515
+ PI_CMD_INR = 810
516
+ PI_CMD_INRA = 811
517
+ PI_CMD_JM = 812
518
+ PI_CMD_JMP = 813
519
+ PI_CMD_JNZ = 814
520
+ PI_CMD_JP = 815
521
+ PI_CMD_JZ = 816
522
+ PI_CMD_TAG = 817
523
+ PI_CMD_LD = 818
524
+ PI_CMD_LDA = 819
525
+ PI_CMD_LDAB = 820
526
+ PI_CMD_MLT = 821
527
+ PI_CMD_MOD = 822
528
+ PI_CMD_NOP = 823
529
+ PI_CMD_OR = 824
530
+ PI_CMD_POP = 825
531
+ PI_CMD_POPA = 826
532
+ PI_CMD_PUSH = 827
533
+ PI_CMD_PUSHA = 828
534
+ PI_CMD_RET = 829
535
+ PI_CMD_RL = 830
536
+ PI_CMD_RLA = 831
537
+ PI_CMD_RR = 832
538
+ PI_CMD_RRA = 833
539
+ PI_CMD_STA = 834
540
+ PI_CMD_STAB = 835
541
+ PI_CMD_SUB = 836
542
+ PI_CMD_SYS = 837
543
+ PI_CMD_WAIT = 838
544
+ PI_CMD_X = 839
545
+ PI_CMD_XA = 840
546
+ PI_CMD_XOR = 841
547
+ PI_CMD_EVTWT = 842
548
+
549
+ # /*DEF_S Error Codes*/
550
+
551
+ PI_INIT_FAILED = -1 # Error Code: gpioInitialise failed
552
+ PI_BAD_USER_GPIO = -2 # Error Code: GPIO not 0-31
553
+ PI_BAD_GPIO = -3 # Error Code: GPIO not 0-53
554
+ PI_BAD_MODE = -4 # Error Code: mode not 0-7
555
+ PI_BAD_LEVEL = -5 # Error Code: level not 0-1
556
+ PI_BAD_PUD = -6 # Error Code: pud not 0-2
557
+ PI_BAD_PULSEWIDTH = -7 # Error Code: pulsewidth not 0 or 500-2500
558
+ PI_BAD_DUTYCYCLE = -8 # Error Code: dutycycle outside set range
559
+ PI_BAD_TIMER = -9 # Error Code: timer not 0-9
560
+ PI_BAD_MS = -10 # Error Code: ms not 10-60000
561
+ PI_BAD_TIMETYPE = -11 # Error Code: timetype not 0-1
562
+ PI_BAD_SECONDS = -12 # Error Code: seconds < 0
563
+ PI_BAD_MICROS = -13 # Error Code: micros not 0-999999
564
+ PI_TIMER_FAILED = -14 # Error Code: gpioSetTimerFunc failed
565
+ PI_BAD_WDOG_TIMEOUT = -15 # Error Code: timeout not 0-60000
566
+ PI_NO_ALERT_FUNC = -16 # Error Code: DEPRECATED
567
+ PI_BAD_CLK_PERIPH = -17 # Error Code: clock peripheral not 0-1
568
+ PI_BAD_CLK_SOURCE = -18 # Error Code: DEPRECATED
569
+ PI_BAD_CLK_MICROS = -19 # Error Code: clock micros not 1, 2, 4, 5, 8, or 10
570
+ PI_BAD_BUF_MILLIS = -20 # Error Code: buf millis not 100-10000
571
+ PI_BAD_DUTYRANGE = -21 # Error Code: dutycycle range not 25-40000
572
+ PI_BAD_DUTY_RANGE = -21 # Error Code: DEPRECATED (use PI_BAD_DUTYRANGE)
573
+ PI_BAD_SIGNUM = -22 # Error Code: signum not 0-63
574
+ PI_BAD_PATHNAME = -23 # Error Code: can't open pathname
575
+ PI_NO_HANDLE = -24 # Error Code: no handle available
576
+ PI_BAD_HANDLE = -25 # Error Code: unknown handle
577
+ PI_BAD_IF_FLAGS = -26 # Error Code: ifFlags > 3
578
+ PI_BAD_CHANNEL = -27 # Error Code: DMA channel not 0-14
579
+ PI_BAD_PRIM_CHANNEL = -27 # Error Code: DMA primary channel not 0-14
580
+ PI_BAD_SOCKET_PORT = -28 # Error Code: socket port not 1024-32000
581
+ PI_BAD_FIFO_COMMAND = -29 # Error Code: unrecognized fifo command
582
+ PI_BAD_SECO_CHANNEL = -30 # Error Code: DMA secondary channel not 0-6
583
+ PI_NOT_INITIALISED = -31 # Error Code: function called before gpioInitialise
584
+ PI_INITIALISED = -32 # Error Code: function called after gpioInitialise
585
+ PI_BAD_WAVE_MODE = -33 # Error Code: waveform mode not 0-3
586
+ PI_BAD_CFG_INTERNAL = -34 # Error Code: bad parameter in gpioCfgInternals call
587
+ PI_BAD_WAVE_BAUD = -35 # Error Code: baud rate not 50-250K(RX)/50-1M(TX)
588
+ PI_TOO_MANY_PULSES = -36 # Error Code: waveform has too many pulses
589
+ PI_TOO_MANY_CHARS = -37 # Error Code: waveform has too many chars
590
+ PI_NOT_SERIAL_GPIO = -38 # Error Code: no bit bang serial read on GPIO
591
+ PI_BAD_SERIAL_STRUC = -39 # Error Code: bad (null) serial structure parameter
592
+ PI_BAD_SERIAL_BUF = -40 # Error Code: bad (null) serial buf parameter
593
+ PI_NOT_PERMITTED = -41 # Error Code: GPIO operation not permitted
594
+ PI_SOME_PERMITTED = -42 # Error Code: one or more GPIO not permitted
595
+ PI_BAD_WVSC_COMMND = -43 # Error Code: bad WVSC subcommand
596
+ PI_BAD_WVSM_COMMND = -44 # Error Code: bad WVSM subcommand
597
+ PI_BAD_WVSP_COMMND = -45 # Error Code: bad WVSP subcommand
598
+ PI_BAD_PULSELEN = -46 # Error Code: trigger pulse length not 1-100
599
+ PI_BAD_SCRIPT = -47 # Error Code: invalid script
600
+ PI_BAD_SCRIPT_ID = -48 # Error Code: unknown script id
601
+ PI_BAD_SER_OFFSET = -49 # Error Code: add serial data offset > 30 minutes
602
+ PI_GPIO_IN_USE = -50 # Error Code: GPIO already in use
603
+ PI_BAD_SERIAL_COUNT = -51 # Error Code: must read at least a byte at a time
604
+ PI_BAD_PARAM_NUM = -52 # Error Code: script parameter id not 0-9
605
+ PI_DUP_TAG = -53 # Error Code: script has duplicate tag
606
+ PI_TOO_MANY_TAGS = -54 # Error Code: script has too many tags
607
+ PI_BAD_SCRIPT_CMD = -55 # Error Code: illegal script command
608
+ PI_BAD_VAR_NUM = -56 # Error Code: script variable id not 0-149
609
+ PI_NO_SCRIPT_ROOM = -57 # Error Code: no more room for scripts
610
+ PI_NO_MEMORY = -58 # Error Code: can't allocate temporary memory
611
+ PI_SOCK_READ_FAILED = -59 # Error Code: socket read failed
612
+ PI_SOCK_WRIT_FAILED = -60 # Error Code: socket write failed
613
+ PI_TOO_MANY_PARAM = -61 # Error Code: too many script parameters (> 10)
614
+ PI_NOT_HALTED = -62 # Error Code: DEPRECATED
615
+ PI_SCRIPT_NOT_READY = -62 # Error Code: script initialising
616
+ PI_BAD_TAG = -63 # Error Code: script has unresolved tag
617
+ PI_BAD_MICS_DELAY = -64 # Error Code: bad MICS delay (too large)
618
+ PI_BAD_MILS_DELAY = -65 # Error Code: bad MILS delay (too large)
619
+ PI_BAD_WAVE_ID = -66 # Error Code: non existent wave id
620
+ PI_TOO_MANY_CBS = -67 # Error Code: No more CBs for waveform
621
+ PI_TOO_MANY_OOL = -68 # Error Code: No more OOL for waveform
622
+ PI_EMPTY_WAVEFORM = -69 # Error Code: attempt to create an empty waveform
623
+ PI_NO_WAVEFORM_ID = -70 # Error Code: no more waveforms
624
+ PI_I2C_OPEN_FAILED = -71 # Error Code: can't open I2C device
625
+ PI_SER_OPEN_FAILED = -72 # Error Code: can't open serial device
626
+ PI_SPI_OPEN_FAILED = -73 # Error Code: can't open SPI device
627
+ PI_BAD_I2C_BUS = -74 # Error Code: bad I2C bus
628
+ PI_BAD_I2C_ADDR = -75 # Error Code: bad I2C address
629
+ PI_BAD_SPI_CHANNEL = -76 # Error Code: bad SPI channel
630
+ PI_BAD_FLAGS = -77 # Error Code: bad i2c/spi/ser open flags
631
+ PI_BAD_SPI_SPEED = -78 # Error Code: bad SPI speed
632
+ PI_BAD_SER_DEVICE = -79 # Error Code: bad serial device name
633
+ PI_BAD_SER_SPEED = -80 # Error Code: bad serial baud rate
634
+ PI_BAD_PARAM = -81 # Error Code: bad i2c/spi/ser parameter
635
+ PI_I2C_WRITE_FAILED = -82 # Error Code: i2c write failed
636
+ PI_I2C_READ_FAILED = -83 # Error Code: i2c read failed
637
+ PI_BAD_SPI_COUNT = -84 # Error Code: bad SPI count
638
+ PI_SER_WRITE_FAILED = -85 # Error Code: ser write failed
639
+ PI_SER_READ_FAILED = -86 # Error Code: ser read failed
640
+ PI_SER_READ_NO_DATA = -87 # Error Code: ser read no data available
641
+ PI_UNKNOWN_COMMAND = -88 # Error Code: unknown command
642
+ PI_SPI_XFER_FAILED = -89 # Error Code: spi xfer/read/write failed
643
+ PI_BAD_POINTER = -90 # Error Code: bad (NULL) pointer
644
+ PI_NO_AUX_SPI = -91 # Error Code: no auxiliary SPI on Pi A or B
645
+ PI_NOT_PWM_GPIO = -92 # Error Code: GPIO is not in use for PWM
646
+ PI_NOT_SERVO_GPIO = -93 # Error Code: GPIO is not in use for servo pulses
647
+ PI_NOT_HCLK_GPIO = -94 # Error Code: GPIO has no hardware clock
648
+ PI_NOT_HPWM_GPIO = -95 # Error Code: GPIO has no hardware PWM
649
+ PI_BAD_HPWM_FREQ = -96 # Error Code: hardware PWM frequency not 1-125M
650
+ PI_BAD_HPWM_DUTY = -97 # Error Code: hardware PWM dutycycle not 0-1M
651
+ PI_BAD_HCLK_FREQ = -98 # Error Code: hardware clock frequency not 4689-250M
652
+ PI_BAD_HCLK_PASS = -99 # Error Code: need password to use hardware clock 1
653
+ PI_HPWM_ILLEGAL = -100 # Error Code: illegal, PWM in use for main clock
654
+ PI_BAD_DATABITS = -101 # Error Code: serial data bits not 1-32
655
+ PI_BAD_STOPBITS = -102 # Error Code: serial (half) stop bits not 2-8
656
+ PI_MSG_TOOBIG = -103 # Error Code: socket/pipe message too big
657
+ PI_BAD_MALLOC_MODE = -104 # Error Code: bad memory allocation mode
658
+ PI_TOO_MANY_SEGS = -105 # Error Code: too many I2C transaction segments
659
+ PI_BAD_I2C_SEG = -106 # Error Code: an I2C transaction segment failed
660
+ PI_BAD_SMBUS_CMD = -107 # Error Code: SMBus command not supported by driver
661
+ PI_NOT_I2C_GPIO = -108 # Error Code: no bit bang I2C in progress on GPIO
662
+ PI_BAD_I2C_WLEN = -109 # Error Code: bad I2C write length
663
+ PI_BAD_I2C_RLEN = -110 # Error Code: bad I2C read length
664
+ PI_BAD_I2C_CMD = -111 # Error Code: bad I2C command
665
+ PI_BAD_I2C_BAUD = -112 # Error Code: bad I2C baud rate, not 50-500k
666
+ PI_CHAIN_LOOP_CNT = -113 # Error Code: bad chain loop count
667
+ PI_BAD_CHAIN_LOOP = -114 # Error Code: empty chain loop
668
+ PI_CHAIN_COUNTER = -115 # Error Code: too many chain counters
669
+ PI_BAD_CHAIN_CMD = -116 # Error Code: bad chain command
670
+ PI_BAD_CHAIN_DELAY = -117 # Error Code: bad chain delay micros
671
+ PI_CHAIN_NESTING = -118 # Error Code: chain counters nested too deeply
672
+ PI_CHAIN_TOO_BIG = -119 # Error Code: chain is too long
673
+ PI_DEPRECATED = -120 # Error Code: deprecated function removed
674
+ PI_BAD_SER_INVERT = -121 # Error Code: bit bang serial invert not 0 or 1
675
+ PI_BAD_EDGE = -122 # Error Code: bad ISR edge value, not 0-2
676
+ PI_BAD_ISR_INIT = -123 # Error Code: bad ISR initialisation
677
+ PI_BAD_FOREVER = -124 # Error Code: loop forever must be last command
678
+ PI_BAD_FILTER = -125 # Error Code: bad filter parameter
679
+ PI_BAD_PAD = -126 # Error Code: bad pad number
680
+ PI_BAD_STRENGTH = -127 # Error Code: bad pad drive strength
681
+ PI_FIL_OPEN_FAILED = -128 # Error Code: file open failed
682
+ PI_BAD_FILE_MODE = -129 # Error Code: bad file mode
683
+ PI_BAD_FILE_FLAG = -130 # Error Code: bad file flag
684
+ PI_BAD_FILE_READ = -131 # Error Code: bad file read
685
+ PI_BAD_FILE_WRITE = -132 # Error Code: bad file write
686
+ PI_FILE_NOT_ROPEN = -133 # Error Code: file not open for read
687
+ PI_FILE_NOT_WOPEN = -134 # Error Code: file not open for write
688
+ PI_BAD_FILE_SEEK = -135 # Error Code: bad file seek
689
+ PI_NO_FILE_MATCH = -136 # Error Code: no files match pattern
690
+ PI_NO_FILE_ACCESS = -137 # Error Code: no permission to access file
691
+ PI_FILE_IS_A_DIR = -138 # Error Code: file is a directory
692
+ PI_BAD_SHELL_STATUS = -139 # Error Code: bad shell return status
693
+ PI_BAD_SCRIPT_NAME = -140 # Error Code: bad script name
694
+ PI_BAD_SPI_BAUD = -141 # Error Code: bad SPI baud rate, not 50-500k
695
+ PI_NOT_SPI_GPIO = -142 # Error Code: no bit bang SPI in progress on GPIO
696
+ PI_BAD_EVENT_ID = -143 # Error Code: bad event id
697
+
698
+ PI_PIGIF_ERR_0 = -2000
699
+ PI_PIGIF_ERR_99 = -2099
700
+
701
+ PI_CUSTOM_ERR_0 = -3000
702
+ PI_CUSTOM_ERR_999 = -3999
703
+
704
+ # /*DEF_E*/
705
+
706
+ # /*DEF_S Defaults*/
707
+
708
+ PI_DEFAULT_BUFFER_MILLIS = 120
709
+ PI_DEFAULT_CLK_MICROS = 5
710
+ PI_DEFAULT_CLK_PERIPHERAL = PI_CLOCK_PCM
711
+ PI_DEFAULT_IF_FLAGS = 0
712
+ PI_DEFAULT_FOREGROUND = 0
713
+ PI_DEFAULT_DMA_CHANNEL = 14
714
+ PI_DEFAULT_DMA_PRIMARY_CHANNEL = 14
715
+ PI_DEFAULT_DMA_SECONDARY_CHANNEL = 6
716
+ PI_DEFAULT_SOCKET_PORT = 8888
717
+ PI_DEFAULT_SOCKET_PORT_STR = "8888"
718
+ PI_DEFAULT_SOCKET_ADDR_STR = "127.0.0.1"
719
+ PI_DEFAULT_UPDATE_MASK_UNKNOWN = 0xFFFFFFFF
720
+ PI_DEFAULT_UPDATE_MASK_B1 = 0x03E7CF93
721
+ PI_DEFAULT_UPDATE_MASK_A_B2 = 0xFBC7CF9C
722
+ PI_DEFAULT_UPDATE_MASK_APLUS_BPLUS = 0x0080480FFFFFFC
723
+ PI_DEFAULT_UPDATE_MASK_ZERO = 0x0080000FFFFFFC
724
+ PI_DEFAULT_UPDATE_MASK_PI2B = 0x0080480FFFFFFC
725
+ PI_DEFAULT_UPDATE_MASK_PI3B = 0x0000000FFFFFFC
726
+ PI_DEFAULT_UPDATE_MASK_COMPUTE = 0x00FFFFFFFFFFFF
727
+ PI_DEFAULT_MEM_ALLOC_MODE = PI_MEM_ALLOC_AUTO
728
+
729
+ PI_DEFAULT_CFG_INTERNALS = 0
730
+
731
+ Pigif_bad_send = -2000
732
+ Pigif_bad_recv = -2001
733
+ Pigif_bad_getaddrinfo = -2002
734
+ Pigif_bad_connect = -2003
735
+ Pigif_bad_socket = -2004
736
+ Pigif_bad_noib = -2005
737
+ Pigif_duplicate_callback = -2006
738
+ Pigif_bad_malloc = -2007
739
+ Pigif_bad_callback = -2008
740
+ Pigif_notify_failed = -2009
741
+ Pigif_callback_not_found = -2010
742
+ Pigif_unconnected_pi = -2011
743
+ Pigif_too_many_pis = -2012
744
+ end
745
+ end