Class: PiPiper::Platform
- Inherits:
-
Object
- Object
- PiPiper::Platform
- Defined in:
- lib/pi_piper/platform.rb
Overview
Hardware abstraction manager. Not intended for direct use.
Constant Summary collapse
- @@driver =
nil
Class Method Summary collapse
-
.driver ⇒ Object
gets the current platform driver.
- .driver=(instance) ⇒ Object
Class Method Details
.driver ⇒ Object
gets the current platform driver. Defaults to BCM2835.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pi_piper/platform.rb', line 8 def self.driver unless @@driver require 'pi_piper/bcm2835' PiPiper::Bcm2835.init @@driver = PiPiper::Bcm2835 at_exit do Bcm2835.unexport_all Bcm2835.close end end @@driver end |
.driver=(instance) ⇒ Object
21 22 23 |
# File 'lib/pi_piper/platform.rb', line 21 def self.driver=(instance) @@driver = instance end |