Module: RPicSim::Sim::ClassMethods
- Included in:
- RPicSim::Sim
- Defined in:
- lib/rpicsim/sim.rb
Overview
These are class methods that you can call on subclasses of RPicSim::Sim.
Instance Attribute Summary collapse
-
#device ⇒ Object
readonly
A string like “PIC10F322” specifying the PIC device number.
-
#filename ⇒ Object
readonly
The path to a COF file for the PIC firmware, which was originally passed to the constructor.
-
#pin_aliases ⇒ Object
readonly
A hash that associates our names for pins (like :main_output_pin) to datasheet pin names (like :RB3).
-
#program_file ⇒ Object
readonly
The ProgramFile object representing the firmware.
Instance Method Summary collapse
-
#label(name) ⇒ Label
Returns a Label object if a program label by that name is found.
-
#labels ⇒ Object
Returns a hash that associates label names as Ruby symbols to Label objects.
Instance Attribute Details
#device ⇒ Object (readonly)
A string like “PIC10F322” specifying the PIC device number.
112 113 114 |
# File 'lib/rpicsim/sim.rb', line 112 def device @device end |
#filename ⇒ Object (readonly)
The path to a COF file for the PIC firmware, which was originally passed to the constructor.
116 117 118 |
# File 'lib/rpicsim/sim.rb', line 116 def filename @filename end |
#pin_aliases ⇒ Object (readonly)
A hash that associates our names for pins (like :main_output_pin) to datasheet pin names (like :RB3). These aliases are defined by RPicSim::Sim::ClassDefinitionMethods#def_pin.
120 121 122 |
# File 'lib/rpicsim/sim.rb', line 120 def pin_aliases @pin_aliases end |
#program_file ⇒ Object (readonly)
The ProgramFile object representing the firmware.
128 129 130 |
# File 'lib/rpicsim/sim.rb', line 128 def program_file @program_file end |
Instance Method Details
#label(name) ⇒ Label
Returns a Label object if a program label by that name is found. The name is specified in the code that defined the label. If you are using a C compiler, you will probably need to prefix the name with an underscore.
139 140 141 |
# File 'lib/rpicsim/sim.rb', line 139 def label(name) program_file.label(name) end |
#labels ⇒ Object
Returns a hash that associates label names as Ruby symbols to Label objects.
131 132 133 |
# File 'lib/rpicsim/sim.rb', line 131 def labels program_file.labels end |