Class: Pigpio::I2C
- Inherits:
-
Object
- Object
- Pigpio::I2C
- Defined in:
- lib/pigpio/i2c.rb
Instance Attribute Summary collapse
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#pi ⇒ Object
readonly
Returns the value of attribute pi.
Instance Method Summary collapse
- #block_process_call(i2c_reg, buf) ⇒ Object
- #close ⇒ Object
-
#initialize(pi, i2c_bus, i2c_addr) ⇒ I2C
constructor
A new instance of I2C.
- #process_call(i2c_reg, wVal) ⇒ Object
- #read_block_data(i2c_reg) ⇒ Object
- #read_byte ⇒ Object
- #read_byte_data(i2c_reg) ⇒ Object
- #read_device(count) ⇒ Object
- #read_i2c_block_data(i2c_reg, count) ⇒ Object
- #read_word_data(i2c_reg) ⇒ Object
- #write_block_data(i2c_reg, buf) ⇒ Object
- #write_byte(bVal) ⇒ Object
- #write_byte_data(i2c_reg, bVal) ⇒ Object
- #write_device(buf) ⇒ Object
- #write_i2c_block_data(i2c_reg, buf) ⇒ Object
- #write_quick(bit) ⇒ Object
- #write_word_data(i2c_reg, wVal) ⇒ Object
- #zip(inBuf, outLen) ⇒ Object
Constructor Details
Instance Attribute Details
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
3 4 5 |
# File 'lib/pigpio/i2c.rb', line 3 def handle @handle end |
#pi ⇒ Object (readonly)
Returns the value of attribute pi.
3 4 5 |
# File 'lib/pigpio/i2c.rb', line 3 def pi @pi end |
Instance Method Details
#block_process_call(i2c_reg, buf) ⇒ Object
61 62 63 |
# File 'lib/pigpio/i2c.rb', line 61 def block_process_call(i2c_reg, buf) IF.i2c_block_process_call(@pi, @handle, i2c_reg, buf) end |
#process_call(i2c_reg, wVal) ⇒ Object
41 42 43 |
# File 'lib/pigpio/i2c.rb', line 41 def process_call(i2c_reg, wVal) IF.i2c_process_call(@pi, @handle, i2c_reg, wVal) end |
#read_block_data(i2c_reg) ⇒ Object
45 46 47 |
# File 'lib/pigpio/i2c.rb', line 45 def read_block_data(i2c_reg) IF.i2c_read_block_data(@pi, @handle, i2c_reg) end |
#read_byte ⇒ Object
21 22 23 |
# File 'lib/pigpio/i2c.rb', line 21 def read_byte IF.i2c_read_byte(@pi, @handle) end |
#read_byte_data(i2c_reg) ⇒ Object
33 34 35 |
# File 'lib/pigpio/i2c.rb', line 33 def read_byte_data(i2c_reg) IF.i2c_read_byte_data(@pi, @handle, i2c_reg) end |
#read_device(count) ⇒ Object
65 66 67 |
# File 'lib/pigpio/i2c.rb', line 65 def read_device(count) IF.i2c_read_device(@pi, @handle, count) end |
#read_i2c_block_data(i2c_reg, count) ⇒ Object
49 50 51 |
# File 'lib/pigpio/i2c.rb', line 49 def read_i2c_block_data(i2c_reg, count) IF.i2c_read_i2c_block_data(@pi, @handle, i2c_reg, count) end |
#read_word_data(i2c_reg) ⇒ Object
37 38 39 |
# File 'lib/pigpio/i2c.rb', line 37 def read_word_data(i2c_reg) IF.i2c_read_word_data(@pi, @handle, i2c_reg) end |
#write_block_data(i2c_reg, buf) ⇒ Object
53 54 55 |
# File 'lib/pigpio/i2c.rb', line 53 def write_block_data(i2c_reg, buf) IF.i2c_write_block_data(@pi, @handle, i2c_reg, buf) end |
#write_byte(bVal) ⇒ Object
17 18 19 |
# File 'lib/pigpio/i2c.rb', line 17 def write_byte(bVal) IF.i2c_write_byte(@pi, @handle, bVal) end |
#write_byte_data(i2c_reg, bVal) ⇒ Object
25 26 27 |
# File 'lib/pigpio/i2c.rb', line 25 def write_byte_data(i2c_reg, bVal) IF.i2c_write_byte_data(@pi, @handle, i2c_reg, bVal) end |
#write_device(buf) ⇒ Object
69 70 71 |
# File 'lib/pigpio/i2c.rb', line 69 def write_device(buf) IF.i2c_write_device(@pi, @handle, buf) end |
#write_i2c_block_data(i2c_reg, buf) ⇒ Object
57 58 59 |
# File 'lib/pigpio/i2c.rb', line 57 def write_i2c_block_data(i2c_reg, buf) IF.i2c_write_i2c_block_data(@pi, @handle, i2c_reg, buf) end |
#write_quick(bit) ⇒ Object
13 14 15 |
# File 'lib/pigpio/i2c.rb', line 13 def write_quick(bit) IF.i2c_write_quick(@pi, @handle, bit) end |
#write_word_data(i2c_reg, wVal) ⇒ Object
29 30 31 |
# File 'lib/pigpio/i2c.rb', line 29 def write_word_data(i2c_reg, wVal) IF.i2c_write_word_data(@pi, @handle, i2c_reg, wVal) end |