Top Level Namespace
Defined Under Namespace
Modules: ArduinoUNO, Rubyduino, SpinelArduinoCodegen
Constant Summary
collapse
- ROOT =
Arduino UNO codegen layer for Spinel.
This file intentionally leaves spinel_codegen.rb unchanged. Spinel’s codegen file is CLI-oriented, so we load only its Compiler definition and keep the same AST-file input/output-file flow as the upstream footer.
File.expand_path("../..", __dir__)
- SPINEL_ROOT =
File.join(ROOT, "vendor/spinel")
Instance Method Summary
collapse
-
#analog_read(pin) ⇒ Object
-
#analog_write(pin, value) ⇒ Object
-
#delay_ms(ms) ⇒ Object
-
#delay_us(us) ⇒ Object
-
#digital_read(pin) ⇒ Object
-
#digital_write(pin, value) ⇒ Object
-
#interrupts ⇒ Object
-
#load_spinel_compiler ⇒ Object
-
#micros ⇒ Object
-
#millis ⇒ Object
-
#no_interrupts ⇒ Object
-
#pin_mode(pin, mode) ⇒ Object
-
#pulse_in(pin, value) ⇒ Object
-
#pulse_in_timeout(pin, value, timeout_us) ⇒ Object
-
#serial_available ⇒ Object
-
#serial_begin(baud) ⇒ Object
-
#serial_read ⇒ Object
-
#serial_write(value) ⇒ Object
-
#shift_in(data_pin, clock_pin, bit_order) ⇒ Object
-
#shift_out(data_pin, clock_pin, bit_order, value) ⇒ Object
Instance Method Details
#analog_read(pin) ⇒ Object
57
58
59
|
# File 'lib/rubyduino/arduino_uno.rb', line 57
def analog_read(pin)
ArduinoUNO.analog_read(pin)
end
|
#analog_write(pin, value) ⇒ Object
61
62
63
|
# File 'lib/rubyduino/arduino_uno.rb', line 61
def analog_write(pin, value)
ArduinoUNO.analog_write(pin, value)
end
|
#delay_ms(ms) ⇒ Object
65
66
67
|
# File 'lib/rubyduino/arduino_uno.rb', line 65
def delay_ms(ms)
ArduinoUNO.delay_ms(ms)
end
|
#delay_us(us) ⇒ Object
69
70
71
|
# File 'lib/rubyduino/arduino_uno.rb', line 69
def delay_us(us)
ArduinoUNO.delay_us(us)
end
|
#digital_read(pin) ⇒ Object
53
54
55
|
# File 'lib/rubyduino/arduino_uno.rb', line 53
def digital_read(pin)
ArduinoUNO.digital_read(pin)
end
|
#digital_write(pin, value) ⇒ Object
49
50
51
|
# File 'lib/rubyduino/arduino_uno.rb', line 49
def digital_write(pin, value)
ArduinoUNO.digital_write(pin, value)
end
|
#interrupts ⇒ Object
113
114
115
|
# File 'lib/rubyduino/arduino_uno.rb', line 113
def interrupts
ArduinoUNO.interrupts
end
|
#load_spinel_compiler ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/rubyduino/spinel_arduino_codegen.rb', line 11
def load_spinel_compiler
path = File.join(SPINEL_ROOT, "spinel_codegen.rb")
source = File.read(path)
marker = "\n# ---- Main ----\n"
split_at = source.index(marker)
unless split_at
warn "spinel_arduino_codegen: cannot find codegen main marker"
exit(1)
end
TOPLEVEL_BINDING.eval(source[0...split_at], path)
end
|
#micros ⇒ Object
77
78
79
|
# File 'lib/rubyduino/arduino_uno.rb', line 77
def micros
ArduinoUNO.micros
end
|
#millis ⇒ Object
73
74
75
|
# File 'lib/rubyduino/arduino_uno.rb', line 73
def millis
ArduinoUNO.millis
end
|
#no_interrupts ⇒ Object
117
118
119
|
# File 'lib/rubyduino/arduino_uno.rb', line 117
def no_interrupts
ArduinoUNO.no_interrupts
end
|
#pin_mode(pin, mode) ⇒ Object
45
46
47
|
# File 'lib/rubyduino/arduino_uno.rb', line 45
def pin_mode(pin, mode)
ArduinoUNO.pin_mode(pin, mode)
end
|
#pulse_in(pin, value) ⇒ Object
81
82
83
|
# File 'lib/rubyduino/arduino_uno.rb', line 81
def pulse_in(pin, value)
ArduinoUNO.pulse_in(pin, value)
end
|
#pulse_in_timeout(pin, value, timeout_us) ⇒ Object
85
86
87
|
# File 'lib/rubyduino/arduino_uno.rb', line 85
def pulse_in_timeout(pin, value, timeout_us)
ArduinoUNO.pulse_in_timeout(pin, value, timeout_us)
end
|
#serial_available ⇒ Object
93
94
95
|
# File 'lib/rubyduino/arduino_uno.rb', line 93
def serial_available
ArduinoUNO.serial_available
end
|
#serial_begin(baud) ⇒ Object
89
90
91
|
# File 'lib/rubyduino/arduino_uno.rb', line 89
def serial_begin(baud)
ArduinoUNO.serial_begin(baud)
end
|
#serial_read ⇒ Object
97
98
99
|
# File 'lib/rubyduino/arduino_uno.rb', line 97
def serial_read
ArduinoUNO.serial_read
end
|
#serial_write(value) ⇒ Object
101
102
103
|
# File 'lib/rubyduino/arduino_uno.rb', line 101
def serial_write(value)
ArduinoUNO.serial_write(value)
end
|
#shift_in(data_pin, clock_pin, bit_order) ⇒ Object
105
106
107
|
# File 'lib/rubyduino/arduino_uno.rb', line 105
def shift_in(data_pin, clock_pin, bit_order)
ArduinoUNO.shift_in(data_pin, clock_pin, bit_order)
end
|
#shift_out(data_pin, clock_pin, bit_order, value) ⇒ Object
109
110
111
|
# File 'lib/rubyduino/arduino_uno.rb', line 109
def shift_out(data_pin, clock_pin, bit_order, value)
ArduinoUNO.shift_out(data_pin, clock_pin, bit_order, value)
end
|