class UChip::MCP2221::I2CProxy
Public Class Methods
new(address, handler)
click to toggle source
# File lib/uchip/mcp2221.rb, line 244 def initialize address, handler @read_address = (address << 1) | 1 @write_address = address << 1 @handler = handler end
Public Instance Methods
cancel()
click to toggle source
# File lib/uchip/mcp2221.rb, line 250 def cancel; @handler.i2c_cancel; end
read(size)
click to toggle source
# File lib/uchip/mcp2221.rb, line 256 def read size @handler.i2c_read_start @read_address, 8 @handler.i2c_read end
write(buf)
click to toggle source
# File lib/uchip/mcp2221.rb, line 252 def write buf @handler.i2c_write @write_address, buf end