tinkerforge 2.1.23 → 2.1.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinkerforge/brick_dc.rb +2 -2
  3. data/lib/tinkerforge/brick_hat.rb +45 -4
  4. data/lib/tinkerforge/brick_hat_zero.rb +69 -3
  5. data/lib/tinkerforge/brick_imu.rb +8 -10
  6. data/lib/tinkerforge/brick_imu_v2.rb +12 -14
  7. data/lib/tinkerforge/brick_master.rb +6 -14
  8. data/lib/tinkerforge/brick_red.rb +2 -2
  9. data/lib/tinkerforge/brick_servo.rb +2 -2
  10. data/lib/tinkerforge/brick_silent_stepper.rb +3 -3
  11. data/lib/tinkerforge/brick_stepper.rb +3 -3
  12. data/lib/tinkerforge/bricklet_accelerometer.rb +7 -16
  13. data/lib/tinkerforge/bricklet_accelerometer_v2.rb +18 -24
  14. data/lib/tinkerforge/bricklet_air_quality.rb +13 -23
  15. data/lib/tinkerforge/bricklet_ambient_light.rb +14 -27
  16. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +4 -8
  17. data/lib/tinkerforge/bricklet_ambient_light_v3.rb +3 -5
  18. data/lib/tinkerforge/bricklet_analog_in.rb +6 -22
  19. data/lib/tinkerforge/bricklet_analog_in_v2.rb +6 -22
  20. data/lib/tinkerforge/bricklet_analog_in_v3.rb +4 -9
  21. data/lib/tinkerforge/bricklet_analog_out.rb +5 -9
  22. data/lib/tinkerforge/bricklet_analog_out_v2.rb +4 -4
  23. data/lib/tinkerforge/bricklet_analog_out_v3.rb +4 -4
  24. data/lib/tinkerforge/bricklet_barometer.rb +10 -33
  25. data/lib/tinkerforge/bricklet_barometer_v2.rb +13 -32
  26. data/lib/tinkerforge/bricklet_can.rb +3 -7
  27. data/lib/tinkerforge/bricklet_can_v2.rb +8 -40
  28. data/lib/tinkerforge/bricklet_co2.rb +5 -13
  29. data/lib/tinkerforge/bricklet_co2_v2.rb +24 -24
  30. data/lib/tinkerforge/bricklet_color.rb +9 -22
  31. data/lib/tinkerforge/bricklet_color_v2.rb +7 -16
  32. data/lib/tinkerforge/bricklet_compass.rb +6 -12
  33. data/lib/tinkerforge/bricklet_current12.rb +6 -18
  34. data/lib/tinkerforge/bricklet_current25.rb +6 -18
  35. data/lib/tinkerforge/bricklet_distance_ir.rb +6 -17
  36. data/lib/tinkerforge/bricklet_distance_ir_v2.rb +5 -16
  37. data/lib/tinkerforge/bricklet_distance_us.rb +6 -16
  38. data/lib/tinkerforge/bricklet_distance_us_v2.rb +4 -10
  39. data/lib/tinkerforge/bricklet_dmx.rb +7 -16
  40. data/lib/tinkerforge/bricklet_dual_button.rb +2 -4
  41. data/lib/tinkerforge/bricklet_dual_button_v2.rb +3 -7
  42. data/lib/tinkerforge/bricklet_dual_relay.rb +3 -5
  43. data/lib/tinkerforge/bricklet_dust_detector.rb +6 -16
  44. data/lib/tinkerforge/bricklet_e_paper_296x128.rb +30 -33
  45. data/lib/tinkerforge/bricklet_energy_monitor.rb +11 -15
  46. data/lib/tinkerforge/bricklet_gps.rb +11 -24
  47. data/lib/tinkerforge/bricklet_gps_v2.rb +10 -28
  48. data/lib/tinkerforge/bricklet_hall_effect.rb +3 -7
  49. data/lib/tinkerforge/bricklet_hall_effect_v2.rb +8 -19
  50. data/lib/tinkerforge/bricklet_humidity.rb +6 -19
  51. data/lib/tinkerforge/bricklet_humidity_v2.rb +6 -20
  52. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +6 -6
  53. data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +6 -13
  54. data/lib/tinkerforge/bricklet_industrial_counter.rb +4 -22
  55. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +9 -9
  56. data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +5 -13
  57. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +3 -3
  58. data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +5 -8
  59. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +6 -15
  60. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +4 -16
  61. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +5 -13
  62. data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +4 -11
  63. data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +5 -7
  64. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +3 -3
  65. data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +3 -5
  66. data/lib/tinkerforge/bricklet_io16.rb +5 -13
  67. data/lib/tinkerforge/bricklet_io16_v2.rb +6 -16
  68. data/lib/tinkerforge/bricklet_io4.rb +4 -10
  69. data/lib/tinkerforge/bricklet_io4_v2.rb +16 -23
  70. data/lib/tinkerforge/bricklet_isolator.rb +44 -11
  71. data/lib/tinkerforge/bricklet_joystick.rb +7 -19
  72. data/lib/tinkerforge/bricklet_joystick_v2.rb +6 -11
  73. data/lib/tinkerforge/bricklet_laser_range_finder.rb +8 -29
  74. data/lib/tinkerforge/bricklet_laser_range_finder_v2.rb +6 -17
  75. data/lib/tinkerforge/bricklet_lcd_128x64.rb +30 -63
  76. data/lib/tinkerforge/bricklet_lcd_16x2.rb +7 -9
  77. data/lib/tinkerforge/bricklet_lcd_20x4.rb +4 -8
  78. data/lib/tinkerforge/bricklet_led_strip.rb +12 -27
  79. data/lib/tinkerforge/bricklet_led_strip_v2.rb +17 -4
  80. data/lib/tinkerforge/bricklet_line.rb +4 -10
  81. data/lib/tinkerforge/bricklet_linear_poti.rb +5 -16
  82. data/lib/tinkerforge/bricklet_linear_poti_v2.rb +3 -5
  83. data/lib/tinkerforge/bricklet_load_cell.rb +6 -19
  84. data/lib/tinkerforge/bricklet_load_cell_v2.rb +4 -13
  85. data/lib/tinkerforge/bricklet_moisture.rb +6 -16
  86. data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
  87. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +3 -7
  88. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +3 -7
  89. data/lib/tinkerforge/bricklet_multi_touch.rb +2 -6
  90. data/lib/tinkerforge/bricklet_multi_touch_v2.rb +3 -13
  91. data/lib/tinkerforge/bricklet_nfc.rb +6 -20
  92. data/lib/tinkerforge/bricklet_nfc_rfid.rb +2 -2
  93. data/lib/tinkerforge/bricklet_oled_128x64.rb +4 -8
  94. data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +12 -18
  95. data/lib/tinkerforge/bricklet_oled_64x48.rb +4 -8
  96. data/lib/tinkerforge/bricklet_one_wire.rb +2 -2
  97. data/lib/tinkerforge/bricklet_outdoor_weather.rb +16 -16
  98. data/lib/tinkerforge/bricklet_particulate_matter.rb +13 -9
  99. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +3 -6
  100. data/lib/tinkerforge/bricklet_piezo_speaker.rb +3 -11
  101. data/lib/tinkerforge/bricklet_piezo_speaker_v2.rb +8 -18
  102. data/lib/tinkerforge/bricklet_ptc.rb +5 -11
  103. data/lib/tinkerforge/bricklet_ptc_v2.rb +4 -8
  104. data/lib/tinkerforge/bricklet_real_time_clock.rb +3 -5
  105. data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +3 -5
  106. data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
  107. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +2 -2
  108. data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
  109. data/lib/tinkerforge/bricklet_rgb_led_button.rb +2 -2
  110. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +2 -2
  111. data/lib/tinkerforge/bricklet_rgb_led_v2.rb +2 -2
  112. data/lib/tinkerforge/bricklet_rotary_encoder.rb +4 -8
  113. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +3 -5
  114. data/lib/tinkerforge/bricklet_rotary_poti.rb +5 -11
  115. data/lib/tinkerforge/bricklet_rotary_poti_v2.rb +3 -5
  116. data/lib/tinkerforge/bricklet_rs232.rb +2 -2
  117. data/lib/tinkerforge/bricklet_rs232_v2.rb +6 -5
  118. data/lib/tinkerforge/bricklet_rs485.rb +30 -71
  119. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
  120. data/lib/tinkerforge/bricklet_segment_display_4x7_v2.rb +3 -3
  121. data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
  122. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +2 -2
  123. data/lib/tinkerforge/bricklet_sound_intensity.rb +4 -8
  124. data/lib/tinkerforge/bricklet_sound_pressure_level.rb +8 -12
  125. data/lib/tinkerforge/bricklet_temperature.rb +6 -14
  126. data/lib/tinkerforge/bricklet_temperature_ir.rb +7 -26
  127. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +6 -19
  128. data/lib/tinkerforge/bricklet_temperature_v2.rb +4 -8
  129. data/lib/tinkerforge/bricklet_thermal_imaging.rb +16 -26
  130. data/lib/tinkerforge/bricklet_thermocouple.rb +4 -8
  131. data/lib/tinkerforge/bricklet_thermocouple_v2.rb +3 -5
  132. data/lib/tinkerforge/bricklet_tilt.rb +2 -2
  133. data/lib/tinkerforge/bricklet_uv_light.rb +4 -8
  134. data/lib/tinkerforge/bricklet_uv_light_v2.rb +5 -11
  135. data/lib/tinkerforge/bricklet_voltage.rb +5 -11
  136. data/lib/tinkerforge/bricklet_voltage_current.rb +6 -14
  137. data/lib/tinkerforge/bricklet_voltage_current_v2.rb +5 -11
  138. data/lib/tinkerforge/bricklet_xmc1400_breakout.rb +4 -8
  139. data/lib/tinkerforge/ip_connection.rb +3 -0
  140. data/lib/tinkerforge/version.rb +1 -1
  141. metadata +2 -2
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-08-23. #
3
+ # This file was automatically generated on 2019-11-25. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.23 #
5
+ # Ruby Bindings Version 2.1.24 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -16,7 +16,7 @@ module Tinkerforge
16
16
  DEVICE_DISPLAY_NAME = 'Industrial Dual Relay Bricklet' # :nodoc:
17
17
 
18
18
  # This callback is triggered whenever a monoflop timer reaches 0. The
19
- # parameter contain the relay (0 or 1) and the current state of the relay
19
+ # parameters contain the relay and the current state of the relay
20
20
  # (the state after the monoflop).
21
21
  CALLBACK_MONOFLOP_DONE = 5
22
22
 
@@ -91,8 +91,6 @@ module Tinkerforge
91
91
  # can use BrickletIndustrialDualRelay#set_selected_value.
92
92
  #
93
93
  # All running monoflop timers will be aborted if this function is called.
94
- #
95
- # The default value is (*false*, *false*).
96
94
  def set_value(channel0, channel1)
97
95
  send_request FUNCTION_SET_VALUE, [channel0, channel1], '? ?', 0, ''
98
96
  end
@@ -104,7 +102,7 @@ module Tinkerforge
104
102
 
105
103
  # The first parameter can be 0 or 1 (relay 0 or relay 1). The second parameter
106
104
  # is the desired state of the relay (*true* means on and *false* means off).
107
- # The third parameter indicates the time (in ms) that the relay should hold
105
+ # The third parameter indicates the time that the relay should hold
108
106
  # the state.
109
107
  #
110
108
  # If this function is called with the parameters (1, true, 1500):
@@ -128,7 +126,7 @@ module Tinkerforge
128
126
  send_request FUNCTION_GET_MONOFLOP, [channel], 'C', 9, '? L L'
129
127
  end
130
128
 
131
- # Sets the state of the selected relay (0 or 1), *true* means on and *false*
129
+ # Sets the state of the selected relay, *true* means on and *false*
132
130
  # means off.
133
131
  #
134
132
  # A running monoflop timer for the selected relay will be aborted if this function
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-08-23. #
3
+ # This file was automatically generated on 2019-11-25. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.23 #
5
+ # Ruby Bindings Version 2.1.24 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -81,7 +81,7 @@ module Tinkerforge
81
81
  # The second parameter is a bitmask with the desired value of the specified
82
82
  # pins. A 1 in the bitmask means relay closed and a 0 means relay open.
83
83
  #
84
- # The third parameter indicates the time (in ms) that the pins should hold
84
+ # The third parameter indicates the time that the pins should hold
85
85
  # the value.
86
86
  #
87
87
  # If this function is called with the parameters (9, 1, 1500) or
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-08-23. #
3
+ # This file was automatically generated on 2019-11-25. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.23 #
5
+ # Ruby Bindings Version 2.1.24 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -111,7 +111,7 @@ module Tinkerforge
111
111
  # The second parameter is the desired value of the specified
112
112
  # channel. A *true* means relay closed and a *false* means relay open.
113
113
  #
114
- # The third parameter indicates the time (in ms) that the channels should hold
114
+ # The third parameter indicates the time that the channels should hold
115
115
  # the value.
116
116
  #
117
117
  # If this function is called with the parameters (0, 1, 1500) channel 0 will
@@ -148,8 +148,6 @@ module Tinkerforge
148
148
  # Each channel has a corresponding LED. You can turn the LED off, on or show a
149
149
  # heartbeat. You can also set the LED to "Channel Status". In this mode the
150
150
  # LED is on if the channel is high and off otherwise.
151
- #
152
- # By default all channel LEDs are configured as "Channel Status".
153
151
  def set_channel_led_config(channel, config)
154
152
  send_request FUNCTION_SET_CHANNEL_LED_CONFIG, [channel, config], 'C C', 0, ''
155
153
  end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-08-23. #
3
+ # This file was automatically generated on 2019-11-25. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.23 #
5
+ # Ruby Bindings Version 2.1.24 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -126,8 +126,6 @@ module Tinkerforge
126
126
  #
127
127
  # Running monoflop timers for the selected pins will be aborted if this
128
128
  # function is called.
129
- #
130
- # The default configuration is input with pull-up.
131
129
  def set_port_configuration(port, selection_mask, direction, value)
132
130
  send_request FUNCTION_SET_PORT_CONFIGURATION, [port, selection_mask, direction, value], 'k C k ?', 0, ''
133
131
  end
@@ -146,13 +144,11 @@ module Tinkerforge
146
144
  send_request FUNCTION_GET_PORT_CONFIGURATION, [port], 'k', 2, 'C C'
147
145
  end
148
146
 
149
- # Sets the debounce period of the CALLBACK_INTERRUPT callback in ms.
147
+ # Sets the debounce period of the CALLBACK_INTERRUPT callback.
150
148
  #
151
149
  # For example: If you set this value to 100, you will get the interrupt
152
150
  # maximal every 100ms. This is necessary if something that bounces is
153
151
  # connected to the IO-16 Bricklet, such as a button.
154
- #
155
- # The default value is 100.
156
152
  def set_debounce_period(debounce)
157
153
  send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, ''
158
154
  end
@@ -187,7 +183,7 @@ module Tinkerforge
187
183
  # The third parameter is a bitmask with the desired value of the specified
188
184
  # output pins. A 1 in the bitmask means high and a 0 in the bitmask means low.
189
185
  #
190
- # The forth parameter indicates the time (in ms) that the pins should hold
186
+ # The forth parameter indicates the time that the pins should hold
191
187
  # the value.
192
188
  #
193
189
  # If this function is called with the parameters ('a', 9, 1, 1500) or
@@ -246,19 +242,15 @@ module Tinkerforge
246
242
  # The edge type parameter configures if rising edges, falling edges or
247
243
  # both are counted if the pin is configured for input. Possible edge types are:
248
244
  #
249
- # * 0 = rising (default)
245
+ # * 0 = rising
250
246
  # * 1 = falling
251
247
  # * 2 = both
252
248
  #
253
- # The debounce time is given in ms.
254
- #
255
249
  # Configuring an edge counter resets its value to 0.
256
250
  #
257
251
  # If you don't know what any of this means, just leave it at default. The
258
252
  # default configuration is very likely OK for you.
259
253
  #
260
- # Default values: 0 (edge type) and 100ms (debounce time)
261
- #
262
254
  # .. versionadded:: 2.0.3$nbsp;(Plugin)
263
255
  def set_edge_count_config(pin, edge_type, debounce)
264
256
  send_request FUNCTION_SET_EDGE_COUNT_CONFIG, [pin, edge_type, debounce], 'C C C', 0, ''
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-08-23. #
3
+ # This file was automatically generated on 2019-11-25. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.23 #
5
+ # Ruby Bindings Version 2.1.24 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -178,8 +178,6 @@ module Tinkerforge
178
178
  #
179
179
  # A running monoflop timer for the specific channel will be aborted if this
180
180
  # function is called.
181
- #
182
- # The default configuration is input with pull-up.
183
181
  def set_configuration(channel, direction, value)
184
182
  send_request FUNCTION_SET_CONFIGURATION, [channel, direction, value], 'C k ?', 0, ''
185
183
  end
@@ -191,7 +189,7 @@ module Tinkerforge
191
189
 
192
190
  # This callback can be configured per channel.
193
191
  #
194
- # The period in ms is the period with which the CALLBACK_INPUT_VALUE
192
+ # The period is the period with which the CALLBACK_INPUT_VALUE
195
193
  # callback is triggered periodically. A value of 0 turns the callback off.
196
194
  #
197
195
  # If the `value has to change`-parameter is set to true, the callback is only
@@ -200,8 +198,6 @@ module Tinkerforge
200
198
  #
201
199
  # If it is set to false, the callback is continuously triggered with the period,
202
200
  # independent of the value.
203
- #
204
- # The default value is (0, false).
205
201
  def set_input_value_callback_configuration(channel, period, value_has_to_change)
206
202
  send_request FUNCTION_SET_INPUT_VALUE_CALLBACK_CONFIGURATION, [channel, period, value_has_to_change], 'C L ?', 0, ''
207
203
  end
@@ -212,7 +208,7 @@ module Tinkerforge
212
208
  send_request FUNCTION_GET_INPUT_VALUE_CALLBACK_CONFIGURATION, [channel], 'C', 5, 'L ?'
213
209
  end
214
210
 
215
- # The period in ms is the period with which the CALLBACK_ALL_INPUT_VALUE
211
+ # The period is the period with which the CALLBACK_ALL_INPUT_VALUE
216
212
  # callback is triggered periodically. A value of 0 turns the callback off.
217
213
  #
218
214
  # If the `value has to change`-parameter is set to true, the callback is only
@@ -221,8 +217,6 @@ module Tinkerforge
221
217
  #
222
218
  # If it is set to false, the callback is continuously triggered with the period,
223
219
  # independent of the value.
224
- #
225
- # The default value is (0, false).
226
220
  def set_all_input_value_callback_configuration(period, value_has_to_change)
227
221
  send_request FUNCTION_SET_ALL_INPUT_VALUE_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 0, ''
228
222
  end
@@ -238,7 +232,7 @@ module Tinkerforge
238
232
  # The second parameter is the desired value of the specified
239
233
  # channel. A *true* means relay closed and a *false* means relay open.
240
234
  #
241
- # The third parameter indicates the time (in ms) that the channels should hold
235
+ # The third parameter indicates the time that the channels should hold
242
236
  # the value.
243
237
  #
244
238
  # If this function is called with the parameters (0, 1, 1500) channel 0 will
@@ -277,18 +271,14 @@ module Tinkerforge
277
271
  # The edge type parameter configures if rising edges, falling edges or
278
272
  # both are counted if the channel is configured for input. Possible edge types are:
279
273
  #
280
- # * 0 = rising (default)
274
+ # * 0 = rising
281
275
  # * 1 = falling
282
276
  # * 2 = both
283
277
  #
284
- # The debounce time is given in ms.
285
- #
286
278
  # Configuring an edge counter resets its value to 0.
287
279
  #
288
280
  # If you don't know what any of this means, just leave it at default. The
289
281
  # default configuration is very likely OK for you.
290
- #
291
- # Default values: 0 (edge type) and 100ms (debounce time)
292
282
  def set_edge_count_configuration(channel, edge_type, debounce)
293
283
  send_request FUNCTION_SET_EDGE_COUNT_CONFIGURATION, [channel, edge_type, debounce], 'C C C', 0, ''
294
284
  end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-08-23. #
3
+ # This file was automatically generated on 2019-11-25. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.23 #
5
+ # Ruby Bindings Version 2.1.24 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -124,8 +124,6 @@ module Tinkerforge
124
124
  #
125
125
  # Running monoflop timers for the specified pins will be aborted if this
126
126
  # function is called.
127
- #
128
- # The default configuration is input with pull-up.
129
127
  def set_configuration(selection_mask, direction, value)
130
128
  send_request FUNCTION_SET_CONFIGURATION, [selection_mask, direction, value], 'C k ?', 0, ''
131
129
  end
@@ -144,13 +142,11 @@ module Tinkerforge
144
142
  send_request FUNCTION_GET_CONFIGURATION, [], '', 2, 'C C'
145
143
  end
146
144
 
147
- # Sets the debounce period of the CALLBACK_INTERRUPT callback in ms.
145
+ # Sets the debounce period of the CALLBACK_INTERRUPT callback.
148
146
  #
149
147
  # For example: If you set this value to 100, you will get the interrupt
150
148
  # maximal every 100ms. This is necessary if something that bounces is
151
149
  # connected to the IO-4 Bricklet, such as a button.
152
- #
153
- # The default value is 100.
154
150
  def set_debounce_period(debounce)
155
151
  send_request FUNCTION_SET_DEBOUNCE_PERIOD, [debounce], 'L', 0, ''
156
152
  end
@@ -184,7 +180,7 @@ module Tinkerforge
184
180
  # The second parameter is a bitmask with the desired value of the specified
185
181
  # output pins. A 1 in the bitmask means high and a 0 in the bitmask means low.
186
182
  #
187
- # The third parameter indicates the time (in ms) that the pins should hold
183
+ # The third parameter indicates the time that the pins should hold
188
184
  # the value.
189
185
  #
190
186
  # If this function is called with the parameters (9, 1, 1500) or
@@ -253,8 +249,6 @@ module Tinkerforge
253
249
  # If you don't know what any of this means, just leave it at default. The
254
250
  # default configuration is very likely OK for you.
255
251
  #
256
- # Default values: 0 (edge type) and 100ms (debounce time)
257
- #
258
252
  # .. versionadded:: 2.0.1$nbsp;(Plugin)
259
253
  def set_edge_count_config(selection_mask, edge_type, debounce)
260
254
  send_request FUNCTION_SET_EDGE_COUNT_CONFIG, [selection_mask, edge_type, debounce], 'C C C', 0, ''
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-08-23. #
3
+ # This file was automatically generated on 2019-11-25. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.23 #
5
+ # Ruby Bindings Version 2.1.24 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -182,8 +182,6 @@ module Tinkerforge
182
182
  #
183
183
  # A running monoflop timer or PWM for the specific channel will be aborted if this
184
184
  # function is called.
185
- #
186
- # The default configuration is input with pull-up.
187
185
  def set_configuration(channel, direction, value)
188
186
  send_request FUNCTION_SET_CONFIGURATION, [channel, direction, value], 'C k ?', 0, ''
189
187
  end
@@ -195,7 +193,7 @@ module Tinkerforge
195
193
 
196
194
  # This callback can be configured per channel.
197
195
  #
198
- # The period in ms is the period with which the CALLBACK_INPUT_VALUE
196
+ # The period is the period with which the CALLBACK_INPUT_VALUE
199
197
  # callback is triggered periodically. A value of 0 turns the callback off.
200
198
  #
201
199
  # If the `value has to change`-parameter is set to true, the callback is only
@@ -204,8 +202,6 @@ module Tinkerforge
204
202
  #
205
203
  # If it is set to false, the callback is continuously triggered with the period,
206
204
  # independent of the value.
207
- #
208
- # The default value is (0, false).
209
205
  def set_input_value_callback_configuration(channel, period, value_has_to_change)
210
206
  send_request FUNCTION_SET_INPUT_VALUE_CALLBACK_CONFIGURATION, [channel, period, value_has_to_change], 'C L ?', 0, ''
211
207
  end
@@ -216,7 +212,7 @@ module Tinkerforge
216
212
  send_request FUNCTION_GET_INPUT_VALUE_CALLBACK_CONFIGURATION, [channel], 'C', 5, 'L ?'
217
213
  end
218
214
 
219
- # The period in ms is the period with which the CALLBACK_ALL_INPUT_VALUE
215
+ # The period is the period with which the CALLBACK_ALL_INPUT_VALUE
220
216
  # callback is triggered periodically. A value of 0 turns the callback off.
221
217
  #
222
218
  # If the `value has to change`-parameter is set to true, the callback is only
@@ -225,8 +221,6 @@ module Tinkerforge
225
221
  #
226
222
  # If it is set to false, the callback is continuously triggered with the period,
227
223
  # independent of the value.
228
- #
229
- # The default value is (0, false).
230
224
  def set_all_input_value_callback_configuration(period, value_has_to_change)
231
225
  send_request FUNCTION_SET_ALL_INPUT_VALUE_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 0, ''
232
226
  end
@@ -238,7 +232,7 @@ module Tinkerforge
238
232
  end
239
233
 
240
234
  # The first parameter is the desired state of the channel (*true* means output *high*
241
- # and *false* means output *low*). The second parameter indicates the time (in ms) that
235
+ # and *false* means output *low*). The second parameter indicates the time that
242
236
  # the channel should hold the state.
243
237
  #
244
238
  # If this function is called with the parameters (true, 1500):
@@ -269,6 +263,9 @@ module Tinkerforge
269
263
  #
270
264
  # If you set the reset counter to *true*, the count is set back to 0
271
265
  # directly after it is read.
266
+ #
267
+ # .. note::
268
+ # Calling this function is only allowed for channels configured as input.
272
269
  def get_edge_count(channel, reset_counter)
273
270
  send_request FUNCTION_GET_EDGE_COUNT, [channel, reset_counter], 'C ?', 4, 'L'
274
271
  end
@@ -278,42 +275,38 @@ module Tinkerforge
278
275
  # The edge type parameter configures if rising edges, falling edges or
279
276
  # both are counted if the channel is configured for input. Possible edge types are:
280
277
  #
281
- # * 0 = rising (default)
278
+ # * 0 = rising
282
279
  # * 1 = falling
283
280
  # * 2 = both
284
281
  #
285
- # The debounce time is given in ms.
286
- #
287
282
  # Configuring an edge counter resets its value to 0.
288
283
  #
289
284
  # If you don't know what any of this means, just leave it at default. The
290
285
  # default configuration is very likely OK for you.
291
286
  #
292
- # Default values: 0 (edge type) and 100ms (debounce time)
287
+ # .. note::
288
+ # Calling this function is only allowed for channels configured as input.
293
289
  def set_edge_count_configuration(channel, edge_type, debounce)
294
290
  send_request FUNCTION_SET_EDGE_COUNT_CONFIGURATION, [channel, edge_type, debounce], 'C C C', 0, ''
295
291
  end
296
292
 
297
293
  # Returns the edge type and debounce time for the selected channel as set by
298
294
  # BrickletIO4V2#set_edge_count_configuration.
295
+ #
296
+ # .. note::
297
+ # Calling this function is only allowed for channels configured as input.
299
298
  def get_edge_count_configuration(channel)
300
299
  send_request FUNCTION_GET_EDGE_COUNT_CONFIGURATION, [channel], 'C', 2, 'C C'
301
300
  end
302
301
 
303
- # Activates a PWM for the given channel with the frequency given in 1/10Hz and the duty
304
- # cycle given in 1/100%.
302
+ # Activates a PWM for the given channel.
305
303
  #
306
304
  # You need to set the channel to output before you call this function, otherwise it will
307
- # be ignored. To turn the PWM off again, you can set the frequency to 0 or any other
305
+ # report an invalid parameter error. To turn the PWM off again, you can set the frequency to 0 or any other
308
306
  # function that changes a value of the channel (e.g. BrickletIO4V2#set_selected_value).
309
307
  #
310
- # The maximum frequency value is 320000000 (32MHz). The maximum duty cycle value is
311
- # 10000 (100%).
312
- #
313
308
  # A running monoflop timer for the given channel will be aborted if this function
314
309
  # is called.
315
- #
316
- # The default values are 0, 0.
317
310
  def set_pwm_configuration(channel, frequency, duty_cycle)
318
311
  send_request FUNCTION_SET_PWM_CONFIGURATION, [channel, frequency, duty_cycle], 'C L S', 0, ''
319
312
  end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-08-23. #
3
+ # This file was automatically generated on 2019-11-25. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.23 #
5
+ # Ruby Bindings Version 2.1.24 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #
@@ -15,12 +15,22 @@ module Tinkerforge
15
15
  DEVICE_IDENTIFIER = 2122 # :nodoc:
16
16
  DEVICE_DISPLAY_NAME = 'Isolator Bricklet' # :nodoc:
17
17
 
18
+ # This callback is triggered periodically according to the configuration set by
19
+ # BrickletIsolator#set_statistics_callback_configuration.
20
+ #
21
+ # The parameters are the same as BrickletIsolator#get_statistics.
22
+ #
23
+ # .. versionadded:: 2.0.2$nbsp;(Plugin)
24
+ CALLBACK_STATISTICS = 9
25
+
18
26
  FUNCTION_GET_STATISTICS = 1 # :nodoc:
19
27
  FUNCTION_SET_SPITFP_BAUDRATE_CONFIG = 2 # :nodoc:
20
28
  FUNCTION_GET_SPITFP_BAUDRATE_CONFIG = 3 # :nodoc:
21
29
  FUNCTION_SET_SPITFP_BAUDRATE = 4 # :nodoc:
22
30
  FUNCTION_GET_SPITFP_BAUDRATE = 5 # :nodoc:
23
31
  FUNCTION_GET_ISOLATOR_SPITFP_ERROR_COUNT = 6 # :nodoc:
32
+ FUNCTION_SET_STATISTICS_CALLBACK_CONFIGURATION = 7 # :nodoc:
33
+ FUNCTION_GET_STATISTICS_CALLBACK_CONFIGURATION = 8 # :nodoc:
24
34
  FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
25
35
  FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
26
36
  FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
@@ -55,7 +65,7 @@ module Tinkerforge
55
65
  def initialize(uid, ipcon)
56
66
  super uid, ipcon
57
67
 
58
- @api_version = [2, 0, 0]
68
+ @api_version = [2, 0, 1]
59
69
 
60
70
  @response_expected[FUNCTION_GET_STATISTICS] = RESPONSE_EXPECTED_ALWAYS_TRUE
61
71
  @response_expected[FUNCTION_SET_SPITFP_BAUDRATE_CONFIG] = RESPONSE_EXPECTED_FALSE
@@ -63,6 +73,8 @@ module Tinkerforge
63
73
  @response_expected[FUNCTION_SET_SPITFP_BAUDRATE] = RESPONSE_EXPECTED_FALSE
64
74
  @response_expected[FUNCTION_GET_SPITFP_BAUDRATE] = RESPONSE_EXPECTED_ALWAYS_TRUE
65
75
  @response_expected[FUNCTION_GET_ISOLATOR_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
76
+ @response_expected[FUNCTION_SET_STATISTICS_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
77
+ @response_expected[FUNCTION_GET_STATISTICS_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
66
78
  @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
67
79
  @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
68
80
  @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
@@ -76,6 +88,7 @@ module Tinkerforge
76
88
  @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
77
89
  @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
78
90
 
91
+ @callback_formats[CALLBACK_STATISTICS] = 'L L S Z8'
79
92
 
80
93
  end
81
94
 
@@ -105,10 +118,6 @@ module Tinkerforge
105
118
  # The maximum value of the baudrate can be set per port with the function
106
119
  # BrickletIsolator#set_spitfp_baudrate. If the dynamic baudrate is disabled, the baudrate
107
120
  # as set by BrickletIsolator#set_spitfp_baudrate will be used statically.
108
- #
109
- # The minimum dynamic baudrate has a value range of 400000 to 2000000 baud.
110
- #
111
- # By default dynamic baudrate is enabled and the minimum dynamic baudrate is 400000.
112
121
  def set_spitfp_baudrate_config(enable_dynamic_baudrate, minimum_dynamic_baudrate)
113
122
  send_request FUNCTION_SET_SPITFP_BAUDRATE_CONFIG, [enable_dynamic_baudrate, minimum_dynamic_baudrate], '? L', 0, ''
114
123
  end
@@ -122,8 +131,6 @@ module Tinkerforge
122
131
  # and the connected Bricklet. The baudrate for communication between
123
132
  # Brick and Isolator Bricklet can be set through the API of the Brick.
124
133
  #
125
- # The baudrate can be in the range 400000 to 2000000.
126
- #
127
134
  # If you want to increase the throughput of Bricklets you can increase
128
135
  # the baudrate. If you get a high error count because of high
129
136
  # interference (see BrickletIsolator#get_spitfp_error_count) you can decrease the
@@ -135,8 +142,6 @@ module Tinkerforge
135
142
  # Regulatory testing is done with the default baudrate. If CE compatibility
136
143
  # or similar is necessary in you applications we recommend to not change
137
144
  # the baudrate.
138
- #
139
- # The default baudrate for all ports is 1400000.
140
145
  def set_spitfp_baudrate(baudrate)
141
146
  send_request FUNCTION_SET_SPITFP_BAUDRATE, [baudrate], 'L', 0, ''
142
147
  end
@@ -160,6 +165,29 @@ module Tinkerforge
160
165
  send_request FUNCTION_GET_ISOLATOR_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
161
166
  end
162
167
 
168
+ # The period is the period with which the CALLBACK_STATISTICS
169
+ # callback is triggered periodically. A value of 0 turns the callback off.
170
+ #
171
+ # If the `value has to change`-parameter is set to true, the callback is only
172
+ # triggered after the value has changed. If the value didn't change within the
173
+ # period, the callback is triggered immediately on change.
174
+ #
175
+ # If it is set to false, the callback is continuously triggered with the period,
176
+ # independent of the value.
177
+ #
178
+ # .. versionadded:: 2.0.2$nbsp;(Plugin)
179
+ def set_statistics_callback_configuration(period, value_has_to_change)
180
+ send_request FUNCTION_SET_STATISTICS_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 0, ''
181
+ end
182
+
183
+ # Returns the callback configuration as set by
184
+ # BrickletIsolator#set_statistics_callback_configuration.
185
+ #
186
+ # .. versionadded:: 2.0.2$nbsp;(Plugin)
187
+ def get_statistics_callback_configuration
188
+ send_request FUNCTION_GET_STATISTICS_CALLBACK_CONFIGURATION, [], '', 5, 'L ?'
189
+ end
190
+
163
191
  # Returns the error count for the communication between Brick and Bricklet.
164
192
  #
165
193
  # The errors are divided into
@@ -278,5 +306,10 @@ module Tinkerforge
278
306
  send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
279
307
  end
280
308
 
309
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
310
+ def register_callback(id, &block)
311
+ callback = block
312
+ @registered_callbacks[id] = callback
313
+ end
281
314
  end
282
315
  end