Module: Denko::Display::SPIEPaperCommon

Includes:
SPICommon
Included in:
IL0373, SSD168X
Defined in:
lib/denko/display/spi_epaper_common.rb

Constant Summary collapse

BUSY_WAIT_TIME =

Defaults. Override in subclasses as needed.

0.005
RESET_TIME =
0.010

Constants included from Behaviors::Lifecycle

Behaviors::Lifecycle::CALLBACK_METHODS

Instance Attribute Summary

Attributes included from SPI::Peripheral

#spi_bit_order, #spi_frequency, #spi_mode

Attributes included from Behaviors::State

#state

Attributes included from Behaviors::Component

#board, #params

Attributes included from Behaviors::MultiPin

#pin, #pins, #proxies

Instance Method Summary collapse

Methods included from SPICommon

#command, #data, #transfer_limit

Methods included from PixelCommon

#canvas, #colors, #columns, #draw, #get_partial_buffer, #p_max, #p_min, #refresh, #rows, #x_max, #x_min, #y_max, #y_min

Methods included from SPI::Peripheral

#ensure_byte_array, #proxy_pin, #spi_listen, #spi_read, #spi_stop, #spi_transfer, #spi_write, #update

Methods included from Behaviors::Lifecycle

included

Methods included from Behaviors::Callbacks

#add_callback, #callbacks, #pre_callback_filter, #remove_callback, #update

Methods included from Behaviors::State

#update_state

Methods included from Behaviors::BusPeripheral

#atomically

Methods included from Behaviors::Component

#initialize, #micro_delay

Methods included from Behaviors::MultiPin

#convert_pins, #proxy_pin, #proxy_states, #require_pin, #require_pins

Instance Method Details

#busy_waitObject



16
17
18
19
# File 'lib/denko/display/spi_epaper_common.rb', line 16

def busy_wait
  # #read is more compatible than #listen
  sleep self.class::BUSY_WAIT_TIME while busy.read == 1
end

#hw_resetObject



21
22
23
24
25
26
27
# File 'lib/denko/display/spi_epaper_common.rb', line 21

def hw_reset
  if reset
    reset.low
    sleep self.class::RESET_TIME
    reset.high
  end
end

#initialize_pins(options = {}) ⇒ Object



10
11
12
13
14
# File 'lib/denko/display/spi_epaper_common.rb', line 10

def initialize_pins(options={})
  super(options)
  proxy_pin :busy, DigitalIO::Input, board: bus.board
  busy.stop
end