pigpio 0.1.10 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.standard_todo.yml +51 -0
- data/README.md +3 -1
- data/Rakefile +3 -4
- data/ext/pigpio/extconf.rb +5 -5
- data/ext/pigpio/pigpio.c +29 -18
- data/lib/pigpio/bank.rb +25 -22
- data/lib/pigpio/bit_bang_serial.rb +21 -19
- data/lib/pigpio/bit_bang_serial_rx.rb +70 -19
- data/lib/pigpio/bit_bang_serial_tx.rb +47 -41
- data/lib/pigpio/buffer.rb +13 -0
- data/lib/pigpio/constant.rb +745 -748
- data/lib/pigpio/gpio.rb +37 -30
- data/lib/pigpio/i2c.rb +77 -60
- data/lib/pigpio/pwm.rb +48 -38
- data/lib/pigpio/serial.rb +35 -29
- data/lib/pigpio/spi.rb +37 -33
- data/lib/pigpio/user_gpio.rb +33 -27
- data/lib/pigpio/version.rb +1 -1
- data/lib/pigpio/wave.rb +100 -78
- data/lib/pigpio.rb +29 -18
- data/pigpio.gemspec +16 -17
- metadata +19 -3
data/lib/pigpio/gpio.rb
CHANGED
@@ -1,30 +1,37 @@
|
|
1
|
-
class Pigpio
|
2
|
-
class GPIO
|
3
|
-
attr_reader :pi
|
4
|
-
def initialize(pi,gpio)
|
5
|
-
@pi=pi #0-15
|
6
|
-
@gpio=gpio #0-53
|
7
|
-
end
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
def
|
18
|
-
ret=IF.
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
1
|
+
class Pigpio
|
2
|
+
class GPIO
|
3
|
+
attr_reader :pi, :gpio
|
4
|
+
def initialize(pi, gpio)
|
5
|
+
@pi = pi # 0-15
|
6
|
+
@gpio = gpio # 0-53
|
7
|
+
end
|
8
|
+
|
9
|
+
def mode=(mode)
|
10
|
+
ret = IF.set_mode(@pi, @gpio, mode)
|
11
|
+
end
|
12
|
+
|
13
|
+
def mode
|
14
|
+
ret = IF.get_mode(@pi, @gpio)
|
15
|
+
end
|
16
|
+
|
17
|
+
def pud=(pud)
|
18
|
+
ret = IF.set_pull_up_down(@pi, @gpio, pud)
|
19
|
+
end
|
20
|
+
|
21
|
+
def read
|
22
|
+
ret = IF.gpio_read(@pi, @gpio)
|
23
|
+
end
|
24
|
+
|
25
|
+
def write(level)
|
26
|
+
ret = IF.gpio_write(@pi, @gpio, level)
|
27
|
+
end
|
28
|
+
|
29
|
+
def hardware_clock(clkfreq)
|
30
|
+
ret = IF.hardware_clock(@pi, @gpio, clkfreq)
|
31
|
+
end
|
32
|
+
|
33
|
+
def hardware_PWM(vPWMfreq, vPWMduty)
|
34
|
+
ret = IF.hardware_PWM(@pi, @gpio, vPWMfreq, vPWMduty)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/pigpio/i2c.rb
CHANGED
@@ -1,60 +1,77 @@
|
|
1
|
-
class Pigpio
|
2
|
-
class I2C
|
3
|
-
attr_reader :pi
|
4
|
-
def initialize(pi,i2c_bus,i2c_addr)
|
5
|
-
@pi=pi
|
6
|
-
@handle=IF.i2c_open(@pi,i2c_bus,i2c_addr,0)
|
7
|
-
end
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
def
|
18
|
-
IF.
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
def
|
30
|
-
IF.
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
def
|
42
|
-
IF.
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
def
|
54
|
-
IF.
|
55
|
-
end
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
1
|
+
class Pigpio
|
2
|
+
class I2C
|
3
|
+
attr_reader :pi, :handle
|
4
|
+
def initialize(pi, i2c_bus, i2c_addr)
|
5
|
+
@pi = pi
|
6
|
+
@handle = IF.i2c_open(@pi, i2c_bus, i2c_addr, 0)
|
7
|
+
end
|
8
|
+
|
9
|
+
def close
|
10
|
+
IF.i2c_close(@pi, @handle)
|
11
|
+
end
|
12
|
+
|
13
|
+
def write_quick(bit)
|
14
|
+
IF.i2c_write_quick(@pi, @handle, bit)
|
15
|
+
end
|
16
|
+
|
17
|
+
def write_byte(bVal)
|
18
|
+
IF.i2c_write_byte(@pi, @handle, bVal)
|
19
|
+
end
|
20
|
+
|
21
|
+
def read_byte
|
22
|
+
IF.i2c_read_byte(@pi, @handle)
|
23
|
+
end
|
24
|
+
|
25
|
+
def write_byte_data(i2c_reg, bVal)
|
26
|
+
IF.i2c_write_byte_data(@pi, @handle, i2c_reg, bVal)
|
27
|
+
end
|
28
|
+
|
29
|
+
def write_word_data(i2c_reg, wVal)
|
30
|
+
IF.i2c_write_word_data(@pi, @handle, i2c_reg, wVal)
|
31
|
+
end
|
32
|
+
|
33
|
+
def read_byte_data(i2c_reg)
|
34
|
+
IF.i2c_read_byte_data(@pi, @handle, i2c_reg)
|
35
|
+
end
|
36
|
+
|
37
|
+
def read_word_data(i2c_reg)
|
38
|
+
IF.i2c_read_word_data(@pi, @handle, i2c_reg)
|
39
|
+
end
|
40
|
+
|
41
|
+
def process_call(i2c_reg, wVal)
|
42
|
+
IF.i2c_process_call(@pi, @handle, i2c_reg, wVal)
|
43
|
+
end
|
44
|
+
|
45
|
+
def read_block_data(i2c_reg)
|
46
|
+
IF.i2c_read_block_data(@pi, @handle, i2c_reg)
|
47
|
+
end
|
48
|
+
|
49
|
+
def read_i2c_block_data(i2c_reg, count)
|
50
|
+
IF.i2c_read_i2c_block_data(@pi, @handle, i2c_reg, count)
|
51
|
+
end
|
52
|
+
|
53
|
+
def write_block_data(i2c_reg, buf)
|
54
|
+
IF.i2c_write_block_data(@pi, @handle, i2c_reg, buf)
|
55
|
+
end
|
56
|
+
|
57
|
+
def write_i2c_block_data(i2c_reg, buf)
|
58
|
+
IF.i2c_write_i2c_block_data(@pi, @handle, i2c_reg, buf)
|
59
|
+
end
|
60
|
+
|
61
|
+
def block_process_call(i2c_reg, buf)
|
62
|
+
IF.i2c_block_process_call(@pi, @handle, i2c_reg, buf)
|
63
|
+
end
|
64
|
+
|
65
|
+
def read_device(count)
|
66
|
+
IF.i2c_read_device(@pi, @handle, count)
|
67
|
+
end
|
68
|
+
|
69
|
+
def write_device(buf)
|
70
|
+
IF.i2c_write_device(@pi, @handle, buf)
|
71
|
+
end
|
72
|
+
|
73
|
+
def zip(inBuf, outLen)
|
74
|
+
IF.i2c_zip(@pi, @handle, inBuf, outLen)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/lib/pigpio/pwm.rb
CHANGED
@@ -1,38 +1,48 @@
|
|
1
|
-
class Pigpio
|
2
|
-
class PWM
|
3
|
-
def initialize(pi,gpio)
|
4
|
-
@pi=pi
|
5
|
-
@gpio=gpio
|
6
|
-
end
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def
|
17
|
-
ret=IF.
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
def
|
29
|
-
ret=IF.
|
30
|
-
end
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
1
|
+
class Pigpio
|
2
|
+
class PWM
|
3
|
+
def initialize(pi, gpio)
|
4
|
+
@pi = pi
|
5
|
+
@gpio = gpio
|
6
|
+
end
|
7
|
+
|
8
|
+
def start(dutycycle)
|
9
|
+
ret = IF.set_PWM_dutycycle(@pi, @gpio, dutycycle)
|
10
|
+
end
|
11
|
+
|
12
|
+
def dutycycle=(dutycycle)
|
13
|
+
ret = IF.set_PWM_dutycycle(@pi, @gpio, dutycycle)
|
14
|
+
end
|
15
|
+
|
16
|
+
def dutycycle
|
17
|
+
ret = IF.get_PWM_dutycycle(@pi, @gpio)
|
18
|
+
end
|
19
|
+
|
20
|
+
def range=(range)
|
21
|
+
ret = IF.set_PWM_range(@pi, @gpio, range)
|
22
|
+
end
|
23
|
+
|
24
|
+
def range
|
25
|
+
ret = IF.get_PWM_range(@pi, @gpio)
|
26
|
+
end
|
27
|
+
|
28
|
+
def real_range
|
29
|
+
ret = IF.get_PWM_real_range(@pi, @gpio)
|
30
|
+
end
|
31
|
+
|
32
|
+
def frequency=(frequency)
|
33
|
+
ret = IF.set_PWM_frequency(@pi, @gpio, frequency)
|
34
|
+
end
|
35
|
+
|
36
|
+
def frequency
|
37
|
+
ret = IF.get_PWM_frequency(@pi, @gpio)
|
38
|
+
end
|
39
|
+
|
40
|
+
def servo_pulsewidth=(pulsewidth)
|
41
|
+
ret = IF.set_servo_pulsewidth(@pi, @gpio, pulsewidth)
|
42
|
+
end
|
43
|
+
|
44
|
+
def servo_pulsewidth
|
45
|
+
ret = IF.get_servo_pulsewidth(@pi, @gpio)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/pigpio/serial.rb
CHANGED
@@ -1,29 +1,35 @@
|
|
1
|
-
class Pigpio
|
2
|
-
class Serial
|
3
|
-
attr_reader :pi
|
4
|
-
TTY
|
5
|
-
Baud=[50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400]
|
6
|
-
def initialize(pi,ser_tty,baud)
|
7
|
-
@pi=pi
|
8
|
-
@handle=IF.serial_open(pi,ser_tty,baud=19200,0)
|
9
|
-
end
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
def
|
20
|
-
IF.
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
end
|
1
|
+
class Pigpio
|
2
|
+
class Serial
|
3
|
+
attr_reader :pi, :handle
|
4
|
+
TTY = %w[/dev/tty /dev/serial]
|
5
|
+
Baud = [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400]
|
6
|
+
def initialize(pi, ser_tty, baud)
|
7
|
+
@pi = pi
|
8
|
+
@handle = IF.serial_open(pi, ser_tty, baud = 19200, 0)
|
9
|
+
end
|
10
|
+
|
11
|
+
def close
|
12
|
+
IF.serial_close(@pi, @handle)
|
13
|
+
end
|
14
|
+
|
15
|
+
def byte=(bVal)
|
16
|
+
IF.serial_write_byte(@pi, @handle, bVal)
|
17
|
+
end
|
18
|
+
|
19
|
+
def byte
|
20
|
+
IF.serial_read_byte(@pi, @handle)
|
21
|
+
end
|
22
|
+
|
23
|
+
def write(buf)
|
24
|
+
IF.serial_write(@pi, @handle, buf)
|
25
|
+
end
|
26
|
+
|
27
|
+
def read(count)
|
28
|
+
IF.serial_read(@pi, @handle, count)
|
29
|
+
end
|
30
|
+
|
31
|
+
def size
|
32
|
+
IF.serial_data_available(@pi, @handle)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/pigpio/spi.rb
CHANGED
@@ -1,33 +1,37 @@
|
|
1
|
-
class Pigpio
|
2
|
-
class SPI
|
3
|
-
attr_reader :pi
|
4
|
-
def initialize(pi,spi_channel=0,enable_cex=1,baud=500000,bits_per_word: 8,first_MISO: false,first_MOSI: false,idol_bytes: 0,is_3wire: false,active_low_cex: 0,spi_mode: 0)
|
5
|
-
is_aux=(spi_channel!=0)
|
6
|
-
flg=((spi_mode.to_i
|
7
|
-
((active_low_cex.to_i & 0x07
|
8
|
-
((enable_cex.to_i
|
9
|
-
((is_aux
|
10
|
-
((is_3wire ? 1 : 0) << 9) |
|
11
|
-
((idol_bytes.to_i
|
12
|
-
((first_MOSI ? 1 : 0) << 14) |
|
13
|
-
((first_MISO ? 1 : 0) << 15) |
|
14
|
-
((bits_per_word.to_i
|
15
|
-
|
16
|
-
@pi=pi
|
17
|
-
@byte_per_word=(bits_per_word/8.0).ceil
|
18
|
-
@handle=IF.spi_open(@pi,spi_channel,baud,flg)
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
def
|
30
|
-
IF.
|
31
|
-
end
|
32
|
-
|
33
|
-
|
1
|
+
class Pigpio
|
2
|
+
class SPI
|
3
|
+
attr_reader :pi, :handle
|
4
|
+
def initialize(pi, spi_channel = 0, enable_cex = 1, baud = 500000, bits_per_word: 8, first_MISO: false, first_MOSI: false, idol_bytes: 0, is_3wire: false, active_low_cex: 0, spi_mode: 0)
|
5
|
+
is_aux = (spi_channel != 0)
|
6
|
+
flg = ((spi_mode.to_i & 0x03) |
|
7
|
+
((active_low_cex.to_i & 0x07) << 2) |
|
8
|
+
((enable_cex.to_i & 0x07) << 5) |
|
9
|
+
((is_aux ? 1 : 0) << 8) |
|
10
|
+
((is_3wire ? 1 : 0) << 9) |
|
11
|
+
((idol_bytes.to_i & 0x0f) << 10) |
|
12
|
+
((first_MOSI ? 1 : 0) << 14) |
|
13
|
+
((first_MISO ? 1 : 0) << 15) |
|
14
|
+
((bits_per_word.to_i & 0x3f) << 16)
|
15
|
+
)
|
16
|
+
@pi = pi
|
17
|
+
@byte_per_word = (bits_per_word / 8.0).ceil
|
18
|
+
@handle = IF.spi_open(@pi, spi_channel, baud, flg)
|
19
|
+
end
|
20
|
+
|
21
|
+
def close
|
22
|
+
IF.spi_close(@pi, @handle)
|
23
|
+
end
|
24
|
+
|
25
|
+
def read(words = 1)
|
26
|
+
IF.spi_read(@pi, @handle, words * @byte_per_word)
|
27
|
+
end
|
28
|
+
|
29
|
+
def write(buf)
|
30
|
+
IF.spi_write(@pi, @handle, buf)
|
31
|
+
end
|
32
|
+
|
33
|
+
def xfer(buf)
|
34
|
+
IF.spi_xfer(@pi, @handle, buf)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/pigpio/user_gpio.rb
CHANGED
@@ -1,27 +1,33 @@
|
|
1
|
-
require_relative "./gpio"
|
2
|
-
class Pigpio
|
3
|
-
class UserGPIO < GPIO
|
4
|
-
def watchdog(timeout)
|
5
|
-
ret=IF.set_watchdog(@pi
|
6
|
-
end
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
1
|
+
require_relative "./gpio"
|
2
|
+
class Pigpio
|
3
|
+
class UserGPIO < GPIO
|
4
|
+
def watchdog(timeout)
|
5
|
+
ret = IF.set_watchdog(@pi, @gpio, timeout)
|
6
|
+
end
|
7
|
+
|
8
|
+
def glitch_filter(steady)
|
9
|
+
ret = IF.set_glitch_filter(@pi, @gpio, steady)
|
10
|
+
end
|
11
|
+
|
12
|
+
def noise_filter(steady, active)
|
13
|
+
ret = IF.set_noise_filter(@pi, @gpio, steady, active)
|
14
|
+
end
|
15
|
+
|
16
|
+
def callback(edge, &blk)
|
17
|
+
return nil unless blk
|
18
|
+
IF.callback(@pi, @gpio, edge, &blk)
|
19
|
+
end
|
20
|
+
|
21
|
+
def wait_for_edge(edge, timeout)
|
22
|
+
ret = IF.wait_for_edge(@pi, @gpio, edge, timeout)
|
23
|
+
end
|
24
|
+
|
25
|
+
def trigger(pulseLen, level)
|
26
|
+
ret = IF.gpio_trigger(@pi, @gpio, pulseLen, level)
|
27
|
+
end
|
28
|
+
|
29
|
+
def pwm
|
30
|
+
PWM.new(@pi, @gpio)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/pigpio/version.rb
CHANGED
data/lib/pigpio/wave.rb
CHANGED
@@ -1,78 +1,100 @@
|
|
1
|
-
class Pigpio
|
2
|
-
class Wave
|
3
|
-
def initialize(pi)
|
4
|
-
@pi=pi
|
5
|
-
IF.wave_clear(pi)
|
6
|
-
end
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
def
|
17
|
-
IF.
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
def
|
29
|
-
IF.wave_delete(@pi,id)
|
30
|
-
end
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
def
|
41
|
-
IF.
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
def
|
53
|
-
IF.
|
54
|
-
end
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
def
|
65
|
-
IF.
|
66
|
-
end
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end
|
1
|
+
class Pigpio
|
2
|
+
class Wave
|
3
|
+
def initialize(pi)
|
4
|
+
@pi = pi
|
5
|
+
IF.wave_clear(pi)
|
6
|
+
end
|
7
|
+
|
8
|
+
def clear
|
9
|
+
IF.wave_clear(@pi)
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_new
|
13
|
+
IF.wave_add_new(@pi)
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_generic(pulses)
|
17
|
+
IF.wave_add_generic(@pi, pulses)
|
18
|
+
end
|
19
|
+
|
20
|
+
def add_serial(user_gpio, baud, data_bits, stop_bits, offset, str)
|
21
|
+
IF.wave_add_serial(@pi, user_gpio, baud, data_bits, stop_bits, offset, str)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
IF.wave_create(@pi)
|
26
|
+
end
|
27
|
+
|
28
|
+
def delete(id)
|
29
|
+
IF.wave_delete(@pi, id)
|
30
|
+
end
|
31
|
+
|
32
|
+
def send_once(id)
|
33
|
+
IF.wave_send_once(@pi, id)
|
34
|
+
end
|
35
|
+
|
36
|
+
def send_repeat(id)
|
37
|
+
IF.wave_send_repeat(@pi, id)
|
38
|
+
end
|
39
|
+
|
40
|
+
def send_using_mode(id, mode)
|
41
|
+
IF.wave_send_using_mode(@pi, id, mode)
|
42
|
+
end
|
43
|
+
|
44
|
+
def chain(buf)
|
45
|
+
IF.wave_chain(@pi, buf)
|
46
|
+
end
|
47
|
+
|
48
|
+
def tx_at
|
49
|
+
IF.wave_tx_at(@pi)
|
50
|
+
end
|
51
|
+
|
52
|
+
def tx_busy
|
53
|
+
IF.wave_tx_busy(@pi)
|
54
|
+
end
|
55
|
+
|
56
|
+
def tx_stop
|
57
|
+
IF.wave_tx_stop(@pi)
|
58
|
+
end
|
59
|
+
|
60
|
+
def micros
|
61
|
+
IF.wave_get_micros(@pi)
|
62
|
+
end
|
63
|
+
|
64
|
+
def high_micros
|
65
|
+
IF.wave_get_high_micros(@pi)
|
66
|
+
end
|
67
|
+
|
68
|
+
def max_micros
|
69
|
+
IF.wave_get_max_micros(@pi)
|
70
|
+
end
|
71
|
+
|
72
|
+
def pulses
|
73
|
+
IF.wave_get_pulses(@pi)
|
74
|
+
end
|
75
|
+
|
76
|
+
def high_pulses
|
77
|
+
IF.wave_get_high_pulses(@pi)
|
78
|
+
end
|
79
|
+
|
80
|
+
def max_pulses
|
81
|
+
IF.wave_get_max_pulses(@pi)
|
82
|
+
end
|
83
|
+
|
84
|
+
def cbs
|
85
|
+
IF.wave_get_cbs(@pi)
|
86
|
+
end
|
87
|
+
|
88
|
+
def high_cbs
|
89
|
+
IF.wave_get_high_cbs(@pi)
|
90
|
+
end
|
91
|
+
|
92
|
+
def max_cbs
|
93
|
+
IF.wave_get_max_cbs(@pi)
|
94
|
+
end
|
95
|
+
|
96
|
+
def pulse(on, off, us)
|
97
|
+
Pulse.make(on, off, us)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|