Class: HackRF::Internals::RegisterArray

Inherits:
Object
  • Object
show all
Defined in:
lib/hackrf/internals.rb

Direct Known Subclasses

MAX2837, RFFC5071, Si5351C

Instance Method Summary collapse

Constructor Details

#initialize(device) ⇒ RegisterArray

Returns a new instance of RegisterArray.



4
5
6
# File 'lib/hackrf/internals.rb', line 4

def initialize(device)
  @device = device.ptr
end

Instance Method Details

#[](register) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/hackrf/internals.rb', line 7

def [](register)
  value = FFI::MemoryPointer.new(:uint16)
  
  read(register,value)
  
  return value.read_uint16
end

#[]=(register, value) ⇒ Object



15
16
17
# File 'lib/hackrf/internals.rb', line 15

def []=(register,value)
  write(register,value)
end