Class: FuseStore

Inherits:
Hash
  • Object
show all
Defined in:
lib/avburn.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#efuseObject (readonly)

Returns the value of attribute efuse.



137
138
139
# File 'lib/avburn.rb', line 137

def efuse
  @efuse
end

#hfuseObject (readonly)

Returns the value of attribute hfuse.



137
138
139
# File 'lib/avburn.rb', line 137

def hfuse
  @hfuse
end

#lfuseObject (readonly)

Returns the value of attribute lfuse.



137
138
139
# File 'lib/avburn.rb', line 137

def lfuse
  @lfuse
end

Instance Method Details

#set(fuse, hex) ⇒ Object



143
144
145
146
147
148
# File 'lib/avburn.rb', line 143

def set(fuse, hex)
  hex = "0#{hex}" if hex.size == 1
  hex = hex[0,2]
  self[fuse.to_sym] =  Integer("0x#{hex}").to_s(2).rjust(8, "0").split(//)
  self["#{fuse}hex"] = hex
end

#set_bit(fuse, bit, bool) ⇒ Object



150
151
152
153
154
155
156
# File 'lib/avburn.rb', line 150

def set_bit(fuse, bit, bool)
  self[fuse][bit] = (bool ? "0" : "1")
  hexval = self[fuse].join.to_i(2).to_s(16).upcase
  hexval = "0#{hexval}" if hexval.size == 1
  self["#{fuse}hex"] = hexval
  hexval
end